A main interface ui, click on the main interface buttons , the main interface of a part of the range of display sub- interface ui, there are multiple sub- interfaces , multiple buttons , a button corresponding to a sub- interface ,
how it nested sub- interface ui ui on the main interface
------ Solution ------------------------------------ --------
sub- interface UI is not there a category, such as call Paintboard,
In the main interface UI where it needs to display the sub- interface class upgrade Paintboard, on it.
in the Qt Designer to do .
------ Solution ---------------------------------------- ----
brothers ! You did not see ah !
you do , you can see the following two lines do .
UI you do not have that three files? If not, will complement the three files. Yes look at the third row .
.
"Paintboard * child_1 = new Paintboard (?????) / / generating sub- interface ."
constructor you write it ? , Gnaw gnaw written by chanting.
------ eference ------------------------------------ ---
set parent, do not use the show function
------ eference ------------------------ ---------------
sub- interface and support functions have a good package is Paintboard;
The main interface function analysis options
ui-> setupUi (this);
Paintboard * child_1 = new Paintboard (?)
how to set a question mark where it ?
------ eference --------------------------------------- < br> landlord Why not QstackWidget? ? ? If the landlord have to do this , then set the parent as you said above that " ? "It should be this , right
------ eference ---------------------------------- -----
bad , because some sub- interface has mousepress event ,
------ eference --------------- ------------------------
use UI designer-generated interface , but also among the nest to another UI , UI in the new sub- interface, a new designer with QtCreator interface classes .
generate three files : Includes a xxxx.UI, a xxxx.h, a xxxx.cpp.
inside another class as long as # include "xxxx.h" can be used.
------ eference --------------------------------------- < br>
Brother, you hit the sauce ah , ui file I have done, he sent nested
The main interface function analysis options
ui-> setupUi (this);
Paintboard * child_1 = new Paintboard (?????) / / generating sub- interface
The key is how to write ?
------ eference ------------------------------------ ---
you are not used to this method , constructor, no matter how to write all owe not go ah
------ eference ------------- --------------------------
reference 8th floor of replies:
references the 6th floor of replies:
5th Floor reply quote :
use the UI designer-generated interface , but also nest to another UI among children in the new UI interface , use QtCreator 's new designer interface classes .
generate three files : Includes a xxxx.UI, a xxxx.h, a xxxx.cpp.
inside another class as long as # include "xxxx.h" can be used.
Brother, you hit the sauce ah , ui file I have done, he sent nested Analysis of the main interface options
letter ......
you are not used to this method , constructor, no matter how to write all owe not go ah
I also tried embedding this does not go in , and I'm still tangled in , there is no good way to do this ?
------ eference --------------------------------------- < br>
this how to do it , this class Paintboard find it
------ eference ----------------------- ----------------
nested landlord I realize you do not know does not solve .
code is as follows :
QSqlDatabase db;
DeviceInfoMangeSec * device = new DeviceInfoMangeSec (db, this);
ui-> stackedWidget-> addWidget (device);
ui-> stackedWidget-> setWindowTitle (" basic data management " ) ;
ui-> stackedWidget-> setCurrentWidget (device);
achieved with QstackWidget
没有评论:
发表评论