dialog.cpp Example File widgets/wiggly/dialog.cpp
#include <QtGui>
#include "dialog.h"
#include "wigglywidget.h"
Dialog::Dialog(QWidget *parent, bool smallScreen)
: QDialog(parent)
{
WigglyWidget *wigglyWidget = new WigglyWidget;
QLineEdit *lineEdit = new QLineEdit;
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(wigglyWidget);
layout->addWidget(lineEdit);
setLayout(layout);
connect(lineEdit, SIGNAL(textChanged(QString)),
wigglyWidget, SLOT(setText(QString)));
if (!smallScreen){
lineEdit->setText(tr("Hello world!"));
}
else{
lineEdit->setText(tr("Hello!"));
}
setWindowTitle(tr("Wiggly"));
resize(360, 145);
}
Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) |
Trademarks |
Qt 4.6.0 |
|