Translucent backdrop in my mainwindow
-
i like to create a transparent backdrop behind my mainwindow, can someone kindly help?
-
I saw the the post on http://doc.qt.digia.com/qq/qq16-background.html
saw the command and windowsopacitysetAttribute(Qt::WA_TranslucentBackground, true);
I am not trying to make the windows transparent, i am trying to make the widgets transparent. Any help, appreciated.
-
Are you on Windows? If yes, did you also set @QMainWindow(parent,Qt::FramelessWindowHint)@
You may need to share some more details.
-
can you kindly direct me to any guide?
I am trying to create a background for my mainwindow. -
What exactly is it that you want? Transparent background of main window? Transparent background of widgets? You are talking about different things. What did you try for which target?
-
Sorry for the bad communication.
My purpose is to paste a picture as background on the main window so that it looks more lively.thought Qt should comes with this features
-
Never tried this ... you should be able to add a background image via a StyleSheet. By code or in Designer select StyleSheet on the respective MainWindow (or CentralWidget or .. depends on your ui) and add a resource as background image.
-
I tried adding it inside using "edit Style Sheet" in qt SDK
it feedback nvalid Style Sheet in red
I tried this method before, -
Could you show a style sheet expression that you were using.
-
I use the below line to set my pushbutton color
ui->pushButton->setStyleSheet("* { background-color: rgb(255,125,100) }");
-
//How to add a picture to mainwindow
below link has the answer
http://stackoverflow.com/questions/4458201/unable-to-set-the-background-image-in-qt-stylesheet#In the constructor add:
setStyleSheet("background-image:url(:/File/abc.png);");where under resources, File.qrc /File/and your files.