Empty QT Project Main.cpp code:
#include <QApplication>#include<QWidget>#include<QDebug>intMainintargcChar*argv[]) {Qapplication A (ARGC,ARGV); Qwidget widgets; Widget.resize ( -, -);//Set Window SizeWidget.move ( $, -);//Set Window Positionwidget.show (); intx = Widget.x ();//value of debug output xQdebug ("x:%d", x); inty =Widget.y (); Qdebug ("y:%d", y); Qrect Geometry=Widget.geometry (); Qrect Frame=Widget.framegeometry (); Qdebug ()<<"Geometry:"<<geometry<<"Frame:"<<frame; returna.exec ();}
Include frame: x () y () framegeometry () POS () Move ()
XY is the part coordinate, Framegeometry is the frame rectangle value qrect Type, POS is the position of the parent window, move is the position in the parent window
Does not contain frame: geometry () width () height () rect () size ()
Geometry is the part rectangle value qrect type, width width, heigeht height
Debug output: Qdebug ()
(ii) Geometric layout of widget parts