mainwindow.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the Qt Solutions component.
7 **
8 ** $QT_BEGIN_LICENSE:BSD$
9 ** You may use this file under the terms of the BSD license as follows:
10 **
11 ** "Redistribution and use in source and binary forms, with or without
12 ** modification, are permitted provided that the following conditions are
13 ** met:
14 ** * Redistributions of source code must retain the above copyright
15 ** notice, this list of conditions and the following disclaimer.
16 ** * Redistributions in binary form must reproduce the above copyright
17 ** notice, this list of conditions and the following disclaimer in
18 ** the documentation and/or other materials provided with the
19 ** distribution.
20 ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
21 ** of its contributors may be used to endorse or promote products derived
22 ** from this software without specific prior written permission.
23 **
24 **
25 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29 ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
36 **
37 ** $QT_END_LICENSE$
38 **
39 ****************************************************************************/
40 
41 #include "mainwindow.h"
42 #include "qtpropertymanager.h"
43 #include "qteditorfactory.h"
44 #include "qttreepropertybrowser.h"
45 #include <QMatrix>
46 #include <QMouseEvent>
47 #include <QMenuBar>
48 #include <QMenu>
49 #include <QAction>
50 #include <QDockWidget>
51 
52 void CanvasView::contentsMousePressEvent(QMouseEvent* event)
53 {
54  handleMouseClickEvent(event);
55 }
56 
58 {
59  handleMouseClickEvent(event);
60 }
61 
62 void CanvasView::handleMouseClickEvent(QMouseEvent* event)
63 {
64  QPoint p = inverseWorldMatrix().map(event->pos());
66  moving = 0;
67 
68  if (!l.isEmpty())
69  {
70  moving = l.first();
71  }
72 
73  moving_start = p;
74  emit itemClicked(moving);
75 }
76 
77 void CanvasView::contentsMouseMoveEvent(QMouseEvent* event)
78 {
79  if (moving)
80  {
81  QPoint p = inverseWorldMatrix().map(event->pos());
82  moving->moveBy(p.x() - moving_start.x(), p.y() - moving_start.y());
83  moving_start = p;
84  canvas()->update();
85  emit itemMoved(moving);
86  }
87 }
88 
89 
90 MainWindow::MainWindow(QWidget* parent)
91  : QMainWindow(parent)
92 {
93  QMenu* editMenu = menuBar()->addMenu(tr("Edit"));
94  QMenu* newObjectMenu = editMenu->addMenu(tr("New Object"));
95 
96  QAction* newRectangleAction = new QAction(tr("Rectangle"), this);
97  connect(newRectangleAction, SIGNAL(triggered(bool)), this, SLOT(newRectangle()));
98  newObjectMenu->addAction(newRectangleAction);
99 
100  QAction* newLineAction = new QAction(tr("Line"), this);
101  connect(newLineAction, SIGNAL(triggered(bool)), this, SLOT(newLine()));
102  newObjectMenu->addAction(newLineAction);
103 
104  QAction* newEllipseAction = new QAction(tr("Ellipse"), this);
105  connect(newEllipseAction, SIGNAL(triggered(bool)), this, SLOT(newEllipse()));
106  newObjectMenu->addAction(newEllipseAction);
107 
108  QAction* newTextAction = new QAction(tr("Text"), this);
109  connect(newTextAction, SIGNAL(triggered(bool)), this, SLOT(newText()));
110  newObjectMenu->addAction(newTextAction);
111 
112  deleteAction = new QAction(tr("Delete Object"), this);
113  connect(deleteAction, SIGNAL(triggered(bool)), this, SLOT(deleteObject()));
114  editMenu->addAction(deleteAction);
115 
116  QAction* clearAction = new QAction(tr("Clear All"), this);
117  connect(clearAction, SIGNAL(triggered(bool)), this, SLOT(clearAll()));
118  editMenu->addAction(clearAction);
119 
120  QAction* fillAction = new QAction(tr("Fill View"), this);
121  connect(fillAction, SIGNAL(triggered(bool)), this, SLOT(fillView()));
122  editMenu->addAction(fillAction);
123 
124  doubleManager = new QtDoublePropertyManager(this);
125  stringManager = new QtStringPropertyManager(this);
126  colorManager = new QtColorPropertyManager(this);
127  fontManager = new QtFontPropertyManager(this);
128  pointManager = new QtPointPropertyManager(this);
129  sizeManager = new QtSizePropertyManager(this);
130 
131  connect(doubleManager, SIGNAL(valueChanged(QtProperty*, double)),
132  this, SLOT(valueChanged(QtProperty*, double)));
133  connect(stringManager, SIGNAL(valueChanged(QtProperty*, const QString&)),
134  this, SLOT(valueChanged(QtProperty*, const QString&)));
135  connect(colorManager, SIGNAL(valueChanged(QtProperty*, const QColor&)),
136  this, SLOT(valueChanged(QtProperty*, const QColor&)));
137  connect(fontManager, SIGNAL(valueChanged(QtProperty*, const QFont&)),
138  this, SLOT(valueChanged(QtProperty*, const QFont&)));
139  connect(pointManager, SIGNAL(valueChanged(QtProperty*, const QPoint&)),
140  this, SLOT(valueChanged(QtProperty*, const QPoint&)));
141  connect(sizeManager, SIGNAL(valueChanged(QtProperty*, const QSize&)),
142  this, SLOT(valueChanged(QtProperty*, const QSize&)));
143 
144  QtDoubleSpinBoxFactory* doubleSpinBoxFactory = new QtDoubleSpinBoxFactory(this);
145  QtCheckBoxFactory* checkBoxFactory = new QtCheckBoxFactory(this);
146  QtSpinBoxFactory* spinBoxFactory = new QtSpinBoxFactory(this);
147  QtLineEditFactory* lineEditFactory = new QtLineEditFactory(this);
148  QtEnumEditorFactory* comboBoxFactory = new QtEnumEditorFactory(this);
149 
150  canvas = new QtCanvas(800, 600);
151  canvasView = new CanvasView(canvas, this);
152  setCentralWidget(canvasView);
153 
154  QDockWidget* dock = new QDockWidget(this);
155  addDockWidget(Qt::RightDockWidgetArea, dock);
156 
157  propertyEditor = new QtTreePropertyBrowser(dock);
158  propertyEditor->setFactoryForManager(doubleManager, doubleSpinBoxFactory);
159  propertyEditor->setFactoryForManager(stringManager, lineEditFactory);
160  propertyEditor->setFactoryForManager(colorManager->subIntPropertyManager(), spinBoxFactory);
161  propertyEditor->setFactoryForManager(fontManager->subIntPropertyManager(), spinBoxFactory);
162  propertyEditor->setFactoryForManager(fontManager->subBoolPropertyManager(), checkBoxFactory);
163  propertyEditor->setFactoryForManager(fontManager->subEnumPropertyManager(), comboBoxFactory);
164  propertyEditor->setFactoryForManager(pointManager->subIntPropertyManager(), spinBoxFactory);
165  propertyEditor->setFactoryForManager(sizeManager->subIntPropertyManager(), spinBoxFactory);
166  dock->setWidget(propertyEditor);
167 
168  currentItem = 0;
169 
170  connect(canvasView, SIGNAL(itemClicked(QtCanvasItem*)),
171  this, SLOT(itemClicked(QtCanvasItem*)));
172  connect(canvasView, SIGNAL(itemMoved(QtCanvasItem*)),
173  this, SLOT(itemMoved(QtCanvasItem*)));
174 
175  fillView();
176  itemClicked(0);
177 }
178 
179 void MainWindow::newRectangle()
180 {
181  QtCanvasItem* item = addRectangle();
182  canvas->update();
183  itemClicked(item);
184 }
185 
186 void MainWindow::newEllipse()
187 {
188  QtCanvasItem* item = addEllipse();
189  canvas->update();
190  itemClicked(item);
191 }
192 
193 void MainWindow::newLine()
194 {
195  QtCanvasItem* item = addLine();
196  canvas->update();
197  itemClicked(item);
198 }
199 
200 void MainWindow::newText()
201 {
202  QtCanvasItem* item = addText();
203  canvas->update();
204  itemClicked(item);
205 }
206 
207 void MainWindow::deleteObject()
208 {
209  if (!currentItem)
210  {
211  return;
212  }
213 
214  delete currentItem;
215  itemClicked(0);
216  canvas->update();
217 }
218 
219 void MainWindow::clearAll()
220 {
221  QtCanvasItemList list = canvas->allItems();
222  qDeleteAll(list);
223  itemClicked(0);
224  canvas->update();
225 }
226 
227 void MainWindow::fillView()
228 {
229  for (int i = 0; i < 10; i++)
230  {
231  addRectangle();
232  addEllipse();
233  addLine();
234  addText();
235  }
236 
237  canvas->update();
238 }
239 
240 QtCanvasItem* MainWindow::addRectangle()
241 {
242  QtCanvasPolygonalItem* item = new QtCanvasRectangle(rand() % canvas->width(),
243  rand() % canvas->height(), 50, 50, canvas);
244  int z = rand() % 256;
245  item->setBrush(QColor(rand() % 32 * 8, rand() % 32 * 8, rand() % 32 * 8));
246  item->setPen(QPen(QColor(rand() % 32 * 8, rand() % 32 * 8, rand() % 32 * 8), 4));
247  item->setZ(z);
248  item->show();
249  return item;
250 }
251 
252 QtCanvasItem* MainWindow::addEllipse()
253 {
254  QtCanvasPolygonalItem* item = new QtCanvasEllipse(50, 50, canvas);
255  item->setBrush(QColor(rand() % 32 * 8, rand() % 32 * 8, rand() % 32 * 8));
256  item->move(rand() % canvas->width(), rand() % canvas->height());
257  item->setZ(rand() % 256);
258  item->show();
259  return item;
260 }
261 
262 QtCanvasItem* MainWindow::addLine()
263 {
264  QtCanvasLine* item = new QtCanvasLine(canvas);
265  item->setPoints(0, 0, rand() % canvas->width() - canvas->width() / 2,
266  rand() % canvas->height() - canvas->height() / 2);
267  item->move(rand() % canvas->width(), rand() % canvas->height());
268  item->setPen(QPen(QColor(rand() % 32 * 8, rand() % 32 * 8, rand() % 32 * 8), 6));
269  item->setZ(rand() % 256);
270  item->show();
271  return item;
272 }
273 
274 QtCanvasItem* MainWindow::addText()
275 {
276  QtCanvasText* item = new QtCanvasText(canvas);
277  item->setText(tr("Text"));
278  item->setColor(QColor(rand() % 32 * 8, rand() % 32 * 8, rand() % 32 * 8));
279  item->move(rand() % canvas->width(), rand() % canvas->height());
280  item->setZ(rand() % 256);
281  item->show();
282  return item;
283 }
284 
285 void MainWindow::itemMoved(QtCanvasItem* item)
286 {
287  if (item != currentItem)
288  {
289  return;
290  }
291 
292  doubleManager->setValue(idToProperty[QLatin1String("xpos")], item->x());
293  doubleManager->setValue(idToProperty[QLatin1String("ypos")], item->y());
294  doubleManager->setValue(idToProperty[QLatin1String("zpos")], item->z());
295 }
296 
297 void MainWindow::updateExpandState()
298 {
299  QList<QtBrowserItem*> list = propertyEditor->topLevelItems();
300  QListIterator<QtBrowserItem*> it(list);
301 
302  while (it.hasNext())
303  {
304  QtBrowserItem* item = it.next();
305  QtProperty* prop = item->property();
306  idToExpanded[propertyToId[prop]] = propertyEditor->isExpanded(item);
307  }
308 }
309 
310 void MainWindow::itemClicked(QtCanvasItem* item)
311 {
312  updateExpandState();
313 
314  QMap<QtProperty*, QString>::ConstIterator itProp = propertyToId.constBegin();
315 
316  while (itProp != propertyToId.constEnd())
317  {
318  delete itProp.key();
319  itProp++;
320  }
321 
322  propertyToId.clear();
323  idToProperty.clear();
324 
325  currentItem = item;
326 
327  if (!currentItem)
328  {
329  deleteAction->setEnabled(false);
330  return;
331  }
332 
333  deleteAction->setEnabled(true);
334 
335  QtProperty* property;
336 
337  property = doubleManager->addProperty(tr("Position X"));
338  doubleManager->setRange(property, 0, canvas->width());
339  doubleManager->setValue(property, item->x());
340  addProperty(property, QLatin1String("xpos"));
341 
342  property = doubleManager->addProperty(tr("Position Y"));
343  doubleManager->setRange(property, 0, canvas->height());
344  doubleManager->setValue(property, item->y());
345  addProperty(property, QLatin1String("ypos"));
346 
347  property = doubleManager->addProperty(tr("Position Z"));
348  doubleManager->setRange(property, 0, 256);
349  doubleManager->setValue(property, item->z());
350  addProperty(property, QLatin1String("zpos"));
351 
352  if (item->rtti() == QtCanvasItem::Rtti_Rectangle)
353  {
355 
356  property = colorManager->addProperty(tr("Brush Color"));
357  colorManager->setValue(property, i->brush().color());
358  addProperty(property, QLatin1String("brush"));
359 
360  property = colorManager->addProperty(tr("Pen Color"));
361  colorManager->setValue(property, i->pen().color());
362  addProperty(property, QLatin1String("pen"));
363 
364  property = sizeManager->addProperty(tr("Size"));
365  sizeManager->setValue(property, i->size());
366  addProperty(property, QLatin1String("size"));
367  }
368  else if (item->rtti() == QtCanvasItem::Rtti_Line)
369  {
370  QtCanvasLine* i = (QtCanvasLine*)item;
371 
372  property = colorManager->addProperty(tr("Pen Color"));
373  colorManager->setValue(property, i->pen().color());
374  addProperty(property, QLatin1String("pen"));
375 
376  property = pointManager->addProperty(tr("Vector"));
377  pointManager->setValue(property, i->endPoint());
378  addProperty(property, QLatin1String("endpoint"));
379  }
380  else if (item->rtti() == QtCanvasItem::Rtti_Ellipse)
381  {
382  QtCanvasEllipse* i = (QtCanvasEllipse*)item;
383 
384  property = colorManager->addProperty(tr("Brush Color"));
385  colorManager->setValue(property, i->brush().color());
386  addProperty(property, QLatin1String("brush"));
387 
388  property = sizeManager->addProperty(tr("Size"));
389  sizeManager->setValue(property, QSize(i->width(), i->height()));
390  sizeManager->setRange(property, QSize(0, 0), QSize(1000, 1000));
391  addProperty(property, QLatin1String("size"));
392  }
393  else if (item->rtti() == QtCanvasItem::Rtti_Text)
394  {
395  QtCanvasText* i = (QtCanvasText*)item;
396 
397  property = colorManager->addProperty(tr("Color"));
398  colorManager->setValue(property, i->color());
399  addProperty(property, QLatin1String("color"));
400 
401  property = stringManager->addProperty(tr("Text"));
402  stringManager->setValue(property, i->text());
403  addProperty(property, QLatin1String("text"));
404 
405  property = fontManager->addProperty(tr("Font"));
406  fontManager->setValue(property, i->font());
407  addProperty(property, QLatin1String("font"));
408  }
409 }
410 
411 void MainWindow::addProperty(QtProperty* property, const QString& id)
412 {
413  propertyToId[property] = id;
414  idToProperty[id] = property;
415  QtBrowserItem* item = propertyEditor->addProperty(property);
416 
417  if (idToExpanded.contains(id))
418  {
419  propertyEditor->setExpanded(item, idToExpanded[id]);
420  }
421 }
422 
423 void MainWindow::valueChanged(QtProperty* property, double value)
424 {
425  if (!propertyToId.contains(property))
426  {
427  return;
428  }
429 
430  if (!currentItem)
431  {
432  return;
433  }
434 
435  QString id = propertyToId[property];
436 
437  if (id == QLatin1String("xpos"))
438  {
439  currentItem->setX(value);
440  }
441  else if (id == QLatin1String("ypos"))
442  {
443  currentItem->setY(value);
444  }
445  else if (id == QLatin1String("zpos"))
446  {
447  currentItem->setZ(value);
448  }
449 
450  canvas->update();
451 }
452 
453 void MainWindow::valueChanged(QtProperty* property, const QString& value)
454 {
455  if (!propertyToId.contains(property))
456  {
457  return;
458  }
459 
460  if (!currentItem)
461  {
462  return;
463  }
464 
465  QString id = propertyToId[property];
466 
467  if (id == QLatin1String("text"))
468  {
469  if (currentItem->rtti() == QtCanvasItem::Rtti_Text)
470  {
471  QtCanvasText* i = (QtCanvasText*)currentItem;
472  i->setText(value);
473  }
474  }
475 
476  canvas->update();
477 }
478 
479 void MainWindow::valueChanged(QtProperty* property, const QColor& value)
480 {
481  if (!propertyToId.contains(property))
482  {
483  return;
484  }
485 
486  if (!currentItem)
487  {
488  return;
489  }
490 
491  QString id = propertyToId[property];
492 
493  if (id == QLatin1String("color"))
494  {
495  if (currentItem->rtti() == QtCanvasItem::Rtti_Text)
496  {
497  QtCanvasText* i = (QtCanvasText*)currentItem;
498  i->setColor(value);
499  }
500  }
501  else if (id == QLatin1String("brush"))
502  {
503  if (currentItem->rtti() == QtCanvasItem::Rtti_Rectangle ||
504  currentItem->rtti() == QtCanvasItem::Rtti_Ellipse)
505  {
506  QtCanvasPolygonalItem* i = (QtCanvasPolygonalItem*)currentItem;
507  QBrush b = i->brush();
508  b.setColor(value);
509  i->setBrush(b);
510  }
511  }
512  else if (id == QLatin1String("pen"))
513  {
514  if (currentItem->rtti() == QtCanvasItem::Rtti_Rectangle ||
515  currentItem->rtti() == QtCanvasItem::Rtti_Line)
516  {
517  QtCanvasPolygonalItem* i = (QtCanvasPolygonalItem*)currentItem;
518  QPen p = i->pen();
519  p.setColor(value);
520  i->setPen(p);
521  }
522  }
523 
524  canvas->update();
525 }
526 
527 void MainWindow::valueChanged(QtProperty* property, const QFont& value)
528 {
529  if (!propertyToId.contains(property))
530  {
531  return;
532  }
533 
534  if (!currentItem)
535  {
536  return;
537  }
538 
539  QString id = propertyToId[property];
540 
541  if (id == QLatin1String("font"))
542  {
543  if (currentItem->rtti() == QtCanvasItem::Rtti_Text)
544  {
545  QtCanvasText* i = (QtCanvasText*)currentItem;
546  i->setFont(value);
547  }
548  }
549 
550  canvas->update();
551 }
552 
553 void MainWindow::valueChanged(QtProperty* property, const QPoint& value)
554 {
555  if (!propertyToId.contains(property))
556  {
557  return;
558  }
559 
560  if (!currentItem)
561  {
562  return;
563  }
564 
565  QString id = propertyToId[property];
566 
567  if (currentItem->rtti() == QtCanvasItem::Rtti_Line)
568  {
569  QtCanvasLine* i = (QtCanvasLine*)currentItem;
570 
571  if (id == QLatin1String("endpoint"))
572  {
573  i->setPoints(i->startPoint().x(), i->startPoint().y(), value.x(), value.y());
574  }
575  }
576 
577  canvas->update();
578 }
579 
580 void MainWindow::valueChanged(QtProperty* property, const QSize& value)
581 {
582  if (!propertyToId.contains(property))
583  {
584  return;
585  }
586 
587  if (!currentItem)
588  {
589  return;
590  }
591 
592  QString id = propertyToId[property];
593 
594  if (id == QLatin1String("size"))
595  {
596  if (currentItem->rtti() == QtCanvasItem::Rtti_Rectangle)
597  {
598  QtCanvasRectangle* i = (QtCanvasRectangle*)currentItem;
599  i->setSize(value.width(), value.height());
600  }
601  else if (currentItem->rtti() == QtCanvasItem::Rtti_Ellipse)
602  {
603  QtCanvasEllipse* i = (QtCanvasEllipse*)currentItem;
604  i->setSize(value.width(), value.height());
605  }
606  }
607 
608  canvas->update();
609 }
610 
QtSizePropertyManager::setValue
void setValue(QtProperty *property, const QSize &val)
Definition: qtpropertymanager.cpp:3777
CanvasView::contentsMouseDoubleClickEvent
void contentsMouseDoubleClickEvent(QMouseEvent *event)
Definition: mainwindow.cpp:57
QtCanvasLine
Definition: qtcanvas.h:761
QtAbstractPropertyBrowser::addProperty
QtBrowserItem * addProperty(QtProperty *property)
Definition: qtpropertybrowser.cpp:1969
QtCanvasPolygonalItem::brush
QBrush brush() const
Definition: qtcanvas.h:637
QtColorPropertyManager::subIntPropertyManager
QtIntPropertyManager * subIntPropertyManager() const
Definition: qtpropertymanager.cpp:7118
QtPointPropertyManager
The QtPointPropertyManager provides and manages QPoint properties.
Definition: qtpropertymanager.h:374
QtFontPropertyManager::subBoolPropertyManager
QtBoolPropertyManager * subBoolPropertyManager() const
Definition: qtpropertymanager.cpp:6723
QtCanvas::update
virtual void update()
Definition: qtcanvas.cpp:1091
QtCanvasText::setFont
void setFont(const QFont &)
Definition: qtcanvas.cpp:5140
QtAbstractPropertyManager::addProperty
QtProperty * addProperty(const QString &name=QString())
Definition: qtpropertybrowser.cpp:826
QtTreePropertyBrowser
The QtTreePropertyBrowser class provides QTreeWidget based property browser.
Definition: qttreepropertybrowser.h:51
QtCanvasItem::x
double x() const
Definition: qtcanvas.h:73
QtCanvasEllipse::width
int width() const
Definition: qtcanvas.cpp:4901
list
list(APPEND SOURCES ${QT_RESOURCES}) set(COMPONENT_LIBS ArmarXGui ArmarXCoreObservers ArmarXCoreEigen3Variants PlotterController $
Definition: CMakeLists.txt:49
QtSizePropertyManager::subIntPropertyManager
QtIntPropertyManager * subIntPropertyManager() const
Definition: qtpropertymanager.cpp:3711
CanvasView::itemClicked
void itemClicked(QtCanvasItem *item)
QtCanvasItem::moveBy
virtual void moveBy(double dx, double dy)
Definition: qtcanvas.cpp:1918
QtFontPropertyManager::setValue
void setValue(QtProperty *property, const QFont &val)
Definition: qtpropertymanager.cpp:6780
qteditorfactory.h
QtCanvasLine::setPoints
void setPoints(int x1, int y1, int x2, int y2)
Definition: qtcanvas.cpp:4590
CanvasView::itemMoved
void itemMoved(QtCanvasItem *item)
MainWindow::MainWindow
MainWindow(QWidget *parent=0)
Definition: mainwindow.cpp:90
QtCanvasText::setColor
void setColor(const QColor &)
Definition: qtcanvas.cpp:5166
QtCanvasItem::setX
void setX(double a)
Definition: qtcanvas.h:88
QtCanvasText::text
QString text() const
Definition: qtcanvas.cpp:5103
QtStringPropertyManager
The QtStringPropertyManager provides and manages QString properties.
Definition: qtpropertymanager.h:176
QtCanvas::width
int width() const
Definition: qtcanvas.h:276
QtBrowserItem
The QtBrowserItem class represents a property in a property browser instance.
Definition: qtpropertybrowser.h:273
QtDoubleSpinBoxFactory
The QtDoubleSpinBoxFactory class provides QDoubleSpinBox widgets for properties created by QtDoublePr...
Definition: qteditorfactory.h:146
QtCanvasItem::Rtti_Text
@ Rtti_Text
Definition: qtcanvas.h:170
QtCanvasItem::setZ
void setZ(double a)
Definition: qtcanvas.h:96
QtDoublePropertyManager::setValue
void setValue(QtProperty *property, double val)
Definition: qtpropertymanager.cpp:1293
QtProperty
The QtProperty class encapsulates an instance of a property.
Definition: qtpropertybrowser.h:71
QtCanvas::collisions
QtCanvasItemList collisions(const QPoint &) const
Definition: qtcanvas.cpp:2627
QtCanvasRectangle::setSize
void setSize(int w, int h)
Definition: qtcanvas.cpp:4758
QtCanvasRectangle::size
QSize size() const
Definition: qtcanvas.h:691
QtFontPropertyManager
The QtFontPropertyManager provides and manages QFont properties.
Definition: qtpropertymanager.h:670
QtCanvasItem::Rtti_Ellipse
@ Rtti_Ellipse
Definition: qtcanvas.h:173
QtSizePropertyManager
The QtSizePropertyManager provides and manages QSize properties.
Definition: qtpropertymanager.h:435
QtCanvas::height
int height() const
Definition: qtcanvas.h:280
QtCanvasPolygonalItem
Definition: qtcanvas.h:622
QtCanvas::allItems
QtCanvasItemList allItems()
Definition: qtcanvas.cpp:684
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
QtCanvasText::color
QColor color() const
Definition: qtcanvas.cpp:5156
QtSpinBoxFactory
The QtSpinBoxFactory class provides QSpinBox widgets for properties created by QtIntPropertyManager o...
Definition: qteditorfactory.h:50
QtDoublePropertyManager::setRange
void setRange(QtProperty *property, double minVal, double maxVal)
Definition: qtpropertymanager.cpp:1456
QtCanvasPolygonalItem::setPen
virtual void setPen(QPen p)
Definition: qtcanvas.cpp:4272
QtCanvasItem::Rtti_Rectangle
@ Rtti_Rectangle
Definition: qtcanvas.h:172
QtCanvasRectangle
Definition: qtcanvas.h:679
QtCanvasItem
Definition: qtcanvas.h:67
QtDoublePropertyManager
The QtDoublePropertyManager provides and manages double properties.
Definition: qtpropertymanager.h:136
QtPointPropertyManager::subIntPropertyManager
QtIntPropertyManager * subIntPropertyManager() const
Definition: qtpropertymanager.cpp:3109
QtCanvasItem::y
double y() const
Definition: qtcanvas.h:77
QtPointPropertyManager::setValue
void setValue(QtProperty *property, const QPoint &val)
Definition: qtpropertymanager.cpp:3152
QtCanvasEllipse::setSize
void setSize(int w, int h)
Definition: qtcanvas.cpp:4917
CanvasView::contentsMousePressEvent
void contentsMousePressEvent(QMouseEvent *event)
Definition: mainwindow.cpp:52
QtCanvasView::inverseWorldMatrix
const QMatrix & inverseWorldMatrix() const
Definition: qtcanvas.cpp:3735
QtCanvasText::setText
void setText(const QString &)
Definition: qtcanvas.cpp:5114
QtCanvasItem::show
void show()
Definition: qtcanvas.cpp:2093
QtLineEditFactory
The QtLineEditFactory class provides QLineEdit widgets for properties created by QtStringPropertyMana...
Definition: qteditorfactory.h:172
CanvasView
Definition: mainwindow.h:49
QtCanvasPolygonalItem::pen
QPen pen() const
Definition: qtcanvas.h:633
QtCanvasItemList
QList< QtCanvasItem * > QtCanvasItemList
Definition: qtcanvas.h:62
QtSizePropertyManager::setRange
void setRange(QtProperty *property, const QSize &minVal, const QSize &maxVal)
Definition: qtpropertymanager.cpp:3841
QtColorPropertyManager::setValue
void setValue(QtProperty *property, const QColor &val)
Definition: qtpropertymanager.cpp:7176
CanvasView::contentsMouseMoveEvent
void contentsMouseMoveEvent(QMouseEvent *event)
Definition: mainwindow.cpp:77
QtBrowserItem::property
QtProperty * property() const
Definition: qtpropertybrowser.cpp:1221
QtCanvasItem::rtti
virtual int rtti() const
Definition: qtcanvas.cpp:5292
QtFontPropertyManager::subIntPropertyManager
QtIntPropertyManager * subIntPropertyManager() const
Definition: qtpropertymanager.cpp:6694
QtCanvas
Definition: qtcanvas.h:233
QtAbstractPropertyBrowser::topLevelItems
QList< QtBrowserItem * > topLevelItems() const
Definition: qtpropertybrowser.cpp:1933
QtCanvasItem::z
double z() const
Definition: qtcanvas.h:81
QtCanvasText::font
QFont font() const
Definition: qtcanvas.cpp:5130
QtCanvasLine::startPoint
QPoint startPoint() const
Definition: qtcanvas.h:768
QtCanvasPolygonalItem::setBrush
virtual void setBrush(QBrush b)
Definition: qtcanvas.cpp:4287
QtCanvasLine::endPoint
QPoint endPoint() const
Definition: qtcanvas.h:772
QtTreePropertyBrowser::isExpanded
bool isExpanded(QtBrowserItem *item) const
Definition: qttreepropertybrowser.cpp:1142
qttreepropertybrowser.h
QtCanvasItem::Rtti_Line
@ Rtti_Line
Definition: qtcanvas.h:174
QtStringPropertyManager::setValue
void setValue(QtProperty *property, const QString &val)
Definition: qtpropertymanager.cpp:1654
QtCheckBoxFactory
The QtCheckBoxFactory class provides QCheckBox widgets for properties created by QtBoolPropertyManage...
Definition: qteditorfactory.h:123
QtFontPropertyManager::subEnumPropertyManager
QtEnumPropertyManager * subEnumPropertyManager() const
Definition: qtpropertymanager.cpp:6708
QtCanvasLine::setPen
void setPen(QPen p)
Definition: qtcanvas.cpp:4565
QtCanvasEllipse
Definition: qtcanvas.h:792
QtCanvasView::canvas
QtCanvas * canvas() const
Definition: qtcanvas.h:411
QtCanvasEllipse::height
int height() const
Definition: qtcanvas.cpp:4909
QtCanvasText
Definition: qtcanvas.h:838
mainwindow.h
QtCanvasItem::move
void move(double x, double y)
Definition: qtcanvas.cpp:1933
QtEnumEditorFactory
The QtEnumEditorFactory class provides QComboBox widgets for properties created by QtEnumPropertyMana...
Definition: qteditorfactory.h:309
QtAbstractPropertyBrowser::setFactoryForManager
void setFactoryForManager(PropertyManager *manager, QtAbstractEditorFactory< PropertyManager > *factory)
Definition: qtpropertybrowser.h:304
QtTreePropertyBrowser::setExpanded
void setExpanded(QtBrowserItem *item, bool expanded)
Definition: qttreepropertybrowser.cpp:1126
QtCanvasItem::setY
void setY(double a)
Definition: qtcanvas.h:92
qtpropertymanager.h
QtColorPropertyManager
The QtColorPropertyManager provides and manages QColor properties.
Definition: qtpropertymanager.h:706