#include <QPushButton.h>
#include <QWidget.h>
#include <QApplication.h>
#include <QFont.h>
#include <QLabel.h>
#include <QLcdnumber.h>
#include <QSlider.h>
class myclass:public QWidget
{
public:
myclass();
//void myclass1();
private:
QPushButton *b1;
QLabel *label;
QLCDNumber *lcd;
QSlider *slider;
};
myclass::myclass()
{
this->setGeometry(100,100,300,200);
b1=new QPushButton("QUIT",this);
b1->setGeometry(10,10,80,40);
//b1->setFont(QFont("Times",18,QFont::Bold));
QFont font("Times",18,QFont::Bold);
b1->setFont(font);
lcd=new QLCDNumber(2,this);
lcd->setGeometry(100,10,190,180);
slider=new QSlider(Vertical,this); //这一句出现了错误,就是单词Vertical
lcd->setGeometry(10,60,80,130);
connect(b1,SIGNAL(clicked()),label,SLOT(myclass1()));
connect(lcd,SIGNAL(valueChanged(int)),slider,SLOT(display(int)));
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
myclass w;
w.show();
return a.exec();
}