void MainWindow::on_actionAlways_on_Top_triggered(bool checked)
{
Qt::WindowFlags flags = this->windowFlags();
if (checked)
{
this->setWind
Tested with
void ConsoleUI::onAllwaysTop(bool checked) { Qt::WindowFlags flags = windowFlags(); if (checked) { flags ^= Qt::WindowStaysOnBottomHint; flags |= Qt::WindowStaysOnTopHint; } else { flags ^= Qt::WindowStaysOnTopHint; flags |= Qt::WindowStaysOnBottomHint; } setWindowFlags(flags); show(); }