aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Native style: call QQuickStylePlugin::registerTypes() from style pluginsMitch Curtis2020-09-076-4/+125
| | | | | | | | This ensures that we received the warning we expect in tst_StyleImports::importStyleWithoutControls when run with native styles. Change-Id: I290f4e72222688e68ae36ace36f1d8be4bedaf31 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QQuickToolTip: don't specify QML import version when creating instanceMitch Curtis2020-09-072-3/+3
| | | | | | | Not all styles will have a specific version, so don't specify it. Change-Id: I92f020314d76934f286ca2946e994e2d1c5d37e5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Native style: fix warnings in QStyle codeMitch Curtis2020-09-071-2/+3
| | | | | | | | These break the build unless Qt is configured with -no-warnings-are-errors. Change-Id: I4a96efc0b29db60e7945fb9739a13da81f8d4c24 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Native style: temporarily disable the Windows style until it's completeRichard Moe Gustavsen2020-09-071-3/+4
| | | | | | | | | | Since the Windows style is not yet complete, it's best to disable it until it is, otherwise causes auto test failures that might already be fixed. Task-number: QTBUG-86399 Change-Id: I1acb130aa872e9effc82cc326e37a037024d49ca Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Native style: don't use ID's inside the stylesRichard Moe Gustavsen2020-09-072-7/+4
| | | | | | | Using ID's violates the rule we have for styles. Change-Id: I923199a62ed2dc3f8563ee9eda593905d8b076f9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Native style: let windows/qmldir report the exact controls it containsRichard Moe Gustavsen2020-09-071-2/+0
| | | | | | | | This will ensure that the customization auto-test will not run for controls that are not available. Change-Id: Ia3164b847115cfb3bd0b34ff60630c06d8095b42 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Native style: don't use signal handlers inside the styleRichard Moe Gustavsen2020-09-072-15/+3
| | | | | | | Using signal handlers will break the sanity test. Change-Id: I1a522520e237a7821162f65f49e7d0e1d501ff94 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Native style: don't use anchors inside the styleRichard Moe Gustavsen2020-09-071-1/+4
| | | | | | | Using anchors will break the sanity test. Change-Id: I6f27e98ae95e811db5063f0bc3866f386dbbb16e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Native style: only list available built-in stylesRichard Moe Gustavsen2020-09-071-0/+4
| | | | | | | | | | Don't add e.g Windows style to the list of built-in styles when running on other platforms than Windows. The Windows style is only available on Windows. Otherwise e.g the autotests will try to execute all the tests for a style that is not present. Change-Id: Iee8b052fd284840951a77d117071ab1b59ee92bc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Native style: fix namespace buildsRichard Moe Gustavsen2020-09-072-2/+6
| | | | | Change-Id: I7ef28cc93fd4acad9849fecb3d4c2cab79f0acdb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Native style: set a sensible default width for TextFieldRichard Moe Gustavsen2020-09-072-2/+4
| | | | | | | | | | Set the default width of an empty TextField to 90px (which is a number found by creating an NSTextField in XCode and measuring it with pixeltool). This should also make tst_QQuickPopup::macOS::cursorShape() pass. Change-Id: Ia2a059668c2e1eaea3eef20015a8ea99468dd8ad Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge "Merge remote-tracking branch 'nativestyle' into dev"Mitch Curtis2020-09-07151-7/+37371
|\
| * Merge remote-tracking branch 'nativestyle' into devMitch Curtis2020-09-04151-7/+37371
| |\ | | | | | | | | | Change-Id: I18a4fd46cf13c65fe6f4c3981b7c61ab52109b8d
| | * Native style: set the default system palette as QQuickTheme::System palettewip/nativestyleRichard Moe Gustavsen2020-08-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After introducing the new registration system in Controls, the theme palette picked up colors from the Default style. Until this is fixed, set the system palette explicitly. Task-number: QTBUG-86303 Change-Id: Ib4c90856bd5410c042160b532175a48fdaea0fbd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * Native style, manual test: update location to Default styleRichard Moe Gustavsen2020-08-283-5/+5
| | | | | | | | | | | | | | | Change-Id: I3fb788ceba150664ed1c7b4040b73a0b7fdd7337 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * Native style: fix up qmldir files to comform to the new registration systemRichard Moe Gustavsen2020-08-284-31/+56
| | | | | | | | | | | | | | | Change-Id: Id28352b397e3fc48423856a7f9322f3475d642ef Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * Native style: move macOS and Windows into QtQuick/Controls instead of ↵Richard Moe Gustavsen2020-08-284-12/+10
| | | | | | | | | | | | | | | | | | | | | QtQuick/Controls.2 Change-Id: I12b0a3846a21cafac29615dbea53d88f9aed8e35 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * Native style: remove versioning from importsRichard Moe Gustavsen2020-08-2864-225/+225
| | | | | | | | | | | | | | | Change-Id: I73319d18ca6540227ce6bf4bdcf217a3c279c64c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * Native style: clean-up importsRichard Moe Gustavsen2020-08-2831-31/+2
| | | | | | | | | | | | | | | Change-Id: Id05edfccb617c72db902f5a7147ed8433be62e7c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * Native style: add macOS and Windows to QQuickStylePrivate::builtInStyles()Richard Moe Gustavsen2020-08-281-2/+9
| | | | | | | | | | | | | | | Change-Id: I9b9aa44fd02a02fcd0ca7671abe120b806acc2cb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * Merge "Merge branch 'dev' into nativestyle" into wip/nativestyleThe Qt Project2020-08-281582-12898/+9407
| | |\
| | | * Merge branch 'dev' into nativestyleRichard Moe Gustavsen2020-08-261582-12898/+9407
| | | |\ | | | | | | | | | | | | | | | Change-Id: I9999194551f71abec3731355cd746e69e2e0b187
| | * | | Native style: make StyleItem::control notifyableRichard Moe Gustavsen2020-08-281-1/+2
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though 'control' should only be set once and never change, the QML engine will complain if you have a binding to e.g control.pressed, since both 'control' and 'pressed' in theory can change. So add a NOTIFY section to silence the engine. Change-Id: I64b79b7fd163cbeb5de78504f3b58d915edc278b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| | * | Native style: add hover effects to ScrollBar on macOSRichard Moe Gustavsen2020-08-263-0/+48
| | | | | | | | | | | | | | | | | | | | Change-Id: I61bb0c2b1fd4dce2939bc4fe91a498a280802cb9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * | Native style: remove superfluous width bindingRichard Moe Gustavsen2020-08-261-1/+0
| | | | | | | | | | | | | | | | | | | | Change-Id: Ieb640d93e6eb09eb58e5b2ab48a399991d453eb5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * | Native style: move DesktopGallery to manual tests, and rename to nativestyleRichard Moe Gustavsen2020-08-2636-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should not be shipped as an example in it's current state. But the app is needed for now as a manual test while we develop the styles. Change-Id: I719ec629789bc4c8b51d14c97afd7b91b822e89b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * | Native style, DesktopGallery: wrap TextArea inside ScrollView, and not FlickableRichard Moe Gustavsen2020-08-211-20/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | From the documentation for TextArea, this is the recommended approach. Change-Id: I37428488cba6d406b3e9c6f6dae9dcab04cece79 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * | Native style: clean-up QStyle using a post routineRichard Moe Gustavsen2020-08-201-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we delete QStyle, it will free up it's own internal resources. Especially on macOS, this means releasing a lot of NSViews and NSCells from the QMacStyle destructor. If we did this from ~QtQuickControls2NativeStylePlugin, it would happen when the plugin was unloaded from a Q_DESTRUCTOR_FUNCTION in QLibrary, which is very late in the tear-down process, and after qGuiApp has been set to nullptr, NSApplication has stopped running, and perhaps also other static platform variables (e.g in AppKit?) has been deleted. And to our best guess, this is also why we see a crash in AppKit from the destructor in QMacStyle. So for this reason, we delete QStyle from a post routine rather than from the destructor. Change-Id: I9dfb0d3394f14e5cd8b88d5a5fbbf3b73284faf1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| | * | Native style: don't draw frame around TextAreaRichard Moe Gustavsen2020-08-205-152/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In controls, it's seems to be undefined if the style should draw a frame around TextArea or not. E.g the Imagine style do, but the the Fusion style does not. This is a bit unfortunate, because depending on how you use a TextArea, you might want a frame around the TextArea itself, or the ScrollView around it (including the scrollbars), or not at all (*). For this reason, we should not draw a frame around the TextArea, but leave it to the user to compose the (style independent) structure, e.g Frame { ScrollView { TextArea{} } } Frame { TextArea {} }. TextArea {} This patch will remove drawing a frame around TextArea from the native style. Then at least Fusion, macOS and Windows will work the same way. This also means that we can remove the QQuickStyleItemTextArea, since we end up not using QStyle at all for drawing a TextArea. (*) Compared to Widgets, a QPlainTextEdit inherits from QAbstractScrollArea, which inherits from QFrame. In QFrame, you can choose frameShape, and even set it to NoFrame. Change-Id: Icabfa294744e87ccf262855faa0992f2d71ec4cb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * | Native style: make textareas selectable by mouseRichard Moe Gustavsen2020-08-131-0/+6
| | | | | | | | | | | | | | | | | | | | Change-Id: I767278fd63ace4248c0e239b9e3872da17433554 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * | Merge branch 'dev' into nativestyleRichard Moe Gustavsen2020-08-1319-64/+247
| | |\ \ | | | | | | | | | | | | | | | Change-Id: Ib1414eac2ad31cbaff6408ba84020a1e5dc064f4
| | * | | Native style: increase combobox minimum sizeRichard Moe Gustavsen2020-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After testing on Big Sur, it becomes clear that the minimum size (which is also the size of the nine patch image) needs to be larger in order for the combobox to render correctly. Change-Id: Iac70efa348afb7efb0af9453dd392b40ba3a9f89 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * | | Native style: add configure optionsRichard Moe Gustavsen2020-08-128-9/+37
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I54521f85aa821369ba3ff57fb037ae4996845c97 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * | | Native style: increase text field minimum sizeRichard Moe Gustavsen2020-08-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After testing on Big Sur, it becomes clear that the minimum size (which is also the size of the nine patch image) needs to be larger in order for the text field to render correctly. Change-Id: I74ede6415545f0ddee3fc2175772c1b07c2c3999 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * | | Native style: fix leaks in qquickmacstyleRichard Moe Gustavsen2020-08-101-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After running the "leaks" app in Instruments, several places showed up to leak memory. This patch will add auto release pools at those places to stop that from happening. Change-Id: If7f49290fde60e71d1a40c10bc3d538df6c1da5c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | * | | Native style: support building with cmakeRichard Moe Gustavsen2020-07-306-1/+426
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Idec0507a8bbdfc345e731a9e376ef8dd00534946 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * | | Native style: remove fusiondesktopRichard Moe Gustavsen2020-07-308-232/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This style is not needed, since the already existing fusion style is working also for desktop. Change-Id: I0f92fdb88dc6173530be0f33b98a6f2d97e65afb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * | | Merge branch 'dev' into nativestyleRichard Moe Gustavsen2020-07-17124-716/+1516
| | |\ \ \ | | | | | | | | | | | | | | | | | | Change-Id: I5375ecd1dcbc058806e34fce757df2bf30dac16e
| | * | | | Native style: add DialRichard Moe Gustavsen2020-06-2614-0/+437
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Iad09b9f6080994528d65dcddc9eda49dbba356f7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * | | | Native style: support checkable buttonsRichard Moe Gustavsen2020-06-262-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Id80add4e7c3611f9a12695745300d335a015cb43 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * | | | Let macOS have TabFocus focus policyJan Arve Sæther2020-06-222-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is how the macOS platform behaves. This will cause a slight behavior change for all Qt Quick Controls 2 styles on macOS, as reflected by the change in autotests. Change-Id: I9ea744737d0d157ee8c83955f718c1cd889a8c1d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * | | | Native style: enhance exampleRichard Moe Gustavsen2020-06-182-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I61805084d21947becc8a48119a113b94cfa897d2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * | | | Native style: move window tests inside window() scopeRichard Moe Gustavsen2020-06-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I0c9860eca383b45926fc2134a54807a845d6bc35 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| | * | | | Make sure the focus rect is drawnJan Arve Sæther2020-06-172-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In windows style, the focus rect is drawn when the button is drawn, but we are only drawing the bevel, so the focus rect was not drawn. We move the logic of drawing the focus rect so that it is drawn when drawing the bevel instead. Also, we have to set the QStyle::State_KeyboardFocusChange in order for the focus rect to be drawn Change-Id: I4463ae1dd0f23ecc5bb0a84c563fda33dc6e93c8 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * | | | Don't use 9-patch for Button on WindowsJan Arve Sæther2020-06-171-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the Button has a dotted focus rect on windows, it cannot be stretched by the 9-patch image, so we disable 9-patch for Button on Windows. Change-Id: I7dd7ea238edda8d9e55d65dbe4bd607a06e6ce6c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| | * | | | Fix active focus handlingJan Arve Sæther2020-06-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should connect to the control instead of the QQuickStyleItem This was also the case for the "enabled" and "window" properties (however, they worked fine, since those properties are inherited by the parent/child relationship) Change-Id: Ibcc5dbe8ea10201db558a534e46233617093e9b7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * | | | Native style: add ProgressBarRichard Moe Gustavsen2020-06-1716-79/+548
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ie48002b083615afd4f8f8ab3b1303a8f5c39f81b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * | | | Native style, DefaultComboBox: position popup at correct placeRichard Moe Gustavsen2020-06-151-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change 4013c4ee caused a regression after renaming layoutRect to layoutMargins. This patch will fix the regression in DefaultComboBox related to that. Change-Id: I05774b582c750e4614c0a70926613114b259a515 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| | * | | | Fix vertical aligment of CheckBox elementsJan Arve Sæther2020-06-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I3cf376c680557c3d43753f6f4c627344192eb30c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * | | | NativeStyle: add ScrollBarRichard Moe Gustavsen2020-06-1214-14/+539
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ied2055866a67798ce60105e7251740a3e66b38db Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>