本文介紹了當鼠標懸停在邊框上時,如何完全禁用調整窗口大小,包括調整大小圖標?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我用過:setFixedSize(size());
停止窗口調整大小,但當鼠標懸停在窗口邊框上時,調整大小箭頭仍然出現.
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.
是否有更好的方法來禁用窗口調整大小以避免在越過邊界時顯示箭頭?
Is there a better way to disable window resizing to avoid showing the arrows when crossing the border?
推薦答案
Qt 為此有一個名為 Qt::MSWindowsFixedSizeDialogHint
的 windowFlag.根據您的確切需求,您希望將此標志與 Qt::Widget
、Qt::Window
或 Qt::Dialog
結合使用.
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);
...
}
這篇關于當鼠標懸停在邊框上時,如何完全禁用調整窗口大小,包括調整大小圖標?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!