summaryrefslogtreecommitdiffstats
path: root/examples/sql/drilldown
diff options
context:
space:
mode:
Diffstat (limited to 'examples/sql/drilldown')
-rw-r--r--examples/sql/drilldown/informationwindow.cpp26
-rw-r--r--examples/sql/drilldown/view.cpp8
2 files changed, 15 insertions, 19 deletions
diff --git a/examples/sql/drilldown/informationwindow.cpp b/examples/sql/drilldown/informationwindow.cpp
index 08fe2ac..a440aad 100644
--- a/examples/sql/drilldown/informationwindow.cpp
+++ b/examples/sql/drilldown/informationwindow.cpp
@@ -83,16 +83,15 @@ InformationWindow::InformationWindow(int id, QSqlRelationalTableModel *offices,
connect(imageFileEditor, SIGNAL(currentIndexChanged(int)),
this, SLOT(enableButtons()));
- QGridLayout *layout = new QGridLayout;
- layout->addWidget(locationLabel, 0, 0, Qt::AlignLeft | Qt::AlignTop);
- layout->addWidget(countryLabel, 1, 0, Qt::AlignLeft | Qt::AlignTop);
- layout->addWidget(imageFileLabel, 2, 0, Qt::AlignLeft | Qt::AlignTop);
- layout->addWidget(descriptionLabel, 3, 0, Qt::AlignLeft | Qt::AlignTop);
- layout->addWidget(locationText, 0, 1);
- layout->addWidget(countryText, 1, 1);
- layout->addWidget(imageFileEditor, 2, 1);
- layout->addWidget(descriptionEditor, 3, 1);
- layout->addWidget(buttonBox, 4, 0, 1, 2);
+ QFormLayout *formLayout = new QFormLayout;
+ formLayout->addRow(locationLabel, locationText);
+ formLayout->addRow(countryLabel, countryText);
+ formLayout->addRow(imageFileLabel, imageFileEditor);
+ formLayout->addRow(descriptionLabel, descriptionEditor);
+
+ QVBoxLayout *layout = new QVBoxLayout;
+ layout->addLayout(formLayout);
+ layout->addWidget(buttonBox);
setLayout(layout);
locationId = id;
@@ -101,9 +100,6 @@ InformationWindow::InformationWindow(int id, QSqlRelationalTableModel *offices,
setWindowFlags(Qt::Window);
enableButtons(false);
setWindowTitle(tr("Office: %1").arg(locationText->text()));
-#ifndef Q_OS_SYMBIAN
- resize(320, sizeHint().height());
-#endif
}
//! [4]
@@ -154,8 +150,8 @@ void InformationWindow::createButtons()
//! [8]
//! [9]
- buttonBox = new QDialogButtonBox;
- buttonBox->addButton(submitButton, QDialogButtonBox::ResetRole);
+ buttonBox = new QDialogButtonBox(this);
+ buttonBox->addButton(submitButton, QDialogButtonBox::AcceptRole);
buttonBox->addButton(revertButton, QDialogButtonBox::ResetRole);
buttonBox->addButton(closeButton, QDialogButtonBox::RejectRole);
}
diff --git a/examples/sql/drilldown/view.cpp b/examples/sql/drilldown/view.cpp
index ff4c511..da29198 100644
--- a/examples/sql/drilldown/view.cpp
+++ b/examples/sql/drilldown/view.cpp
@@ -134,20 +134,20 @@ void View::showInformation(ImageItem *image)
#ifndef Q_OS_SYMBIAN
window->show();
#else
- window->showFullScreen();
+ window->showMaximized();
#endif
} else {
InformationWindow *window;
window = new InformationWindow(id, officeTable, this);
- connect(window, SIGNAL(imageChanged(int, QString)),
- this, SLOT(updateImage(int, QString)));
+ connect(window, SIGNAL(imageChanged(int,QString)),
+ this, SLOT(updateImage(int,QString)));
#ifndef Q_OS_SYMBIAN
window->move(pos() + QPoint(20, 40));
window->show();
#else
- window->showFullScreen();
+ window->showMaximized();
#endif
informationWindows.append(window);
}