如何使点击第一行的QLineLabel,第四行的QListView得到QLomeEdit的值。界面代码如下,请帮忙写下实现功能,万分感谢!!!
#include <QtGui/QApplication>
#include <QtGui/QWidget>
#include <QtGui/QSpinBox>
#include <QtGui/QSlider>
#include <QtGui/QHBoxLayout>
#include <QtGui/QVBoxLayout>
#include<QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton *button1 = new QPushButton("One");
QPushButton *button2 = new QPushButton("Two");
QHBoxLayout *topLeftLayout = new QHBoxLayout;
topLeftLayout->addWidget(button1);
topLeftLayout->addWidget(button2);
QPushButton *button3 = new QPushButton("Tne");
QPushButton *button4 = new QPushButton("Fwo");
QVBoxLayout *leftLayout = new QVBoxLayout;
leftLayout->addLayout(topLeftLayout);
leftLayout->addWidget(button3);
leftLayout->addWidget(button4);
QPushButton *button5 = new QPushButton("Wne");
QPushButton *button6 = new QPushButton("Kwo");
QVBoxLayout *rightLayout = new QVBoxLayout;
rightLayout->addWidget(button5);
rightLayout->addWidget(button6);
QHBoxLayout *mainLayout = new QHBoxLayout;
mainLayout->addLayout(leftLayout);
mainLayout->addLayout(rightLayout);
setLayout(mainLayout);
return app.exec();
}
------解决方案--------------------
楼主,你就写了个界面的布局代码然后贴出来就让大家伙给你实现功能?这就相当于你什么也不用做了,就等有人帮你写代码。这个恐怕有点不妥吧
而且你的布局代码里也全是button,并没有LineEdit和ListView,莫非这也让别人帮你加上?