VirtualBox

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


Ignore:
Timestamp:
Jul 18, 2019 9:56:56 AM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9241: VirtualBox Manager: Details pane: A bit of cleanup for UIDetailsView.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/details
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsView.cpp

    r79842 r79855  
    1818/* Qt includes: */
    1919#include <QAccessibleWidget>
    20 #include <QApplication>
    2120#include <QScrollBar>
    2221
     
    111110    , m_iMinimumWidthHint(0)
    112111{
    113     /* Install Details-view accessibility interface factory: */
    114     QAccessible::installFactory(UIAccessibilityInterfaceForUIDetailsView::pFactory);
    115 
    116     /* Setup frame: */
    117     setFrameShape(QFrame::NoFrame);
    118     setFrameShadow(QFrame::Plain);
    119     setAlignment(Qt::AlignLeft | Qt::AlignTop);
    120 
    121     /* Setup scroll-bars policy: */
    122     setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    123     setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    124 
    125     /* Update scene-rect: */
    126     updateSceneRect();
    127 
    128     /* Translate finally: */
    129     retranslateUi();
     112    prepare();
    130113}
    131114
    132 void UIDetailsView::sltMinimumWidthHintChanged(int iMinimumWidthHint)
     115void UIDetailsView::sltMinimumWidthHintChanged(int iHint)
    133116{
    134117    /* Is there something changed? */
    135     if (m_iMinimumWidthHint == iMinimumWidthHint)
     118    if (m_iMinimumWidthHint == iHint)
    136119        return;
    137120
    138121    /* Remember new value: */
    139     m_iMinimumWidthHint = iMinimumWidthHint;
     122    m_iMinimumWidthHint = iHint;
    140123    if (m_iMinimumWidthHint <= 0)
    141124        m_iMinimumWidthHint = 1;
    142125
    143126    /* Set minimum view width according passed width-hint: */
    144     setMinimumWidth(2 * frameWidth() + iMinimumWidthHint + verticalScrollBar()->sizeHint().width());
     127    setMinimumWidth(2 * frameWidth() + m_iMinimumWidthHint + verticalScrollBar()->sizeHint().width());
    145128
    146129    /* Update scene-rect: */
     
    167150}
    168151
     152void UIDetailsView::prepare()
     153{
     154    /* Install Details-view accessibility interface factory: */
     155    QAccessible::installFactory(UIAccessibilityInterfaceForUIDetailsView::pFactory);
     156
     157    /* Setup frame: */
     158    setFrameShape(QFrame::NoFrame);
     159    setFrameShadow(QFrame::Plain);
     160    setAlignment(Qt::AlignLeft | Qt::AlignTop);
     161
     162    /* Setup scroll-bars policy: */
     163    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
     164    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
     165
     166    /* Update scene-rect: */
     167    updateSceneRect();
     168
     169    /* Translate finally: */
     170    retranslateUi();
     171}
     172
    169173void UIDetailsView::updateSceneRect()
    170174{
    171175    setSceneRect(0, 0, m_iMinimumWidthHint, height());
    172176}
    173 
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsView.h

    r79842 r79855  
    3636signals:
    3737
    38     /* Notifier: Resize stuff: */
     38    /** Notifies listeners about resize. */
    3939    void sigResized();
    4040
     
    5050public slots:
    5151
    52     /* Handlers: Size-hint stuff: */
    53     void sltMinimumWidthHintChanged(int iMinimumWidthHint);
     52    /** Handles minimum width @a iHint change. */
     53    void sltMinimumWidthHintChanged(int iHint);
    5454
    55 private:
     55protected:
    5656
    5757    /** Handles translation event. */
    5858    virtual void retranslateUi() /* override */;
    5959
    60     /* Handler: Resize-event stuff: */
    61     void resizeEvent(QResizeEvent *pEvent);
     60    /** Handles resize @a pEvent. */
     61    virtual void resizeEvent(QResizeEvent *pEvent) /* override */;
    6262
    63     /* Helper: Update stuff: */
     63private:
     64
     65    /** Prepares all. */
     66    void prepare();
     67
     68    /** Updates scene rectangle. */
    6469    void updateSceneRect();
    6570
     
    6772    UIDetails *m_pDetails;
    6873
    69     /* Variables: */
     74    /** Updates scene rectangle. */
    7075    int m_iMinimumWidthHint;
    7176};
    7277
    7378#endif /* !FEQT_INCLUDED_SRC_manager_details_UIDetailsView_h */
    74 
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