From 3d29f2198fdb7e710767b6711edf96f412d9bfac Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Thu, 8 Aug 2019 14:18:34 +0200 Subject: Add Q_ENUM for QCompleter enums This is necessary in order to use the properties of QCompleter that use these enums. Change-Id: I9f7edfc1137f200810b6bc98d27709695f37de5d Reviewed-by: Friedemann Kleint --- src/widgets/util/qcompleter.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/widgets/util/qcompleter.h b/src/widgets/util/qcompleter.h index 5620b55589..5448fc313c 100644 --- a/src/widgets/util/qcompleter.h +++ b/src/widgets/util/qcompleter.h @@ -75,12 +75,14 @@ public: UnfilteredPopupCompletion, InlineCompletion }; + Q_ENUM(CompletionMode) enum ModelSorting { UnsortedModel = 0, CaseSensitivelySortedModel, CaseInsensitivelySortedModel }; + Q_ENUM(ModelSorting) QCompleter(QObject *parent = nullptr); QCompleter(QAbstractItemModel *model, QObject *parent = nullptr); -- cgit v1.2.3 From fdffa035ba261d374101d230c0a884725f34e362 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 9 Aug 2019 17:38:41 +0200 Subject: Unix: Disable complex page ranges widget when printing to pdf It doesn't work since it relies on cups to do the heavy lifting and cups is not used when printing to PDF Task-number: QTBUG-77351 Change-Id: I1bdda58b50112b9bb3d7991f3cfd860d6b4f4fc4 Reviewed-by: Shawn Rutledge --- src/printsupport/dialogs/qprintdialog_unix.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp index 9fb9d6c55e..d2937e7547 100644 --- a/src/printsupport/dialogs/qprintdialog_unix.cpp +++ b/src/printsupport/dialogs/qprintdialog_unix.cpp @@ -727,6 +727,11 @@ void QPrintDialogPrivate::selectPrinter(const QPrinter::OutputFormat outputForma else options.pageSetCombo->setEnabled(true); + // Disable complex page ranges widget when printing to pdf + // It doesn't work since it relies on cups to do the heavy lifting and cups + // is not used when printing to PDF + options.pagesRadioButton->setEnabled(outputFormat != QPrinter::PdfFormat); + #if QT_CONFIG(cups) // Disable color options on main dialog if not printing to file, it will be handled by CUPS advanced dialog options.colorMode->setVisible(outputFormat == QPrinter::PdfFormat); -- cgit v1.2.3 From de26ea6a7ff921995b6229f1f683821adb95e973 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sat, 10 Aug 2019 18:21:59 +0200 Subject: QTree/TableView: allow to reset the sort order to natural sorting QTreeView allowed to set the sort column to -1 which shows the data in it's natural order (when the model supports it). This functionality was removed during the porting away from the deprecated sortByColumn(int) functionality done in d0f909f8dbdd8594b0d950822f0e7ab8728da513 Readd the functionality and also allow it for QTableView. Fixes: QTBUG-77419 Change-Id: I96b0c09ab9da36ca0a9de58fe0f37e2c56b1d51b Reviewed-by: Samuel Gaist Reviewed-by: David Faure --- src/widgets/itemviews/qtableview.cpp | 8 ++++++-- src/widgets/itemviews/qtreeview.cpp | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp index d4a6433c4d..b05662f6bc 100644 --- a/src/widgets/itemviews/qtableview.cpp +++ b/src/widgets/itemviews/qtableview.cpp @@ -3187,14 +3187,18 @@ void QTableView::sortByColumn(int column) /*! \since 4.2 - Sorts the model by the values in the given \a column in the given \a order. + Sorts the model by the values in the given \a column and \a order. + + \a column may be -1, in which case no sort indicator will be shown + and the model will return to its natural, unsorted order. Note that not + all models support this and may even crash in this case. \sa sortingEnabled */ void QTableView::sortByColumn(int column, Qt::SortOrder order) { Q_D(QTableView); - if (column < 0) + if (column < -1) return; // If sorting is enabled it will emit a signal connected to // _q_sortIndicatorChanged, which then actually sorts diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp index 55b10d13c1..e9228edcda 100644 --- a/src/widgets/itemviews/qtreeview.cpp +++ b/src/widgets/itemviews/qtreeview.cpp @@ -2618,7 +2618,7 @@ void QTreeView::sortByColumn(int column) /*! \since 4.2 - Sets the model up for sorting by the values in the given \a column and \a order. + Sorts the model by the values in the given \a column and \a order. \a column may be -1, in which case no sort indicator will be shown and the model will return to its natural, unsorted order. Note that not @@ -2629,7 +2629,7 @@ void QTreeView::sortByColumn(int column) void QTreeView::sortByColumn(int column, Qt::SortOrder order) { Q_D(QTreeView); - if (column < 0) + if (column < -1) return; // If sorting is enabled it will emit a signal connected to // _q_sortIndicatorChanged, which then actually sorts -- cgit v1.2.3 From 8bd48a1c335b404ebbeb7c09c859e0715e6b5cd4 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 14 Aug 2019 10:29:21 +0200 Subject: Fix crash in optimized solid fills on RGBA64PM Was expecting destStore64 to be non-null. Change-Id: I4fc827256630a35e0669d405c04f9b5b7e71580e Reviewed-by: Eirik Aavitsland --- src/gui/painting/qdrawhelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 36fb091ff8..533ad39b86 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -4491,7 +4491,7 @@ void blend_color_generic_rgb64(int count, const QSpan *spans, void *userData) while (count--) { int x = spans->x; int length = spans->len; - if (solidFill && bpp >= QPixelLayout::BPP8 && spans->coverage == 255 && length) { + if (solidFill && bpp >= QPixelLayout::BPP8 && spans->coverage == 255 && length && op.destStore64) { // If dest doesn't matter we don't need to bother with blending or converting all the identical pixels op.destStore64(data->rasterBuffer, x, spans->y, &color, 1); spanfill_from_first(data->rasterBuffer, bpp, x, spans->y, length); -- cgit v1.2.3