forked from qt/qtbase
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QObject: port to new property system
Extended QObjectPrivate::ExtraData to store a pointer to its parent, and reimplemented qGetBindingStorage() function for QObjectPrivate::ExtraData. This allows to use Q_OBJECT_COMPAT_PROPERTY macro for a property, stored in QObjectPrivate::ExtraData and solves all the problems with calling a custom setter. Task-number: QTBUG-85520 Change-Id: I40e01c29430846359ef9160fa1ae97c702be9a18 Reviewed-by: Edward Welbourne <[email protected]> Reviewed-by: Sona Kurazyan <[email protected]>
- Loading branch information
Showing
7 changed files
with
68 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/**************************************************************************** | ||
** | ||
** Copyright (C) 2016 The Qt Company Ltd. | ||
** Copyright (C) 2021 The Qt Company Ltd. | ||
** Copyright (C) 2015 Olivier Goffart <[email protected]> | ||
** Contact: https://www.qt.io/licensing/ | ||
** | ||
|
@@ -28,6 +28,7 @@ | |
****************************************************************************/ | ||
|
||
#include <QTest> | ||
#include <QtTest/private/qpropertytesthelper_p.h> | ||
#include <QStringListModel> | ||
#include <QAbstractEventDispatcher> | ||
#include <QScopedValueRollback> | ||
|
@@ -161,6 +162,7 @@ private slots: | |
void functorReferencesConnection(); | ||
void disconnectDisconnects(); | ||
void singleShotConnection(); | ||
void objectNameBinding(); | ||
}; | ||
|
||
struct QObjectCreatedOnShutdown | ||
|
@@ -8115,6 +8117,13 @@ void tst_QObject::singleShotConnection() | |
} | ||
} | ||
|
||
void tst_QObject::objectNameBinding() | ||
{ | ||
QObject obj; | ||
QTestPrivate::testReadWritePropertyBasics<QObject, QString>(obj, "test1", "test2", | ||
"objectName"); | ||
} | ||
|
||
// Test for QtPrivate::HasQ_OBJECT_Macro | ||
static_assert(QtPrivate::HasQ_OBJECT_Macro<tst_QObject>::Value); | ||
static_assert(!QtPrivate::HasQ_OBJECT_Macro<SiblingDeleter>::Value); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters