Mark QApplication::globalStrut as deprecated
This property is obsolete with today's user interface reality, and was never consistently implemented in all styles and widgets. Deprecating it for Qt 5.15 as preparating for removing the code for Qt 6. [ChangeLog][QtWidgets][QApplication] The globalStrut property has been deprecated and will be removed from Qt 6 Change-Id: Iaea88e563144481a395de6cf0745a512e386407d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
858c5a73fc
commit
eb18be36ad
@ -91,7 +91,7 @@ int main(int argc, char *argv[])
|
||||
//! [3]
|
||||
QSize MyWidget::sizeHint() const
|
||||
{
|
||||
return QSize(80, 25).expandedTo(QApplication::globalStrut());
|
||||
return QSize(80, 25);
|
||||
}
|
||||
//! [3]
|
||||
|
||||
|
@ -93,7 +93,7 @@ int main(int argc, char *argv[])
|
||||
//! [3]
|
||||
QSize MyWidget::sizeHint() const
|
||||
{
|
||||
return QSize(80, 25).expandedTo(QApplication::globalStrut());
|
||||
return QSize(80, 25);
|
||||
}
|
||||
//! [3]
|
||||
|
||||
|
@ -1224,6 +1224,7 @@ void QApplication::setColorSpec(int spec)
|
||||
\property QApplication::globalStrut
|
||||
\brief the minimum size that any GUI element that the user can interact
|
||||
with should have
|
||||
\deprecated
|
||||
|
||||
For example, no button should be resized to be smaller than the global
|
||||
strut size. The strut size should be considered when reimplementing GUI
|
||||
|
@ -79,7 +79,9 @@ class Q_WIDGETS_EXPORT QApplication : public QGuiApplication
|
||||
#if QT_CONFIG(wheelevent)
|
||||
Q_PROPERTY(int wheelScrollLines READ wheelScrollLines WRITE setWheelScrollLines)
|
||||
#endif
|
||||
#if QT_DEPRECATED_SINCE(5, 15)
|
||||
Q_PROPERTY(QSize globalStrut READ globalStrut WRITE setGlobalStrut)
|
||||
#endif
|
||||
Q_PROPERTY(int startDragTime READ startDragTime WRITE setStartDragTime)
|
||||
Q_PROPERTY(int startDragDistance READ startDragDistance WRITE setStartDragDistance)
|
||||
#ifndef QT_NO_STYLE_STYLESHEET
|
||||
@ -158,8 +160,10 @@ public:
|
||||
static void setWheelScrollLines(int);
|
||||
static int wheelScrollLines();
|
||||
#endif
|
||||
#if QT_DEPRECATED_SINCE(5, 15)
|
||||
static void setGlobalStrut(const QSize &);
|
||||
static QSize globalStrut();
|
||||
#endif
|
||||
|
||||
static void setStartDragTime(int ms);
|
||||
static int startDragTime();
|
||||
|
Loading…
Reference in New Issue
Block a user