HI all.
I ve changed the colour of window by usning the code
this->setPalette(p);
QPalette p( this->palette());
p.setColor( QPalette::Window, QColor(Qt::black));
this->setPalette(p);
To copy to clipboard, switch view to plain text mode
now i need to check the window colour. if it is black i need 2 change it to gray and vice versa. i Tried to do as below but its not working
{
this->setPalette(p);
}
if(QMainWindow::backgroundRole() == Qt::black)
{
QPalette p( this->palette());
p.setColor( QPalette::Window, QColor(Qt::gray));
this->setPalette(p);
}
To copy to clipboard, switch view to plain text mode
But its not coming inside if loop.
Can any body help me.
thank you all.
Bookmarks