From 3af55691bc17b2473212343739736e7e1c275fc9 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 11 Jun 2019 15:20:49 +0200 Subject: Add neglected connect()s to Q{Date,Time}Edit constructors Pointed out by Daniel Teske. This amends commit c3e1abad4e141e6e9d876e5cff194c473a2654eb. Change-Id: Ia6c6f41bf28e846152f9f86322f20a1b99e57201 Reviewed-by: David Faure --- src/widgets/widgets/qdatetimeedit.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index 41d9faa5c2..acab768d75 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -1530,7 +1530,7 @@ void QDateTimeEdit::mousePressEvent(QMouseEvent *event) QTimeEdit::QTimeEdit(QWidget *parent) : QDateTimeEdit(QDATETIMEEDIT_TIME_MIN, QVariant::Time, parent) { - connect(this, SIGNAL(timeChanged(QTime)), SIGNAL(userTimeChanged(QTime))); + connect(this, &QTimeEdit::timeChanged, this, &QTimeEdit::userTimeChanged); } /*! @@ -1541,6 +1541,7 @@ QTimeEdit::QTimeEdit(QWidget *parent) QTimeEdit::QTimeEdit(const QTime &time, QWidget *parent) : QDateTimeEdit(time, QVariant::Time, parent) { + connect(this, &QTimeEdit::timeChanged, this, &QTimeEdit::userTimeChanged); } /*! @@ -1599,7 +1600,7 @@ QTimeEdit::~QTimeEdit() QDateEdit::QDateEdit(QWidget *parent) : QDateTimeEdit(QDATETIMEEDIT_DATE_INITIAL, QVariant::Date, parent) { - connect(this, SIGNAL(dateChanged(QDate)), SIGNAL(userDateChanged(QDate))); + connect(this, &QDateEdit::dateChanged, this, &QDateEdit::userDateChanged); } /*! @@ -1610,6 +1611,7 @@ QDateEdit::QDateEdit(QWidget *parent) QDateEdit::QDateEdit(const QDate &date, QWidget *parent) : QDateTimeEdit(date, QVariant::Date, parent) { + connect(this, &QDateEdit::dateChanged, this, &QDateEdit::userDateChanged); } /*! -- cgit v1.2.3 From 0e2c013a4523915a0af37fe1f338a4f66b07f91d Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 7 May 2019 10:56:08 +0200 Subject: doc: Add dontdocument.qdoc files Each module that has publically declared classes or structs that are not meant to be documented is given a dontdocument.qdoc file to tell qdoc that these classes are not meant to be documentented. Then qdoc will not print warnings about missing \class comments for these classes and structs. Change-Id: I9195f0b546032e1c7642c9da34d85a0a4a9bfb08 Reviewed-by: Paul Wicking --- src/widgets/doc/src/dontdocument.qdoc | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/widgets/doc/src/dontdocument.qdoc (limited to 'src/widgets') diff --git a/src/widgets/doc/src/dontdocument.qdoc b/src/widgets/doc/src/dontdocument.qdoc new file mode 100644 index 0000000000..9de8b5e62d --- /dev/null +++ b/src/widgets/doc/src/dontdocument.qdoc @@ -0,0 +1,30 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \dontdocument (QTypeInfo QMetaTypeId) +*/ -- cgit v1.2.3 From 8bcc6f111b1c8f0e5c9c9da18313a16559de63a5 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Thu, 14 Mar 2019 20:12:08 +0100 Subject: QComboBox: add QT_DEPRECATED_X() for deprecated functions QT_DEPRECATED_X() was not added with d6d33f0b80dd85043c71f71a3ed5485d6014e6c4 for the deprecated QComboBox functions - Add them now. Change-Id: I8d4ea08766ae6ff052dfccac6c3f35ecf34affb7 Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qcombobox.cpp | 2 +- src/widgets/widgets/qcombobox.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 9a403e8eef..a93c72a933 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -1509,7 +1509,7 @@ int QComboBox::maxCount() const /*! \obsolete - Use setCompleter() instead. + Use completer() instead. */ bool QComboBox::autoCompletion() const { diff --git a/src/widgets/widgets/qcombobox.h b/src/widgets/widgets/qcombobox.h index 64fbebb3c5..33686e547d 100644 --- a/src/widgets/widgets/qcombobox.h +++ b/src/widgets/widgets/qcombobox.h @@ -96,10 +96,13 @@ public: #if QT_CONFIG(completer) #if QT_DEPRECATED_SINCE(5, 13) + QT_DEPRECATED_X("Use completer() instead.") bool autoCompletion() const; + QT_DEPRECATED_X("Use setCompleter() instead.") void setAutoCompletion(bool enable); - + QT_DEPRECATED_X("Use completer()->caseSensitivity() instead.") Qt::CaseSensitivity autoCompletionCaseSensitivity() const; + QT_DEPRECATED_X("Use completer()->setCaseSensitivity() instead.") void setAutoCompletionCaseSensitivity(Qt::CaseSensitivity sensitivity); #endif #endif -- cgit v1.2.3 From 81b33a8252d8a69277782f51c9c7401c7009c72e Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 27 May 2019 14:35:18 +0200 Subject: Fusion: Fill the rect with base brush when drawing the combobox frame Instead of doing this directly inside the PE_FrameLineEdit as this can be used directly when a stylesheet is set the rect of the lineedit used in the combobox in fusion style is filled directly with the base brush. This ensures it still renders the background correctly when using fusion style, but enables stylesheets to work as it will not override that if the background is set in a stylesheet for a combobox. Fixes: QTBUG-75816 Change-Id: I50a0600b500088ebcf1d70a02f9c74c6040d34d9 Reviewed-by: Friedemann Kleint Reviewed-by: Richard Moe Gustavsen --- src/widgets/styles/qfusionstyle.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index c565932889..64954dc833 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -2769,8 +2769,16 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption buttonOption.state &= ~State_MouseOver; } - if (comboBox->frame) + if (comboBox->frame) { + cachePainter.save(); + cachePainter.setRenderHint(QPainter::Antialiasing, true); + cachePainter.translate(0.5, 0.5); + cachePainter.setPen(Qt::NoPen); + cachePainter.setBrush(buttonOption.palette.base()); + cachePainter.drawRoundedRect(rect.adjusted(0, 0, -1, -1), 2, 2); + cachePainter.restore(); proxy()->drawPrimitive(PE_FrameLineEdit, &buttonOption, &cachePainter, widget); + } // Draw button clipped cachePainter.save(); -- cgit v1.2.3 From 90c683e41cd978b55de57cb424a986db3b637fcc Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 15 May 2019 15:06:20 +0200 Subject: Q(Plain)TextEdit: Observe color hints from style sheet depending on focus state Ask the style sheet style to adapt the palette in WidgetTextControl::getPaintContext() as is done for QLineEdit. Use the palette color in QPlainTextEdit. Change-Id: I67758716b66feaeac8c2433c2a4d3744cd0d5327 Fixes: QTBUG-72100 Reviewed-by: Christian Ehrlicher Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qplaintextedit.cpp | 1 + src/widgets/widgets/qwidgettextcontrol.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) (limited to 'src/widgets') diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp index 0b5e69b6c3..3b5132a8c8 100644 --- a/src/widgets/widgets/qplaintextedit.cpp +++ b/src/widgets/widgets/qplaintextedit.cpp @@ -1957,6 +1957,7 @@ void QPlainTextEdit::paintEvent(QPaintEvent *e) } QAbstractTextDocumentLayout::PaintContext context = getPaintContext(); + painter.setPen(context.palette.text().color()); while (block.isValid()) { diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index 6b8ce63380..ee757bf870 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -64,6 +64,9 @@ #include "private/qtextdocument_p.h" #include "qtextlist.h" #include "private/qwidgettextcontrol_p.h" +#if QT_CONFIG(style_stylesheet) +# include "private/qstylesheetstyle_p.h" +#endif #if QT_CONFIG(graphicsview) #include "qgraphicssceneevent.h" #endif @@ -3187,6 +3190,15 @@ QAbstractTextDocumentLayout::PaintContext QWidgetTextControl::getPaintContext(QW ctx.selections = d->extraSelections; ctx.palette = d->palette; +#if QT_CONFIG(style_stylesheet) + if (widget) { + if (auto cssStyle = qt_styleSheet(widget->style())) { + QStyleOption option; + option.initFrom(widget); + cssStyle->styleSheetPalette(widget, &option, &ctx.palette); + } + } +#endif // style_stylesheet if (d->cursorOn && d->isEnabled) { if (d->hideCursor) ctx.cursorPosition = -1; -- cgit v1.2.3 From 804a18ef0ec4a054778e223c8cec6ee26dec3f76 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 15 May 2019 13:42:16 +0200 Subject: Document that QHeaderView rendered with themed style might ignore roles While this is generally true for widgets, QHeaderView's documentation about how appearance related data roles are respected can be misleading. Fixes: QTBUG-31804 Change-Id: I93c6562e59ecf771d938d282723169202ac15bc2 Reviewed-by: Richard Moe Gustavsen --- src/widgets/itemviews/qheaderview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index 7bfa51337d..ed418f143c 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -146,7 +146,10 @@ static const int maxSizeSection = 1048575; // since section size is in a bitfiel Not all \l{Qt::}{ItemDataRole}s will have an effect on a QHeaderView. If you need to draw other roles, you can subclass QHeaderView and reimplement \l{QHeaderView::}{paintEvent()}. - QHeaderView respects the following item data roles: + QHeaderView respects the following item data roles, unless they are + in conflict with the style (which can happen for styles that follow + the desktop theme): + \l{Qt::}{TextAlignmentRole}, \l{Qt::}{DisplayRole}, \l{Qt::}{FontRole}, \l{Qt::}{DecorationRole}, \l{Qt::}{ForegroundRole}, and \l{Qt::}{BackgroundRole}. -- cgit v1.2.3