mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 10:22:55 +00:00
drop QStyleOptionFrameV2 and QStyleOptionFrameV3 typedefs
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
01e0f63c6a
commit
ef67586cf3
16 changed files with 33 additions and 57 deletions
|
@ -635,8 +635,6 @@ katie_generate_obsolete(QStyleOptionComplex QtGui qstyleoption.h)
|
|||
katie_generate_obsolete(QStyleOptionDockWidget QtGui qstyleoption.h)
|
||||
katie_generate_obsolete(QStyleOptionFocusRect QtGui qstyleoption.h)
|
||||
katie_generate_obsolete(QStyleOptionFrame QtGui qstyleoption.h)
|
||||
katie_generate_obsolete(QStyleOptionFrameV2 QtGui qstyleoption.h)
|
||||
katie_generate_obsolete(QStyleOptionFrameV3 QtGui qstyleoption.h)
|
||||
katie_generate_obsolete(QStyleOptionGraphicsItem QtGui qstyleoption.h)
|
||||
katie_generate_obsolete(QStyleOptionGroupBox QtGui qstyleoption.h)
|
||||
katie_generate_obsolete(QStyleOptionHeader QtGui qstyleoption.h)
|
||||
|
|
|
@ -526,8 +526,6 @@ include/katie/QtGui/QStyleOptionComplex
|
|||
include/katie/QtGui/QStyleOptionDockWidget
|
||||
include/katie/QtGui/QStyleOptionFocusRect
|
||||
include/katie/QtGui/QStyleOptionFrame
|
||||
include/katie/QtGui/QStyleOptionFrameV2
|
||||
include/katie/QtGui/QStyleOptionFrameV3
|
||||
include/katie/QtGui/QStyleOptionGraphicsItem
|
||||
include/katie/QtGui/QStyleOptionGroupBox
|
||||
include/katie/QtGui/QStyleOptionHeader
|
||||
|
|
|
@ -188,8 +188,6 @@ incmap = {
|
|||
'QStyleOptionDockWidget': 'qstyleoption.h',
|
||||
'QStyleOptionFocusRect': 'qstyleoption.h',
|
||||
'QStyleOptionFrame': 'qstyleoption.h',
|
||||
'QStyleOptionFrameV2': 'qstyleoption.h',
|
||||
'QStyleOptionFrameV3': 'qstyleoption.h',
|
||||
'QStyleOptionGraphicsItem': 'qstyleoption.h',
|
||||
'QStyleOptionGroupBox': 'qstyleoption.h',
|
||||
'QStyleOptionHeader': 'qstyleoption.h',
|
||||
|
|
|
@ -412,8 +412,6 @@ classlist = [
|
|||
"QStyleOptionDockWidget",
|
||||
"QStyleOptionFocusRect",
|
||||
"QStyleOptionFrame",
|
||||
"QStyleOptionFrameV2",
|
||||
"QStyleOptionFrameV3",
|
||||
"QStyleOptionGraphicsItem",
|
||||
"QStyleOptionGroupBox",
|
||||
"QStyleOptionHeader",
|
||||
|
|
|
@ -496,7 +496,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).
|
||||
|
|
|
@ -3004,11 +3004,11 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
|
|||
if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(option)) {
|
||||
QRect textRect = proxy()->subControlRect(CC_GroupBox, groupBox, SC_GroupBoxLabel, widget);
|
||||
QRect checkBoxRect = proxy()->subControlRect(CC_GroupBox, groupBox, SC_GroupBoxCheckBox, widget);
|
||||
bool flat = groupBox->features & QStyleOptionFrameV2::Flat;
|
||||
bool flat = groupBox->features & QStyleOptionFrame::Flat;
|
||||
|
||||
if(!flat) {
|
||||
if (groupBox->subControls & QStyle::SC_GroupBoxFrame) {
|
||||
QStyleOptionFrameV2 frame;
|
||||
QStyleOptionFrame frame;
|
||||
frame.QStyleOption::operator=(*groupBox);
|
||||
frame.features = groupBox->features;
|
||||
frame.lineWidth = groupBox->lineWidth;
|
||||
|
@ -3704,7 +3704,7 @@ QRect QCleanlooksStyle::subControlRect(ComplexControl control, const QStyleOptio
|
|||
int topMargin = 0;
|
||||
int topHeight = 0;
|
||||
int verticalAlignment = proxy()->styleHint(SH_GroupBox_TextLabelVerticalAlignment, groupBox, widget);
|
||||
bool flat = groupBox->features & QStyleOptionFrameV2::Flat;
|
||||
bool flat = groupBox->features & QStyleOptionFrame::Flat;
|
||||
if (!groupBox->text.isEmpty()) {
|
||||
topHeight = groupBox->fontMetrics.height();
|
||||
if (verticalAlignment & Qt::AlignVCenter)
|
||||
|
|
|
@ -375,7 +375,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
|
|||
#ifndef QT_NO_GROUPBOX
|
||||
case PE_FrameGroupBox: {
|
||||
if (const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
|
||||
if (frame->features & QStyleOptionFrameV2::Flat) {
|
||||
if (frame->features & QStyleOptionFrame::Flat) {
|
||||
QRect fr = frame->rect;
|
||||
QPoint p1(fr.x(), fr.y() + 1);
|
||||
QPoint p2(fr.x() + fr.width(), p1.y());
|
||||
|
@ -2075,7 +2075,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
|
|||
#endif // QT_NO_ITEMVIEWS
|
||||
#ifndef QT_NO_FRAME
|
||||
case CE_ShapedFrame:
|
||||
if (const QStyleOptionFrameV3 *f = qstyleoption_cast<const QStyleOptionFrameV3 *>(opt)) {
|
||||
if (const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
|
||||
int frameShape = f->frameShape;
|
||||
int frameShadow = QFrame::Plain;
|
||||
if (f->state & QStyle::State_Sunken) {
|
||||
|
@ -2659,14 +2659,14 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
|
|||
}
|
||||
break;
|
||||
case SE_FrameContents:
|
||||
if (const QStyleOptionFrameV2 *f = qstyleoption_cast<const QStyleOptionFrameV2 *>(opt)) {
|
||||
if (const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
|
||||
int fw = proxy()->pixelMetric(PM_DefaultFrameWidth, f, widget);
|
||||
r = opt->rect.adjusted(fw, fw, -fw, -fw);
|
||||
r = visualRect(opt->direction, opt->rect, r);
|
||||
}
|
||||
break;
|
||||
case SE_ShapedFrameContents:
|
||||
if (const QStyleOptionFrameV3 *f = qstyleoption_cast<const QStyleOptionFrameV3 *>(opt)) {
|
||||
if (const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
|
||||
int frameShape = f->frameShape;
|
||||
int frameShadow = QFrame::Plain;
|
||||
if (f->state & QStyle::State_Sunken) {
|
||||
|
@ -3466,7 +3466,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
|
|||
QRect textRect = proxy()->subControlRect(CC_GroupBox, opt, SC_GroupBoxLabel, widget);
|
||||
QRect checkBoxRect = proxy()->subControlRect(CC_GroupBox, opt, SC_GroupBoxCheckBox, widget);
|
||||
if (groupBox->subControls & QStyle::SC_GroupBoxFrame) {
|
||||
QStyleOptionFrameV2 frame;
|
||||
QStyleOptionFrame frame;
|
||||
frame.QStyleOption::operator=(*groupBox);
|
||||
frame.features = groupBox->features;
|
||||
frame.lineWidth = groupBox->lineWidth;
|
||||
|
@ -3993,7 +3993,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
|
|||
QFontMetrics fontMetrics = groupBox->fontMetrics;
|
||||
int h = fontMetrics.height();
|
||||
int tw = fontMetrics.size(Qt::TextShowMnemonic, groupBox->text + QLatin1Char(' ')).width();
|
||||
int marg = (groupBox->features & QStyleOptionFrameV2::Flat) ? 0 : 8;
|
||||
int marg = (groupBox->features & QStyleOptionFrame::Flat) ? 0 : 8;
|
||||
ret = groupBox->rect.adjusted(marg, 0, -marg, 0);
|
||||
ret.setHeight(h);
|
||||
|
||||
|
|
|
@ -806,7 +806,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
|
|||
\value CE_ToolBoxTabLabel The toolbox's tab label.
|
||||
\value CE_HeaderEmptyArea The area of a header view where there are no header sections.
|
||||
|
||||
\value CE_ShapedFrame The frame with the shape specified in the QStyleOptionFrameV3; see QFrame.
|
||||
\value CE_ShapedFrame The frame with the shape specified in the QStyleOptionFrame; see QFrame.
|
||||
|
||||
\omitvalue CE_ColumnViewGrip
|
||||
|
||||
|
@ -942,7 +942,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
|
|||
\value SE_ProgressBarLayoutItem Area that counts for the parent layout.
|
||||
|
||||
\value SE_FrameContents Area for a frame's contents.
|
||||
\value SE_ShapedFrameContents Area for a frame's contents using the shape in QStyleOptionFrameV3; see QFrame
|
||||
\value SE_ShapedFrameContents Area for a frame's contents using the shape in QStyleOptionFrame; see QFrame
|
||||
\value SE_FrameLayoutItem Area that counts for the parent layout.
|
||||
|
||||
\value SE_HeaderArrow Area for the sort indicator for a header.
|
||||
|
|
|
@ -420,20 +420,6 @@ QStyleOptionFocusRect::QStyleOptionFocusRect(int version)
|
|||
\sa QStyleOption
|
||||
*/
|
||||
|
||||
/*!
|
||||
\typedef QStyleOptionFrameV2
|
||||
\relates QStyleOptionFrame
|
||||
|
||||
Synonym for QStyleOptionFrame.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\typedef QStyleOptionFrameV3
|
||||
\relates QStyleOptionFrame
|
||||
|
||||
Synonym for QStyleOptionFrame.
|
||||
*/
|
||||
|
||||
/*!
|
||||
Constructs a QStyleOptionFrame, initializing the members
|
||||
variables to their default values.
|
||||
|
|
|
@ -118,8 +118,6 @@ protected:
|
|||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionFrame::FrameFeatures)
|
||||
typedef QStyleOptionFrame QStyleOptionFrameV2;
|
||||
typedef QStyleOptionFrame QStyleOptionFrameV3;
|
||||
|
||||
#ifndef QT_NO_TABWIDGET
|
||||
class Q_GUI_EXPORT QStyleOptionTabWidgetFrame : public QStyleOption
|
||||
|
@ -580,7 +578,7 @@ public:
|
|||
enum StyleOptionType { Type = SO_GroupBox };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
QStyleOptionFrameV2::FrameFeatures features;
|
||||
QStyleOptionFrame::FrameFeatures features;
|
||||
QString text;
|
||||
Qt::Alignment textAlignment;
|
||||
QColor textColor;
|
||||
|
|
|
@ -1776,7 +1776,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QWidget *w, const QStyleOption *o
|
|||
extraClass |= PseudoClass_Frameless;
|
||||
#endif // QT_NO_SPINBOX
|
||||
} else if (const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
|
||||
if (gb->features & QStyleOptionFrameV2::Flat)
|
||||
if (gb->features & QStyleOptionFrame::Flat)
|
||||
extraClass |= PseudoClass_Flat;
|
||||
if (gb->lineWidth == 0)
|
||||
extraClass |= PseudoClass_Frameless;
|
||||
|
@ -2920,7 +2920,7 @@ void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionC
|
|||
}
|
||||
|
||||
frameRect = subControlRect(CC_GroupBox, opt, SC_GroupBoxFrame, w);
|
||||
QStyleOptionFrameV2 frame;
|
||||
QStyleOptionFrame frame;
|
||||
frame.QStyleOption::operator=(*gb);
|
||||
frame.features = gb->features;
|
||||
frame.lineWidth = gb->lineWidth;
|
||||
|
@ -3976,7 +3976,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
|
|||
case CE_ShapedFrame:
|
||||
if (const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
|
||||
if (rule.hasNativeBorder()) {
|
||||
QStyleOptionFrameV3 frmOpt(*frm);
|
||||
QStyleOptionFrame frmOpt(*frm);
|
||||
rule.configurePalette(&frmOpt.palette, QPalette::Text, QPalette::Base);
|
||||
frmOpt.rect = rule.borderRect(frmOpt.rect);
|
||||
baseStyle()->drawControl(ce, &frmOpt, p, w);
|
||||
|
@ -4118,7 +4118,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op
|
|||
case PE_Frame: {
|
||||
if (const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
|
||||
if (rule.hasNativeBorder()) {
|
||||
QStyleOptionFrameV2 frmOpt(*frm);
|
||||
QStyleOptionFrame frmOpt(*frm);
|
||||
rule.configurePalette(&frmOpt.palette, QPalette::Text, QPalette::Base);
|
||||
baseStyle()->drawPrimitive(pe, &frmOpt, p, w);
|
||||
} else {
|
||||
|
|
|
@ -357,7 +357,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;
|
||||
|
@ -467,7 +467,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;
|
||||
|
|
|
@ -86,7 +86,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;
|
||||
|
|
|
@ -541,7 +541,7 @@ QSize QLineEdit::sizeHint() const
|
|||
int w = fm.width(QLatin1Char('x')) * 17 + 2*d->horizontalMargin
|
||||
+ d->leftTextMargin + d->rightTextMargin
|
||||
+ 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));
|
||||
|
@ -562,7 +562,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));
|
||||
|
@ -850,7 +850,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);
|
||||
|
@ -1248,7 +1248,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() || style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, this))
|
||||
d->setCursorVisible(true);
|
||||
|
@ -1413,7 +1413,7 @@ void QLineEdit::focusInEvent(QFocusEvent *e)
|
|||
d->clickCausedFocus = 1;
|
||||
}
|
||||
d->control->setCursorBlinkPeriod(QApplication::cursorFlashTime());
|
||||
QStyleOptionFrameV2 opt;
|
||||
QStyleOptionFrame opt;
|
||||
initStyleOption(&opt);
|
||||
if(!hasSelectedText() || style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, this))
|
||||
d->setCursorVisible(true);
|
||||
|
@ -1471,7 +1471,7 @@ void QLineEdit::paintEvent(QPaintEvent *)
|
|||
QRect r = rect();
|
||||
QPalette pal = palette();
|
||||
|
||||
QStyleOptionFrameV2 panel;
|
||||
QStyleOptionFrame panel;
|
||||
initStyleOption(&panel);
|
||||
style()->drawPrimitive(QStyle::PE_PanelLineEdit, &panel, &p, this);
|
||||
r = style()->subElementRect(QStyle::SE_LineEditContents, &panel, this);
|
||||
|
@ -1770,7 +1770,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));
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ void QLineEditPrivate::_q_cursorPositionChanged(int from, int to)
|
|||
void QLineEditPrivate::_q_selectionChanged()
|
||||
{
|
||||
Q_Q(QLineEdit);
|
||||
QStyleOptionFrameV2 opt;
|
||||
QStyleOptionFrame opt;
|
||||
q->initStyleOption(&opt);
|
||||
bool showCursor = control->hasSelectedText() ?
|
||||
q->style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, q):
|
||||
|
@ -140,7 +140,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));
|
||||
#ifndef QT_NO_CURSOR
|
||||
|
@ -158,7 +158,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() + leftTextMargin);
|
||||
|
|
|
@ -124,10 +124,10 @@ void tst_QStyleOption::qstyleoptioncast()
|
|||
void tst_QStyleOption::copyconstructors()
|
||||
{
|
||||
QStyleOptionFrame frame;
|
||||
QStyleOptionFrameV2 frame2(frame);
|
||||
QCOMPARE(frame2.version, int(QStyleOptionFrameV2::Version));
|
||||
QStyleOptionFrame frame2(frame);
|
||||
QCOMPARE(frame2.version, int(QStyleOptionFrame::Version));
|
||||
frame2 = frame;
|
||||
QCOMPARE(frame2.version, int(QStyleOptionFrameV2::Version));
|
||||
QCOMPARE(frame2.version, int(QStyleOptionFrame::Version));
|
||||
|
||||
QStyleOptionProgressBar bar;
|
||||
QStyleOptionProgressBar bar2(bar);
|
||||
|
|
Loading…
Add table
Reference in a new issue