January 12, 2011

bunjee bunjee
Lab Rat
122 posts

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.

7 replies

January 12, 2011

Mohsen Mohsen
Lab Rat
747 posts

you may also make your own qml objects but first, put your qml code here. have to be solved!

 Signature 

www.madagon.com

January 13, 2011

mbrasser mbrasser
Lab Rat
452 posts

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

January 16, 2011

bunjee bunjee
Lab Rat
122 posts

@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.

January 17, 2011

mbrasser mbrasser
Lab Rat
452 posts
bunjee wrote:
Maybe the Qt Team should consider revealing a little bit more of those encapsulated classes :).

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

January 17, 2011

bunjee bunjee
Lab Rat
122 posts

we didn’t want to force all the newly introduced QML elements to maintain C++ binary compatibility

Makes perfect sense.

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.

December 15, 2011

Bernhard Roth Bernhard Roth
Lab Rat
22 posts

Are those classes still private in 4.8?

Regards,
Bernhard

December 15, 2011

bunjee bunjee
Lab Rat
122 posts

On 4.8 RC they still are.

 
  ‹‹ Showing animated progress while loading large QML files      No network connection ››

You must log in to post a reply. Not a member yet? Register here!