#include <QApplication>
#include <QFont>
#include <QPushButton>
#include <QWidget>
#include <QMessageBox>
{
Q_OBJECT
public:
~MyWidget();
{
delete btn;
}
public slots:
void test()
{
QMessageBox::information(this,
"mesaj",
"merhaba dunya");
}
};
{
setFixedSize(150,100);
btn->setGeometry(50,30,50,30);
connect(btn,SIGNAL(clicked()),this,SIGNAL(test()));
}
MyWidget::~MyWidget()
{
delete btn;
}
int main(int argc, char *argv[])
{
MyWidget widget;
widget.show();
return app.exec();
}
#include <QApplication>
#include <QFont>
#include <QPushButton>
#include <QWidget>
#include <QMessageBox>
class MyWidget : public QWidget
{
Q_OBJECT
public:
QPushButton *btn;
MyWidget(QWidget *parent = 0);
~MyWidget();
{
delete btn;
}
public slots:
void test()
{
QMessageBox::information(this, "mesaj", "merhaba dunya");
}
};
MyWidget::MyWidget(QWidget *parent ): QWidget(parent)
{
setFixedSize(150,100);
btn = new QPushButton("tikla", this);
btn->setGeometry(50,30,50,30);
connect(btn,SIGNAL(clicked()),this,SIGNAL(test()));
}
MyWidget::~MyWidget()
{
delete btn;
}
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