#include <QApplication>
#include <QFont>
#include <QPushButton>
#include <QWidget>
#include <QLCDNumber>
{
public:
};
MyWidget
::MyWidget(QWidget *parent
){
setFixedSize(200,120);
quit -> setGeometry(62,40,75,30);
quit
-> setFont
(QFont("Times",
18,
QFont::Black,
true));
connect(quit,SIGNAL(clicked()),lcd,SLOT(display(5)));
}
int main(int argc, char *argv[])
{
MyWidget widget;
widget.show();
return app.exec();
}
#include <QApplication>
#include <QFont>
#include <QPushButton>
#include <QWidget>
#include <QLCDNumber>
class MyWidget : public QWidget
{
public:
MyWidget(QWidget *parent = 0);
};
MyWidget::MyWidget(QWidget *parent)
: QWidget(parent)
{
setFixedSize(200,120);
QPushButton *quit = new QPushButton(tr("Click"),this);
QLCDNumber *lcd = new QLCDNumber(2,this);
quit -> setGeometry(62,40,75,30);
quit -> setFont(QFont("Times", 18, QFont::Black, true));
connect(quit,SIGNAL(clicked()),lcd,SLOT(display(5)));
}
int main(int argc, char *argv[])
{
QApplication app(argc,argv);
MyWidget widget;
widget.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks