사용자 도구

사이트 도구


qt:helloworld

문서의 이전 판입니다!


"Hello, World!" in Qt

main.cpp
#include <QCoreApplication>
#include <QTimer>
#include "signal_emitter.h"
 
int main(int argc, char *argv[])
{
  QCoreApplication app(argc, argv);
 
  // emitter is now a child of core application app.
  // app will delete emitter.
  signal_emitter *emitter = new signal_emitter(&app);
 
  // when emitter emits 'finished' signal, app will be terminated.
  QObject::connect(emitter, SIGNAL(finished()), &app, SLOT(quit()));
 
  // we emit initial 'launch()'.
  QTimer::singleShot(0, emitter, SLOT(launch()));
 
  return app.exec();
}
qt/helloworld.1392762118.txt.gz · 마지막으로 수정됨: 2014/10/09 21:23 (바깥 편집)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki