aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
Commit message (Collapse)AuthorAgeFilesLines
...
* Windows, TextField: ensure we set a valid minimum sizeRichard Moe Gustavsen2020-11-201-1/+5
| | | | | | | | | | | | The current implementation would sometimes return a minimum size with a height equal to 3. And when trying to divide the image at the center for use with a nine patch image later, we would get drawing artifacts. This patch will ensure that we set a valid minimumsize. Pick-to: 6.0 Change-Id: I9ee72c525966462ced596c5191153d3e2a0d68fe Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Native style: use the same scale from all placesRichard Moe Gustavsen2020-11-201-2/+4
| | | | | | | | | To be on the safe side, let's ensure that we set the same scale one the scene graph node as on the image it's created from Pick-to: 6.0 Change-Id: Ib8a86dd29f6f458d4c43dd36c6838dd632cb4078 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Complete add QtQuick.Layout dependency to native style qmldirFawzi Mohamed2020-11-181-1/+2
| | | | | | | | Cmake recreates the qmldir, so dependencies need to be listed in it too Fixes: QTBUG-88492 Change-Id: Ibcb7555216ba2804b545534d9ce8b304d6172f29 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add QtQuick.Layout dependency to native style qmldirFawzi Mohamed2020-11-181-1/+2
| | | | | | | | | | | | | | Without it qmlimportscanner misses the dependency of FocusFrame.qml and static builds fail to add the dependency leading to a QComponent is not ready error. This happens because the qml file is in a qrc, and thus not visible to qmlimportscanner. Adding a depends QtQuick.Layouts fixes it (and updating the controls dependency to drop the version) Fixes: QTBUG-88492 Change-Id: I9be3e26c3a03b663cb90618368f3480f141a6b04 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Tag porting guides so that they show up in the listVolker Hilsheimer2020-11-172-0/+4
| | | | | Change-Id: I58a307b1bfae55b6c0b4d9663db817bea50b6b34 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* macOS: don't use a focus frame around TextAreaRichard Moe Gustavsen2020-11-172-35/+2
| | | | | | | | | | | As it turns out, text areas in general should not show a focus frame. We don't do that for widgets, and AppKit doesn't do that for NSTextView. And for good reason, we don't want to show a big focus ring around the whole text edit in e.g a text editor application. Change-Id: Idc344c9f8d9f4a11dce22b2d2284800f05cd551a Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Add link in Qt Quick Controls C++ pageJerome Pasion2020-11-171-1/+4
| | | | | | | | -link to Qt Quick Controls help navigation Task-number: QTBUG-87155 Change-Id: I65a5775c8754ee9a5fa5f669918a04026afde996 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Highlight only the Gallery examples, with the correct nameVolker Hilsheimer2020-11-161-5/+1
| | | | | Change-Id: I0ea36493f49bb642886346164d0e1c300af9afa5 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Fix static build using native stylesFawzi Mohamed2020-11-163-0/+31
| | | | | | | | | | | | Ensure that the qml registration function of macOS, Windows and native styles get linked and executed in static builds by referencing the initialization function in the plugin constructor. This is intrusive and ugly, but is the method currently used in other plugins. Fixes: QTBUG-88463 Change-Id: I1b41ec89116066f46818f40ad155d12f6e719ca7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use QChar constructor explicitlyVolker Hilsheimer2020-11-141-1/+1
| | | | | | | Prepare for upcoming changes in qtbase. Change-Id: Iace6fb0c99a0256b4665ff8ee6962c8ea837a74a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Doc: Correct the style import names in snippetsVenugopal Shivashankar2020-11-131-4/+4
| | | | | | Change-Id: If8126bc760b4a0a4f7ee05a8d858c3ffdf63f64c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Remove usage of Qt4CompatiblePaintingAllan Sandfeld Jensen2020-11-122-12/+0
| | | | | | | Matching qtbase Change-Id: I1bd569995197158727ed5dff5b86e041c7af2177 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Handle installation of AUX_QML_FILESAlexandru Croitor2020-11-122-0/+132
| | | | | | | | | Use the new pro2cmake functionality to copy / install the files specified in AUX_QML_FILES entries. Task-number: QTBUG-87818 Change-Id: Ibdee35d54aaf37589d31d113bed67520b57fdbf2 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Register native styles under 2.0 in addition to 6.0Mitch Curtis2020-11-1111-68/+121
| | | | | | | | | | | | | | | | | | Since we changed the logic that decides the default style, users with QML that imports 2.x versions of QtQuick.Controls will get errors if the default style that is chosen is a native style: qrc:/main.qml:53:1: module "QtQuick.Controls.macOS" version 2.15 is not installed qrc:/main.qml: Failed to load dependencies for module "QtQuick.Controls" version 2.15 We use PAST_MAJOR_VERSIONS to register the module for 2.x, and not just 6.0, and register the types of those styles under version 2.0 in addition to 6.0. This should not cause any problems for existing QML code. Fixes: QTBUG-87658 Change-Id: I976078c0aea3fbebe4e04f5ba4d8056c0ca7a0e6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Follow up on change of QQmlListProperty to qsizetypeVolker Hilsheimer2020-11-116-26/+26
| | | | | | | | | | | | | This deals with d7008c79d4ec023527ebfc118ad47f40075f244d in qtdeclarative which aligned QQmlListProperty with our container types. Note: not changing the respective APIs of the QQuick classes in this change. Ie. QQuickPlatformMenu::insertItem still operates on int as index, and QQuickMenuPrivate still stores currentIndex as int. This might need to be addressed in a follow-up commit. Fixes: QTBUG-88362 Change-Id: Ia663cfa47fa91c55997cdef288b2a866107a5f25 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlDesigner: Remove duplicate of repeatThomas Hartmann2020-11-102-13/+3
| | | | | | | | | | The autoRepeat property is already part of AbstractButton. I renamed "Repeat" to "Auto Repeat" Pick-to: 5.15 Change-Id: I4f22ebc18a2094e67c8f48263f84ab9eb7d497b6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Document how to use Controls types in property declarationsMitch Curtis2020-11-092-0/+73
| | | | | | | Fixes: QTBUG-88222 Change-Id: I26ac9ce14fc86b3ada4e3024cb70b1ed4ce4755b Reviewed-by: Nils Jeisecke <nils.jeisecke@saltation.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Rename "Porting" pages to "Changes"Jerome Pasion2020-11-095-5/+5
| | | | | | | | | | | | | | The content in the porting guides are closer to a changelog than a porting guide. At this point, it is easier for maintainers and contributors to write in a changelog than a guide. This change should help with readability and is closer to the usage of "Changes" in documentation. Part of a rename in other submodules. Task-number: QTBUG-87156 Change-Id: Ib34fc9e3e5719c75fcd7d18d9d2cc7dd994c3116 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: Fix broken links and other warningsVenugopal Shivashankar2020-11-093-3/+7
| | | | | | | | | | | | | | | | Fixed these warnings: qt5/qtquickcontrols2/src/quicktemplates2/qquickdialog.cpp:515: (qdoc) warning: Missing '}' qt5/qtquickcontrols2/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc:28: (qdoc) warning: Can't link to 'Creating Qt Quick Projects' qt5/qtquickcontrols2/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc:28: (qdoc) warning: Can't link to 'Differences with Qt Quick Controls 1' qt5/qtquickcontrols2/src/quicktemplates2/qquickdialog.cpp:505: (qdoc) warning: Can't link to 'Popup::' Change-Id: I7f66c7e3baa317af0890876ec7a7e9084997f324 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: use correct casing for Material style nameMitch Curtis2020-11-091-4/+4
| | | | | Change-Id: Ia2d10b9fd27c8e83bfd8ed8ae021391ba1df50f1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Qt Labs Platform - Qt 6 porting guideMitch Curtis2020-11-091-1/+14
| | | | | | Task-number: QTBUG-88158 Change-Id: Idce6ec14216d5f09b4cc729677b17084defdee1b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Qt Quick Controls 2 - Qt 6 porting guideMitch Curtis2020-11-091-0/+250
| | | | | | Fixes: QTBUG-88158 Change-Id: I25eb0d0fef161fdb7c63ae66d27244bb359ce0c2 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: remove all instances of \qmlpropertygroupMitch Curtis2020-11-094-4/+0
| | | | | | | | This is apparently no longer necessary. Pick-to: 5.15 Change-Id: I0f45a84ced5118d248ffab4e745c4e2f2ce5738f Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: fix Qt Labs Platform Menu icon documentationMitch Curtis2020-11-091-4/+4
| | | | | | | | It was probably copy-pasted from MenuItem. Pick-to: 5.15 Change-Id: I20f7e107252346f52bf8c061fe18e1ca6a0bf150 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Doc: update Versions sectionMitch Curtis2020-11-091-5/+14
| | | | | | | | | Since not everyone will switch to Qt 6 instantly, and the Qt 6 docs will become the "current" docs that users see when they search online, it's good to keep the information about older versions around. Change-Id: I7efa6efa5a25a10f292160f5cb53b2ef17ad6d57 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: remove Qt Quick Templates' Qt 6 porting guideMitch Curtis2020-11-091-42/+0
| | | | | | | | | | | While Qt Quick Templates does define the API for each type, it and Qt Quick Controls are quite closely intertwined, and it doesn't serve much value to have the porting guides separated. Task-number: QTBUG-88158 Change-Id: I9d5ee403049a17da1dc5e45e7d26bbd6c7b5b986 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Fix qdoc warningsVenugopal Shivashankar2020-11-068-704/+48
| | | | | | | | | | | Mostly broken links to types and properties that are either dropped or renamed. Task-number: QTBUG-88141 Fixes: QTBUG-88141 Change-Id: I44789cdd1b8560a967b0b3868fd637deef488d88 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Native style/GroupBox: Add contentsMargins for GroupBox on WindowsJan Arve Sæther2020-11-061-0/+9
| | | | | | | | | | | QWindowsStyle did not add these margins because the layout did that. (It had a 9 pixel margin all around it) However, Qt Quick Controls2 expects that the contentPadding includes that margin. We therefore change the subControlRect implementation for (CC_GroupBox,SC_GroupBoxContents) to add those margins. Change-Id: I953a49340dc085716b4e9ecf736a5438e7cc4bbd Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QQuickStyleItem: use imageSize directlyRichard Moe Gustavsen2020-11-041-10/+9
| | | | | | | | There is no reason to calculate the image size over and over. Just calculate imgSize once. Change-Id: Idf49a64102de18ba535899d4a46085de79e7ca2f Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* QQuickStyleItem: reuse QImage when painting, if possibleRichard Moe Gustavsen2020-11-041-2/+7
| | | | | | | | | | If the size of the QImage we draw on hasn't changed between subsequent calls to paintControlToImage, we can just reuse the one we already got. This way we avoid creating and throwing away images unnecessary. Change-Id: Icf65bb8d9008a21e7114e588df46bc1e4cbdea97 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Native style: add separate Info debug flagRichard Moe Gustavsen2020-11-022-19/+23
| | | | | | | | | | | | | | | Add an extra debug flag that lets us distinguish between general information, like geometry info, and explicit debug statements. E.g when writing: qqc2Debug() << "entering this block" ...you sometimes only want to print that line, and not all the additional "noise" you also get if this would print out general information. Change-Id: I86f60557f7c9b08e24c3de55bd0d526e095c6104 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Fix deprecation warnings related to QIcon::pixmap()Friedemann Kleint2020-11-021-27/+37
| | | | | Change-Id: I5eb7441ce557773e5253d3ce623be637819bab0d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix deprecation warnings related to QMetaTypeFriedemann Kleint2020-11-024-7/+7
| | | | | Change-Id: I4e6c1b03915c33f6225c0fb7f86e6acb7715cd4d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* nativestyle: refactor many functions to be constRichard Moe Gustavsen2020-11-0228-102/+102
| | | | | | | | Many of the virtual functions should be const, as they should not modify the state of the item. Change-Id: I94a7f9ae56204c8f8f737911e15d81f82d8add83 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* macOS: draw the handle as a part of the backgroundRichard Moe Gustavsen2020-10-302-1/+30
| | | | | | | | | | | | | | | | In dark mode, the slider handle is semi-transparent. If we draw the handle and the groove separately like we do today, the handle will end up _on top of_ the groove rather than as a part of it. The result is that you will see the groove behind the handle, which is wrong. Since we already draw the groove with tick marks without using a nine-patch image, we might as well draw the handle at the same time. This will give us the correct appearance. Change-Id: Ie582f99450c824d6955e3c0783dad89ab41160ef Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* macOS: clean up slider qstyle implementationRichard Moe Gustavsen2020-10-301-81/+31
| | | | | | | | | | | | | | | | | | | | | The current implementation doesn't work if drawing the groove and the handle together. The reason is that we transformed the CGContext as a way to flip the groove when drawing the slider in inverted (upside down) mode, which would also affect the position of the handle. Since we don't have an inverted API in Slider, we can simplify the code greatly in QStyle and remove all the transformation code. If we are to support inverted mode in the future, this can be achieved much easier by simply setting the scale on the Slider (or the style item) to -1. We also change the way we draw tick marks on both sides of the slider to use the API in NSSliderCell directly rather than manipulating the CGContext. Change-Id: I882a9e7eb69944da590d9d6b5ffb85c1f960cdaf Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Native style/Button: Avoid that the label gets elidedJan Arve Sæther2020-10-291-1/+1
| | | | | | | | | | | | | This was observed on Button on Windows style, where the labels size hint was a fractional number (e.g. 38.26). This got truncated by QQuickStyleItem::contentSize(), which caused the content item to get less space than it actually needed It was only observed on Button, but it was likely to also happen with other control types. Change-Id: I50b98fa7d54e5be2cedeeaf60018367689f168cf Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Change terminology to "look and feel"Jerome Pasion2020-10-292-3/+3
| | | | | | | | -should be "look and feel" Task-number: QTBUG-88010 Change-Id: I8fa72334a7fb0aab7e057422364966055ac39584 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QuickStyleItem: refactor updatePaintNode()Richard Moe Gustavsen2020-10-291-20/+23
| | | | | | | | | Refactor the padding part, since there is no reason to go through all the if-tests if we don't use nine patch image scaling. Change-Id: If89c13aec0e6de955f032145ee325974c7169d6c Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Regenerate CMake project filesMitch Curtis2020-10-289-0/+16
| | | | | Change-Id: I7f1fe2b07a6c22f02802b0fdc31917b398cbd770 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* macOS: Update slider metrics by explicitly asking it to layoutRichard Moe Gustavsen2020-10-281-33/+4
| | | | | | | Cherry-picked from qtbase:873579d1579 Change-Id: Icb9ba3cabe9d5bd6670a6e4659701d06ff048d13 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* macOS: Don't assume NSSlider is never flippedRichard Moe Gustavsen2020-10-281-7/+7
| | | | | | | Cherry-picked from qtbase:6f850c080aac36 Change-Id: Ib6fd2ffa918a8bd5c4e7f0a3198eff36b3298f6d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* macOS: stop using the deprecated APIRichard Moe Gustavsen2020-10-281-3/+0
| | | | | | Change-Id: If1481afbfbc2e655e2b09a232abb16aa2dd792fe Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* nativestyle: only draw the control if the control is visibleRichard Moe Gustavsen2020-10-282-1/+16
| | | | | | | | Check if the control is visible before taking the time to draw the image. Change-Id: Icb64b85355e1341279a95e9035ae18d91c14d6a8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickStyleItem: add proper constructorRichard Moe Gustavsen2020-10-282-2/+3
| | | | | | | | | QQuickStyleItem has been missing a proper constructor that calls the constructur of the base class. This patch will add one. Change-Id: I7ba16b84a548bf8674723aa0d569b929111d07cf Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* nativestyle, slider: ensure that we set correct slider positionRichard Moe Gustavsen2020-10-271-2/+1
| | | | | | | | | | slider.position is a number between 0 and 1. And when the position is 1, styleOption.sliderPosition should be equal to styleOption.maximum. So no reason to subtract "min" (which is also not a normalized number). Change-Id: I9f9ff2e112e224b3aa32bda12aa1963a6e74c6ca Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Native style: Add ComboBox for WindowsJan Arve Sæther2020-10-273-36/+150
| | | | | Change-Id: I59f64b3941bd0744bba6f6079b9ab3fc30063447 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Text color should not be bright when highlighted on WindowsJan Arve Sæther2020-10-271-2/+1
| | | | | Change-Id: I863764d6b3f957a92551d1cd51f2e69e980db9d3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Native style: Fix bug in layoutMargins()Jan Arve Sæther2020-10-262-3/+7
| | | | | | | | | | | | | | It should return margin of 0 if style()->subElementRect(XXXLayoutItem) returned an invalid rect. This means that we cannot rely on m_styleItemGeometry.layoutRect blindly. Change-Id: If6b5a40481c8199a63f3446abc9e7dd1c670d181 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Native style: Add ScrollBar on WindowsJan Arve Sæther2020-10-236-4/+131
| | | | | Change-Id: I82c8cf3e637550cd458ac77f2cc4f6490dc11802 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>