Can I set transparent for Dialog, but not for widget ?
I tried like this, but not work.
Qt Code:
setWindowOpacity(0.1); m_ui->lineEdit->setWindowOpacity(1.0);To copy to clipboard, switch view to plain text mode
Can I set transparent for Dialog, but not for widget ?
I tried like this, but not work.
Qt Code:
setWindowOpacity(0.1); m_ui->lineEdit->setWindowOpacity(1.0);To copy to clipboard, switch view to plain text mode
Wouldn't that be kind of daft? Having widgets with different opacity levels than the window itself?
You will need to play around with Qt::WA_TranslucentBackground to get that effect ( semi transparent main window and opaque child widgets)
wirasto (12th November 2009)
Not work Just make dialog background is black.
Qt Code:
setWindowOpacity(0.1); setAttribute(Qt::WA_TranslucentBackground); m_ui->lineEdit->setWindowOpacity(1.0);To copy to clipboard, switch view to plain text mode
the doc for Qt::WA_TranslucentBackground says
Indicates that the widget should have a translucent background, i.e., any non-opaque regions of the widgets will be translucent because the widget will have an alpha channel. Setting this flag causes WA_NoSystemBackground to be set. On Windows the widget also needs the Qt::FramelessWindowHint window flag to be set. This flag is set or cleared by the widget's author.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
wirasto (12th November 2009)
Bookmarks