From e9190eda1a2b16bd6aa07cce4e00f302eeb3562e Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Mon, 9 Sep 2019 10:43:27 +0200 Subject: Doc: Remove broken example snippet from Q_ENUMS The code snippet is used by both Q_ENUMS and Q_ENUM. Therefore, remove the example snippet from Q_ENUMS documentation, as it is obsolete. Also, move recommendation to use Q_ENUM in new code to the very top of Q_ENUMS' documentation. Fixes: QTBUG-63203 Change-Id: I12a9f45e0b3bd75dfe98e1ecbc45e299a688b80c Reviewed-by: Giuseppe D'Angelo --- src/corelib/kernel/qobject.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 1f5b61c978..598ce75bd4 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -4291,22 +4291,18 @@ QDebug operator<<(QDebug dbg, const QObject *o) \relates QObject \obsolete + In new code, you should prefer the use of the Q_ENUM() macro, which makes the + type available also to the meta type system. + For instance, QMetaEnum::fromType() will not work with types declared with Q_ENUMS(). + This macro registers one or several enum types to the meta-object system. - For example: - - \snippet code/src_corelib_kernel_qobject.cpp 38 - If you want to register an enum that is declared in another class, the enum must be fully qualified with the name of the class defining it. In addition, the class \e defining the enum has to inherit QObject as well as declare the enum using Q_ENUMS(). - In new code, you should prefer the use of the Q_ENUM() macro, which makes the - type available also to the meta type system. - For instance, QMetaEnum::fromType() will not work with types declared with Q_ENUMS(). - \sa {Qt's Property System} */ -- cgit v1.2.3 From b8a911fbebfcd297ce08b91fbe85bb1624d257d9 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Wed, 11 Sep 2019 11:46:47 +0200 Subject: QPainter: Avoid leaking memory on unbalanced save/restore If a QPainter ended without all saved states having been restored, the state stack would leak memory. Fixes: QTBUG-77843 Change-Id: I760904d6391de24a4867be54fa1bebf76be14ba7 Reviewed-by: Allan Sandfeld Jensen --- src/gui/painting/qpainter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 95e6bda78b..f9e9563f10 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -1710,8 +1710,8 @@ void QPainter::restore() static inline void qt_cleanup_painter_state(QPainterPrivate *d) { + qDeleteAll(d->states); d->states.clear(); - delete d->state; d->state = 0; d->engine = 0; d->device = 0; -- cgit v1.2.3 From 9b6179cf957c32e0c02547d510dfee2088f02340 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 5 Sep 2019 12:52:43 +0200 Subject: Ensure all children of a widget get updated when a stylesheet changes Before, only the direct children would get an update when the stylesheet changed, any children below that would be unchanged. Fixes: QTBUG-77006 Change-Id: Id668eaae74a8289d78d66644f077e6a3302960cd Reviewed-by: Frederik Gladhorn --- src/widgets/styles/qstylesheetstyle.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 85b65f39b1..98a9f74f5b 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -2735,6 +2735,11 @@ static void updateObjects(const QList& objects) if (auto widget = qobject_cast(const_cast(object))) { widget->style()->polish(widget); QApplication::sendEvent(widget, &event); + QList children; + children.reserve(widget->children().size() + 1); + for (auto child: qAsConst(widget->children())) + children.append(child); + updateObjects(children); } } } -- cgit v1.2.3 From ac5e198db4eea4670a5a4a22fb44eb8a6acc4c47 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Sat, 21 Sep 2019 02:02:58 +0200 Subject: Add SQLite specific documentation when specifying a database name Fixes: QTBUG-67847 Change-Id: I3c640233526260b596e8224dc48f713a3f0cff56 Reviewed-by: Paul Wicking --- src/sql/kernel/qsqldatabase.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp index d63a9e59a8..f61c72285a 100644 --- a/src/sql/kernel/qsqldatabase.cpp +++ b/src/sql/kernel/qsqldatabase.cpp @@ -881,6 +881,14 @@ bool QSqlDatabase::rollback() connection name must be passed to addDatabase() at connection object create time. + For the QSQLITE driver, if the database name specified does not + exist, then it will create the file for you unless the + QSQLITE_OPEN_READONLY option is set. + + Additionally, \a name can be set to \c ":memory:" which will + create a temporary database which is only available for the + lifetime of the application. + For the QOCI (Oracle) driver, the database name is the TNS Service Name. -- cgit v1.2.3