問(wèn)題描述
我用過(guò):setFixedSize(size());
停止窗口調(diào)整大小,但當(dāng)鼠標(biāo)懸停在窗口邊框上時(shí),調(diào)整大小箭頭仍然出現(xiàn).
I used:
setFixedSize(size());
to stop the window from resizing, but the resize arrows still appear when the mouse is over the border of the window.
是否有更好的方法來(lái)禁用窗口調(diào)整大小以避免在越過(guò)邊界時(shí)顯示箭頭?
Is there a better way to disable window resizing to avoid showing the arrows when crossing the border?
推薦答案
Qt 為此有一個(gè)名為 Qt::MSWindowsFixedSizeDialogHint
的 windowFlag.根據(jù)您的確切需求,您希望將此標(biāo)志與 Qt::Widget
、Qt::Window
或 Qt::Dialog
結(jié)合使用.
Qt has a windowFlag called Qt::MSWindowsFixedSizeDialogHint
for that. Depending on what you exactly want, you want to combine this flag with Qt::Widget
, Qt::Window
or Qt::Dialog
.
void MyDialog::MyDialog()
{
setWindowFlags(Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
...
}
這篇關(guān)于當(dāng)鼠標(biāo)懸停在邊框上時(shí),如何完全禁用調(diào)整窗口大小,包括調(diào)整大小圖標(biāo)?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!