about Dockwindow. Cpp:
1#include"mainwindow.h"2#include <QTextEdit>3#include <QDockWidget>4 5Mainwindow::mainwindow (Qwidget *parent):6 7 Qmainwindow (parent)8 {9Setwindowtitle ("Mindmap");//Set Window captionTenQtextedit *te=NewQtextedit ( This);//this is replaced by the parent to run the same result, because C + + and QT are both fast so this problem is put here first =-= OneTe->setalignment (Qt::aligncenter);//setting alignment is the property->aligncenter the edit box occupies the center position ... (The English slag means it probably means it =-=) A setcentralwidget (TE); - - //Set Docking Window 1↓↓↓ theQdockwidget *dock=NewQdockwidget (("Chen plays game high"), This);//set up a floating window titled "Chen Play Race High" <=w=> -Dock->setfeatures (qdockwidget::D ockwidgetmovable);//set the features of the float window to movable -Dock->setallowedareas (qt::leftdockwidgetarea| Qt::rightdockwidgetarea);//set the allowable range of the move, which can be moved to Leftside and Rightside -Qtextedit *te1=NewQtextedit ();//set *tel, a new text box +Dock->setwidget (TE1);//embed a text box inside a floating window -Adddockwidget (Qt::rightdockwidgetarea,dock);//here ... It's about setting the initial position, which is set to the right overhang. + A //Set Docking Window 2↓↓↓ atdock=NewQdockwidget (("3rd-month male divine power Max"), This);//new floating window, plus title -Dock->setfeatures (qdockwidget::D ockwidgetclosable| Qdockwidget::D ockwidgetfloatable);//features can be off, independent from the main window, ... There is also a function to add all features ... -Qtextedit *te2=NewQtextedit (); -Te2->settext ("A picture of a sword in a disorderly choreography"); - -Dock->Setwidget (TE2); in Adddockwidget (Qt::rightdockwidgetarea,dock); - to //Note that the Dockwindow2 is not set to move, so this box is not movable, but its size will change freely within the right range of the set. + - //Set Docking Window 3↓↓↓ thedock=NewQdockwidget (TR ("DockWindow3"), This); *Dock->setfeatures (Qdockwidget::alldockwidgetfeatures);//The legend of all features, after the operation of DOCKWINDOW3 how to move no problem $Qtextedit *te3=NewQtextedit ();Panax NotoginsengTe3->settext (TR ("Hok Maru Country Yong Shuai")); -Dock->Setwidget (te3); the Adddockwidget (qt::rightdockwidgetarea,dock); + A } the +mainwindow::~MainWindow () - {
$ $}
As follows:
Mindmap requires at least 3 Dockwindow (minimum required):
Chen play refueling refueling, Countdown 15 days!!!
Qt-mindmap (1)-Dockwindow