23 uuid ( QUuid::createUuid() )
29 setWindowTitle (
"Graphical View" );
31 QGraphicsScene * scene =
new QGraphicsScene (
this );
32 scene->setItemIndexMethod ( QGraphicsScene::NoIndex );
33 scene->setSceneRect ( 0, 0, 10000, 10000 );
34 GraphicalView->setScene ( scene );
35 GraphicalView->setCacheMode ( QGraphicsView::CacheBackground );
36 GraphicalView->setViewportUpdateMode ( QGraphicsView::BoundingRectViewportUpdate );
37 GraphicalView->setRenderHint ( QPainter::Antialiasing );
38 GraphicalView->setTransformationAnchor ( QGraphicsView::AnchorUnderMouse );
39 GraphicalView->setMinimumSize ( 400, 400 );
40 GraphicalView->centerOn ( scene->sceneRect().topLeft() );
41 GraphicalView->setAcceptDrops (
true );
57 GraphicalView->scene()->clear();
67 ClassName.toStdString() );
75 double ChildNodeHeight = 0;
90 Used, Object->GetData ( 0 ).toString(), GraphicalClassInfo );
91 GraphicalView->scene()->addItem ( ObjectNodeGraphical );
92 ObjectNodeGraphical->setPos (
93 GraphicalView->scene()->sceneRect().topLeft() + QPointF ( dx, dy ) );
96 if ( ( dx + ObjectNodeGraphical->
boundingRect().width() ) > GraphicalView->scene()
97 ->sceneRect().width() )
100 dy += ChildNodeHeight + 30;
103 ChildNodeHeight = ObjectNodeGraphical->
boundingRect().height();
106 dy += ChildNodeHeight + 30;
141 editObject =
new QAction ( tr (
"&Edit Object" ),
this );
143 editObject->setShortcutContext ( Qt::WidgetShortcut );
145 Qt::UniqueConnection );
152 Qt::UniqueConnection );
155 refByAc =
new QAction ( tr (
"Referenced B&y (All objects)" ),
this );
156 refByAc->setShortcut ( tr (
"Ctrl+Y" ) );
157 refByAc->setShortcutContext ( Qt::WidgetShortcut );
158 refByAc->setToolTip (
"Find all objects which reference the selecetd object" );
161 Qt::UniqueConnection );
164 refByAcOnlyComp =
new QAction ( tr (
"Referenced B&y (Only Composite)" ),
this );
168 "Find objects (ONLY Composite ones) which reference the selecetd object" );
172 Qt::UniqueConnection );
175 copyObjectAc =
new QAction ( tr (
"Copy This Object Into A &New One" ),
this );
177 copyObjectAc->setShortcutContext ( Qt::WidgetShortcut );
179 Qt::UniqueConnection );
307 QString ChoosenWindow;
309 QDialog * ChooseDialog =
new QDialog (
this );
310 QComboBox * Combo =
new QComboBox ( ChooseDialog );
311 QPushButton * GoButton =
new QPushButton (
"Choose" );
312 QHBoxLayout * Layout =
new QHBoxLayout ( ChooseDialog );
313 QLabel * Label =
new QLabel (
"Window Configuration : ", ChooseDialog );
315 connect ( GoButton, SIGNAL ( clicked() ), ChooseDialog, SLOT ( accept() ),
316 Qt::UniqueConnection );
320 for (
Window const & WindowConfig : Configurations )
322 Combo->addItem ( WindowConfig.Title );
325 Layout->addWidget ( Label );
326 Layout->addWidget ( Combo );
327 Layout->addWidget ( GoButton );
329 ChooseDialog->setLayout ( Layout );
330 ChooseDialog->setWindowTitle (
"Choose window configuration" );
332 if ( ChooseDialog->exec() )
334 ChoosenWindow = Combo->currentText();
337 for (
Window & Setting : Configurations )
339 if ( ChoosenWindow == Setting.Title )
cptr< dbe::CustomTreeView > get_view() const
static MainWindow * findthis()