#include <QApplication>
#include <QFont>
#include <QPushButton>
#include <QWidget>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
//단순한 widget객체를 만든다. QWidget 클래스는 사용자 인터페이스의 기초클래스이다.
//윈도우 시스템으로 부터 마우스, 키보드 등의 이벤트들을 받고 화면상에 있는 객체를 나타낸다.
QWidget window;
window.resize(200, 120);
//버튼이 부모윈도우(window)에 만들어졌다. 이 버튼은 항상 부모윈도우 영역에 나타난다.
QPushButton quit("Quit", &window);
quit.setFont(QFont("Times", 18, QFont::Bold));
//setGeometry() 함수의 첫번째 두번째 아규먼트는 버튼의 top-left의 x, y 좌표이다
//마지막 두개는 길이와 높이이다.
quit.setGeometry(10, 40, 180, 40);
QObject::connect(&quit, SIGNAL(clicked()), &app, SLOT(quit()));
window.show();
return app.exec();
}
by Redef( http://www.redef.pe.kr )
댓글을 달아 주세요