VirtualBox

Changeset 18631 in vbox


Ignore:
Timestamp:
Apr 2, 2009 12:16:45 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
45547
Message:

FE/Qt4: Work-around for bug in Qt4.x for windows vista look'n'feel style where sizeFromContents() returns incorrectly large size for QLineEdit as for QComboBox.

File:
1 edited

Legend:

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

    r8621 r18631  
    2525/* Qt includes */
    2626#include <QStyleOptionFrame>
     27#include <QWindowsVistaStyle>
    2728
    2829void QILineEdit::setFixedWidthByText (const QString &aText)
     
    4142    QSize sa = style()->sizeFromContents (QStyle::CT_LineEdit, &sof, sc, this);
    4243
     44    /* Vista l&f style has a bug where the last parameter of sizeFromContents
     45     * function ('widget' what corresponds to 'this' in our class) is ignored.
     46     * Due to it QLineEdit processed as QComboBox and size calculation includes
     47     * non-existing combo-box button of 23 pix in width. So fixing it here: */
     48    if (qobject_cast <QWindowsVistaStyle*> (style()))
     49        sa -= QSize (23, 0);
     50
    4351    setMaximumWidth (sa.width());
    4452    setMinimumWidth (sa.width());
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