rendered paste body#include <QApplication>
#include <QPushButton>
#include <QLineEdit>
#include <QHBoxLayout>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QWidget *window = new QWidget;
window->setWindowTitle("Test");
QPushButton *quit = new QPushButton("Quitter");
quit->setFont(QFont("Arial", 18, QFont::Bold));
QPushButton *clean = new QPushButton("Effacer");
clean->setFont(QFont("Arial", 18, QFont::Bold));
QLineEdit *line = new QLineEdit;
QLineEdit *lineRo = new QLineEdit;
lineRo->setReadOnly(true);
// FIXME: Broken for the moment
//QObject::connect( line, SIGNAL(textChanged ( const QString & text )),
// lineRo, SLOT(textEdited ( setText ( const QString & ) )));
QObject::connect( clean, SIGNAL(clicked()), line, SLOT(clear ()));
QObject::connect( quit, SIGNAL(clicked()), &app, SLOT(quit()));
QHBoxLayout *topLayout = new QHBoxLayout;
topLayout->addWidget(line);
topLayout->addWidget(lineRo);
QHBoxLayout *bottomLayout = new QHBoxLayout;
bottomLayout->addWidget(clean);
bottomLayout->addWidget(quit);
QHBoxLayout *mainLayout = new QHBoxLayout;
mainLayout->addWidget(topLayout);
mainLayout->addWidget(bottomLayout);
window->setLayout(mainLayout);
window->show();
return app.exec();
}