VirtualBox

Changeset 9386 in vbox for trunk


Ignore:
Timestamp:
Jun 4, 2008 12:49:29 PM (17 years ago)
Author:
vboxsync
Message:

FE/Qt4: Renamed QIRichLabel to QILabel. From now QAbstractWizard uses the new global QILabel.

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
13 edited
3 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk

    r9382 r9386  
    442442        include/QIStateIndicator.h \
    443443        include/QIMessageBox.h \
    444         include/QIRichLabel.h \
    445         include/QIRichLabel_p.h \
     444        include/QILabel.h \
     445        include/QILabel_p.h \
    446446        include/QIAbstractWizard.h \
    447447        include/QIListView.h \
     
    526526        src/QIStatusBar.cpp \
    527527        src/QIMessageBox.cpp \
    528         src/QIRichLabel.cpp \
     528        src/QILabel.cpp \
    529529        src/QIAbstractWizard.cpp \
    530530        src/QIDialog.cpp \
  • trunk/src/VBox/Frontends/VirtualBox4/include/QIAbstractWizard.h

    r9091 r9386  
    6767 *  2. Tries to take into account horizontal scrollbar if present to avoid
    6868 *     vertical scrollbar appearing.
     69 *
     70 * --> uses now global QILabel
    6971 */
    70 class QILabel : public QLabel
    71 {
    72     Q_OBJECT;
    73 
    74 public:
    75 
    76     QILabel (QWidget *aParent);
    77 
    78     QSize sizeHint() const;
    79     void updateSizeHint();
    80 
    81 private:
    82 
    83     QSize mOwnSizeHint;
    84 };
    8572
    8673/**
  • trunk/src/VBox/Frontends/VirtualBox4/include/QILabel.h

    r9382 r9386  
    22 *
    33 * VBox frontends: Qt GUI ("VirtualBox"):
    4  * VirtualBox Qt extensions: QIRichLabel class declaration
     4 * VirtualBox Qt extensions: QILabel class declaration
    55 */
    66
     
    2525 */
    2626
    27 #ifndef __QIRichLabel_h__
    28 #define __QIRichLabel_h__
     27#ifndef __QILabel_h__
     28#define __QILabel_h__
    2929
    3030/* Qt includes */
     
    3333class QILabelPrivate;
    3434
    35 class QIRichLabel: public QWidget
     35class QILabel: public QWidget
    3636{
    3737    Q_OBJECT;
     
    3939public:
    4040
    41     QIRichLabel (QWidget *aParent = NULL, Qt::WindowFlags aFlags = 0);
    42     QIRichLabel (const QString &aText, QWidget *aParent = NULL, Qt::WindowFlags aFlags = 0);
     41    QILabel (QWidget *aParent = NULL, Qt::WindowFlags aFlags = 0);
     42    QILabel (const QString &aText, QWidget *aParent = NULL, Qt::WindowFlags aFlags = 0);
    4343
    4444    /* QLabel extensions */
    4545    bool fullSizeSelection () const;
    4646    void setFullSizeSelection (bool bOn);
     47
     48    void updateSizeHint();
    4749
    4850    /* Default QLabel methods */
     
    7072    bool wordWrap() const;
    7173
     74    /* Default QWidget methods */
     75    void setSizePolicy (QSizePolicy aPolicy);
     76    void setMinimumSize (const QSize &aSize);
     77
    7278public slots:
    7379
     
    9399};
    94100
    95 #endif // __QIRichLabel_h__
     101#endif // __QILabel_h__
     102
  • trunk/src/VBox/Frontends/VirtualBox4/include/QILabel_p.h

    r9382 r9386  
    7070    void setFullSizeSelection (bool bOn);
    7171
     72    void updateSizeHint()
     73    {
     74        if (minimumWidth() > 0)
     75            mOwnSizeHint = QSize (minimumWidth(),
     76                                  heightForWidth (minimumWidth()));
     77    }
     78
     79    QSize sizeHint() const
     80    {
     81        /* If there is an updated sizeHint() present - using it. */
     82        return mOwnSizeHint.isValid() ? mOwnSizeHint : QLabel::sizeHint();
     83    }
     84
    7285protected:
    7386
     
    115128    static const QRegExp mCopyRegExp;
    116129    static QRegExp mElideRegExp;
     130    QSize mOwnSizeHint;
    117131};
    118132
  • trunk/src/VBox/Frontends/VirtualBox4/include/QIMessageBox.h

    r9287 r9386  
    3131#include <QTextEdit>
    3232
    33 class QIRichLabel;
     33class QILabel;
    3434class QLabel;
    3535class QPushButton;
     
    106106    int mButton0, mButton1, mButton2, mButtonEsc;
    107107    QLabel *mIconLabel;
    108     QIRichLabel *mTextLabel;
     108    QILabel *mTextLabel;
    109109    QPushButton *mButton0PB, *mButton1PB, *mButton2PB;
    110110    QCheckBox *mFlagCB, *mFlagCB_Main, *mFlagCB_Details;
     
    116116
    117117#endif
     118
  • trunk/src/VBox/Frontends/VirtualBox4/src/QIAbstractWizard.cpp

    r9091 r9386  
    2222
    2323#include "QIAbstractWizard.h"
     24#include "QILabel.h"
    2425
    2526/* Qt includes */
     
    6768    QTextEdit::setText (aText);
    6869    updateSizeHint();
    69 }
    70 
    71 
    72 QILabel::QILabel (QWidget *aParent)
    73     : QLabel (aParent)
    74 {
    75 }
    76 
    77 QSize QILabel::sizeHint() const
    78 {
    79     /* If there is an updated sizeHint() present - using it. */
    80     return mOwnSizeHint.isValid() ? mOwnSizeHint : QLabel::sizeHint();
    81 }
    82 
    83 void QILabel::updateSizeHint()
    84 {
    85     if (minimumWidth() > 0)
    86         mOwnSizeHint = QSize (minimumWidth(),
    87                               heightForWidth (minimumWidth()));
    8870}
    8971
  • trunk/src/VBox/Frontends/VirtualBox4/src/QILabel.cpp

    r9382 r9386  
    22 *
    33 * VBox frontends: Qt GUI ("VirtualBox"):
    4  * VirtualBox Qt extensions: QIRichLabel class implementation
     4 * VirtualBox Qt extensions: QILabel class implementation
    55 */
    66
     
    2525 */
    2626
    27 #include "QIRichLabel.h"
    28 #include "QIRichLabel_p.h"
     27#include "QILabel.h"
     28#include "QILabel_p.h"
    2929#include "VBoxGlobal.h"
    3030
     
    3636/* @todo: Compare the minimal size behavior in the qt3 & qt4 version. */
    3737
    38 QIRichLabel::QIRichLabel (QWidget *aParent /* = NULL */, Qt::WindowFlags aFlags /* = 0 */)
     38QILabel::QILabel (QWidget *aParent /* = NULL */, Qt::WindowFlags aFlags /* = 0 */)
    3939    : QWidget (aParent, aFlags)
    4040    , mLabel (NULL)
     
    4343}
    4444
    45 QIRichLabel::QIRichLabel (const QString &aText, QWidget *aParent /* = NULL */, Qt::WindowFlags aFlags /* = 0 */)
     45QILabel::QILabel (const QString &aText, QWidget *aParent /* = NULL */, Qt::WindowFlags aFlags /* = 0 */)
    4646    : QWidget (aParent, aFlags)
    4747    , mLabel (NULL)
     
    5151}
    5252
    53 bool QIRichLabel::fullSizeSelection () const
    54 {
    55     mLabel->fullSizeSelection();
    56 }
    57 
    58 void QIRichLabel::setFullSizeSelection (bool bOn)
     53bool QILabel::fullSizeSelection () const
     54{
     55    return mLabel->fullSizeSelection();
     56}
     57
     58void QILabel::setFullSizeSelection (bool bOn)
    5959{
    6060    mLabel->setFullSizeSelection (bOn);
    6161}
    6262
    63 void QIRichLabel::init()
     63void QILabel::updateSizeHint()
     64{
     65    mLabel->updateSizeHint();
     66}
     67
     68void QILabel::init()
    6469{
    6570    QHBoxLayout *layout = new QHBoxLayout (this);
     
    7681/* Default QLabel methods */
    7782
    78 Qt::Alignment QIRichLabel::alignment () const
     83Qt::Alignment QILabel::alignment () const
    7984{
    8085    return mLabel->alignment();
    8186}
    8287
    83 QWidget *QIRichLabel::buddy () const
     88QWidget *QILabel::buddy () const
    8489{
    8590    return mLabel->buddy();
    8691}
    8792
    88 bool QIRichLabel::hasScaledContents () const
     93bool QILabel::hasScaledContents () const
    8994{
    9095    return mLabel->hasScaledContents();
    9196}
    9297
    93 int QIRichLabel::indent () const
     98int QILabel::indent () const
    9499{
    95100    return mLabel->indent();
    96101}
    97102
    98 int QIRichLabel::margin () const
     103int QILabel::margin () const
    99104{
    100105    return mLabel->margin();
    101106}
    102107
    103 QMovie *QIRichLabel::movie () const
     108QMovie *QILabel::movie () const
    104109{
    105110    return mLabel->movie();
    106111}
    107112
    108 bool QIRichLabel::openExternalLinks () const
     113bool QILabel::openExternalLinks () const
    109114{
    110115    return mLabel->openExternalLinks();
    111116}
    112117
    113 const QPicture *QIRichLabel::picture () const
     118const QPicture *QILabel::picture () const
    114119{
    115120    return mLabel->picture();
    116121}
    117122
    118 const QPixmap *QIRichLabel::pixmap () const
     123const QPixmap *QILabel::pixmap () const
    119124{
    120125    return mLabel->pixmap();
    121126}
    122127
    123 void QIRichLabel::setAlignment (Qt::Alignment aAlignment)
     128void QILabel::setAlignment (Qt::Alignment aAlignment)
    124129{
    125130    mLabel->setAlignment (aAlignment);
    126131}
    127132
    128 void QIRichLabel::setBuddy (QWidget *aBuddy)
     133void QILabel::setBuddy (QWidget *aBuddy)
    129134{
    130135    mLabel->setBuddy (aBuddy);
    131136}
    132137
    133 void QIRichLabel::setIndent (int aIndent)
     138void QILabel::setIndent (int aIndent)
    134139{
    135140    mLabel->setIndent (aIndent);
    136141}
    137142
    138 void QIRichLabel::setMargin (int aMargin)
     143void QILabel::setMargin (int aMargin)
    139144{
    140145    mLabel->setMargin (aMargin);
    141146}
    142147
    143 void QIRichLabel::setOpenExternalLinks (bool aOpen)
     148void QILabel::setOpenExternalLinks (bool aOpen)
    144149{
    145150    mLabel->setOpenExternalLinks (aOpen);
    146151}
    147152
    148 void QIRichLabel::setScaledContents (bool aOn)
     153void QILabel::setScaledContents (bool aOn)
    149154{
    150155    mLabel->setScaledContents (aOn);
    151156}
    152157
    153 void QIRichLabel::setTextFormat (Qt::TextFormat aFormat)
     158void QILabel::setTextFormat (Qt::TextFormat aFormat)
    154159{
    155160    mLabel->setTextFormat (aFormat);
    156161}
    157162
    158 void QIRichLabel::setTextInteractionFlags (Qt::TextInteractionFlags aFlags)
     163void QILabel::setTextInteractionFlags (Qt::TextInteractionFlags aFlags)
    159164{
    160165    mLabel->setTextInteractionFlags (aFlags);
    161166}
    162167
    163 void QIRichLabel::setWordWrap (bool aOn)
     168void QILabel::setWordWrap (bool aOn)
    164169{
    165170    mLabel->setWordWrap (aOn);
    166171}
    167172
    168 QString QIRichLabel::text () const
     173QString QILabel::text () const
    169174{
    170175    return mLabel->fullText();
    171176}
    172177
    173 Qt::TextFormat QIRichLabel::textFormat () const
     178Qt::TextFormat QILabel::textFormat () const
    174179{
    175180    return mLabel->textFormat();
    176181}
    177182
    178 Qt::TextInteractionFlags QIRichLabel::textInteractionFlags () const
     183Qt::TextInteractionFlags QILabel::textInteractionFlags () const
    179184{
    180185    return mLabel->textInteractionFlags();
    181186}
    182187
    183 bool QIRichLabel::wordWrap () const
     188bool QILabel::wordWrap () const
    184189{
    185190    return mLabel->wordWrap();
    186191}
    187192
    188 void QIRichLabel::clear()
     193void QILabel::setSizePolicy (QSizePolicy aPolicy)
     194{
     195    mLabel->setSizePolicy (aPolicy);
     196    QWidget::setSizePolicy (aPolicy);
     197}
     198
     199void QILabel::setMinimumSize (const QSize &aSize)
     200{
     201    mLabel->setMinimumSize (aSize);
     202    QWidget::setMinimumSize (aSize);
     203}
     204
     205void QILabel::clear()
    189206{
    190207    mLabel->clearAll();
    191208}
    192209
    193 void QIRichLabel::setMovie (QMovie *aMovie)
     210void QILabel::setMovie (QMovie *aMovie)
    194211{
    195212    mLabel->setMovie (aMovie);
    196213}
    197214
    198 void QIRichLabel::setNum (int aNum)
     215void QILabel::setNum (int aNum)
    199216{
    200217    mLabel->setNum (aNum);
    201218}
    202219
    203 void QIRichLabel::setNum (double aNum)
     220void QILabel::setNum (double aNum)
    204221{
    205222    mLabel->setNum (aNum);
    206223}
    207224
    208 void QIRichLabel::setPicture (const QPicture &aPicture)
     225void QILabel::setPicture (const QPicture &aPicture)
    209226{
    210227    mLabel->setPicture (aPicture);
    211228}
    212229
    213 void QIRichLabel::setPixmap (const QPixmap &aPixmap)
     230void QILabel::setPixmap (const QPixmap &aPixmap)
    214231{
    215232    mLabel->setPixmap (aPixmap);
    216233}
    217234
    218 void QIRichLabel::setText (const QString &aText)
     235void QILabel::setText (const QString &aText)
    219236{
    220237    mLabel->setFullText (aText);
  • trunk/src/VBox/Frontends/VirtualBox4/src/QIMessageBox.cpp

    r9382 r9386  
    2525
    2626#include "QIMessageBox.h"
    27 #include "QIRichLabel.h"
     27#include "QILabel.h"
    2828#include "QIDialogButtonBox.h"
    2929
     
    8282    hLayout->addLayout (messageVBoxLayout);
    8383
    84     mTextLabel = new QIRichLabel (aText, NULL);
     84    mTextLabel = new QILabel (aText, NULL);
    8585    mTextLabel->setAlignment (Qt::AlignLeft | Qt::AlignTop);
    8686    mTextLabel->setWordWrap (true);
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxDiskImageManagerDlg.cpp

    r9382 r9386  
    2323#include "VBoxDiskImageManagerDlg.h"
    2424#include "VBoxToolBar.h"
    25 #include "QIRichLabel.h"
     25#include "QILabel.h"
    2626#include "VBoxNewHDWzd.h"
    2727#include "VBoxProblemReporter.h"
     
    192192};
    193193
    194 class InfoPaneLabel : public QIRichLabel
     194class InfoPaneLabel : public QILabel
    195195{
    196196public:
    197197
    198198    InfoPaneLabel (QWidget *aParent, QLabel *aLabel = 0)
    199         : QIRichLabel (aParent), mLabel (aLabel) {}
     199        : QILabel (aParent), mLabel (aLabel) {}
    200200
    201201    QLabel* label() const { return mLabel; }
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxRegistrationDlg.cpp

    r9089 r9386  
    244244             this, SLOT (revalidate (QIWidgetValidator *)));
    245245    connect (mTimeout, SIGNAL (timeout()), this, SLOT (processTimeout()));
    246     /* TODO: Implement mouse on link click for QILabel:
    247      * connect (mTextRegInfo, SIGNAL (clickedOnLink (const QString &)),
    248      *          &vboxGlobal(), SLOT (openURL (const QString &))); */
    249246
    250247    /* Setup initial dialog parameters. */
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxGlobalSettingsDlg.ui

    r8155 r9386  
    13081308    <include location="local" impldecl="in implementation">VBoxProblemReporter.h</include>
    13091309    <include location="local" impldecl="in implementation">VBoxUSBFilterSettings.h</include>
    1310     <include location="local" impldecl="in implementation">QIRichLabel.h</include>
     1310    <include location="local" impldecl="in implementation">QILabel.h</include>
    13111311</includes>
    13121312<forwards>
    13131313    <forward>class VBoxUSBMenu</forward>
    1314     <forward>class QIRichLabel</forward>
     1314    <forward>class QILabel</forward>
    13151315</forwards>
    13161316<variables>
     
    13271327    <variable access="private">VBoxUSBMenu *usbDevicesMenu;</variable>
    13281328    <variable access="private">bool mLanguageChanged;</variable>
    1329     <variable access="private">QIRichLabel *whatsThisLabel;</variable>
     1329    <variable access="private">QILabel *whatsThisLabel;</variable>
    13301330</variables>
    13311331<slots>
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxGlobalSettingsDlg.ui.h

    r9382 r9386  
    3030*****************************************************************************/
    3131
     32#include "QILabel.h"
     33
    3234#include <iprt/err.h>
    3335#include <iprt/param.h>
     
    303305
    304306#warning port me
    305     whatsThisLabel = new QIRichLabel (this);
     307    whatsThisLabel = new QILabel (this);
    306308//    VBoxGlobalSettingsDlgLayout->addWidget (whatsThisLabel, 2, 1);
    307309
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxNewHDWzd.ui

    r8621 r9386  
    948948   <class>QILabel</class>
    949949   <extends>QLabel</extends>
    950    <header>QIAbstractWizard.h</header>
     950   <header>QILabel.h</header>
    951951  </customwidget>
    952952  <customwidget>
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxNewVMWzd.ui

    r8632 r9386  
    12131213   <class>QILabel</class>
    12141214   <extends>QLabel</extends>
    1215    <header>QIAbstractWizard.h</header>
     1215   <header>QILabel.h</header>
    12161216  </customwidget>
    12171217  <customwidget>
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxRegistrationDlg.ui

    r8648 r9386  
    255255   <class>QILabel</class>
    256256   <extends>QLabel</extends>
    257    <header>QIAbstractWizard.h</header>
     257   <header>QILabel.h</header>
    258258  </customwidget>
    259259 </customwidgets>
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMFirstRunWzd.ui

    r8641 r9386  
    849849   <class>QILabel</class>
    850850   <extends>QLabel</extends>
    851    <header>QIAbstractWizard.h</header>
     851   <header>QILabel.h</header>
    852852  </customwidget>
    853853  <customwidget>
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