Zum Verständniss meines kleinen Problems füge ich mal einen Scrrenshot hinzu.
Die hellblauen Editzeilen und die hellgrünen Buttons sollen halbtransparent werden, d.h. in diesem Falle sollen die Biergläser durchscheinen. Ich habe es mit folgendem Code versucht, der jedoch nicht funktioniert.
Code: Alles auswählen
BOMChecker::BOMChecker(QWidget *parent) : QMainWindow(parent)
{
ui.setupUi(this);
ui.m_pEdtPathOld->setWindowOpacity(0.5);
...
connect(ui.m_pBtnBrowseOld, SIGNAL(clicked(bool)), this, SLOT(OnBrowsePathOld(bool)));
...
} // BOMChecker::BOMChecker
chris_g schrieb:
Im Konstruktor setzte ich eine der folgenden Eigenschaften für den WindowType.
Code:
setWindowFlags(Qt::SplashScreen); // With this set, the Widget can have a parent AND setWindowOpacity works without a Window border.
//setWindowFlags( Qt::ToolTip ); // FullscreenController from VLC sources does this. Same effect as Qt::SplashScreen
this->setWindowOpacity(0.5);
Wenn ich das mache, also:
Code: Alles auswählen
BOMChecker::BOMChecker(QWidget *parent) : QMainWindow(parent)
{
ui.setupUi(this);
setWindowFlags(Qt::SplashScreen);
ui.m_pEdtPathOld->setWindowOpacity(0.5);
...
connect(ui.m_pBtnBrowseOld, SIGNAL(clicked(bool)), this, SLOT(OnBrowsePathOld(bool)));
...
} // BOMChecker::BOMChecker
erhalte ich als Resultat ein QMainWindow ohne Rahmen (eben ein Splash-Window), und die Controls sind immer noch nicht transparent
Was mache ich falsch?