#include <qapplication.h>
#include <qmainwindow.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qstring.h>
#include <qvbox.h>
#include <qhbox.h>
#include <qtextcodec.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
int
main (int argc, char *argv[])
{
QApplication application (argc, argv);
#if 0
GettextTranslator *translator =
new GettextTranslator (&application, "hello-c++-qt", LOCALEDIR);
#else
QTranslator *translator = new QTranslator (NULL);
translator->load (QString ("hello-c++-qt") + "_" + QTextCodec::locale(),
PKGLOCALEDIR);
#endif
application.installTranslator (translator);
#define _(string) application.translate ("", string)
QMainWindow *window = new QMainWindow ();
window->setCaption ("Hello example");
QVBox *panel = new QVBox (window);
panel->setSpacing (2);
QLabel *label1 = new QLabel (_("Hello, world!"), panel);
QString label2text;
label2text = _("This program is running as process number %1.").arg(getpid ());
QLabel *label2 = new QLabel (label2text, panel);
QHBox *buttonbar = new QHBox (panel);
QWidget *filler = new QWidget (buttonbar); QPushButton *button = new QPushButton ("OK", buttonbar);
button->setMaximumWidth (button->sizeHint().width() + 20);
QObject::connect (button, SIGNAL (clicked ()), &application, SLOT (quit ()));
panel->resize (panel->sizeHint ());
window->resize (panel->frameSize ());
application.setMainWidget (window);
window->show ();
return application.exec ();
}