布局嵌套-qt开发文档

时间:2024-05-16 03:17:13
【文件属性】:

文件名称:布局嵌套-qt开发文档

文件大小:541KB

文件格式:PPT

更新时间:2024-05-16 03:17:13

qt-Linux

布局嵌套 QVBoxLayout *buttonBox = new QVBoxLayout( 6 ); buttonBox->addWidget( new QPushButton("OK", this) ); buttonBox->addWidget( new QPushButton("Cancel", this) ); buttonBox->addStretch( 1 ); buttonBox->addWidget( new QPushButton("Help", this) ); QListBox *countryList = new QListBox( this ); countryList->insertItem( "Canada" ); /* … */ countryList->insertItem( "United States of America" ); QHBoxLayout *middleBox = new QHBoxLayout( 11 ); middleBox->addWidget( countryList ); middleBox->addLayout( buttonBox ); QVBoxLayout *topLevelBox = new QVBoxLayout( this, 6, 11 ); topLevelBox->addWidget( new QLabel("Select a country", this) ); topLevelBox->addLayout( middleBox );


网友评论