#if QT_VERSION >= 0x050000 #include #else #include #endif int main(int argc, char *argv[]) { QApplication a(argc, argv); QWidget *w = new QWidget; QLineEdit *l = new QLineEdit("", w); l->setPlaceholderText("type here"); QPushButton *b = new QPushButton("Ok", w); QVBoxLayout *o = new QVBoxLayout(w); o->addWidget(l); o->addWidget(b); w->setLayout(o); w->show(); return a.exec(); }