当前位置: 代码迷 >> QT开发 >> QT 关于按键的使用,
  详细解决方案

QT 关于按键的使用,

热度:87   发布时间:2016-04-25 05:03:47.0
QT 关于按键的使用,求救!!!!!!
如何使点击第一行的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,莫非这也让别人帮你加上?
  相关解决方案