summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorKai Köhne <kai.koehne@qt.io>2022-01-06 16:03:21 +0100
committerKai Köhne <kai.koehne@qt.io>2022-02-14 12:50:59 +0100
commit8275611766bceecf045c75a59487d46c8f8a8d4b (patch)
tree3f26b881fea9f19acd540d5aa5a2dc67dcdc9547 /src/widgets
parentb99fdae5f520dbd10b94a2124ea950723c162efb (diff)
Core: Remove 'properties' feature
Even QtCore alone cannot be built without the properties feature since Qt 5.5. While fixing this is easy, other modules like dbus, networking are also using QObject::property() and friends liberally. All in all I doubt that anybody will miss the feature (otherwise it would have been fixed in the last decade). Change-Id: Iaf3cc20bda54ee2ff3b809fac8fa82b94ecc88c0 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/configure.cmake8
-rw-r--r--src/widgets/dialogs/qinputdialog.cpp4
-rw-r--r--src/widgets/itemviews/qitemdelegate.cpp11
-rw-r--r--src/widgets/itemviews/qstyleditemdelegate.cpp11
-rw-r--r--src/widgets/kernel/qwidget.cpp2
-rw-r--r--src/widgets/widgets/qwidgettextcontrol.cpp10
6 files changed, 4 insertions, 42 deletions
diff --git a/src/widgets/configure.cmake b/src/widgets/configure.cmake
index 650c35876d..c0fadc97ec 100644
--- a/src/widgets/configure.cmake
+++ b/src/widgets/configure.cmake
@@ -42,7 +42,7 @@ qt_feature("style-stylesheet" PUBLIC
SECTION "Styles"
LABEL "QStyleSheetStyle"
PURPOSE "Provides a widget style which is configurable via CSS."
- CONDITION QT_FEATURE_style_windows AND QT_FEATURE_properties AND QT_FEATURE_cssparser
+ CONDITION QT_FEATURE_style_windows AND QT_FEATURE_cssparser
)
qt_feature_definition("style-stylesheet" "QT_NO_STYLE_STYLESHEET" NEGATE VALUE "1")
qt_feature("effects" PRIVATE
@@ -355,7 +355,7 @@ qt_feature("textedit" PUBLIC
SECTION "Widgets"
LABEL "QTextEdit"
PURPOSE "Supports rich text editing."
- CONDITION QT_FEATURE_scrollarea AND QT_FEATURE_properties AND QT_FEATURE_widgettextcontrol
+ CONDITION QT_FEATURE_scrollarea AND QT_FEATURE_widgettextcontrol
)
qt_feature_definition("textedit" "QT_NO_TEXTEDIT" NEGATE VALUE "1")
qt_feature("syntaxhighlighter" PUBLIC
@@ -468,7 +468,7 @@ qt_feature("wizard" PUBLIC
SECTION "Dialogs"
LABEL "QWizard"
PURPOSE "Provides a framework for multi-page click-through dialogs."
- CONDITION ( QT_FEATURE_dialog ) AND ( QT_FEATURE_pushbutton ) AND ( QT_FEATURE_properties ) AND ( QT_FEATURE_label )
+ CONDITION ( QT_FEATURE_dialog ) AND ( QT_FEATURE_pushbutton ) AND ( QT_FEATURE_label )
)
qt_feature_definition("wizard" "QT_NO_WIZARD" NEGATE VALUE "1")
qt_feature("listview" PUBLIC
@@ -496,7 +496,7 @@ qt_feature("datawidgetmapper" PUBLIC
SECTION "ItemViews"
LABEL "QDataWidgetMapper"
PURPOSE "Provides mapping between a section of a data model to widgets."
- CONDITION QT_FEATURE_itemviews AND QT_FEATURE_properties
+ CONDITION QT_FEATURE_itemviews
)
qt_feature_definition("datawidgetmapper" "QT_NO_DATAWIDGETMAPPER" NEGATE VALUE "1")
qt_feature("columnview" PUBLIC
diff --git a/src/widgets/dialogs/qinputdialog.cpp b/src/widgets/dialogs/qinputdialog.cpp
index 7569367768..e77ae52d85 100644
--- a/src/widgets/dialogs/qinputdialog.cpp
+++ b/src/widgets/dialogs/qinputdialog.cpp
@@ -118,9 +118,7 @@ private slots:
private:
void keyPressEvent(QKeyEvent *event) override {
if ((event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) && !hasAcceptableInput()) {
-#ifndef QT_NO_PROPERTIES
setProperty("value", property("value"));
-#endif
} else {
QSpinBox::keyPressEvent(event);
}
@@ -153,9 +151,7 @@ private slots:
private:
void keyPressEvent(QKeyEvent *event) override {
if ((event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) && !hasAcceptableInput()) {
-#ifndef QT_NO_PROPERTIES
setProperty("value", property("value"));
-#endif
} else {
QDoubleSpinBox::keyPressEvent(event);
}
diff --git a/src/widgets/itemviews/qitemdelegate.cpp b/src/widgets/itemviews/qitemdelegate.cpp
index 9d755c0b55..2640d7163d 100644
--- a/src/widgets/itemviews/qitemdelegate.cpp
+++ b/src/widgets/itemviews/qitemdelegate.cpp
@@ -522,10 +522,6 @@ QWidget *QItemDelegate::createEditor(QWidget *parent,
void QItemDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
{
-#ifdef QT_NO_PROPERTIES
- Q_UNUSED(editor);
- Q_UNUSED(index);
-#else
QVariant v = index.data(Qt::EditRole);
QByteArray n = editor->metaObject()->userProperty().name();
@@ -534,7 +530,6 @@ void QItemDelegate::setEditorData(QWidget *editor, const QModelIndex &index) con
v = QVariant(editor->property(n).metaType());
editor->setProperty(n, v);
}
-#endif
}
/*!
@@ -552,11 +547,6 @@ void QItemDelegate::setModelData(QWidget *editor,
QAbstractItemModel *model,
const QModelIndex &index) const
{
-#ifdef QT_NO_PROPERTIES
- Q_UNUSED(model);
- Q_UNUSED(editor);
- Q_UNUSED(index);
-#else
Q_D(const QItemDelegate);
Q_ASSERT(model);
Q_ASSERT(editor);
@@ -566,7 +556,6 @@ void QItemDelegate::setModelData(QWidget *editor,
model->data(index, Qt::EditRole).userType());
if (!n.isEmpty())
model->setData(index, editor->property(n), Qt::EditRole);
-#endif
}
/*!
diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp
index 975735eb15..ddf706c0e6 100644
--- a/src/widgets/itemviews/qstyleditemdelegate.cpp
+++ b/src/widgets/itemviews/qstyleditemdelegate.cpp
@@ -458,10 +458,6 @@ QWidget *QStyledItemDelegate::createEditor(QWidget *parent,
*/
void QStyledItemDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
{
-#ifdef QT_NO_PROPERTIES
- Q_UNUSED(editor);
- Q_UNUSED(index);
-#else
QVariant v = index.data(Qt::EditRole);
QByteArray n = editor->metaObject()->userProperty().name();
@@ -470,7 +466,6 @@ void QStyledItemDelegate::setEditorData(QWidget *editor, const QModelIndex &inde
v = QVariant(editor->property(n).metaType());
editor->setProperty(n, v);
}
-#endif
}
/*!
@@ -487,11 +482,6 @@ void QStyledItemDelegate::setModelData(QWidget *editor,
QAbstractItemModel *model,
const QModelIndex &index) const
{
-#ifdef QT_NO_PROPERTIES
- Q_UNUSED(model);
- Q_UNUSED(editor);
- Q_UNUSED(index);
-#else
Q_D(const QStyledItemDelegate);
Q_ASSERT(model);
Q_ASSERT(editor);
@@ -501,7 +491,6 @@ void QStyledItemDelegate::setModelData(QWidget *editor,
model->data(index, Qt::EditRole).userType());
if (!n.isEmpty())
model->setData(index, editor->property(n), Qt::EditRole);
-#endif
}
/*!
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 80dcadb81f..0a0957bf5e 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -9236,7 +9236,6 @@ bool QWidget::event(QEvent *event)
d->renderToTextureReallyDirty = 1;
#endif
break;
-#ifndef QT_NO_PROPERTIES
case QEvent::DynamicPropertyChange: {
const QByteArray &propName = static_cast<QDynamicPropertyChangeEvent *>(event)->propertyName();
if (propName.length() == 13 && !qstrncmp(propName, "_q_customDpi", 12)) {
@@ -9254,7 +9253,6 @@ bool QWidget::event(QEvent *event)
windowHandle()->setProperty(propName, property(propName));
Q_FALLTHROUGH();
}
-#endif
default:
return QObject::event(event);
}
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp
index ef1158b8ce..159262f953 100644
--- a/src/widgets/widgets/qwidgettextcontrol.cpp
+++ b/src/widgets/widgets/qwidgettextcontrol.cpp
@@ -1433,9 +1433,7 @@ QRectF QWidgetTextControlPrivate::rectForPosition(int position) const
int cursorWidth;
{
bool ok = false;
-#ifndef QT_NO_PROPERTIES
cursorWidth = docLayout->property("cursorWidth").toInt(&ok);
-#endif
if (!ok)
cursorWidth = 1;
}
@@ -2468,24 +2466,16 @@ void QWidgetTextControl::setOverwriteMode(bool overwrite)
int QWidgetTextControl::cursorWidth() const
{
-#ifndef QT_NO_PROPERTIES
Q_D(const QWidgetTextControl);
return d->doc->documentLayout()->property("cursorWidth").toInt();
-#else
- return 1;
-#endif
}
void QWidgetTextControl::setCursorWidth(int width)
{
Q_D(QWidgetTextControl);
-#ifdef QT_NO_PROPERTIES
- Q_UNUSED(width);
-#else
if (width == -1)
width = QApplication::style()->pixelMetric(QStyle::PM_TextCursorWidth, nullptr);
d->doc->documentLayout()->setProperty("cursorWidth", width);
-#endif
d->repaintCursor();
}