Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Semi-transparent QTextEdit
Forum Updated to NodeBB v4.3 + New Features

Semi-transparent QTextEdit

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.4k 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.
  • D Offline
    D Offline
    danielbsig
    wrote on last edited by
    #1

    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
    0
    • B Offline
      B Offline
      b1gsnak3
      wrote on last edited by
      #2

      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
      0

      • Login

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