VirtualBox

Changeset 24002 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 22, 2009 11:44:58 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: Cleaning QILabel from garbage, reworking QILabel size-hint mechanism, updating related stuff; Fixing layout bug in Global Settings / Language page.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
1 deleted
7 edited

Legend:

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

    r23980 r24002  
    267267        include/QIMessageBox.h \
    268268        include/QILabel.h \
    269         include/QILabel_p.h \
    270269        include/QILabelSeparator.h \
    271270        include/QIAbstractWizard.h \
  • trunk/src/VBox/Frontends/VirtualBox/include/QILabel.h

    r16955 r24002  
    66
    77/*
    8  * Copyright (C) 2006-2008 Sun Microsystems, Inc.
     8 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2828#define __QILabel_h__
    2929
    30 /* Qt includes */
    31 #include <QFrame>
     30/* Global includes */
     31#include <QLabel>
    3232
    33 class QILabelPrivate;
    34 
    35 class QILabel: public QWidget
     33class QILabel: public QLabel
    3634{
    3735    Q_OBJECT;
     
    3937public:
    4038
    41     QILabel (QWidget *aParent = NULL, Qt::WindowFlags aFlags = 0);
    42     QILabel (const QString &aText, QWidget *aParent = NULL, Qt::WindowFlags aFlags = 0);
     39    QILabel (QWidget *aParent = 0, Qt::WindowFlags aFlags = 0);
     40    QILabel (const QString &aText, QWidget *aParent = 0, Qt::WindowFlags aFlags = 0);
    4341
    44     /* QLabel extensions */
    45     bool fullSizeSelection () const;
    46     void setFullSizeSelection (bool bOn);
     42    /* Focusing extensions */
     43    bool fullSizeSelection() const;
     44    void setFullSizeSelection (bool aEnabled);
    4745
    48     void updateSizeHint();
     46    /* Size-Hint extensions */
     47    void useSizeHintForWidth (int aWidthHint) const;
     48    QSize sizeHint() const;
     49    QSize minimumSizeHint() const;
    4950
    5051    /* Default QLabel methods */
    51     Qt::Alignment alignment() const;
    52     QWidget * buddy() const;
    53     int frameWidth() const;
    54     bool hasScaledContents() const;
    55     int indent() const;
    56     int margin() const;
    57     QMovie *movie() const;
    58     bool openExternalLinks() const;
    59     const QPicture *picture() const;
    60     const QPixmap *pixmap() const;
    61     void setAlignment (Qt::Alignment aAlignment);
    62     void setBuddy (QWidget *aBuddy);
    63     void setFrameShadow (QFrame::Shadow aShadow);
    64     void setFrameShape (QFrame::Shape aShape);
    65     void setIndent (int aIndent);
    66     void setMargin (int aMargin);
    67     void setOpenExternalLinks (bool aOpen);
    68     void setScaledContents (bool aOn);
    69     void setTextFormat (Qt::TextFormat aFormat);
    70     void setTextInteractionFlags (Qt::TextInteractionFlags aFlags);
    71     void setWordWrap (bool aOn);
    72     void setMinimumWidth (int aMinWidth);
    7352    QString text() const;
    74     Qt::TextFormat textFormat() const;
    75     Qt::TextInteractionFlags textInteractionFlags() const;
    76     bool wordWrap() const;
    77 
    78     /* Default QWidget methods */
    79     void setSizePolicy (QSizePolicy aPolicy);
    80     void setMinimumSize (const QSize &aSize);
    8153
    8254public slots:
    8355
    8456    void clear();
    85     void setMovie (QMovie *aMovie);
    86     void setNum (int aNum);
    87     void setNum (double aNum);
    88     void setPicture (const QPicture &aPicture);
    89     void setPixmap (const QPixmap &aPixmap);
    9057    void setText (const QString &aText);
    91 
    92 signals:
    93 
    94       void linkActivated (const QString &);
    95       void linkHovered (const QString &);
     58    void copy();
    9659
    9760protected:
    9861
    99     virtual void init();
     62    void resizeEvent (QResizeEvent *aEvent);
     63    void mousePressEvent (QMouseEvent *aEvent);
     64    void mouseReleaseEvent (QMouseEvent *aEvent);
     65    void mouseMoveEvent (QMouseEvent *aEvent);
     66    void contextMenuEvent (QContextMenuEvent *aEvent);
     67    void focusInEvent (QFocusEvent *aEvent);
     68    void focusOutEvent (QFocusEvent *aEvent);
     69    void paintEvent (QPaintEvent *aEvent);
    10070
    101     /* Protected member vars */
    102     QILabelPrivate *mLabel;
     71private:
     72
     73    void init();
     74
     75    void updateSizeHint() const;
     76    void setFullText (const QString &aText);
     77    void updateText();
     78    QString removeHtmlTags (QString aText) const;
     79    Qt::TextElideMode toTextElideMode (const QString& aStr) const;
     80    QString compressText (const QString &aText) const;
     81
     82    QString mText;
     83    bool mFullSizeSelection;
     84    static const QRegExp mCopyRegExp;
     85    static QRegExp mElideRegExp;
     86    mutable bool mIsHintValid;
     87    mutable int mWidthHint;
     88    mutable QSize mOwnSizeHint;
     89    bool mStartDragging;
     90    QAction *mCopyAction;
    10391};
    10492
  • trunk/src/VBox/Frontends/VirtualBox/src/QIAbstractWizard.cpp

    r17046 r24002  
    176176        findChildren<QILabel*> (QRegExp ("mText.+"));
    177177    for (int i = 0; i < textLabels.count(); ++ i)
    178         textLabels [i]->updateSizeHint();
     178        textLabels [i]->useSizeHintForWidth (400);
    179179
    180180    /* Update sizeHint() of summary viewer of inherited dialog.
     
    183183    QITextEdit *teSummary = findChild<QITextEdit*> ("mTeSummary");
    184184    if (teSummary)
     185    {
     186        teSummary->setMinimumWidth (400);
    185187        teSummary->updateSizeHint();
     188    }
    186189}
    187190
  • trunk/src/VBox/Frontends/VirtualBox/src/QILabel.cpp

    r19670 r24002  
    2525 */
    2626
    27 #include "QILabel.h"
    28 #include "QILabel_p.h"
    29 #include "VBoxGlobal.h"
    30 
    31 /* Qt includes */
    32 #include <QHBoxLayout>
     27/* Global includes */
     28#include <QApplication>
    3329#include <QClipboard>
    34 #include <QApplication>
     30#include <QContextMenuEvent>
     31#include <QFocusEvent>
     32#include <QMenu>
     33#include <QMimeData>
     34#include <QMouseEvent>
    3535#include <QPainter>
    3636#include <QStyleOptionFocusRect>
    37 #include <QMouseEvent>
    38 #include <QMimeData>
    39 #include <QContextMenuEvent>
    40 #include <QFocusEvent>
    41 
    42 /* @todo: Compare the minimal size behavior in the qt3 & qt4 version. */
    43 
    44 QILabel::QILabel (QWidget *aParent /* = NULL */, Qt::WindowFlags aFlags /* = 0 */)
    45     : QWidget (aParent, aFlags)
    46     , mLabel (NULL)
     37
     38/* Local inclused */
     39#include "QILabel.h"
     40
     41/* Some constant predefines */
     42const QRegExp QILabel::mCopyRegExp = QRegExp ("<[^>]*>");
     43QRegExp QILabel::mElideRegExp = QRegExp ("(<compact\\s+elipsis=\"(start|middle|end)\"?>([^<]*)</compact>)");
     44
     45#define HOR_PADDING 1
     46
     47QILabel::QILabel (QWidget *aParent /* = 0 */, Qt::WindowFlags aFlags /* = 0 */)
     48    : QLabel (aParent, aFlags)
    4749{
    4850    init();
    4951}
    5052
    51 QILabel::QILabel (const QString &aText, QWidget *aParent /* = NULL */, Qt::WindowFlags aFlags /* = 0 */)
    52     : QWidget (aParent, aFlags)
    53     , mLabel (NULL)
     53QILabel::QILabel (const QString &aText, QWidget *aParent /* = 0 */, Qt::WindowFlags aFlags /* = 0 */)
     54    : QLabel (aParent, aFlags)
    5455{
    5556    init();
    56     mLabel->setFullText (aText);
     57    setFullText (aText);
    5758}
    5859
    5960bool QILabel::fullSizeSelection () const
    6061{
    61     return mLabel->fullSizeSelection();
    62 }
    63 
    64 void QILabel::setFullSizeSelection (bool bOn)
    65 {
    66     mLabel->setFullSizeSelection (bOn);
    67 }
    68 
    69 void QILabel::updateSizeHint()
    70 {
    71     mLabel->updateSizeHint();
    72 }
    73 
    74 void QILabel::init()
    75 {
    76     QHBoxLayout *layout = new QHBoxLayout (this);
    77     VBoxGlobal::setLayoutMargin (layout, 0);
    78     layout->setSpacing (0);
    79     mLabel = new QILabelPrivate (this);
    80     layout->addWidget (mLabel);
    81     connect (mLabel, SIGNAL (linkActivated (const QString &)),
    82              this, SIGNAL (linkActivated (const QString &)));
    83     connect (mLabel, SIGNAL (linkHovered (const QString &)),
    84              this, SIGNAL (linkHovered (const QString &)));
    85 }
    86 
    87 /* Default QLabel methods */
    88 
    89 Qt::Alignment QILabel::alignment () const
    90 {
    91     return mLabel->alignment();
    92 }
    93 
    94 QWidget *QILabel::buddy () const
    95 {
    96     return mLabel->buddy();
    97 }
    98 
    99 int QILabel::frameWidth() const
    100 {
    101     return mLabel->frameWidth();
    102 }
    103 
    104 bool QILabel::hasScaledContents () const
    105 {
    106     return mLabel->hasScaledContents();
    107 }
    108 
    109 int QILabel::indent () const
    110 {
    111     return mLabel->indent();
    112 }
    113 
    114 int QILabel::margin () const
    115 {
    116     return mLabel->margin();
    117 }
    118 
    119 QMovie *QILabel::movie () const
    120 {
    121     return mLabel->movie();
    122 }
    123 
    124 bool QILabel::openExternalLinks () const
    125 {
    126     return mLabel->openExternalLinks();
    127 }
    128 
    129 const QPicture *QILabel::picture () const
    130 {
    131     return mLabel->picture();
    132 }
    133 
    134 const QPixmap *QILabel::pixmap () const
    135 {
    136     return mLabel->pixmap();
    137 }
    138 
    139 void QILabel::setAlignment (Qt::Alignment aAlignment)
    140 {
    141     mLabel->setAlignment (aAlignment);
    142 }
    143 
    144 void QILabel::setBuddy (QWidget *aBuddy)
    145 {
    146     mLabel->setBuddy (aBuddy);
    147 }
    148 
    149 void QILabel::setFrameShadow (QFrame::Shadow aShadow)
    150 {
    151     mLabel->setFrameShadow (aShadow);
    152 }
    153 
    154 void QILabel::setFrameShape (QFrame::Shape aShape)
    155 {
    156     mLabel->setFrameShape (aShape);
    157 }
    158 
    159 void QILabel::setIndent (int aIndent)
    160 {
    161     mLabel->setIndent (aIndent);
    162 }
    163 
    164 void QILabel::setMargin (int aMargin)
    165 {
    166     mLabel->setMargin (aMargin);
    167 }
    168 
    169 void QILabel::setOpenExternalLinks (bool aOpen)
    170 {
    171     mLabel->setOpenExternalLinks (aOpen);
    172 }
    173 
    174 void QILabel::setScaledContents (bool aOn)
    175 {
    176     mLabel->setScaledContents (aOn);
    177 }
    178 
    179 void QILabel::setTextFormat (Qt::TextFormat aFormat)
    180 {
    181     mLabel->setTextFormat (aFormat);
    182 }
    183 
    184 void QILabel::setTextInteractionFlags (Qt::TextInteractionFlags aFlags)
    185 {
    186     mLabel->setTextInteractionFlags (aFlags);
    187 }
    188 
    189 void QILabel::setWordWrap (bool aOn)
    190 {
    191     mLabel->setWordWrap (aOn);
    192 }
    193 
    194 void QILabel::setMinimumWidth (int aMinWidth)
    195 {
    196     mLabel->setMinimumWidth (aMinWidth);
    197     QWidget::setMinimumWidth (aMinWidth);
    198 }
    199 
    200 QString QILabel::text () const
    201 {
    202     return mLabel->fullText();
    203 }
    204 
    205 Qt::TextFormat QILabel::textFormat () const
    206 {
    207     return mLabel->textFormat();
    208 }
    209 
    210 Qt::TextInteractionFlags QILabel::textInteractionFlags () const
    211 {
    212     return mLabel->textInteractionFlags();
    213 }
    214 
    215 bool QILabel::wordWrap () const
    216 {
    217     return mLabel->wordWrap();
    218 }
    219 
    220 void QILabel::setSizePolicy (QSizePolicy aPolicy)
    221 {
    222     mLabel->setSizePolicy (aPolicy);
    223     QWidget::setSizePolicy (aPolicy);
    224 }
    225 
    226 void QILabel::setMinimumSize (const QSize &aSize)
    227 {
    228     mLabel->setMinimumSize (aSize);
    229     QWidget::setMinimumSize (aSize);
    230 }
    231 
    232 void QILabel::clear()
    233 {
    234     mLabel->clearAll();
    235 }
    236 
    237 void QILabel::setMovie (QMovie *aMovie)
    238 {
    239     mLabel->setMovie (aMovie);
    240 }
    241 
    242 void QILabel::setNum (int aNum)
    243 {
    244     mLabel->setNum (aNum);
    245 }
    246 
    247 void QILabel::setNum (double aNum)
    248 {
    249     mLabel->setNum (aNum);
    250 }
    251 
    252 void QILabel::setPicture (const QPicture &aPicture)
    253 {
    254     mLabel->setPicture (aPicture);
    255 }
    256 
    257 void QILabel::setPixmap (const QPixmap &aPixmap)
    258 {
    259     mLabel->setPixmap (aPixmap);
    260 }
    261 
    262 void QILabel::setText (const QString &aText)
    263 {
    264     mLabel->setFullText (aText);
    265 
    266     /* If QILabel forced to be fixed vertically */
    267     if (minimumHeight() == maximumHeight())
    268     {
    269         /* Check if new text requires label growing */
    270         QSize sh (mLabel->width(), mLabel->heightForWidth (mLabel->width()));
    271         if (sh.height() > minimumHeight())
    272             setFixedHeight (sh.height());
    273     }
    274 }
    275 
    276 /* QILabelPrivate implementation: */
    277 
    278 /* Some constant predefines */
    279 const QRegExp QILabelPrivate::mCopyRegExp = QRegExp ("<[^>]*>");
    280 QRegExp QILabelPrivate::mElideRegExp = QRegExp ("(<compact\\s+elipsis=\"(start|middle|end)\"?>([^<]*)</compact>)");
    281 
    282 #define HOR_PADDING 1
    283 
    284 bool QILabelPrivate::fullSizeSelection () const
    285 {
    286     return mFullSizeSeclection;
    287 }
    288 
    289 void QILabelPrivate::setFullSizeSelection (bool bOn)
    290 {
    291     mFullSizeSeclection = bOn;
    292     if (mFullSizeSeclection)
     62    return mFullSizeSelection;
     63}
     64
     65void QILabel::setFullSizeSelection (bool aEnabled)
     66{
     67    mFullSizeSelection = aEnabled;
     68    if (mFullSizeSelection)
    29369    {
    29470        /* Enable mouse interaction only */
     
    30379         * around the label. So this is done manually in the paintEvent. Not
    30480         * sure if the stylesheet stuff is ready for production environments. */
    305         setStyleSheet (QString("QLabel::focus {\
    306                                background-color: palette(highlight);\
    307                                }\
    308                                QLabel {\
    309                                padding: 0px %1px 0px %1px;\
    310                                }").arg (HOR_PADDING));
     81        setStyleSheet (QString ("QLabel::focus {\
     82                                background-color: palette(highlight);\
     83                                }\
     84                                QLabel {\
     85                                padding: 0px %1px 0px %1px;\
     86                                }").arg (HOR_PADDING));
    31187    }
    31288    else
     
    32197}
    32298
    323 void QILabelPrivate::resizeEvent (QResizeEvent *aEvent)
     99void QILabel::useSizeHintForWidth (int aWidthHint) const
     100{
     101    mWidthHint = aWidthHint;
     102    updateSizeHint();
     103}
     104
     105QSize QILabel::sizeHint() const
     106{
     107    if (!mIsHintValid)
     108        updateSizeHint();
     109
     110    /* If there is an updated sizeHint() present - using it. */
     111    return mOwnSizeHint.isValid() ? mOwnSizeHint : QLabel::sizeHint();
     112}
     113
     114QSize QILabel::minimumSizeHint() const
     115{
     116    if (!mIsHintValid)
     117        updateSizeHint();
     118
     119    /* If there is an updated minimumSizeHint() present - using it. */
     120    return mOwnSizeHint.isValid() ? mOwnSizeHint : QLabel::minimumSizeHint();
     121}
     122
     123QString QILabel::text() const
     124{
     125    return mText;
     126}
     127
     128void QILabel::clear()
     129{
     130    QLabel::clear();
     131    setFullText ("");
     132}
     133
     134void QILabel::setText (const QString &aText)
     135{
     136    setFullText (aText);
     137
     138    /* If QILabel forced to be fixed vertically */
     139    if (minimumHeight() == maximumHeight())
     140    {
     141        /* Check if new text requires label growing */
     142        QSize sh (width(), heightForWidth (width()));
     143        if (sh.height() > minimumHeight())
     144            setFixedHeight (sh.height());
     145    }
     146}
     147
     148void QILabel::copy()
     149{
     150    QString text = removeHtmlTags (mText);
     151    /* Copy the current text to the global and selection clipboard. */
     152    QApplication::clipboard()->setText (text, QClipboard::Clipboard);
     153    QApplication::clipboard()->setText (text, QClipboard::Selection);
     154}
     155
     156void QILabel::resizeEvent (QResizeEvent *aEvent)
    324157{
    325158    QLabel::resizeEvent (aEvent);
     
    328161}
    329162
    330 void QILabelPrivate::mousePressEvent (QMouseEvent *aEvent)
    331 {
    332     if (aEvent->button() == Qt::LeftButton &&
    333         geometry().contains (aEvent->pos()) &&
    334         mFullSizeSeclection)
     163void QILabel::mousePressEvent (QMouseEvent *aEvent)
     164{
     165    if (aEvent->button() == Qt::LeftButton && geometry().contains (aEvent->pos()) && mFullSizeSelection)
    335166        mStartDragging = true;
    336167    else
     
    338169}
    339170
    340 void QILabelPrivate::mouseReleaseEvent (QMouseEvent *aEvent)
     171void QILabel::mouseReleaseEvent (QMouseEvent *aEvent)
    341172{
    342173    mStartDragging = false;
     
    344175}
    345176
    346 void QILabelPrivate::mouseMoveEvent (QMouseEvent *aEvent)
     177void QILabel::mouseMoveEvent (QMouseEvent *aEvent)
    347178{
    348179    if (mStartDragging)
     
    365196}
    366197
    367 void QILabelPrivate::contextMenuEvent (QContextMenuEvent *aEvent)
    368 {
    369     if (mFullSizeSeclection)
     198void QILabel::contextMenuEvent (QContextMenuEvent *aEvent)
     199{
     200    if (mFullSizeSelection)
    370201    {
    371202        /* Create a context menu for the copy to clipboard action. */
     
    374205        menu.addAction (mCopyAction);
    375206        menu.exec (aEvent->globalPos());
    376     } else
     207    }
     208    else
    377209        QLabel::contextMenuEvent (aEvent);
    378210}
    379211
    380 void QILabelPrivate::focusInEvent (QFocusEvent * /* aEvent */)
    381 {
    382     if (mFullSizeSeclection)
     212void QILabel::focusInEvent (QFocusEvent * /* aEvent */)
     213{
     214    if (mFullSizeSelection)
    383215    {
    384216        /* Set the text color to the current used highlight text color. */
     
    389221}
    390222
    391 void QILabelPrivate::focusOutEvent (QFocusEvent *aEvent)
     223void QILabel::focusOutEvent (QFocusEvent *aEvent)
    392224{
    393225    /* Reset to the default palette */
    394     if (mFullSizeSeclection &&
    395         aEvent->reason() != Qt::PopupFocusReason) /* For right mouse click */
     226    if (mFullSizeSelection && aEvent->reason() != Qt::PopupFocusReason)
    396227        setPalette (qApp->palette());
    397228}
    398229
    399 void QILabelPrivate::paintEvent (QPaintEvent *aEvent)
     230void QILabel::paintEvent (QPaintEvent *aEvent)
    400231{
    401232    QLabel::paintEvent (aEvent);
    402233
    403     if (mFullSizeSeclection &&
    404         hasFocus())
     234    if (mFullSizeSelection && hasFocus())
    405235    {
    406236        QPainter painter (this);
     
    412242}
    413243
    414 
    415 void QILabelPrivate::copy()
    416 {
    417     QString text = removeHtmlTags (mText);
    418     /* Copy the current text to the global and selection clipboard. */
    419     QApplication::clipboard()->setText (text, QClipboard::Clipboard);
    420     QApplication::clipboard()->setText (text, QClipboard::Selection);
    421 }
    422 
    423 void QILabelPrivate::init()
    424 {
     244void QILabel::init()
     245{
     246    /* Initial setup */
     247    mIsHintValid = false;
     248    mWidthHint = -1;
    425249    mStartDragging = false;
    426250    setFullSizeSelection (false);
    427     /* Open links with the QDesktopService */
    428251    setOpenExternalLinks (true);
    429252
     
    436259}
    437260
    438 void QILabelPrivate::updateText()
     261void QILabel::updateSizeHint() const
     262{
     263    mOwnSizeHint = mWidthHint == -1 ? QSize() : QSize (mWidthHint, heightForWidth (mWidthHint));
     264    mIsHintValid = true;
     265}
     266
     267void QILabel::setFullText (const QString &aText)
     268{
     269    QSizePolicy sp = sizePolicy();
     270    sp.setHeightForWidth (wordWrap());
     271    setSizePolicy (sp);
     272    mIsHintValid = false;
     273
     274    mText = aText;
     275    updateText();
     276}
     277
     278void QILabel::updateText()
    439279{
    440280    QString comp = compressText (mText);
     
    448288}
    449289
    450 QString QILabelPrivate::compressText (const QString &aText) const
     290QString QILabel::removeHtmlTags (QString aText) const
     291{
     292    /* Remove all HTML tags from the text and return it. */
     293    return QString(aText).remove (mCopyRegExp);
     294}
     295
     296Qt::TextElideMode QILabel::toTextElideMode (const QString& aStr) const
     297{
     298    /* Converts a string to a Qt elide mode */
     299    Qt::TextElideMode mode = Qt::ElideNone;
     300    if (aStr == "start")
     301        mode = Qt::ElideLeft;
     302    else if (aStr == "middle")
     303        mode = Qt::ElideMiddle;
     304    else if (aStr == "end")
     305        mode  = Qt::ElideRight;
     306    return mode;
     307}
     308
     309QString QILabel::compressText (const QString &aText) const
    451310{
    452311    QStringList strResult;
     
    470329            /* Create the shortened text */
    471330            QString newStr = fm.elidedText (elideStr, toTextElideMode (elideModeStr), width() - (2 * HOR_PADDING) - flatWidth);
    472             /* Replace the compact part with the shortened text in the initial
    473              * string */
     331            /* Replace the compact part with the shortened text in the initial string */
    474332            text = QString (workStr).replace (compactStr, newStr);
    475             /* For debug */
    476 //            printf ("%d, %s # %s # %s ## %s\n", pos,
    477 //                    qPrintable (compactStr),
    478 //                    qPrintable (elideModeStr),
    479 //                    qPrintable (elideStr),
    480 //                    qPrintable (newStr));
    481333        }
    482334        strResult << text;
     
    484336    return strResult.join ("<br />");
    485337}
    486 
  • trunk/src/VBox/Frontends/VirtualBox/src/QIMessageBox.cpp

    r22948 r24002  
    363363        resize (minimumSizeHint());
    364364        qApp->processEvents();
    365         mTextLabel->setMinimumWidth (mTextLabel->width());
    366         mTextLabel->updateSizeHint();
     365        mTextLabel->useSizeHintForWidth (mTextLabel->width());
     366        mTextLabel->updateGeometry();
    367367        qApp->processEvents();
    368368        setFixedWidth (width());
     
    378378    /* Update message text iteself */
    379379    mTextLabel->setText (mText + mDetailsList [mDetailsIndex].first);
    380     mTextLabel->updateSizeHint();
    381380    /* Update details table */
    382381    mDetailsText->setText (mDetailsList [mDetailsIndex].second);
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGLSettingsLanguage.cpp

    r18415 r24002  
    193193             this, SLOT (mTwLanguageChanged (QTreeWidgetItem *, QTreeWidgetItem *)));
    194194
    195     mTxName->setMinimumHeight (fontMetrics().height() * 4);
    196195    /* Applying language settings */
    197196    retranslateUi();
     
    202201{
    203202    reload (aGs.languageId());
     203    mTxName->setFixedHeight (fontMetrics().height() * 4);
    204204}
    205205
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxGLSettingsLanguage.ui

    r18247 r24002  
    113113   </item>
    114114   <item row="2" column="2" >
    115     <widget class="QLabel" name="mTxName" >
     115    <widget class="QILabel" name="mTxName" >
    116116     <property name="sizePolicy" >
    117117      <sizepolicy vsizetype="Minimum" hsizetype="Expanding" >
     
    136136   <header>QITreeWidget.h</header>
    137137  </customwidget>
     138  <customwidget>
     139   <class>QILabel</class>
     140   <extends>QLabel</extends>
     141   <header>QILabel.h</header>
     142  </customwidget>
    138143 </customwidgets>
    139144 <resources/>
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