VirtualBox

Ignore:
Timestamp:
Mar 13, 2008 9:37:52 PM (17 years ago)
Author:
vboxsync
Message:

First group of qt3->qt4 convertions done:

  1. VirtualBox About Dialog.
  2. CloseVM Dialog.
  3. NewVM Wizard.
  4. NewHD Wizard.
  5. FirstRun Wizard.

Wizards are rewritten fully due to qt designer 4.x is not supports QWizard class now.

Location:
trunk/src/VBox/Frontends/VirtualBox4/include
Files:
2 edited

Legend:

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

    r7220 r7447  
    3434public:
    3535
    36     VBoxMediaComboBox (QWidget *aParent = 0, const char *aName = 0,
     36    VBoxMediaComboBox (QWidget *aParent, const char *aName,
    3737                       int aType = 0, bool aUseEmptyItem = false);
     38    VBoxMediaComboBox (QWidget *aParent);
    3839    ~VBoxMediaComboBox() {}
    3940
     
    5859protected:
    5960
     61    void init();
    6062    void updateToolTip (int);
    6163    void processMedia (const VBoxMedia &);
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxUtils.h

    r7220 r7447  
    2323#include <qevent.h>
    2424#include <q3listview.h>
    25 #include <q3textedit.h>
    2625#include <qlabel.h>
    2726#include <qlayout.h>
     
    171170};
    172171
    173 
    174 /**
    175  *  Simple QTextEdit subclass to return its minimumSizeHint() as sizeHint()
    176  *  for getting more compact layout.
    177  */
    178 class QITextEdit : public Q3TextEdit
    179 {
    180     Q_OBJECT
    181 
    182 public:
    183 
    184     QITextEdit (QWidget *aParent)
    185         : Q3TextEdit (aParent) {}
    186 
    187     QSize sizeHint() const
    188     {
    189         return minimumSizeHint();
    190     }
    191 
    192     QSize minimumSizeHint() const
    193     {
    194         return QSize (width(), heightForWidth (width()));
    195     }
    196 };
    197 
    198 
    199 /**
    200  *  Simple QLabel subclass to re-query and return its sizeHint()
    201  *  before the widget to be shown for getting more compact layout.
    202  */
    203 class QILabel : public QLabel
    204 {
    205     Q_OBJECT
    206 
    207 public:
    208 
    209     QILabel (QWidget *aParent, const char *aName)
    210          : QLabel (aParent, aName), mShowed (false)
    211     {
    212         /* setup default size policy and alignment */
    213         setSizePolicy (QSizePolicy ((QSizePolicy::SizeType)1,
    214                                     (QSizePolicy::SizeType)0,
    215                                     0, 0,
    216                                     sizePolicy().hasHeightForWidth()));
    217         setAlignment (int (Qt::AlignTop));
    218         /* install show-parent-widget watcher */
    219         aParent->topLevelWidget()->installEventFilter (this);
    220     }
    221 
    222     QSize sizeHint() const
    223     {
    224         return mShowed ?
    225             QSize (width(), heightForWidth (width())) : QLabel::sizeHint();
    226     }
    227 
    228 private:
    229 
    230     bool eventFilter (QObject *aObject, QEvent *aEvent)
    231     {
    232         switch (aEvent->type())
    233         {
    234             case QEvent::Show:
    235             {
    236                 mShowed = true;
    237                 if (parent() && ((QWidget*)parent())->layout())
    238                     ((QWidget*)parent())->layout()->activate();
    239                 break;
    240             }
    241             default:
    242                 break;
    243         }
    244         return QLabel::eventFilter (aObject, aEvent);
    245     }
    246 
    247     bool mShowed;
    248 };
    249 
    250 
    251172#ifdef Q_WS_MAC
    252173# undef PAGE_SIZE
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