VirtualBox

Changeset 43935 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Nov 22, 2012 11:55:38 AM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: VM group UI: Details-container cleanup.

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  
    3333    , m_pDetailsView(0)
    3434{
    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();
    4037
    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();
    4540
    46     /* Create details-model: */
    47     m_pDetailsModel = new UIGDetailsModel(this);
     41    /* Prepare model: */
     42    prepareModel();
    4843
    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();
    5946
    6047    /* Prepare connections: */
     
    6451void UIGDetails::setItems(const QList<UIVMItem*> &items)
    6552{
     53    /* Propagate to details-model: */
    6654    m_pDetailsModel->setItems(items);
     55}
     56
     57void 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
     66void 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
     74void UIGDetails::prepareModel()
     75{
     76    /* Setup details-model: */
     77    m_pDetailsModel = new UIGDetailsModel(this);
     78}
     79
     80void 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);
    6790}
    6891
    6992void UIGDetails::prepareConnections()
    7093{
    71     /* Selector-model connections: */
     94    /* Setup details-model connections: */
    7295    connect(m_pDetailsModel, SIGNAL(sigRootItemResized(const QSizeF&, int)),
    7396            m_pDetailsView, SLOT(sltHandleRootItemResized(const QSizeF&, int)));
     
    81104            m_pDetailsModel, SLOT(sltHandleToggleFinished()));
    82105
    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()));
    85109}
    86110
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetails.h

    r42734 r43935  
    3636signals:
    3737
    38     /* Link-click stuff: */
     38    /* Notifier: Link processing stuff: */
    3939    void sigLinkClicked(const QString &strCategory, const QString &strControl, const QString &strId);
    4040
    41     /* Notifier: Sliding started: */
     41    /* Notifier: Sliding stuff: */
    4242    void sigSlidingStarted();
    4343
     
    5151    UIGDetails(QWidget *pParent);
    5252
    53     /* API: Group/machine stuff: */
     53    /* API: Current item(s) stuff: */
    5454    void setItems(const QList<UIVMItem*> &items);
    5555
     
    5757
    5858    /* Helpers: Prepare stuff: */
     59    void preparePalette();
     60    void prepareLayout();
     61    void prepareModel();
     62    void prepareView();
    5963    void prepareConnections();
    6064
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette