Widgets: remove references to QStyleOptionFrameV<n>

They're gone since Qt 5.0 and only exist as typedefs for QStyleOptionFrame.

Change-Id: Icff45cbd3a47db8618a7f7a80f7252651969237c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
Marc Mutz 2014-09-22 20:42:53 +02:00
parent 10e5bcf9d0
commit 55fbf1db19
8 changed files with 22 additions and 24 deletions

View File

@ -550,7 +550,7 @@ void QExpandingLineEdit::updateMinimumWidth()
getContentsMargins(&left, 0, &right, 0);
width += left + right;
QStyleOptionFrameV2 opt;
QStyleOptionFrame opt;
initStyleOption(&opt);
int minWidth = style()->sizeFromContents(QStyle::CT_LineEdit, &opt, QSize(width, 0).

View File

@ -611,7 +611,7 @@ public:
enum StyleOptionType { Type = SO_GroupBox };
enum StyleOptionVersion { Version = 1 };
QStyleOptionFrameV2::FrameFeatures features;
QStyleOptionFrame::FrameFeatures features;
QString text;
Qt::Alignment textAlignment;
QColor textColor;

View File

@ -361,7 +361,7 @@ int QFrame::midLineWidth() const
void QFramePrivate::updateStyledFrameWidths()
{
Q_Q(const QFrame);
QStyleOptionFrameV3 opt;
QStyleOptionFrame opt;
opt.initFrom(q);
opt.lineWidth = lineWidth;
opt.midLineWidth = midLineWidth;
@ -473,7 +473,7 @@ void QFrame::paintEvent(QPaintEvent *)
void QFrame::drawFrame(QPainter *p)
{
Q_D(QFrame);
QStyleOptionFrameV3 opt;
QStyleOptionFrame opt;
opt.init(this);
int frameShape = d->frameStyle & QFrame::Shape_Mask;
int frameShadow = d->frameStyle & QFrame::Shadow_Mask;

View File

@ -103,7 +103,7 @@ void QGroupBox::initStyleOption(QStyleOptionGroupBox *option) const
option->state &= ~QStyle::State_MouseOver;
if (d->flat)
option->features |= QStyleOptionFrameV2::Flat;
option->features |= QStyleOptionFrame::Flat;
if (d->checkable) {
option->subControls |= QStyle::SC_GroupBoxCheckBox;

View File

@ -87,10 +87,8 @@ extern void qt_mac_secure_keyboard(bool); //qapplication_mac.cpp
/*!
Initialize \a option with the values from this QLineEdit. This method
is useful for subclasses when they need a QStyleOptionFrame or QStyleOptionFrameV2, but don't want
to fill in all the information themselves. This function will check the version
of the QStyleOptionFrame and fill in the additional values for a
QStyleOptionFrameV2.
is useful for subclasses when they need a QStyleOptionFrame, but don't want
to fill in all the information themselves.
\sa QStyleOption::initFrom()
*/
@ -695,7 +693,7 @@ QSize QLineEdit::sizeHint() const
int w = fm.width(QLatin1Char('x')) * 17 + 2*d->horizontalMargin
+ d->effectiveLeftTextMargin() + d->effectiveRightTextMargin()
+ d->leftmargin + d->rightmargin; // "some"
QStyleOptionFrameV2 opt;
QStyleOptionFrame opt;
initStyleOption(&opt);
return (style()->sizeFromContents(QStyle::CT_LineEdit, &opt, QSize(w, h).
expandedTo(QApplication::globalStrut()), this));
@ -716,7 +714,7 @@ QSize QLineEdit::minimumSizeHint() const
int h = fm.height() + qMax(2*d->verticalMargin, fm.leading())
+ d->topmargin + d->bottommargin;
int w = fm.maxWidth() + d->leftmargin + d->rightmargin;
QStyleOptionFrameV2 opt;
QStyleOptionFrame opt;
initStyleOption(&opt);
return (style()->sizeFromContents(QStyle::CT_LineEdit, &opt, QSize(w, h).
expandedTo(QApplication::globalStrut()), this));
@ -995,7 +993,7 @@ void QLineEdit::setSelection(int start, int length)
d->control->setSelection(start, length);
if (d->control->hasSelectedText()){
QStyleOptionFrameV2 opt;
QStyleOptionFrame opt;
initStyleOption(&opt);
if (!style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, this))
d->setCursorVisible(false);
@ -1433,7 +1431,7 @@ bool QLineEdit::event(QEvent * e)
//In order to get the cursor blinking if QComboBox::setEditable is called when the combobox has focus
if (hasFocus()) {
d->control->setCursorBlinkPeriod(QApplication::cursorFlashTime());
QStyleOptionFrameV2 opt;
QStyleOptionFrame opt;
initStyleOption(&opt);
if ((!hasSelectedText() && d->control->preeditAreaText().isEmpty())
|| style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, this))
@ -1795,7 +1793,7 @@ void QLineEdit::focusInEvent(QFocusEvent *e)
if (!QApplication::keypadNavigationEnabled() || (hasEditFocus() && ( e->reason() == Qt::PopupFocusReason))) {
#endif
d->control->setCursorBlinkPeriod(QApplication::cursorFlashTime());
QStyleOptionFrameV2 opt;
QStyleOptionFrame opt;
initStyleOption(&opt);
if((!hasSelectedText() && d->control->preeditAreaText().isEmpty())
|| style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, this))
@ -1871,7 +1869,7 @@ void QLineEdit::paintEvent(QPaintEvent *)
QPainter p(this);
QPalette pal = palette();
QStyleOptionFrameV2 panel;
QStyleOptionFrame panel;
initStyleOption(&panel);
style()->drawPrimitive(QStyle::PE_PanelLineEdit, &panel, &p, this);
QRect r = style()->subElementRect(QStyle::SE_LineEditContents, &panel, this);
@ -2177,7 +2175,7 @@ void QLineEdit::changeEvent(QEvent *ev)
break;
case QEvent::StyleChange:
{
QStyleOptionFrameV2 opt;
QStyleOptionFrame opt;
initStyleOption(&opt);
d->control->setPasswordCharacter(style()->styleHint(QStyle::SH_LineEdit_PasswordCharacter, &opt, this));
d->control->setPasswordMaskDelay(style()->styleHint(QStyle::SH_LineEdit_PasswordMaskDelay, &opt, this));

View File

@ -135,7 +135,7 @@ void QLineEditPrivate::_q_selectionChanged()
{
Q_Q(QLineEdit);
if (control->preeditAreaText().isEmpty()) {
QStyleOptionFrameV2 opt;
QStyleOptionFrame opt;
q->initStyleOption(&opt);
bool showCursor = control->hasSelectedText() ?
q->style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, q):
@ -194,7 +194,7 @@ void QLineEditPrivate::init(const QString& txt)
QObject::connect(control, SIGNAL(updateNeeded(QRect)),
q, SLOT(_q_updateNeeded(QRect)));
QStyleOptionFrameV2 opt;
QStyleOptionFrame opt;
q->initStyleOption(&opt);
control->setPasswordCharacter(q->style()->styleHint(QStyle::SH_LineEdit_PasswordCharacter, &opt, q));
control->setPasswordMaskDelay(q->style()->styleHint(QStyle::SH_LineEdit_PasswordMaskDelay, &opt, q));
@ -217,7 +217,7 @@ void QLineEditPrivate::init(const QString& txt)
QRect QLineEditPrivate::adjustedContentsRect() const
{
Q_Q(const QLineEdit);
QStyleOptionFrameV2 opt;
QStyleOptionFrame opt;
q->initStyleOption(&opt);
QRect r = q->style()->subElementRect(QStyle::SE_LineEditContents, &opt, q);
r.setX(r.x() + effectiveLeftTextMargin());
@ -387,7 +387,7 @@ QSize QLineEditPrivate::iconSize() const
QIcon QLineEditPrivate::clearButtonIcon() const
{
Q_Q(const QLineEdit);
QStyleOptionFrameV2 styleOption;
QStyleOptionFrame styleOption;
q->initStyleOption(&styleOption);
return QIcon(q->style()->standardPixmap(QStyle::SP_LineEditClearButton, &styleOption, q));
}

View File

@ -3200,7 +3200,7 @@ void tst_QTreeWidget::task239150_editorWidth()
//we check that an item with no text will get an editor with a correct size
QTreeWidget tree;
QStyleOptionFrameV2 opt;
QStyleOptionFrame opt;
opt.init(&tree);
const int minWidth = tree.style()->sizeFromContents(QStyle::CT_LineEdit, &opt, QSize(0, 0).
expandedTo(QApplication::globalStrut()), 0).width();

View File

@ -1670,7 +1670,7 @@ void tst_QLineEdit::displayText()
void tst_QLineEdit::passwordEchoOnEdit()
{
QStyleOptionFrameV2 opt;
QStyleOptionFrame opt;
QLineEdit *testWidget = ensureTestWidget();
QChar fillChar = testWidget->style()->styleHint(QStyle::SH_LineEdit_PasswordCharacter, &opt, testWidget);
@ -1715,7 +1715,7 @@ void tst_QLineEdit::passwordEchoDelay()
if (delay <= 0)
QSKIP("Platform not defining echo delay and overriding only possible in internal build");
QStyleOptionFrameV2 opt;
QStyleOptionFrame opt;
QChar fillChar = testWidget->style()->styleHint(QStyle::SH_LineEdit_PasswordCharacter, &opt, testWidget);
testWidget->setEchoMode(QLineEdit::Password);
@ -3648,7 +3648,7 @@ void tst_QLineEdit::task233101_cursorPosAfterInputMethod()
void tst_QLineEdit::task241436_passwordEchoOnEditRestoreEchoMode()
{
QStyleOptionFrameV2 opt;
QStyleOptionFrame opt;
QLineEdit *testWidget = ensureTestWidget();
QChar fillChar = testWidget->style()->styleHint(QStyle::SH_LineEdit_PasswordCharacter, &opt, testWidget);