Hello.
The application I am trying to develop is required to have the window as the main output of the information. This window needs to be resizable and have an ability to be transparent.
With resizing there is no problem. But the second feature has an issue.
I am setting the window next way:
MainOutput
:: MainOutput(QWidget *parent
): QWidget(parent, Qt
::FramelessWindowHint | Qt
::WindowStaysOnTopHint) {
setWindowTitle("title");
}
MainOutput:: MainOutput(QWidget *parent)
: QWidget(parent, Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint)
{
setWindowTitle("title");
}
To copy to clipboard, switch view to plain text mode
void MainOutput::configureWindow()
{
if(myConfig.IsFullScrn()){
showFullScreen();
}
else{
showNormal();
resize(myConfig.wCoordinate(),myConfig.hCoordinate());
move(myConfig.xCoordinate(),myConfig.yCoordinate());
}
setAttribute(Qt::WA_TranslucentBackground, myConfig.IsTransparent());
}
void MainOutput::configureWindow()
{
if(myConfig.IsFullScrn()){
showFullScreen();
}
else{
showNormal();
resize(myConfig.wCoordinate(),myConfig.hCoordinate());
move(myConfig.xCoordinate(),myConfig.yCoordinate());
}
setAttribute(Qt::WA_TranslucentBackground, myConfig.IsTransparent());
}
To copy to clipboard, switch view to plain text mode
The problem is that if initially window was not transparent – the setting it to be such works as I am passing
setAttribute(Qt::WA_TranslucentBackground, true);
setAttribute(Qt::WA_TranslucentBackground, true);
To copy to clipboard, switch view to plain text mode
But when I am trying to unset transparency with
setAttribute(Qt::WA_TranslucentBackground, false);
setAttribute(Qt::WA_TranslucentBackground, false);
To copy to clipboard, switch view to plain text mode
it doesn’t make any change.
I am using QT 4.5 under Ms Windows XP with MiGW.
Is there anything I am doing wrong?
Bookmarks