VirtualBox

Changeset 7308 in vbox


Ignore:
Timestamp:
Mar 5, 2008 2:50:08 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
28706
Message:

Removed several Q3* classes in the selector window.

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSelectorWnd.h

    r7246 r7308  
    2424#include "VBoxGlobal.h"
    2525
    26 #include <qapplication.h>
     26/* Qt includes */
    2727#include <QMainWindow>
    28 #include <q3listbox.h>
    29 #include <q3groupbox.h>
    30 #include <qaction.h>
    31 
    32 #include <q3valuelist.h>
    33 //Added by qt3to4:
    34 #include <QEvent>
    35 #include <QLabel>
    36 #include <Q3PopupMenu>
    3728
    3829class VBoxVMListBox;
     
    4233class VBoxVMLogViewer;
    4334
    44 class QLabel;
    45 class Q3TextBrowser;
    4635class QTabWidget;
    47 struct QUuid;
     36class Q3ListBoxItem;
     37class QEvent;
     38class QUuid;
    4839
    4940class VBoxSelectorWnd : public QMainWindow
     
    5445
    5546    VBoxSelectorWnd (VBoxSelectorWnd **aSelf,
    56                      QWidget* aParent = 0, const char* aName = 0,
     47                     QWidget* aParent = 0,
    5748                     Qt::WFlags aFlags = Qt::WType_TopLevel);
    5849    virtual ~VBoxSelectorWnd();
     
    114105
    115106    /** VM list context menu */
    116     Q3PopupMenu *mVMCtxtMenu;
     107    QMenu *mVMCtxtMenu;
    117108
    118109    /* actions */
     
    141132    VBoxVMDescriptionPage *vmDescriptionPage;
    142133
    143     Q3ValueList <CSession> sessions;
    144 
    145134    QPoint normal_pos;
    146135    QSize normal_size;
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxToolBar.h

    r7282 r7308  
    3737public:
    3838
    39     VBoxToolBar (QMainWindow *aMainWindow, QWidget *aParent)
    40         : QToolBar (aParent),
     39    VBoxToolBar (QMainWindow *aMainWindow, QWidget *aParent = NULL)
     40        : QToolBar (aParent), 
    4141          mMainWindow (aMainWindow)
    4242    {
     
    5454    void setUsesBigPixmaps (bool enable)
    5555    {
    56         QSize bigSize(32, 32);
    57 
     56        QSize size (32, 32);
     57        if (!enable)
     58            size = QSize (16, 16);
     59               
    5860        if (mMainWindow)
    59             mMainWindow->setIconSize (bigSize);
     61            mMainWindow->setIconSize (size);
    6062        else
    61             setIconSize (bigSize);
     63            setIconSize (size);
    6264    }
    6365
    6466    void setUsesTextLabel (bool enable)
    6567    {
     68        Qt::ToolButtonStyle tbs = Qt::ToolButtonTextUnderIcon;
     69        if (!enable)
     70            tbs = Qt::ToolButtonIconOnly;
     71           
    6672        if (mMainWindow)
    67             mMainWindow->setToolButtonStyle (Qt::ToolButtonTextUnderIcon);
     73            mMainWindow->setToolButtonStyle (tbs);
    6874        else
    69             setToolButtonStyle (Qt::ToolButtonTextUnderIcon);
     75            setToolButtonStyle (tbs);
    7076    }
    7177
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp

    r7250 r7308  
    863863         *  from the below constructor or from constructors/methods it calls.
    864864         */
    865         VBoxSelectorWnd *w = new VBoxSelectorWnd (&mSelectorWnd, 0, "selectorWnd");
     865        VBoxSelectorWnd *w = new VBoxSelectorWnd (&mSelectorWnd, 0);
    866866        Assert (w == mSelectorWnd);
    867867        NOREF(w);
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp

    r7250 r7308  
    3030#include "VBoxVMLogViewer.h"
    3131
    32 #include <qlabel.h>
    33 #include <QTextBrowser>
    34 #include <q3textbrowser.h>
    35 #include <qmenubar.h>
    36 #include <q3popupmenu.h>
    37 #include <qmessagebox.h>
    38 #include <qwidget.h>
    39 #include <qtabwidget.h>
    40 #include <q3widgetstack.h>
    41 #include <qpushbutton.h>
    42 #include <q3process.h>
    43 
    44 #include <qlayout.h>
    45 #include <q3vbox.h>
    46 //Added by qt3to4:
    47 #include <QDesktopWidget>
    48 #include <Q3HBoxLayout>
    49 #include <Q3Frame>
    50 #include <q3mimefactory.h>
    51 #include <QResizeEvent>
    52 #include <QEvent>
    53 #include <Q3VBoxLayout>
    54 #include <QMenuItem>
    55 
    5632#ifdef Q_WS_X11
    5733#include <iprt/env.h>
    5834#endif
    5935
     36/* Qt includes */
     37#include <QTextBrowser>
     38#include <QMenuBar>
     39#include <QMenu>
     40#include <QMenuItem>
     41#include <QStackedWidget>
     42#include <QDesktopWidget>
    6043
    6144// VBoxVMDetailsView class
     
    6649 *  and another one for inaccessibility errors.
    6750 */
    68 class VBoxVMDetailsView : public Q3WidgetStack
     51class VBoxVMDetailsView : public QStackedWidget
    6952{
    7053    Q_OBJECT
     
    7255public:
    7356
    74     VBoxVMDetailsView (QWidget *aParent, const char *aName,
     57    VBoxVMDetailsView (QWidget *aParent,
    7558                       QAction *aRefreshAction = NULL);
    7659
     
    8063    {
    8164        mDetailsText->setText (aText);
    82         raiseWidget (0);
     65        setCurrentIndex (0);
    8366    }
    8467
     
    8770        createErrPage();
    8871        mErrText->setText (aText);
    89         raiseWidget (1);
     72        setCurrentIndex (1);
    9073    }
    9174
     
    9376    {
    9477        mDetailsText->setText (QString::null);
    95         raiseWidget (0);
     78        setCurrentIndex (0);
    9679    }
    9780
     
    120103    QWidget *mErrBox;
    121104    QLabel *mErrLabel;
    122     Q3TextBrowser *mErrText;
     105    QTextBrowser *mErrText;
    123106    QToolButton *mRefreshButton;
    124107    QAction *mRefreshAction;
    125108};
    126109
    127 VBoxVMDetailsView::VBoxVMDetailsView (QWidget *aParent, const char *aName,
     110VBoxVMDetailsView::VBoxVMDetailsView (QWidget *aParent,
    128111                                      QAction *aRefreshAction /* = NULL */)
    129     : Q3WidgetStack (aParent, aName)
     112    : QStackedWidget (aParent)
    130113    , mErrBox (NULL), mErrLabel (NULL), mErrText (NULL)
    131114    , mRefreshButton (NULL)
     
    150133            this, SLOT (gotLinkClicked (const QUrl &)));
    151134
    152     addWidget (mDetailsText, 0);
     135    addWidget (mDetailsText);
    153136}
    154137
     
    162145    mErrBox = new QWidget();
    163146
    164     Q3VBoxLayout *layout = new Q3VBoxLayout (mErrBox);
    165     layout->setSpacing (10);
     147    QVBoxLayout *pVLayout = new QVBoxLayout (mErrBox);
     148    pVLayout->setSpacing (10);
    166149
    167150    mErrLabel = new QLabel (mErrBox);
    168151    mErrLabel->setAlignment (Qt::WordBreak);
    169152    mErrLabel->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Fixed);
    170     layout->add (mErrLabel);
    171 
    172     mErrText = new Q3TextBrowser (mErrBox);
     153    pVLayout->add (mErrLabel);
     154
     155    mErrText = new QTextBrowser (mErrBox);
    173156    mErrText->setFocusPolicy (Qt::StrongFocus);
    174     mErrText->setLinkUnderline (false);
    175     layout->add (mErrText);
     157    mErrText->document()->setDefaultStyleSheet ("a { text-decoration: none; }");
     158    pVLayout->add (mErrText);
    176159
    177160    if (mRefreshAction)
     
    180163        mRefreshButton->setFocusPolicy (Qt::StrongFocus);
    181164
    182         Q3HBoxLayout *hLayout = new Q3HBoxLayout (layout);
    183         hLayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Expanding,
    184                                                  QSizePolicy::Minimum));
    185         hLayout->add (mRefreshButton);
     165        QHBoxLayout *pHLayout = new QHBoxLayout (pVLayout);
     166        pHLayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Expanding,
     167                                                  QSizePolicy::Minimum));
     168        pHLayout->add (mRefreshButton);
    186169
    187170        connect (mRefreshButton, SIGNAL (clicked()),
     
    189172    }
    190173
    191     layout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum,
     174    pVLayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum,
    192175                                            QSizePolicy::Expanding));
    193176
    194     addWidget (mErrBox, 1);
     177    addWidget (mErrBox);
    195178
    196179    languageChange();
     
    249232    VBoxSelectorWnd *mParent;
    250233    QToolButton *mBtnEdit;
    251     Q3TextBrowser *mBrowser;
     234    QTextBrowser *mBrowser;
    252235    QLabel *mLabel;
    253236};
     
    260243{
    261244    /* main layout */
    262     Q3VBoxLayout *mainLayout = new Q3VBoxLayout (this, 0, 10, "mainLayout");
     245    QVBoxLayout *pVMainLayout = new QVBoxLayout (this);
     246    pVMainLayout->setSpacing (10);
     247    pVMainLayout->setContentsMargins (0, 0, 0, 0);
    263248
    264249    /* mBrowser */
    265     mBrowser = new Q3TextBrowser (this, "mBrowser");
     250    mBrowser = new QTextBrowser (this, "mBrowser");
    266251    mBrowser->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding);
    267252    mBrowser->setFocusPolicy (Qt::StrongFocus);
    268     mBrowser->setLinkUnderline (false);
    269     mainLayout->addWidget (mBrowser);
     253    mBrowser->document()->setDefaultStyleSheet ("a { text-decoration: none; }");
     254    pVMainLayout->addWidget (mBrowser);
    270255    /* hidden by default */
    271256    mBrowser->setHidden (true);
     
    275260    mLabel->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding);
    276261    mLabel->setAlignment (Qt::AlignCenter | Qt::WordBreak);
    277     mainLayout->addWidget (mLabel);
     262    pVMainLayout->addWidget (mLabel);
    278263    /* always disabled */
    279264    mLabel->setEnabled (false);
    280265
    281266    /* button layout */
    282     Q3HBoxLayout *btnLayout = new Q3HBoxLayout (mainLayout, 10, "btnLayout");
    283     btnLayout->addItem (new QSpacerItem (0, 0,
    284                                          QSizePolicy::Expanding,
    285                                          QSizePolicy::Minimum));
     267    QHBoxLayout *pHBtnLayout = new QHBoxLayout (pVMainLayout);
     268    pHBtnLayout->setSpacing (10);
     269    pHBtnLayout->addItem (new QSpacerItem (0, 0,
     270                                           QSizePolicy::Expanding,
     271                                           QSizePolicy::Minimum));
    286272
    287273    /* button */
     
    294280    mBtnEdit->setUsesTextLabel (true);
    295281    connect (mBtnEdit, SIGNAL (clicked()), this, SLOT (goToSettings()));
    296     btnLayout->addWidget (mBtnEdit);
    297 
    298     mainLayout->addItem (new QSpacerItem (0, 0,
     282    pHBtnLayout->addWidget (mBtnEdit);
     283
     284    pVMainLayout->addItem (new QSpacerItem (0, 0,
    299285                                          QSizePolicy::Expanding,
    300286                                          QSizePolicy::Minimum));
     
    392378 */
    393379VBoxSelectorWnd::
    394 VBoxSelectorWnd (VBoxSelectorWnd **aSelf, QWidget* aParent, const char* aName,
     380VBoxSelectorWnd (VBoxSelectorWnd **aSelf, QWidget* aParent,
    395381                 Qt::WFlags aFlags)
    396382    : QMainWindow (aParent, aFlags)
     
    462448
    463449    /* central widget & horizontal layout */
    464     setCentralWidget (new QWidget (this, "centralWidget"));
    465     Q3HBoxLayout *centralLayout =
    466         new Q3HBoxLayout (centralWidget(), 5, 9, "centralLayout");
     450    setCentralWidget (new QWidget (this));
     451    QHBoxLayout *pCentralLayout =
     452        new QHBoxLayout (centralWidget());
     453    pCentralLayout->setSpacing (9);
     454    pCentralLayout->setContentsMargins (5, 5, 5, 5);
    467455
    468456    /* left vertical box */
    469     Q3VBox *leftVBox = new Q3VBox (centralWidget(), "leftWidget");
    470     leftVBox->setSpacing (5);
     457    QVBoxLayout *pLeftVLayout = new QVBoxLayout ();
     458    pLeftVLayout->setSpacing (5);
    471459    /* right vertical box */
    472     Q3VBox *rightVBox = new Q3VBox (centralWidget(), "rightWidget");
    473     rightVBox->setSpacing (5);
    474     centralLayout->addWidget (leftVBox, 3);
    475     centralLayout->addWidget (rightVBox, 5);
     460    QVBoxLayout *pRightVLayout = new QVBoxLayout ();
     461    pRightVLayout->setSpacing (5);
     462    pCentralLayout->addLayout (pLeftVLayout, 3);
     463    pCentralLayout->addLayout (pRightVLayout, 3);
    476464
    477465    /* VM list toolbar */
    478     VBoxToolBar *vmTools = new VBoxToolBar (this, leftVBox);
     466    VBoxToolBar *vmTools = new VBoxToolBar (this);
     467    pLeftVLayout->addWidget(vmTools);
    479468
    480469    /* VM list box */
    481     vmListBox = new VBoxVMListBox (leftVBox, "vmListBox");
     470    vmListBox = new VBoxVMListBox ();
     471    pLeftVLayout->addWidget (vmListBox);
    482472
    483473    /* VM tab widget containing details and snapshots tabs */
    484     vmTabWidget = new QTabWidget (rightVBox, "vmTabWidget");
     474    vmTabWidget = new QTabWidget ();
     475    pRightVLayout->addWidget (vmTabWidget);
    485476    vmTabWidget->setMargin (10);
    486477
    487478    /* VM details view */
    488     vmDetailsView = new VBoxVMDetailsView (NULL, "vmDetailsView",
     479    vmDetailsView = new VBoxVMDetailsView (NULL,
    489480                                           vmRefreshAction);
    490481    vmTabWidget->addTab (vmDetailsView,
     
    511502//    setUsesTextLabel (true);
    512503//    setUsesBigPixmaps (true);
     504    vmTools->setIconSize (QSize (32, 32));
     505    vmTools->setToolButtonStyle (Qt::ToolButtonTextUnderIcon);
    513506    vmTools->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Preferred);
    514507
     
    526519    /* add actions to menubar */
    527520
    528     Q3PopupMenu *fileMenu = new Q3PopupMenu(this, "fileMenu");
     521    QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
    529522    fileDiskMgrAction->addTo( fileMenu );
    530523    fileMenu->insertSeparator();
     
    535528    menuBar()->insertItem( QString::null, fileMenu, 1);
    536529
    537     Q3PopupMenu *vmMenu = new Q3PopupMenu (this, "vmMenu");
     530    QMenu *vmMenu = menuBar()->addMenu(tr("&Machine"));
    538531    vmNewAction->addTo (vmMenu);
    539532    vmMenu->insertSeparator();
     
    552545    menuBar()->insertItem (QString::null, vmMenu, 2);
    553546
    554     mVMCtxtMenu = new Q3PopupMenu (this, "mVMCtxtMenu");
     547    mVMCtxtMenu = new QMenu (this);
    555548    vmConfigAction->addTo (mVMCtxtMenu);
    556549    vmDeleteAction->addTo (mVMCtxtMenu);
     
    565558    vmShowLogsAction->addTo (mVMCtxtMenu);
    566559
    567     Q3PopupMenu *helpMenu = new Q3PopupMenu( this, "helpMenu" );
     560    QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
    568561    helpContentsAction->addTo (helpMenu);
    569562    helpWebAction->addTo (helpMenu);
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