aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickvaluetypes_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Export QML and Quick value typesUlf Hermann2021-01-221-9/+9
| | | | | | | They need to be accessible from C++. Change-Id: I60f2213bdbe6b8b64856e13f1e0cc798f8a51086 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use factory functions and ctors for creating value typesUlf Hermann2020-10-021-0/+16
| | | | | | | | | | As you can extend value types with QML_EXTENDED we may as well allow a factory function in the extended type. Furthermore, if the original type allows construction from QJSValue, we may just use that. In turn, we can get rid of the value type providers now. Change-Id: I9124ea47537eab6c33d7451080ab2fff942eaa7b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Allow proper registration of value typesUlf Hermann2020-09-231-77/+91
| | | | | | | | | | | | | | | | | | | | You can now have an extension object on a value type that offers additional properties. This is how we model the QtQuick value types. It allows us to retrieve the extension's metaobject without using the virtual functions in the value type provider. As before, this mechanism is still rather dangerous and not fit for public consumption. It relies on the extension object having exactly the same layout as the original value type, and it hides any properties the original value type might expose. Furthermore we enforce now that gadgets should have lowercase names. The ones that didn't before are split up into an anonymous value type and a namespace that contains all the addressable bits. Task-number: QTBUG-82443 Change-Id: Ic93d6764538d6ccc0774b3c5648eee08ba0939c0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Clean up registration of QEasingCurveUlf Hermann2020-05-191-6/+0
| | | | | | | | | | | | | | | | We don't need to register the Type enum for both QtQml and QtQuick. QtQml is enough. Removing this makes the whole manual value type registration obsolete. Furthermore, we want QEasingCurve as QML_FOREIGN as we have several classes with properties of that type. To keep it nice and tidy, we make the uppercase-named enum holder class a separate type. Unfortunately, the Type enums differ in one entry: QEasingCurve::BezierSpline is called Easing.Bezier in QML. Therefore, we need to keep the custom enum around. We can change all users in qtdeclarative to use the name from QEasingCurve, though. Change-Id: Ibbc78d8bbf8938e2a8722f8c09833a0c73394c3d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Register value types declarativelyUlf Hermann2020-04-281-19/+53
| | | | | | | | | For now this has the effect of adding them to the .qmltypes files. In the future, the registration shall actually add additional value types you can declare as properties in QML. Change-Id: Ifee5a8ec054f35cc7bd07eb992a136730be68da7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Implement Qt.alpha()Maximilian Goldstein2020-04-141-0/+1
| | | | | | | | | | | | Introduces an easy way to get a version of a color with transparency (e.g. Qt.alpha("red", 0.5)). [ChangeLog][QML][General] Added Qt.alpha for easily modifying a color's alpha value Task-number: QTBUG-77635 Change-Id: Ic724e5fa503ca2ae5157a99eed1b5c913a39239f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Implement modifying colors using methodsMaximilian Goldstein2020-04-021-0/+4
| | | | | | | | | | | | | | | | | | Instead of having to use Qt.tint, Qt.lighter or Qt.lighter you can now directly use these on colors (e.g. color.tint("red")). Also adds Qt.color to explicitly convert color strings into actual color objects. [ChangeLog][QML][General] Added Qt.color to turn color strings into color objects [ChangeLog][Quick][General] Make Qt.tint, Qt.lighter and Qt.darker methods that can directly operate on color objects Task-number: QTBUG-77635 Change-Id: Ie10ced7ba7f1dc10afdebbcbc8664d74cd6efccf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add major version to all Q_REVISIONsUlf Hermann2020-02-191-0/+2
| | | | | Change-Id: Id72fbe10c16de61bd847773d0055d83cfe03f63c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devSimon Hausmann2020-02-031-0/+52
|\ | | | | | | | | | | | | | | Conflicts: src/qml/common/qv4compileddata_p.h tests/auto/qml/qmlmin/tst_qmlmin.cpp Change-Id: Ieabc9e0729630de6a8644024d11b765f35199f29
| * Image ColorSpace bindings for Quick/QMLAllan Sandfeld Jensen2020-01-311-0/+52
| | | | | | | | | | | | | | | | | | | | Adds a ColorSpace type mapped to QColorSpace, and adds a property to Image nodes to read and change it, converting the image if necessary on read. Fixes: QTBUG-80616 Change-Id: Ie80c8bc045f66de01de3a5d2c4a9974f07d2871d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | Make Font.weight an integer instead of enumerationEskil Abrahamsen Blomfeldt2020-01-211-3/+3
|/ | | | | | | | | | | | | | | | | | | The weight in QFont is an integer, allowing you to request a font of any weight given the predefined scale. In Qt Quick, however, you were limited to the predefined values. This is done in Qt 6 because it breaks conversions from string to weight, as the change in the autotest illustrates. [ChangeLog][Font] Made Font.weight an integer value rather than limit it to a predefined set of weights. As a side effect, conversion from strings to font weights are no longer supported. Fixes: QTBUG-80402 Change-Id: Ifbe9a0e608b63bfa93bb54999b0b3c1851ccfa88 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-101-0/+2
|\ | | | | | | Change-Id: I2835748c27616103f275849141fbe5a93e3dfd8c
| * Add a property "valid" to the color value typeUlf Hermann2019-10-081-0/+2
| | | | | | | | | | | | | | | | | | | | This gives users a more convenient way to determine if a particular color is valid. Before you had to actually compare with an invalid color. Fixes: QTBUG-78325 Change-Id: Id86bc46a48aa11da3e6654d2940d758d2b0e784f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Specify parameters of type registration in class declarationsUlf Hermann2019-09-261-0/+3
|/ | | | | | | | | | | | | | | | | | | | | Using this technique we can automatically register all necessary revisions and minor versions of a type, using the metaobject system. This greatly reduces the potential for mistakes and resulting incompatibilities between versions of imports. We assume that for each type we need to register all revisions of its super types and its attached type, and that the revisions match. That is, if you import version X of type A, you will also get version X of its attached type and of any super types. As we previously didn't take these dependencies into account when manually registering the types, a number of extra revisions are now registered for some types. Potentially, we can now generate the qmltypes files at compile time, using moc. Change-Id: I7abb8a5c39f5e63ad1a0cb41a783f2c91909491b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add property to disable shaping on fontsEskil Abrahamsen Blomfeldt2017-08-251-0/+4
| | | | | | | | | | | | | | | Major performance improvements can be gained if you know for sure your text does not require any shaping features. This patch adds Qt Quick support for the QFont::PreferNoShaping flag (though as a boolean property to work better with property bindings). [ChangeLog][QtQuick][Text] Added "font.preferShaping" property to Text, TextEdit and TextInput. This makes it possible to improve performance at the expense of some cosmetic font features. Task-number: QTBUG-56728 Change-Id: Ib4e23d5b21b9d4929562df521347285b2586a62e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Expose "kerning" property for fontsEskil Abrahamsen Blomfeldt2017-06-301-0/+4
| | | | | | | | | | | | For text where the content is known, it can be handy to be able to disable the kerning feature in OpenType to improve performance. [ChangeLog][Qt Quick][Text] Added "kerning" property to the font type to support disabling kerning on text. Task-number: QTBUG-56728 Change-Id: I2e447587a066a7e12c5d38967e0845eaad021014 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Expose HSV and HSL color values to QMLNikita Krupenko2016-07-251-0/+18
| | | | | | | | | [ChangeLog][QtQuick] Added properties to access color values for the HSV and HSL color models to the basic QML color type. Task-number: QTBUG-48723 Change-Id: I45fa52f9f3878553e1b3d0a34b47804ede7794f8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add property for setting hinting preference on fontsEskil Abrahamsen Blomfeldt2016-03-151-0/+12
| | | | | | | | | | | | | | | | | As screen density is rapidly increasing and user interfaces are moving more and more towards using unhinted text as default, we have to make it possible to select the hint level from Qt Quick as well. While this is already partially covered by the unhinted QtRendering render type, it is still interesting to be able to tweak the native rendering accordingly, since this is a more precise rasterization. QtRendering also doesn't support medium hinting. [ChangeLog][Text] Added "hintingPreference" property to Text, TextEdit and TextInput. Change-Id: Ib99dbea24aba082481629deddde88c04cdeb8cdb Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-191-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Make the qml/js matrix4x4 type more usefulSean Harmer2015-11-111-0/+7
| | | | | | | | | | | | | | This is used in Qt3D. We also added these additional functions there but for a nice user experience that doesn't kick up errors depending upon the order in which QML modules are imported it would be useful to add these new functions here too. In the long term it would be nice if these QtGui type wrappers were in a qtqmlgui module that was implicitly imported by both QtQuick and Qt3D. Change-Id: Iab03bb6c79b89bcecb4b3204cd0cb01d71f36701 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-061-0/+11
| | | | | | Task-number: QTBUG-48594 Change-Id: Ifc207938de7f0c8995fc712df92665f222612647 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Font matching by font stylenameAllan Sandfeld Jensen2015-08-101-0/+4
| | | | | | | | | | | Some fonts may have styles that does not directly match to QFont properties. To support those QFontDatabase supports matching by style name. This patch exposes that to QML. Change-Id: I9896f2e3d9f6b56fb51f5694b018b456bcd05ed6 Task-number: QTBUG-30851 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Port from Q_ENUMS to new macro Q_ENUM.Friedemann Kleint2015-06-191-2/+2
| | | | | | | | | | | Remove Q_ENUMS in favor of the new Q_ENUM macro which provides registration as meta enum and a debug stream operator. QQuickXmlListModel::Status is left unmodified as porting it creates a link error in tst_qquickxmllistmodel. Change-Id: Id5e6192c9f85e7c94332508fbd91873ddda31e1a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Add QtQuick::Text::font.weight enum valuesShawn Rutledge2015-05-111-5/+9
| | | | | | | | | | Followup to 517da68893be9e6d97c7993922c573de9560604d in qtbase: make all possible font weights available in QML. Task-number: QTBUG-38482 Change-Id: I4f821d2fadbcd42fbb237903be474d67a0a5a7c9 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Initial work on gadget supportSimon Hausmann2014-12-221-43/+27
| | | | | | | | | | | | | | | | | | | | | | Changed built-in QtQml value types to use gadgets. This is in preparation for supporting external gadgets. This replaces the mostly direct inheritance of the concrete value types with gadgets and "dynamic" inheritance through QQmlValueType being generic. Over time as some of the value types may become gadgets, we can remove the ones here. It's important that these "separate" gadgets have the same memory layout as the actual types (QPointF, etc.). Also while QQmlValueType remains practically a singleton, it's not required anymore to be one. Consequently the JS wrappers for value types keep their own instance of QQmlValueType. This allows eliminating the qobject_cast in various places that dealt with the singleton nature. This comes at a cost, making the JS wrappers slightly heavier. However that is meant to be a temporary situation and finally the value type wrapper should merely store the meta-object in addition to the data and the type. Change-Id: I15071ded0a1e54203f29ec1ecf7a9ab646d1168e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Simplify QFont value type wrapper in preparation for gadgetsSimon Hausmann2014-12-131-4/+0
| | | | | | | | | | | | | | | The value type wrapper for QFont tries to keep track whether pixel or point sizes were set and warns the programmer accordingly if both were set. This is implemented using separate boolean variables, but this can also be done using QFont's resolve mask. This move is motivated by the ability of the value type wrappers to operate only on the type they wrap in the future, without requiring additional helper variables. Change-Id: Ia05093b5dcc950281ef89b2bb6fe96c18329cdfa Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Slightly accelerate access to value type propertiesSimon Hausmann2013-11-281-41/+41
| | | | | | | | | | | We can't do a fast property index based access on them, due to the inability to read individual fields from the original object (i.e. the logic in QQmlValueTypeWrapper). However what we can determine and propagate is the type information of the individual properties, i.e. that the x and y properties of a QPointF are always doubles. Change-Id: Iee71ece2117294b7bc0b93deb0a77d7c51148b11 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix license headers of QtQuick sources.Gunnar Sletta2013-09-301-1/+1
| | | | | Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-281-4/+0
| | | | | | | | | | | The macro was made empty in qtbase/ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Ia07e99676e0134fde5e32880edb95e57c779a7ff Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Alan Alpert <aalpert@rim.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Allow invokable functions of value-type classes to be calledChris Adams2012-08-091-0/+60
| | | | | | | | | | | | Previously, invokable functions of value-type classes were returned as properties. This commit fixes that bug by allowing such functions to be invoked normally. It also improves copy-value type handling. This commit also ensures that QMatrix4x4 value types are constructed with qreal values as this is the storage type used internally. Change-Id: Iab0fe4c522ed53d60154e8a8d46dda925fb9f4de Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Migrate gui dependencies from QtQml to QtQuick.Matthew Vogt2012-03-201-0/+310
Ensure that users of declarative that have no need for functionality provided by the Qt Gui module do not have to link against it. Any use of QtGui functionality is delegated to providers that can be installed by another library; QtQuick adds default providers for this functionality when linked against QtQml. Task-number: QTBUG-24559 Change-Id: I5e6a58a4198732dc2f8f52f71abfa1152b871aa7 Reviewed-by: Martin Jones <martin.jones@nokia.com>