VirtualBox

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


Ignore:
Timestamp:
Dec 29, 2023 2:13:40 PM (15 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160898
Message:

FE/Qt: bugref:10496: Provide UIPaneContainer with embedding type; This is useful to distinguish between window and tool modes.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerPanel.cpp

    r102725 r102726  
    4545#endif
    4646
    47 UIVMLogViewerPaneContainer::UIVMLogViewerPaneContainer(QWidget *pParent, UIVMLogViewerWidget *pViewer)
    48     : UIPaneContainer(pParent)
     47UIVMLogViewerPaneContainer::UIVMLogViewerPaneContainer(QWidget *pParent,
     48                                                       UIVMLogViewerWidget *pViewer,
     49                                                       EmbedTo enmEmbedTo /* = EmbedTo_Stack */)
     50    : UIPaneContainer(pParent, enmEmbedTo)
    4951    , m_pViewer(pViewer)
    5052    , m_pSearchWidget(0)
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerPanel.h

    r102723 r102726  
    6969public:
    7070
    71     UIVMLogViewerPaneContainer(QWidget *pParent, UIVMLogViewerWidget *pViewer);
     71    UIVMLogViewerPaneContainer(QWidget *pParent,
     72                               UIVMLogViewerWidget *pViewer,
     73                               EmbedTo enmEmbedTo = EmbedTo_Stack);
    7274
    7375    /** @name Search page pass through functions
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp

    r102723 r102726  
    763763    connect(m_pTabWidget, &QITabWidget::currentChanged, this, &UIVMLogViewerWidget::sltCurrentTabChanged);
    764764
    765     m_pPanel = new UIVMLogViewerPaneContainer(0, this);
     765    m_pPanel = new UIVMLogViewerPaneContainer(0, this, m_enmEmbedding);
    766766    AssertReturnVoid(m_pPanel);
    767767    installEventFilter(m_pPanel);
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPaneContainer.cpp

    r102511 r102726  
    2828/* Qt includes: */
    2929#include <QComboBox>
    30 #include <QHBoxLayout>
    3130#include <QLabel>
    3231#include <QPlainTextEdit>
    3332#include <QTextCursor>
    3433#include <QToolButton>
     34#include <QVBoxLayout>
    3535
    3636/* GUI includes: */
     
    4444#include <iprt/assert.h>
    4545
    46 UIPaneContainer::UIPaneContainer(QWidget *pParent /* = 0 */)
     46UIPaneContainer::UIPaneContainer(QWidget *pParent, EmbedTo enmEmbedTo /* = EmbedTo_Stack */)
    4747    : QIWithRetranslateUI<QWidget>(pParent)
     48    , m_enmEmbedTo(enmEmbedTo)
    4849    , m_pTabWidget(0)
    4950{
     
    5859void UIPaneContainer::prepare()
    5960{
    60     QHBoxLayout *pLayout = new QHBoxLayout(this);
     61    QVBoxLayout *pLayout = new QVBoxLayout(this);
    6162    AssertReturnVoid(pLayout);
    6263    pLayout->setContentsMargins(0, 0, 0, 0);
    6364
    6465    /* Add the tab widget: */
    65     m_pTabWidget = new QTabWidget();
     66    m_pTabWidget = new QTabWidget;
     67    AssertReturnVoid(m_pTabWidget);
    6668    connect(m_pTabWidget, &QTabWidget::currentChanged, this, &UIPaneContainer::sigCurrentTabChanged);
    67     AssertReturnVoid(m_pTabWidget);
    6869    pLayout->addWidget(m_pTabWidget);
    6970}
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPaneContainer.h

    r102511 r102726  
    3535#include <QWidget>
    3636#include <QKeySequence>
     37
    3738/* GUI includes: */
     39#include "QIManagerDialog.h"
    3840#include "QIWithRetranslateUI.h"
    3941
     
    5355public:
    5456
    55     UIPaneContainer(QWidget *pParent = 0);
     57    UIPaneContainer(QWidget *pParent, EmbedTo enmEmbedTo = EmbedTo_Stack);
    5658    void setCurrentIndex(int iIndex);
    5759    int currentIndex() const;
     
    7072private:
    7173
    72     QTabWidget    *m_pTabWidget;
     74    EmbedTo  m_enmEmbedTo;
     75
     76    QTabWidget *m_pTabWidget;
    7377};
    7478
Note: See TracChangeset for help on using the changeset viewer.

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