Changeset 43935 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 22, 2012 11:55:38 AM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetails.cpp
r43926 r43935 33 33 , m_pDetailsView(0) 34 34 { 35 /* Setup palette: */ 36 setAutoFillBackground(true); 37 QPalette pal = qApp->palette(); 38 pal.setColor(QPalette::Window, pal.color(QPalette::Active, QPalette::Window)); 39 setPalette(pal); 35 /* Prepare palette: */ 36 preparePalette(); 40 37 41 /* Create main-layout: */ 42 m_pMainLayout = new QVBoxLayout(this); 43 m_pMainLayout->setContentsMargins(2, 0, 0, 0); 44 m_pMainLayout->setSpacing(0); 38 /* Prepare layout: */ 39 prepareLayout(); 45 40 46 /* Create details-model: */47 m_pDetailsModel = new UIGDetailsModel(this);41 /* Prepare model: */ 42 prepareModel(); 48 43 49 /* Create details-view: */ 50 m_pDetailsView = new UIGDetailsView(this); 51 m_pDetailsView->setFrameShape(QFrame::NoFrame); 52 m_pDetailsView->setFrameShadow(QFrame::Plain); 53 m_pDetailsView->setScene(m_pDetailsModel->scene()); 54 m_pDetailsView->show(); 55 setFocusProxy(m_pDetailsView); 56 57 /* Add tool-bar into layout: */ 58 m_pMainLayout->addWidget(m_pDetailsView); 44 /* Prepare view: */ 45 prepareView(); 59 46 60 47 /* Prepare connections: */ … … 64 51 void UIGDetails::setItems(const QList<UIVMItem*> &items) 65 52 { 53 /* Propagate to details-model: */ 66 54 m_pDetailsModel->setItems(items); 55 } 56 57 void UIGDetails::preparePalette() 58 { 59 /* Setup palette: */ 60 setAutoFillBackground(true); 61 QPalette pal = qApp->palette(); 62 pal.setColor(QPalette::Window, pal.color(QPalette::Active, QPalette::Window)); 63 setPalette(pal); 64 } 65 66 void UIGDetails::prepareLayout() 67 { 68 /* Setup main-layout: */ 69 m_pMainLayout = new QVBoxLayout(this); 70 m_pMainLayout->setContentsMargins(2, 0, 0, 0); 71 m_pMainLayout->setSpacing(0); 72 } 73 74 void UIGDetails::prepareModel() 75 { 76 /* Setup details-model: */ 77 m_pDetailsModel = new UIGDetailsModel(this); 78 } 79 80 void UIGDetails::prepareView() 81 { 82 /* Setup details-view: */ 83 m_pDetailsView = new UIGDetailsView(this); 84 m_pDetailsView->setFrameShape(QFrame::NoFrame); 85 m_pDetailsView->setFrameShadow(QFrame::Plain); 86 m_pDetailsView->setScene(m_pDetailsModel->scene()); 87 m_pDetailsView->show(); 88 setFocusProxy(m_pDetailsView); 89 m_pMainLayout->addWidget(m_pDetailsView); 67 90 } 68 91 69 92 void UIGDetails::prepareConnections() 70 93 { 71 /* Se lector-model connections: */94 /* Setup details-model connections: */ 72 95 connect(m_pDetailsModel, SIGNAL(sigRootItemResized(const QSizeF&, int)), 73 96 m_pDetailsView, SLOT(sltHandleRootItemResized(const QSizeF&, int))); … … 81 104 m_pDetailsModel, SLOT(sltHandleToggleFinished())); 82 105 83 /* Selector-view connections: */ 84 connect(m_pDetailsView, SIGNAL(sigResized()), m_pDetailsModel, SLOT(sltHandleViewResized())); 106 /* Setup details-view connections: */ 107 connect(m_pDetailsView, SIGNAL(sigResized()), 108 m_pDetailsModel, SLOT(sltHandleViewResized())); 85 109 } 86 110 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetails.h
r42734 r43935 36 36 signals: 37 37 38 /* Link-clickstuff: */38 /* Notifier: Link processing stuff: */ 39 39 void sigLinkClicked(const QString &strCategory, const QString &strControl, const QString &strId); 40 40 41 /* Notifier: Sliding st arted: */41 /* Notifier: Sliding stuff: */ 42 42 void sigSlidingStarted(); 43 43 … … 51 51 UIGDetails(QWidget *pParent); 52 52 53 /* API: Group/machinestuff: */53 /* API: Current item(s) stuff: */ 54 54 void setItems(const QList<UIVMItem*> &items); 55 55 … … 57 57 58 58 /* Helpers: Prepare stuff: */ 59 void preparePalette(); 60 void prepareLayout(); 61 void prepareModel(); 62 void prepareView(); 59 63 void prepareConnections(); 60 64
Note:
See TracChangeset
for help on using the changeset viewer.