#include<QApplication>
#include<QFont>
#include<QPushButton>
{
public:
{
// p is a child widget of calling widget
// p.setFont(QFont("Times",80,QFont::Bold));
//p.setGeometry(62,40,75,30);
//since it does not know abt qapp object we connect it to QApp pointer
connect( &p, SIGNAL(clicked()), qApp, SLOT(quit()) );
//QLabel l("Hello");
p.show();
}
};
int main(int argc,char *argv[])
{
quitwidget q(&w);
//q.setGeometry( 100, 100, 200, 120 );
w.show();
return a.exec();
}
#include<QApplication>
#include<QFont>
#include<QPushButton>
class quitwidget:public QWidget
{
public:
quitwidget(QWidget *parent=0):QWidget(parent)
{
QPushButton p("hey",this);
// p is a child widget of calling widget
// p.setFont(QFont("Times",80,QFont::Bold));
//p.setGeometry(62,40,75,30);
//since it does not know abt qapp object we connect it to QApp pointer
connect( &p, SIGNAL(clicked()), qApp, SLOT(quit()) );
//QLabel l("Hello");
p.show();
}
};
int main(int argc,char *argv[])
{
QApplication a( argc, argv );
QWidget w;
quitwidget q(&w);
//q.setGeometry( 100, 100, 200, 120 );
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
3.any way to host qt applications online?
Bookmarks