1 #include "QnetNewMeasureDialog.h"
27 m_qnetTool = qnetTool;
29 QLabel *listLabel =
new QLabel(
"Select Files:");
31 m_fileList =
new QListWidget;
32 m_fileList->setSelectionMode(QAbstractItemView::ExtendedSelection);
35 m_okButton =
new QPushButton(
"OK");
37 QPushButton *cancelButton =
new QPushButton(
"Cancel");
38 QHBoxLayout *buttonLayout =
new QHBoxLayout;
39 buttonLayout->addWidget(m_okButton);
40 buttonLayout->addWidget(cancelButton);
42 connect(m_okButton, SIGNAL(clicked()),
this, SLOT(accept()));
43 connect(cancelButton, SIGNAL(clicked()),
this, SLOT(reject()));
45 QVBoxLayout *vLayout =
new QVBoxLayout;
46 vLayout->addWidget(listLabel);
47 vLayout->addWidget(m_fileList);
48 vLayout->addLayout(buttonLayout);
51 setWindowTitle(
"Add Measures to ControlPoint");
65 int bottomMostSelectedItemIndex = 0;
69 for (
int i = 0; i < snList->
size(); i++) {
78 QListWidgetItem *item =
new QListWidgetItem(label);
83 if (pointFiles.contains(label)) {
84 m_fileList->insertItem(bottomMostSelectedItemIndex++, item);
85 item->setSelected(
true);
88 m_fileList->addItem(item);
94 QStringList QnetNewMeasureDialog::selectedFiles()
const {
97 foreach (QListWidgetItem *fileItem, m_fileList->selectedItems()) {
98 result.append(fileItem->text());
105 void QnetNewMeasureDialog::enableOkButton(
const QString &text) {
106 m_okButton->setEnabled(!text.isEmpty());