Qt-mindmap (1)-Dockwindow

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.