Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to set attribute for QStylePainter ?
Forum Updated to NodeBB v4.3 + New Features

How to set attribute for QStylePainter ?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 271 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.
  • Q Offline
    Q Offline
    Qt embedded developer
    wrote on last edited by
    #1

    i have used QStylePainter to rotate font awesome icon.

    QStylePainter painter(this);
    QFont font1;
    font1.setFamily("FontAwesome");
    font1.setPixelSize(30);
    painter.setFont(font1);
    painter.rotate(90);
    painter.drawText(0, 0, ICON_BOLT);

    in above code how to set below property for painter object

    setAttribute(Qt::WA_NoSystemBackground,true);
    setAttribute(Qt::WA_TranslucentBackground,true);

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      These are Window Attribute. Not something you can set on your painter.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      Q 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        These are Window Attribute. Not something you can set on your painter.

        Q Offline
        Q Offline
        Qt embedded developer
        wrote on last edited by
        #3

        @SGaist So what i need to do to its white background to transparent so i can see transparent label

        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