VirtualBox

Changeset 107351 in vbox for trunk


Ignore:
Timestamp:
Dec 18, 2024 12:59:12 PM (6 weeks ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10814: VBox Manager: Extend UITools with possibility to create this pane as simple widget; Previously it was possible to use it as popup only.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager
Files:
3 edited

Legend:

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

    r107348 r107351  
    222222
    223223        /* Create tool-menu: */
    224         m_pMenu = new UITools(this, UIToolClass_Global, actionPool());
     224        m_pMenu = new UITools(this, UIToolClass_Global, actionPool(), Qt::Widget);
    225225        if (toolMenu())
    226226        {
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UITools.cpp

    r107299 r107351  
    3838
    3939
    40 UITools::UITools(QWidget *pParent, UIToolClass enmClass, UIActionPool *pActionPool)
    41     : QWidget(pParent, Qt::Popup)
     40UITools::UITools(QWidget *pParent,
     41                 UIToolClass enmClass,
     42                 UIActionPool *pActionPool,
     43                 Qt::WindowFlags theFlags /* = Qt::Popup */)
     44    : QWidget(pParent, theFlags)
    4245    , m_enmClass(enmClass)
    4346    , m_pActionPool(pActionPool)
     
    8790{
    8891    return m_pToolsModel->currentItem();
     92}
     93
     94void UITools::sltClose()
     95{
     96    /* Close the widget in popup mode only: */
     97    if (windowFlags() == Qt::Popup)
     98        close();
    8999}
    90100
     
    146156    /* Model connections: */
    147157    connect(m_pToolsModel, &UIToolsModel::sigClose,
    148             this, &UITools::close);
     158            this, &UITools::sltClose);
    149159    connect(m_pToolsModel, &UIToolsModel::sigSelectionChanged,
    150160            this, &UITools::sigSelectionChanged);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UITools.h

    r107299 r107351  
    6868    /** Constructs Tools-pane passing @a pParent to the base-class.
    6969      * @param  enmClass     Brings the tools class, it will be fixed one.
    70       * @param  pActionPool  Brings the action-pool reference. */
    71     UITools(QWidget *pParent, UIToolClass enmClass, UIActionPool *pActionPool);
     70      * @param  pActionPool  Brings the action-pool reference.
     71      * @param  theFlags     Brings the widget flags. */
     72    UITools(QWidget *pParent,
     73            UIToolClass enmClass,
     74            UIActionPool *pActionPool,
     75            Qt::WindowFlags theFlags = Qt::Popup);
    7276
    7377    /** @name General stuff.
     
    101105        /** Returns current item. */
    102106        UIToolsItem *currentItem() const;
     107    /** @} */
     108
     109private slots:
     110
     111    /** @name General stuff.
     112      * @{ */
     113        /** Handles the close request. */
     114        void sltClose();
    103115    /** @} */
    104116
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