QT_4_QpushButton simple to use object tree _

  1. QpushButton simple to use

    1.1 Create a button QPushButton * btn = new QPushButton;

    1.2 btn -> setParent (this) ; provided parent window

    1.3 text btn -> setText ( "Song Dongdong");

    1.4 Mobile btn -> move (x, y );

    1.5 Set the window size resize ( width , high );

    1.6 Set window title setWindowTitle ( "title name");

    1.7 provided a fixed window size setFixedSize ( width , high );

  2. Object Tree

    2.1 when creating the object, if the parent class is a QObject or QObject derived class, this object can not manage to release, will be put into an object tree, the release automatically manage the object's destructor will

    2.2 sequence and structure of a release order is reversed.

  FIG object tree for the understanding of the

Guess you like

Origin www.cnblogs.com/doker/p/10973329.html