Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QDeclarativeStyledText in my custom QML QDeclarativeItem
Qt 6.11 is out! See what's new in the release blog

QDeclarativeStyledText in my custom QML QDeclarativeItem

Scheduled Pinned Locked Moved QML and Qt Quick
8 Posts 4 Posters 5.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bunjee
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mohsen
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mbrasser
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bunjee
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mbrasser
            wrote on last edited by
            #5

            [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

            1 Reply Last reply
            0
            • B Offline
              B Offline
              bunjee
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              • B Offline
                B Offline
                b.roth
                wrote on last edited by
                #7

                Are those classes still private in 4.8?

                Regards,
                Bernhard

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  bunjee
                  wrote on last edited by
                  #8

                  On 4.8 RC they still are.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved