# cd /qtwork/
# mkdir Hello_World
# cd Hello_World
# $QTDIR
# source /work/qtx/qtx_env
# designer //Designer 실행
# uic hello_world.ui > ui_hello_world.h
# vi hello_world.h
#ifndef __HELLODLG_H__
#define __HEELLODLG_H__
#include <QDialog>
#include "ui_hello_world.h"
class QPushButton;
class QTextBrowser;
class Hello_World : public QDialog
{
#define __HEELLODLG_H__
#include <QDialog>
#include "ui_hello_world.h"
class QPushButton;
class QTextBrowser;
class Hello_World : public QDialog
{
Q_OBJECT
public:
Hello_World();
public slots:
void pb_ok_clicked();
private:
Ui::Hello_World ui;
};
#endif
#endif
# vi hello_world.cpp
#include <QPushButton>
#include <QTextBrowser>
#include "hello_world.h"
Hello_World::Hello_World()
{
#include <QTextBrowser>
#include "hello_world.h"
Hello_World::Hello_World()
{
ui.setupUi(this);
connect(ui.pb_ok, SIGNAL(clicked()), this, SLOT(pb_ok_clicked()));
connect(ui.pb_ok, SIGNAL(clicked()), this, SLOT(pb_ok_clicked()));
}
void Hello_World::pb_ok_clicked()
{
void Hello_World::pb_ok_clicked()
{
printf("test\n");
ui.le_output->insert("Hello_World");
ui.le_output->insert("Hello_World");
}
# vi main.cpp
#include <QApplication>
#include "hello_world.h"
int main(int argc, char **argv)
{
#include "hello_world.h"
int main(int argc, char **argv)
{
QApplication app(argc, argv);
Hello_World dlg;
dlg.show();
return app.exec();
Hello_World dlg;
dlg.show();
return app.exec();
}
# qmake -project
# qmake
# make
# ./hello_world
'Education > QT programming' 카테고리의 다른 글
madplayer (4) | 2009.11.04 |
---|---|
mount (7) | 2009.11.03 |
Signal 과 Slot 예제 (0) | 2009.09.04 |