16,213
社区成员
发帖
与我相关
我的任务
分享
QTtest::QTtest(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout * m_viewLayout = new QHBoxLayout();
this->setLayout(m_viewLayout);
QHBoxLayout * showLayout = new QHBoxLayout();
QHBoxLayout * btnLayout = new QHBoxLayout();
m_viewLayout->addLayout(showLayout);
m_viewLayout->addLayout(btnLayout);
widget1 = new QWidget();
label1 = new QLabel("label1");
label1->setParent(widget1);
showLayout->addWidget(widget1);
widget2 = new QWidget();
label2 = new QLabel("label2");
label2->setParent(widget2);
showLayout->addWidget(widget2);
QPixmap image1("C:\\Users\\zhq\\Desktop\\1.png");
label1->setPixmap(image1);
QPixmap image2("C:\\Users\\zhq\\Desktop\\1.png");
label2->setPixmap(image2);
QPushButton * btn = new QPushButton("btn");
btnLayout->addWidget(btn);
showLayout->addStretch();
}