transparent QLabel with a pixmap

后端 未结 1 677
长发绾君心
长发绾君心 2021-01-22 18:45

I have a QLabel, and I put an image on it using setpixmap(). That image has alpha channel.

The QLabel is on a QWidget which has a border-image specified by an image (so

1条回答
  •  暖寄归人
    2021-01-22 19:25

    You need to set the Widget Attributes and Window Flags appropriately:

    Using QWidget::setAttribute() and Qt::WidgetAttribute...

    Qt::WA_TranslucentBackground needs to be set to true.

    Along with learning the Window Flags Example should help a lot.

    If you are just looking for a single widget that paints a frameless image...

    Here is a perfect example:

    QSplashScreen Replacement

    0 讨论(0)
提交回复
热议问题