QtWidgets: mark obsolete functions as deprecated
Mark some long obsolete functions as deprecated so the can be removed with Qt6: - QLayout::margin()/setMargin() - QComboBox::autoCompletion()/setAutoCompletion() - QComboBox::autoCompletionCaseSensitivity() - QComboBox::setAutoCompletionCaseSensitivity() - QTextStream& operator<<(QTextStream&, const QSplitter&) - QTextStream& operator>>(QTextStream&, QSplitter&); Change-Id: Ic16b36bf647413b5b3ea2d9105981b95370b3178 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This commit is contained in:
parent
4715ca7bc5
commit
d6d33f0b80
@ -282,6 +282,7 @@ bool QLayout::setAlignment(QLayout *l, Qt::Alignment alignment)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_DEPRECATED_SINCE(5, 13)
|
||||||
/*!
|
/*!
|
||||||
\property QLayout::margin
|
\property QLayout::margin
|
||||||
\brief the width of the outside border of the layout
|
\brief the width of the outside border of the layout
|
||||||
@ -306,6 +307,15 @@ int QLayout::margin() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\obsolete
|
||||||
|
*/
|
||||||
|
void QLayout::setMargin(int margin)
|
||||||
|
{
|
||||||
|
setContentsMargins(margin, margin, margin, margin);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
/*!
|
/*!
|
||||||
\property QLayout::spacing
|
\property QLayout::spacing
|
||||||
\brief the spacing between widgets inside the layout
|
\brief the spacing between widgets inside the layout
|
||||||
@ -344,14 +354,6 @@ int QLayout::spacing() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
|
||||||
\obsolete
|
|
||||||
*/
|
|
||||||
void QLayout::setMargin(int margin)
|
|
||||||
{
|
|
||||||
setContentsMargins(margin, margin, margin, margin);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QLayout::setSpacing(int spacing)
|
void QLayout::setSpacing(int spacing)
|
||||||
{
|
{
|
||||||
if (QBoxLayout* boxlayout = qobject_cast<QBoxLayout*>(this)) {
|
if (QBoxLayout* boxlayout = qobject_cast<QBoxLayout*>(this)) {
|
||||||
|
@ -63,7 +63,9 @@ class Q_WIDGETS_EXPORT QLayout : public QObject, public QLayoutItem
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_DECLARE_PRIVATE(QLayout)
|
Q_DECLARE_PRIVATE(QLayout)
|
||||||
|
|
||||||
|
#if QT_DEPRECATED_SINCE(5, 13)
|
||||||
Q_PROPERTY(int margin READ margin WRITE setMargin)
|
Q_PROPERTY(int margin READ margin WRITE setMargin)
|
||||||
|
#endif
|
||||||
Q_PROPERTY(int spacing READ spacing WRITE setSpacing)
|
Q_PROPERTY(int spacing READ spacing WRITE setSpacing)
|
||||||
Q_PROPERTY(SizeConstraint sizeConstraint READ sizeConstraint WRITE setSizeConstraint)
|
Q_PROPERTY(SizeConstraint sizeConstraint READ sizeConstraint WRITE setSizeConstraint)
|
||||||
public:
|
public:
|
||||||
@ -81,10 +83,12 @@ public:
|
|||||||
QLayout();
|
QLayout();
|
||||||
~QLayout();
|
~QLayout();
|
||||||
|
|
||||||
|
#if QT_DEPRECATED_SINCE(5, 13)
|
||||||
int margin() const;
|
int margin() const;
|
||||||
int spacing() const;
|
|
||||||
|
|
||||||
void setMargin(int);
|
void setMargin(int);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int spacing() const;
|
||||||
void setSpacing(int);
|
void setSpacing(int);
|
||||||
|
|
||||||
void setContentsMargins(int left, int top, int right, int bottom);
|
void setContentsMargins(int left, int top, int right, int bottom);
|
||||||
|
@ -1483,6 +1483,7 @@ int QComboBox::maxCount() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if QT_CONFIG(completer)
|
#if QT_CONFIG(completer)
|
||||||
|
#if QT_DEPRECATED_SINCE(5, 13)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\property QComboBox::autoCompletion
|
\property QComboBox::autoCompletion
|
||||||
@ -1576,6 +1577,7 @@ void QComboBox::setAutoCompletionCaseSensitivity(Qt::CaseSensitivity sensitivity
|
|||||||
if (d->lineEdit && d->lineEdit->completer())
|
if (d->lineEdit && d->lineEdit->completer())
|
||||||
d->lineEdit->completer()->setCaseSensitivity(sensitivity);
|
d->lineEdit->completer()->setCaseSensitivity(sensitivity);
|
||||||
}
|
}
|
||||||
|
#endif // QT_DEPRECATED_SINCE(5, 13)
|
||||||
|
|
||||||
#endif // QT_CONFIG(completer)
|
#endif // QT_CONFIG(completer)
|
||||||
|
|
||||||
|
@ -73,8 +73,10 @@ class Q_WIDGETS_EXPORT QComboBox : public QWidget
|
|||||||
Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
|
Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
|
||||||
|
|
||||||
#if QT_CONFIG(completer)
|
#if QT_CONFIG(completer)
|
||||||
|
#if QT_DEPRECATED_SINCE(5, 13)
|
||||||
Q_PROPERTY(bool autoCompletion READ autoCompletion WRITE setAutoCompletion DESIGNABLE false)
|
Q_PROPERTY(bool autoCompletion READ autoCompletion WRITE setAutoCompletion DESIGNABLE false)
|
||||||
Q_PROPERTY(Qt::CaseSensitivity autoCompletionCaseSensitivity READ autoCompletionCaseSensitivity WRITE setAutoCompletionCaseSensitivity DESIGNABLE false)
|
Q_PROPERTY(Qt::CaseSensitivity autoCompletionCaseSensitivity READ autoCompletionCaseSensitivity WRITE setAutoCompletionCaseSensitivity DESIGNABLE false)
|
||||||
|
#endif
|
||||||
#endif // QT_CONFIG(completer)
|
#endif // QT_CONFIG(completer)
|
||||||
|
|
||||||
Q_PROPERTY(bool duplicatesEnabled READ duplicatesEnabled WRITE setDuplicatesEnabled)
|
Q_PROPERTY(bool duplicatesEnabled READ duplicatesEnabled WRITE setDuplicatesEnabled)
|
||||||
@ -93,11 +95,13 @@ public:
|
|||||||
int maxCount() const;
|
int maxCount() const;
|
||||||
|
|
||||||
#if QT_CONFIG(completer)
|
#if QT_CONFIG(completer)
|
||||||
|
#if QT_DEPRECATED_SINCE(5, 13)
|
||||||
bool autoCompletion() const;
|
bool autoCompletion() const;
|
||||||
void setAutoCompletion(bool enable);
|
void setAutoCompletion(bool enable);
|
||||||
|
|
||||||
Qt::CaseSensitivity autoCompletionCaseSensitivity() const;
|
Qt::CaseSensitivity autoCompletionCaseSensitivity() const;
|
||||||
void setAutoCompletionCaseSensitivity(Qt::CaseSensitivity sensitivity);
|
void setAutoCompletionCaseSensitivity(Qt::CaseSensitivity sensitivity);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool duplicatesEnabled() const;
|
bool duplicatesEnabled() const;
|
||||||
|
@ -1783,6 +1783,7 @@ void QSplitter::setStretchFactor(int index, int stretch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if QT_DEPRECATED_SINCE(5, 13)
|
||||||
/*!
|
/*!
|
||||||
\relates QSplitter
|
\relates QSplitter
|
||||||
\obsolete
|
\obsolete
|
||||||
@ -1813,6 +1814,7 @@ QTextStream& operator>>(QTextStream& ts, QSplitter& splitter)
|
|||||||
splitter.restoreState(std::move(line).toLatin1());
|
splitter.restoreState(std::move(line).toLatin1());
|
||||||
return ts;
|
return ts;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
@ -129,8 +129,12 @@ private:
|
|||||||
friend class QSplitterHandle;
|
friend class QSplitterHandle;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if QT_DEPRECATED_SINCE(5, 13)
|
||||||
|
QT_DEPRECATED_X("Use QSplitter::saveState() instead")
|
||||||
Q_WIDGETS_EXPORT QTextStream& operator<<(QTextStream&, const QSplitter&);
|
Q_WIDGETS_EXPORT QTextStream& operator<<(QTextStream&, const QSplitter&);
|
||||||
|
QT_DEPRECATED_X("Use QSplitter::restoreState() instead")
|
||||||
Q_WIDGETS_EXPORT QTextStream& operator>>(QTextStream&, QSplitter&);
|
Q_WIDGETS_EXPORT QTextStream& operator>>(QTextStream&, QSplitter&);
|
||||||
|
#endif
|
||||||
|
|
||||||
class QSplitterHandlePrivate;
|
class QSplitterHandlePrivate;
|
||||||
class Q_WIDGETS_EXPORT QSplitterHandle : public QWidget
|
class Q_WIDGETS_EXPORT QSplitterHandle : public QWidget
|
||||||
|
Loading…
x
Reference in New Issue
Block a user