2013-06-27 26 views
1

假設我有一個form_child表單和另一個稱爲form_parent的表單。現在,當我從form_parent顯示form_child。 form_Child也出現在任務欄中。爲了讓它停止這樣做,我被告知將form_parent作爲form_child表單的父級。這樣做後,我意識到form_child變化的大小,在我看來,子窗體被粘貼在父窗體中。有關如何解決此問題的任何建議。下面是我想設置QTForm的父級 - 調整大小爲實際的表單大小

form_child *u = new form_child(this); //this ptr is the address of parent form 
u->setFixedSize(u->size()); 
u->show(); 

我怎樣才能讓在同一時間子窗體不會出現在任務欄確保它不會出現在父窗體裏面,有自己的大小設置

回答

1

添加Qt::Dialog窗口標誌爲當前窗口標誌:u->setWindowFlags(u->windowFlags() | Qt::Dialog);或從QDialog派生form_child類而不是QWidget或QMainWindow。

相關問題