Δημοσιεύτηκε: 09 Αύγ 2009, 14:16
- Κώδικας: Επιλογή όλων
#include <QtGui>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QWidget *window = new QWidget();
QVBoxLayout *layout = new QVBoxLayout();
QLabel *label = new QLabel(tr("The label here !!!"));
QLineEdit *edit = new QLineEdit(tr("Lets wright something"));
QPushButton *button = new QPushButton(tr("&close"));
connect(button, SIGNAL(clicked()), &app, SLOT(quit()));
layout->addWidget(label);
layout->addWidget(button);
layout->addWidget(edit);
window->setLayout(layout);
window->show();
return app.exec();
}
Με μια πρώτη προσέγγιση ... χωρίς να εισάγω καινούριες έννοιες.