QDeclarativeStyledText in my custom QML QDeclarativeItem
-
Greetings Qt Guys,
I would like to use a QDeclarativeStyledText in my own QDeclarativeItem custom text item.
That class seems to be private. I successfully included it on Windows and it works fine. Unfortunately on OS-X I have missing symbols errors.
Is there an easy workaround for that or do I have to reimplement my own QDeclarativeStyledText item ?
Thanks.
B.A.
-
Hi,
QDeclarativeStyledText is private, and not usually exported from the library -- it uses Q_AUTOTEST_EXPORT rather than Q_DECLARATIVE_EXPORT. This means you won't really be able to use it unless you modify Qt (or use your own copy of the class; it doesn't rely on any other private classes).
Regards,
Michael -
@mbrasser: Thanks !
I guess I'll duplicate the QDeclarativeStyledText in my own library.
I've browsed the QML graphicsItems sources. A few classes seem hidden from library export. Here is a few example:
- QDeclarativeGradient
- QDeclarativeGradientStop
- QDeclarativeStyledText
I'm not sure how I can come up with my own original QML Rectangle or Text item without reinventing the wheel / copy pasting existing code.
Maybe the Qt Team should consider revealing a little bit more of those encapsulated classes :).
Thanks again !
B.A.
-
[quote author="bunjee" date="1295213482"]Maybe the Qt Team should consider revealing a little bit more of those encapsulated classes :).[/quote]
To provide a little background on this...the number of public classes for the initial release was intentionally kept very minimal, as we didn't want to force all the newly introduced QML elements to maintain C++ binary compatibility as well as QML compatibility (this should make it easier to e.g. move a QML application to the QML scene graph).
Unfortunately at the moment this means more work for those writing custom C++ components :-( If you have a list of things you'd like to see made public, a suggestion at http://bugreports.qt.nokia.com would be much appreciated.
Regards,
Michael -
bq. we didn’t want to force all the newly introduced QML elements to maintain C++ binary compatibility
Makes perfect sense.
bq. Unfortunately at the moment this means more work for those writing custom C++ components
I've been working on "scaling friendly" components. I found QML base components to scale quite poorly:
- Pixmaps tend to be blurry when scaled even with "smooth: true".
- Scaled fonts tend to look bad when zoomed a tad much.
- Rectangles and pixmaps draw differently when scaled causing rounding issues.
I guess it's a trade-off between smooth scaling and high performances for portable devices. Anyway I'm trying to provide "scale friendly" alternative to existing QML items.
Do you guys consider working more on the QML scaling in the future ? Or do you find this secondary and believe that each platform should have its own taylor made GUI ?
As a sidenote I'm looking forward to use the scene graph a lot and I hope it will not make my custom QML items obsolete :).
Thanks for the insights.
B.A.