comparison src/folderselectdialog.cpp @ 86:a32406f8832f

Fix resize to contents in folderselection
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 18 Jun 2015 19:35:07 +0200
parents 90c297a2a3dd
children 3916cb3c9105
comparison
equal deleted inserted replaced
85:6fa321b3dfe7 86:a32406f8832f
119 base->addWidget(mFilterWidget); 119 base->addWidget(mFilterWidget);
120 120
121 mView = new QTableView; 121 mView = new QTableView;
122 mView->setModel(mSortModel); 122 mView->setModel(mSortModel);
123 123
124 mView->resizeColumnsToContents();
125 mView->setSelectionBehavior(QAbstractItemView::SelectRows); 124 mView->setSelectionBehavior(QAbstractItemView::SelectRows);
126 mView->setSelectionMode(QAbstractItemView::SingleSelection); 125 mView->setSelectionMode(QAbstractItemView::SingleSelection);
127 mView->setSortingEnabled(true); 126 mView->setSortingEnabled(true);
128 mView->setEditTriggers(QAbstractItemView::NoEditTriggers); 127 mView->setEditTriggers(QAbstractItemView::NoEditTriggers);
129 connect(mView->selectionModel(), &QItemSelectionModel::selectionChanged, 128 connect(mView->selectionModel(), &QItemSelectionModel::selectionChanged,
210 if (!errors.isEmpty()) { 209 if (!errors.isEmpty()) {
211 QString errMsg = tr("The following folders did not match the pattern: %1").arg(mFolderPattern); 210 QString errMsg = tr("The following folders did not match the pattern: %1").arg(mFolderPattern);
212 errMsg += "\n" + errors.join("\n"); 211 errMsg += "\n" + errors.join("\n");
213 QMessageBox::warning(this, tr("Failed to parse some folders."), errMsg); 212 QMessageBox::warning(this, tr("Failed to parse some folders."), errMsg);
214 } 213 }
214 mView->resizeColumnsToContents();
215 } 215 }
216 216
217 void FolderSelectDialog::wantToAccept() { 217 void FolderSelectDialog::wantToAccept() {
218 QItemSelectionModel *selection = mView->selectionModel(); 218 QItemSelectionModel *selection = mView->selectionModel();
219 QModelIndexList selected = selection->selectedIndexes(); 219 QModelIndexList selected = selection->selectedIndexes();
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)