summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Widget style: Use per-screen DPI in QStyleHelper::dpiScaled()Friedemann Kleint2019-08-238-120/+166
| | | | | | | | | | | | | | | | | Pass the style option to dpiScaled() in order to get the correct screen DPI. The style option contains the font, which again contains the current DPI value. Add QFontMetrics::fontDpi() accessors to get the DPI from the QFont. This DPI will/should be updated on screen change. Replace hardcoded Q_OS_MAC DPI with hardcoded base DPI. This makes per-screen DPI testable on macOS, too. Task-number: QTBUG-45055 Change-Id: I75f8b37d45eb50c3334b46b8469a546d29712f1b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* widgets: Clean up and reorder QWidgetRepaintManager implementationTor Arne Vestbø2019-08-223-438/+460
| | | | | | | | Group functions by related areas and order them roughly by their flow in a normal app repaint cycle. Change-Id: I7a963f612134b3fdbaf748e0432606825b8db64e Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* QWidget: two small fixesMarc Mutz2019-08-221-2/+2
| | | | | | | | | | | | - Use QPointer::data() instead of a C-style cast - Remove an abuse of Q_UNLIKELY. Q_UNLIKELY is for error code. Using it for conditions that have a good chance of being true in normal operations just caused all the error handling code to be paged in needlessly. Change-Id: I542a5b938b032ca84f2cf1f78fbc45049a12ad1a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Adapt QCalendarWidget and QDateTimeEdit to support choice of calendarSoroush Rabiei2019-08-225-158/+242
| | | | | | | | | | | | [ChangeLog][QtWidgets][QCalendarWidget] Allow choice of calendar, with Gregorian remaining the default. [ChangeLog][QtWidgets][QDateTimeEdit] Allow choice of calendar, with Gregorian remaining the default. Change-Id: Ia11dd895032393543aee534b177324e643dcfb20 Done-with: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* widgets: Merge QWidgetRepaintManager::begin/endPaint into callsiteTor Arne Vestbø2019-08-222-24/+7
| | | | | Change-Id: Iff5f78dcc8124bcecf53d42d920e74467937412a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* widgets: Rename QWidgetRepaintManager::doSync to paintAndFlushTor Arne Vestbø2019-08-222-4/+5
| | | | | Change-Id: Ie41bb76d33d59f70eb418f845defc212396d3915 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* widgets: Don't rely on QWidget friending QWidgetRepaintManagerTor Arne Vestbø2019-08-222-56/+55
| | | | | Change-Id: Id9fc28eb62103d38eaa51261f61a2294db85e0d6 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* widgets: Simplify QWidgetRepaintManager::qt_flushTor Arne Vestbø2019-08-222-90/+85
| | | | | | | | | No longer static, so we can access the members directly instead of passing them as arguments. Renamed to flush() while we're at it. Otherwise no changes to the code, just moved the function. Change-Id: Id491a8628c8cecf7cf3b33d3458e7427f5bcd22e Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Goodbye showYellowThingTor Arne Vestbø2019-08-224-212/+7
| | | | | | | | | | The code hasn't been working for at least 5 years, and is just making the repaint manager more complex. We can always re-introduce the feature at a later point. Change-Id: Ib07c782c821f3e653f9452f6fbfe2f87effccc92 Fixes: QTBUG-36435 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Add screen() accessor to QWidgetFriedemann Kleint2019-08-214-3/+28
| | | | | | | | | | | | | Base it on QWidgetPrivate::associatedScreen(), but make a larger effort to find a screen in case the widget is not shown yet. Rename QDesktopScreenWidget::screen() to something else to avoid clashes. Task-number: QTBUG-62094 Task-number: QTBUG-53022 Change-Id: I36ba5ef5f0645a4ac89da0b38a391f7057b2f49c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Remove dead code from Qt 4 timesTor Arne Vestbø2019-08-2049-1661/+73
| | | | | | | | | | The benefit of keeping this code around was to inspire or inform changes in the areas to take into account possibly missing features in Qt 5, but at this point that benefit is questionable. We can always use the history to learn about missing pieces if needed. Change-Id: I87a02dc451e9027be9b97554427bf8a1c6b2c025 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* widgets: Remove stale documentation of QWidgetRepaintManager::flushTor Arne Vestbø2019-08-201-1/+0
| | | | | Change-Id: I5c4df4a8694bc56014beaec34a81219d91332fec Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* widgets: Remove unused arguments from QWidgetRepaintManager::beginPaintTor Arne Vestbø2019-08-202-8/+3
| | | | | Change-Id: I3720d8ef31e623e514fc2e382192d3c4f99fb4ed Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* widgets: Remove unused function qt_dirtyRegionTor Arne Vestbø2019-08-203-19/+0
| | | | | Change-Id: I7e6dbc4fb777a2323d65b73164d8645d6efc95a4 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* widgets: Remove dead members from BeginPaintInfoTor Arne Vestbø2019-08-202-10/+1
| | | | | | | The flags haven't been used since 2011 (6ce6b8a37) and is dead code. Change-Id: Ic5c47b30326ff70534bbf1aa37b25bae666b6b96 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Remove dead macOS specific code from QWidgetPaintManagerTor Arne Vestbø2019-08-201-12/+0
| | | | | Change-Id: I8fdde17d32f20407aed44e4708f30db21555b81a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Widgets: Simplify discardSyncRequestTor Arne Vestbø2019-08-202-9/+8
| | | | | Change-Id: I3bc66a0f958fed44eac5fee6642ef1b00d45a2c4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Upgrade QWidgetPrivate::DrawWidgetFlag to QFlagsTor Arne Vestbø2019-08-203-13/+20
| | | | | | | Allows for easier debugging of the paint cycle. Change-Id: Iab85bccb99198a02f33c0beeccd4e3914375358d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Rename QWidgetBackingStore to QWidgetRepaintManagerTor Arne Vestbø2019-08-207-129/+128
| | | | | | | | | | | | | Quoting a blog from 2009, "this class is responsible for figuring out which parts of the window surface needs to be updated prior to showing it to screen, so it's really a repaint manager." https://blog.qt.io/blog/2009/12/16/qt-graphics-and-performance-an-overview/ What better time to do the rename than 10 years later! Change-Id: Ibf3c3bc8c7df64ac03d72e1f71d296b62d832fee Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Get rid of QWidgetBackingStoreTrackerTor Arne Vestbø2019-08-194-152/+13
| | | | | | | | | | | | | It was added for Symbian almost 10 years ago (d7057e7c1f1a), for a somewhat dubious use-case. The Symbian code is since long gone (ae30d7141), so the remaining pieces are just adding complexity to the already intricate workings of the QtWidgets backingstore/painting logic. Task-number: QTBUG-8697 Change-Id: I82af610a8ac26719c588ac63f06b4501f59b400d Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 2e0b0be2ce30394269559590b42c81de27301ee6) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QWidgetBackingStore: clean up around dirtyOnScreenWidgetsMarc Mutz2019-08-172-50/+13
| | | | | | | | | | | | | | | | | | | | | | The QVector dirtyOnScreenWidgets was aggregated by pointer, which makes no sense, as a QVector is just as large as a pointer (and even in Qt 6, when it will be larger, it's not going to be horrible). But this complicated the code quite a bit. Aggregate by value instead (it's just one of three such vectors now). Drive-by fixes: - use QVector::removeAll() instead of rolling your own - port two indexed loops to ranged ones. In the first case, it's safe, as the loop body clearly doesn't touch the iteratee (it's just a std::accumulate). In the second, the question no longer applies, as we're now using a consume loop. Change-Id: Icd4ac13bb4a6f9a783f0adf2fb6a5bdfacd1f91a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix build without features.proxymodelTasuku Suzuki2019-08-171-0/+4
| | | | | Change-Id: I9e51ed78d783da999187e7df58ddb83d76e3c7b7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QWidget: unbreak QT_NO_OPENGL buildsMarc Mutz2019-08-161-0/+2
| | | | | | | | | | | | | | | | | Amends 94d7603d5114eacaf648e0b0d2dcae5e161e0217. The port from QVector<QPlatformTextureList*> to a container of unique_ptr<QPlatformTextureList> uncovered that QPlatformTextureList isn't defined for QT_NO_OPENGL builds. Some unguarded forward-declarations made the old declaration compile by accident. The new code caught this, so add the #ifdef that had been missing all along. Change-Id: If3b14fc24007b1c917a41ab83343c2e5e65fc643 Reviewed-by: Martin Storsjö <martin@martin.st> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qbc.io>
* QWidget: replace manual memory management with unique_ptr [5/N]: extra->topextraMarc Mutz2019-08-162-6/+5
| | | | | | | | | | It is a bit frustrating that all the initialization and cleanup code are not in the QTLWExtra ctor and dtor. But that is for another patch. Change-Id: I0e45f89c1a53eb2f9a5699d3fbbef1a628b55432 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QWidget: replace manual memory management with unique_ptr [4/N]: extra->cursMarc Mutz2019-08-162-14/+4
| | | | | | | Change-Id: Id65ead5563321b8edbe0055ad1531c2442d4d597 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QWidget: replace manual memory management with unique_ptr [3/N]: ↵Marc Mutz2019-08-162-8/+7
| | | | | | | | | | | | | | | topextra->shareContext Despite the name, it's fully owned by an individual QWidget object. Also make the member mutable, so we can remove the const_cast hack in QWidgetPrivate::shareContext(), and protect QT_NO_OPENGL builds, since the naked pointer compiled by chance due to some unguarded forward declarations while a unique_ptr will somewhere want to call the dtor, which doesn't compile on an object of merely forward-declared type. Change-Id: If8027b55d303822236fcdc1a79e4f3010967b4d2 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Introduce a new feature called easingcurveTasuku Suzuki2019-08-162-2/+6
| | | | | | | | | | features.animation and features.scroller depend on the feature. In total, this saves around 180KB from QtCore and 75KB from QtWidgets. Change-Id: I65aac3ec4d50d62424ee33f44b99f3cfb91121d6 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix build without features.shortcutTasuku Suzuki2019-08-151-0/+2
| | | | | Change-Id: I56ccf104c57e24824e8d09951bb27415307d5abc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.13' into dev"Qt Forward Merge Bot2019-08-153-4/+10
|\
| * Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-08-153-4/+10
| |\ | | | | | | | | | Change-Id: Icc80dacbca8613f2996be75553ff15d0ad242b7e
| | * QTree/TableView: allow to reset the sort order to natural sortingChristian Ehrlicher2019-08-132-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <samuel.gaist@idiap.ch> Reviewed-by: David Faure <david.faure@kdab.com>
| | * Add Q_ENUM for QCompleter enumsVolker Krause2019-08-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | This is necessary in order to use the properties of QCompleter that use these enums. Change-Id: I9f7edfc1137f200810b6bc98d27709695f37de5d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | QWidget: replace manual memory management with unique_ptr [2/N]: topextra->iconMarc Mutz2019-08-142-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | I wonder whether a QIcon could be aggregated here by value, as it has a null state and its default ctor sets d = nullptr. Change-Id: I7a0f46e9fdd51a93afb5db768d46d93b08f307ec Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | QWidget: replace manual memory management with unique_ptr [1/N]: widgetTexturesMarc Mutz2019-08-143-14/+17
|/ / | | | | | | | | | | | | | | Use a vector<unique_ptr> (QVector cannot hold move-only classes), adapt to different API. Change-Id: Iece4b1bfcb35a02aac05935963e1e7f8c986b18d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Fix build without features.groupboxTasuku Suzuki2019-08-151-0/+2
| | | | | | | | | | Change-Id: Ic040d0ba69620cf49700d83e45ccd9b8c363e587 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | QFileSystemModel: Add optionsFriedemann Kleint2019-08-142-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Options flags similar to QFileDialog: - DontWatch: Do not use file system watchers for simple use cases like line edit completion. This brings it closer to QDirModel, which then can be deprecated. - DontResolveSymlinks: Similar to QFileDialog::DontResolveSymlinks. - DontUseCustomDirectoryIcons: matching QFileIconProvider::DontUseCustomDirectoryIcons for convenience. Task-number: QTBUG-76493 Change-Id: I09d3cb73ef902a700e6ebfba427e2d990fce4b4c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | QFileInfoGatherer: Make it possible to turn off file watchingFriedemann Kleint2019-08-132-30/+107
| | | | | | | | | | | | | | | | | | | | Add a boolean watch property and delay-create the file system watcher in watchPaths(). De-inline the watchedFiles(), watchedDirectories(), watchPaths(), unwatchPaths() helpers and a check for the watcher. Task-number: QTBUG-76493 Change-Id: Ie02ac496c8c0246be62bc67ff7e0fcdb990b5ca6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-08-135-38/+44
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/win32-clang-msvc/qmake.conf src/corelib/tools/qlist.h src/gui/painting/qcompositionfunctions.cpp src/gui/painting/qtriangulator_p.h src/gui/text/qfontengine_p.h src/network/kernel/qhostinfo_p.h src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: Ib8a0308cf77224c4fbdcf56778fdac4a43e37798
| * Docs: Fix the snippet lookup for QFileDialog::getOpenFileContentAlessandro Portale2019-08-122-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | src_gui_dialogs_qfiledialog.cpp had two snippets labeled "14". This change bumps one of them to "15" and fixes the the snippet lookup for QFileDialog::getOpenFileContent accordingly. Also, fix two typos: "QSting" -> "QString" and "contents has" -> "contents have". Change-Id: Ic018c23b6ca585f30c116b8a6eb29293560c7a35 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| * Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-08-121-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/arch/write_info.pri Repair architecture config test for the WASM_OBJECT_FILES=1 build mode configure.pri tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp Done-With: Jörg Bornemann <joerg.bornemann@qt.io> Change-Id: I9e12088356eb5bc65b53211cd7a8e330cccd1bb4
| | * QWizard: Account for missing background image on macOS 10.14+Morten Johan Sørvig2019-08-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were loading “Background.png” from the KeyboardSetupAssistant app bundle. As of macOS 10.14 that image is no longer there. Adjust auto tests and document the behavior. Change-Id: Icb4dd73b3fa88927e87bb86db2bc9f7b4a8094f7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-08-081-9/+15
| |\| | | | | | | | | | Change-Id: I4c0fd501db974fb8339944b8df845336776d80a9
| | * Don't rely on QWidget::internalWinId in QWidgetBackingStoreTor Arne Vestbø2019-08-071-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWidget does not handle QWindow and QPlatformWindow being destroyed behind its back, and the QWidget state for internalWinId and the Qt::WA_WState_Created attribute can easily get out of sync with reality. To avoid QWidgetBackingStore mistakenly thinking that a widget does not have a platform window it can operate on we use the QWindow and QPlatformWindow handles directly, instead of relying on the winId. This is a stop gap until we can teach QWidget to deal with dynamic changes to its underlying window handles. Change-Id: Ib09bea2ad62c42e9667a20ca6b5faf0f957288da Fixes: QTBUG-74559 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Fix GCC 4.8 buildVille Voutilainen2019-08-051-23/+23
| | | | | | | | | | | | | | | | | | Change-Id: I4994146b359e8e37f6c0fa1b27f03fb9e800fdd5 Fixes: QTBUG-77218 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Remove the unused includes for QSignalMapperSona Kurazyan2019-08-051-1/+0
| | | | | | | | | | | | | | | Change-Id: I13f19fadc7ad3fed8eb0a6718244cc8880e91be9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Clean up documentation of deprecated APIs from QApplicationSona Kurazyan2019-08-011-41/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Build docs for deprecated APIs conditionally, based on deprecation version. Remove the docs of methods deprecated since 5.0.0, these methods are not compiled anymore. Change-Id: If9302eecc8b3fff4a27c2e4a66ac102add7d66c5 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Remove usages of deprecated APIs of qtbase/widgetsSona Kurazyan2019-08-015-77/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replace the usages of deprecated APIs by corresponding alternatives in the library code and documentation. - Build docs for deprecated APIs conditionally, based on deprecation version. Remove the docs of methods deprecated since 5.0.0, these methods are not compiled anymore. - Modify the tests to make them build when deprecated APIs disabled: * Make the the parts of the tests testing the deprecated APIs to be compiled conditionally, only when the corresponding methods are enabled. * If the test-case tests only the deprecated API, but not the corresponding replacement, add tests for the replacement Task-number: QTBUG-76491 Task-number: QTBUG-76540 Task-number: QTBUG-76541 Change-Id: I6aaf0a1369c479fb880369a38f2b8e1e86b46934 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-08-011-1/+1
|\| | | | | | | | | | | Change-Id: I4505ec6fe17a1aa2c8d1e6576234d06a34eb9f99
| * | QAbstractItemView: refine documentation for SingleSelectionChristian Ehrlicher2019-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since Qt5.1 it is possible to deselect the current selected item in SingleSelection mode when pressing the Ctrl key during the click but this was not mentioned in the docs. Change-Id: I86652308215bf218ea959f869334b6077e4634f9 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.13' into dev"Liang Qi2019-07-301-0/+10
|\ \ \