Copyright 2010 Comarch S.A.
*******************************************************************************/
-
/*!
- \file XdxfDictSelectDialog.cpp
- \author Mateusz Półrola <mateusz.polrola@comarch.com>
- */
+ \file XdxfDictSelectDialog.cpp
+ \author Mateusz Półrola <mateusz.polrola@comarch.com>
+*/
#include "XdxfDictSelectDialog.h"
XdxfDictSelectDialog::XdxfDictSelectDialog(QList<DownloadDict> dicts,
QWidget *parent) :
- QDialog(parent) {
-
-
+ QDialog(parent) {
setWindowTitle(tr("Select dictionary"));
layout = new QVBoxLayout;
proxyModel->setDynamicSortFilter(true);
proxyModel->setSourceModel(model);
-
treeView = new QTreeView;
treeView->setModel(proxyModel);
treeView->setRootIsDecorated(false);
treeView->setColumnWidth(3, 150);
#endif
-
layout->addWidget(treeView);
-
connect(langFrom, SIGNAL(currentIndexChanged(int)),
this, SLOT(refreshDictList()));
void XdxfDictSelectDialog::initializeDicts() {
-
//scan of all languages of dictionaries, using QSet to get only distinct languages
QSet<QString> languagesFrom;
QSet<QString> languagesTo;
}
}
+
void XdxfDictSelectDialog::refreshDictList() {
//if selected language is "Any"(index 0), from filter string is set to empty string, proxy model uses empty string as special case and don't filter by this field.
if(langTo->currentIndex() == 0)
proxyModel->setFrom(langFrom->currentText());
}
+
void XdxfDictSelectDialog::itemClicked(QModelIndex index) {
_link = index.model()->data(index, Qt::UserRole).toString();
accept();