Pavel Abrosimov
8th October 2009, 12:05
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");
}
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());
}
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);
But when I am trying to unset transparency with
setAttribute(Qt::WA_TranslucentBackground, false);
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?
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");
}
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());
}
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);
But when I am trying to unset transparency with
setAttribute(Qt::WA_TranslucentBackground, false);
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?