QT_END_NAMESPACE Priorities::Priorities(QWidget *parent /* = 0 */): DictionaryTemplate(parent) , actualRecords(true) { m_model = new QStandardItemModel(this); m_proxymodel = new QSortFilterProxyModel(this); m_proxymodel->setSourceModel(m_model); m_proxymodel->setFilterKeyColumn(1); m_proxymodel->setFilterCaseSensitivity(Qt::CaseInsensitive); m_selectionModel = new QItemSelectionModel(m_proxymodel); treeView->setRootIsDecorated(false); treeView->setAlternatingRowColors(true); treeView->setModel(m_proxymodel); treeView->setSelectionModel(m_selectionModel); ui->m_lblCurrentUser->setText(QString("Пользователь: <b><u>" + currentUser() + "</u></b>")); dictionaryDialog->ui->comboBoxIcon->addItem(QIcon("data/picture/additionally/red.ico"), "Высокий"); dictionaryDialog->ui->comboBoxIcon->addItem(QIcon("data/picture/additionally/yellow.ico"), "Средний"); dictionaryDialog->ui->comboBoxIcon->addItem(QIcon("data/picture/additionally/green.ico"), "Низкий"); connect(this, SIGNAL(pushSelectRecordData()), SLOT(slotPushSelectRecordData())); connect(lineEditSearchToItem, SIGNAL(textEdited(QString)), m_proxymodel, SLOT(setFilterWildcard(QString))); connect(getClearButton(), SIGNAL(clicked()), SLOT(slotClearSearchToItem())); connect(dictionaryDialog, SIGNAL(saveDataChanged()), this, SLOT(slotInsertOrUpdateRecords())); connect(m_selectionModel, SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), this, SLOT(slotDataChanged(QModelIndex))); connect(treeView, SIGNAL(clicked(QModelIndex)), this, SLOT(slotDataChanged(QModelIndex))); connect(this, SIGNAL(selectionModelIndex(QModelIndex)), SLOT(slotGetSelectionModel(QModelIndex))); slotSelectRecords(actualRecords); }
QT_END_NAMESPACE CTaskType::CTaskType(QWidget *parent /* = 0 */): CCppsst(parent) , actualRecords(false) { // model modelTask = new QStandardItemModel(this); modelSelectionTask = new QItemSelectionModel(modelTask); treeCppsst->setRootIsDecorated(false); treeCppsst->setAlternatingRowColors(true); treeCppsst->setModel(modelTask); treeCppsst->setSelectionModel(modelSelectionTask); treeCppsst->installEventFilter(this); modelTask->insertColumns(0, TASK_MODEL_COLUMN_COUNT); modelTask->setHeaderData(1, Qt::Horizontal, QObject::tr("Наименование")); QVector<int> storage; storage.append(0); storage.append(2); CDictionaryCore::columnHidden(treeCppsst, modelTask, storage); storage.clear(); ui->labelCurrentUser->setText(QString("Пользователь: <b><u>" + currentUser() + "</u></b>")); connect(cppsstDialog, SIGNAL(saveDataChanged(QList<QString>)), this, SLOT(slotInsertOrUpdateRecords(QList<QString>))); connect(this, SIGNAL(enabledComboBox(bool)), cppsstDialog, SLOT(slotEnabledComboBox(bool))); connect(filter, SIGNAL(textChanged(QString)), SLOT(slotFindTask(QString))); slotFillTask(); actualRecords ? ui->labelViewState->setText(QString(tr("Отображаются записи: <b><u>Актуальные</u></b>"))) : ui->labelViewState->setText(QString(tr("Отображаются записи: <b><u>Все</u></b>"))); }