Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Semi-transparent QTextEdit

    General and Desktop
    2
    2
    2151
    Loading More Posts
    • 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.
    • D
      danielbsig last edited by

      Hi all,

      I've been trying to get a QTextEdit control to draw its background semi-transparently, but to no avail. I've lost count on the number of different methods I've tried:

      • setting the palette, both to the QTextEdit control itself, and to the viewport() (i.e. a Palette with colors for both QPalette::Base and QPalette::Background set to RGBA colors)
      • calling control->setStyleSheet with background set to "none"
      • this method:
        @ control->setAttribute( Qt::WA_TranslucentBackground, true );

      @

      • and this:
        @control->viewport()->setAutoFillBackground(false);
        @

      • and finally this:
        @QGraphicsOpacityEffect* effect = new QGraphicsOpacityEffect( control );
        effect->setOpacity( 0.75 );
        control->setGraphicsEffect( effect );
        @

      • and of course a number of combinations of some or all of these methods

      but nothing works.

      A thing to note is that I'm NOT adding this control to a layout, since it is absolutely positioned on top of other windows.

      I'm currently on page 3 in the Google search, will continue to go deeper.

      Any ideas?

      Regards,
      Daniel

      1 Reply Last reply Reply Quote 0
      • B
        b1gsnak3 last edited by

        you have to set your window flag for you QTextEdit to Qt::FramelessWindowHint so it can work with the first option

        1 Reply Last reply Reply Quote 0
        • First post
          Last post