Results 1 to 4 of 4

Thread: Background image and semitransparent widget

  1. #1
    Join Date
    Sep 2006
    Posts
    23
    Thanks
    4
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Android

    Default Background image and semitransparent widget

    Hello,
    I'm trying to put a background image beside some qlistview widgets. So I think that I've to made them semitransparent.
    I've tried different aproaches but I can't get a semitransparent widget.
    How can I do it?
    Thanks in advance.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Background image and semitransparent widget

    If you want a semitransparent list view the use QWidget::setWindowOpacity(0.5);

    Regards

  3. #3
    Join Date
    Sep 2006
    Posts
    23
    Thanks
    4
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Android

    Default Re: Background image and semitransparent widget

    If i try the following code, I can't see the mainwindow's yellow color. But I can if I remove the setCentralWidget(a);

    Qt Code:
    1. setStyleSheet("QMainWindow {background-color: yellow}");
    2. a->setWindowOpacity(0.5);
    3. setCentralWidget(a);
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Sep 2006
    Posts
    23
    Thanks
    4
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Android

    Default Re: Background image and semitransparent widget

    I want something like the attatched image, with designer I've selected QlistWidgets frame, as Qt::StyledFrame, and in this case it works, but i can't get it coding.
    Attached Images Attached Images

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.