#include <QApplication>
#include <QPushButton>
#include <QWidget>
#include <qmessagebox.h>
{
public:
public slots:
void print();
};
void MyWidget:: print()
{
QMessageBox::information(this,
"Some window label here",
"hello");
}
MyWidget
::MyWidget(QWidget *parent
){
setFixedSize(200, 120);
quit->setGeometry(62, 40, 75, 30);
connect(b, SIGNAL(clicked()), this, SLOT(print()));[/B]
}
int main(int argc, char *argv[])
{
MyWidget widget;
widget.show();
return app.exec();
}
#include <QApplication>
#include <QPushButton>
#include <QWidget>
#include <qmessagebox.h>
class MyWidget : public QWidget
{
public:
MyWidget(QWidget *parent = 0);
public slots:
void print();
};
void MyWidget:: print()
{
QMessageBox::information(this, "Some window label here", "hello");
}
MyWidget::MyWidget(QWidget *parent)
: QWidget(parent)
{
setFixedSize(200, 120);
QPushButton *b = new QPushButton(tr("QT"), this);[/B]
quit->setGeometry(62, 40, 75, 30);
connect(b, SIGNAL(clicked()), this, SLOT(print()));[/B]
}
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