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. Qt::WA_AlwaysStackOnTop influences font rendering in QML
Forum Updated to NodeBB v4.3 + New Features

Qt::WA_AlwaysStackOnTop influences font rendering in QML

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 3.1k 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.
  • F Offline
    F Offline
    Frime
    wrote on last edited by
    #1

    Hi together,

    I need a transparent QQuickWidget embedded in an QWidget UI. But to get this widget transparent, i have to set the window attribute "Qt::WA_AlwaysStackOnTop". But this influences the font rendering in Ubuntu.. There is no anti-aliasing anymore. If i comment this out, i have a black background (instead of transparent) but a nicely rendered font.

    Does anybody has an idea?
    Thank you very much in advance!
    Frime

    1 Reply Last reply
    0
    • PrezesP Offline
      PrezesP Offline
      Prezes
      wrote on last edited by
      #2

      Add:

      setClearColor(Qt::transparent);

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Frime
        wrote on last edited by
        #3

        Thanks for your response. But this is already done.. the window attribute "Qt::WA_AlwaysOnTop" has to be set in addition. "setClearColor(Qt::transparent)" only has no effect without this attribute..

        Ilf i comment this line (setWindowAtttribut(Qt::WA_Alw...)) out, the the fonts are rendered with anti-aliasing but the background has no transparency anymore. Otherwise, the background is transparent but the fonts are rendered pixelated..

        Any ideas?
        Thank you very much in advance,
        Frime

        PrezesP 1 Reply Last reply
        0
        • F Frime

          Thanks for your response. But this is already done.. the window attribute "Qt::WA_AlwaysOnTop" has to be set in addition. "setClearColor(Qt::transparent)" only has no effect without this attribute..

          Ilf i comment this line (setWindowAtttribut(Qt::WA_Alw...)) out, the the fonts are rendered with anti-aliasing but the background has no transparency anymore. Otherwise, the background is transparent but the fonts are rendered pixelated..

          Any ideas?
          Thank you very much in advance,
          Frime

          PrezesP Offline
          PrezesP Offline
          Prezes
          wrote on last edited by
          #4

          @Frime

          Yes you're absolutely right! I have the same problem with this and I don't find any satisfaction solution.
          I suppose this is a bug from Qt.

          I made this in this way:

          view = new QQuickWidget(this);
          view->setSource(QUrl(QStringLiteral("qrc:///qml/vs.qml")));
          view->setClearColor(Qt::transparent);
          view->setAttribute(Qt::WA_AlwaysStackOnTop);

          But this is not solution.

          1 Reply Last reply
          0
          • F Offline
            F Offline
            Frime
            wrote on last edited by
            #5

            Yep, seems like a Qt Bug :/

            My (unsatisfying) workaround: "copy" the background. In my case, I just have a pixelated background-texture I can use as background image.

            But this should work also to fake a transparent QML Widget:
            Grep the background and provide it via property binding to your QML world. Then you can set it as background-Image in QML.
            This could help: http://stackoverflow.com/questions/10381854/how-to-create-screenshot-of-qwidget Not nice, but should work.

            Best,
            Frime

            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