summaryrefslogtreecommitdiffstats
path: root/examples/dialogs/findfiles/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/dialogs/findfiles/window.cpp')
-rw-r--r--examples/dialogs/findfiles/window.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/examples/dialogs/findfiles/window.cpp b/examples/dialogs/findfiles/window.cpp
index 3d6c0fd398..f700e82d5e 100644
--- a/examples/dialogs/findfiles/window.cpp
+++ b/examples/dialogs/findfiles/window.cpp
@@ -44,7 +44,7 @@
//! [0]
Window::Window(QWidget *parent)
- : QDialog(parent)
+ : QWidget(parent)
{
browseButton = createButton(tr("&Browse..."), SLOT(browse()));
findButton = createButton(tr("&Find"), SLOT(find()));
@@ -62,11 +62,8 @@ Window::Window(QWidget *parent)
//! [0]
//! [1]
- QHBoxLayout *buttonsLayout = new QHBoxLayout;
- buttonsLayout->addStretch();
- buttonsLayout->addWidget(findButton);
-
QGridLayout *mainLayout = new QGridLayout;
+ mainLayout->setSizeConstraint(QLayout::SetNoConstraint);
mainLayout->addWidget(fileLabel, 0, 0);
mainLayout->addWidget(fileComboBox, 0, 1, 1, 2);
mainLayout->addWidget(textLabel, 1, 0);
@@ -75,12 +72,14 @@ Window::Window(QWidget *parent)
mainLayout->addWidget(directoryComboBox, 2, 1);
mainLayout->addWidget(browseButton, 2, 2);
mainLayout->addWidget(filesTable, 3, 0, 1, 3);
- mainLayout->addWidget(filesFoundLabel, 4, 0, 1, 3);
- mainLayout->addLayout(buttonsLayout, 5, 0, 1, 3);
+ mainLayout->addWidget(filesFoundLabel, 4, 0, 1, 2);
+ mainLayout->addWidget(findButton, 4, 2);
setLayout(mainLayout);
setWindowTitle(tr("Find Files"));
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR)
resize(700, 300);
+#endif
}
//! [1]
@@ -194,7 +193,12 @@ void Window::showFiles(const QStringList &files)
filesTable->setItem(row, 1, sizeItem);
}
filesFoundLabel->setText(tr("%1 file(s) found").arg(files.size()) +
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5)
+ (" (Select file to open it)"));
+#else
(" (Double click on a file to open it)"));
+#endif
+ filesFoundLabel->setWordWrap(true);
}
//! [8]
@@ -214,6 +218,9 @@ QComboBox *Window::createComboBox(const QString &text)
comboBox->setEditable(true);
comboBox->addItem(text);
comboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ comboBox->setMinimumContentsLength(3);
+#endif
return comboBox;
}
//! [10]
@@ -225,7 +232,7 @@ void Window::createFilesTable()
filesTable->setSelectionBehavior(QAbstractItemView::SelectRows);
QStringList labels;
- labels << tr("File Name") << tr("Size");
+ labels << tr("Filename") << tr("Size");
filesTable->setHorizontalHeaderLabels(labels);
filesTable->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
filesTable->verticalHeader()->hide();