Hi, thanks for your answer.
I tried to following your hint:
popup.h:
{
Q_OBJECT
public:
explicit Popup
(QWidget *parent
= 0);
~Popup();
protected:
p.
fillRect(rect
(),
QColor(100,
100,
100,
150));
};
class Popup: public QDialog
{
Q_OBJECT
public:
explicit Popup(QWidget *parent = 0);
~Popup();
protected:
voi paintEvent(QPaintEvent *){
QPainter p(this);
p.fillRect(rect(),QColor(100,100,100,150));
};
To copy to clipboard, switch view to plain text mode
popup.cpp:
ui(new Ui::Popup)
{
ui->setupUi(this);
setAttribute(Qt::WA_TranslucentBackground);
setWindowFlags(Qt::FramelessWindowHint);
setStyleSheet("QWidget{background: rgb(100,100,100,150);}");
show();
}
Popup::Popup(QWidget *parent) :
QDialog(parent),
ui(new Ui::Popup)
{
ui->setupUi(this);
setAttribute(Qt::WA_TranslucentBackground);
setWindowFlags(Qt::FramelessWindowHint);
setStyleSheet("QWidget{background: rgb(100,100,100,150);}");
show();
}
To copy to clipboard, switch view to plain text mode
The problem is, that I have a certain transparency, but it looks as if there would be a black background and my semi-transparent background over it.
look here. the right picture is without the popup, the left one with the popup:
IMG_20151208_131951.jpgIMG_20151208_131944.jpg
Bookmarks