Always On Top Again
Solved
General and Desktop
-
I have searched here and all over the internet to try and find a solution to get the checkbox is checked state to allow the window to stay on top. I am not looking for a button to click, but just click the checkbox and it stays on top, or unchech it and it doesn't stay on top. This is what I have:
void MainWindow::on_checkBox_stateChanged(int arg1) { Qt::WindowFlags flags = windowFlags(); if (ui->checkBox->isChecked()) flags |= Qt:: WindowStaysOnTopHint; }
Any help would be appreciated, thank you!
This is what I have in the header:
private slots: void on_checkBox_stateChanged(int arg1);
-
@Epiales666 said in Always On Top Again:
WindowStaysOnTopHint
What's the last part of the word above? The window manager can override what you specify in Qt.
-
additionally to what @Kent-Dorfman said,
void MainWindow::on_checkBox_stateChanged(int arg1) { Qt::WindowFlags flags = windowFlags(); if (ui->checkBox->isChecked()) flags |= Qt:: WindowStaysOnTopHint; }
this also fails to set the new windowFlags to the MainWindow, where's your
setWindowFlags(flags);
? -
Thank Kent and HIlk... Working .. tytyty