我想让我的Qt窗口保持在最上面。当执行setWindowFlags(Qt::WindowStaysOnTopHint)
时,窗口会变得隐藏(在Windows 7上)。
我也尝试过:
Qt::WindowFlags flags = windowFlags();
setWindowFlags(flags | Qt::WindowStaysOnTopHint);
还是一样,我做错了什么?
在设置标志后调用show()方法:
Qt::WindowFlags flags = windowFlags();
setWindowFlags(flags | Qt::WindowStaysOnTopHint);
show();