示例#1
0
void CTaskType::slotFindTask(const QString &text)
{
    QList<QVariant> list;
    QSqlQuery       stored;

#ifndef QT_NO_CURSOR
        QApplication::setOverrideCursor(QCursor(QPixmap("data/picture/additionally/wait.png")));
#endif

        list.append((int)actualRecords);
        list.append(text);
        stored.setForwardOnly(true);
        stored = execStored(currentDatabase(), "FindTaskType", storageHashTable(list));

        bool empty(false);
        while (stored.next()){
            empty = true;
        }

        stored = execStored(currentDatabase(), "FindTaskType", storageHashTable(list));

        if (empty) {
            fillTaskModel(stored);
        }

#ifndef QT_NO_CURSOR
        QApplication::restoreOverrideCursor();
#endif
        stored.finish();
}
示例#2
0
void CTaskType::slotDeleteRecords(void)
{
    QList<QVariant> list;
    QSqlQuery       stored;

    if (currentDatabase().isOpen()) {

        int code = modelSelectionTask->currentIndex().sibling(modelSelectionTask->currentIndex().row(), 0).data().toUInt();

        if (!modelSelectionTask->selection().isEmpty()) {
            CMessage answer(this, "Удаление", "Подтверждаете удаление?");
            QPushButton *_delete = answer.addButton(QString("Удалить"), QMessageBox::ActionRole);
            QPushButton *cancel = answer.addButton(QString("Отмена"),  QMessageBox::ActionRole);

            answer.exec();

            if (answer.clickedButton() == _delete){
                list.append((int)code);
                stored.setForwardOnly(true);
                stored = execStored(currentDatabase(), "DeleteTaskType", storageHashTable(list));
                stored.finish();

                slotRefreshRecords(); // refresh

            } else if (answer.clickedButton() == cancel){
                treeCppsst->clearSelection();
                answer.reject();
            }
        } else
            CCommunicate::showing(QString("Не удается выполнить, запись не выбрана"));
    } else
        CCommunicate::showing(QString("Не удается выполнить, база данных не доступна"));

}
示例#3
0
void Priorities::slotInsertOrUpdateRecords(void)
{
    QList<QVariant> list;
    QSqlQuery       stored;

    if (m_rad == RecordActionDatabase::ardInsert){
        list.append(dictionaryDialog->ui->lineEditItem->text());
        list.append((int)dictionaryDialog->ui->checkBoxActual->isChecked());
        list.append((int)(dictionaryDialog->ui->comboBoxIcon->currentIndex()));
        stored = execStored(currentDatabase(), "InsertPriorityType", storageHashTable(list));
        stored.finish();
    }
    else
    if (m_rad == RecordActionDatabase::ardUpdate){
        unsigned i(0);
        unsigned m_code = m_selectionModel->currentIndex().sibling(m_selectionModel->currentIndex().row(), i).data(Qt::DisplayRole).toUInt();

        list.append(m_code);
        list.append(dictionaryDialog->ui->lineEditItem->text());
        list.append((int)(dictionaryDialog->ui->checkBoxActual->isChecked()));
        list.append((int)(dictionaryDialog->ui->comboBoxIcon->currentIndex()));
        stored = execStored(currentDatabase(), "UpdatePriorityType", storageHashTable(list));
        stored.finish();
   }
   slotRefreshRecords();
   clearEditDialog(dictionaryDialog);
   m_selectedItem = false;
}
示例#4
0
void Positions::slotPushSelectRecordData(void)
{
    QList<QVariant> list;
    QSqlQuery       stored;
    QString         userName;

    if (m_rad == RecordActionDatabase::ardInsert) {
        dictionaryDialog->ui->labelUserD->setText(currentUser());
        dictionaryDialog->ui->labelDateD->setText(QString(tr("Не определено")).trimmed());
    }
    else if (m_rad == RecordActionDatabase::ardUpdate) {
        unsigned i(1);
        QString m_item = m_selectionModel->currentIndex().sibling(m_selectionModel->currentIndex().row(), i).data(Qt::DisplayRole).toString();
        dictionaryDialog->setWindowTitle(QString(dictionaryDialog->windowTitle() + " запись - [ %1 ]").arg(m_item));
        dictionaryDialog->ui->lineEditItem->setText(QString(m_item).trimmed());

        unsigned c(2);
        unsigned m_check = m_selectionModel->currentIndex().sibling(m_selectionModel->currentIndex().row(), c).data(Qt::DisplayRole).toUInt();
        dictionaryDialog->ui->checkBoxActual->setChecked((bool)m_check);

        unsigned u(3);
        unsigned m_muser = m_selectionModel->currentIndex().sibling(m_selectionModel->currentIndex().row(), u).data(Qt::DisplayRole).toUInt();
        list.append(m_muser);
        stored = execStored(currentDatabase(), "ReadCurrentUser", storageHashTable(list));
        while (stored.next()) {
            userName = stored.record().field("opt_name_first").value().toString();
        }
        dictionaryDialog->ui->labelUserD->setText(userName);
        stored.finish();

        unsigned d(4);
        QString m_mdate = m_selectionModel->currentIndex().sibling(m_selectionModel->currentIndex().row(), d).data(Qt::DisplayRole).toString();
        dictionaryDialog->ui->labelDateD->setText(m_mdate);
    }
}
示例#5
0
void Priorities::slotRefreshRecords()
{
    QList<QVariant> list;
    QSqlQuery       stored;

#ifndef QT_NO_CURSOR
    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
#endif
    list.append(!actualRecords);
    stored = execStored(currentDatabase(), "ReadAllPriorityType", storageHashTable(list));

    fillingModel(stored);
    m_model->setHeaderData(1, Qt::Horizontal, QObject::tr("Наименование"));
    m_model->setHeaderData(6, Qt::Horizontal, QObject::tr("Иконка"));

    for (int i = 0; i != m_model->columnCount(); ++i){
        if (i == 1 || i == 6) {
            continue;
        } else {
            treeView->setColumnHidden(i, true);
        }
    }
#ifndef QT_NO_CURSOR
    QApplication::restoreOverrideCursor();
#endif
    stored.finish();
}
示例#6
0
void Priorities::slotSelectRecords(bool actual)
{
    QList<QVariant> list;
    QSqlQuery       stored;

#ifndef QT_NO_CURSOR
    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
#endif
    list.append((int)actual);
    stored = this->execStored(currentDatabase(), "ReadAllPriorityType", storageHashTable(list));

    fillingModel(stored);
    m_model->setHeaderData(1, Qt::Horizontal, QObject::tr("Наименование"));
    m_model->setHeaderData(6, Qt::Horizontal, QObject::tr("Иконка"));

    for (int i = 0; i != m_model->columnCount(); ++i){
        if (i == 1 || i == 6) {
            continue;
        } else {
            treeView->setColumnHidden(i, true);
        }
    }
#ifndef QT_NO_CURSOR
    QApplication::restoreOverrideCursor();
#endif
    stored.finish();

    actual ? ui->m_lblViewState->setText(QString(tr("Отображаются записи: <b><u>Актуальные</u></b>")))
           :
             ui->m_lblViewState->setText(QString(tr("Отображаются записи: <b><u>Все</u></b>")));
    m_selectedItem = false;
    actualRecords = !actualRecords;
}
示例#7
0
void CCustomer::slotFillPartner(const QModelIndex &index)
{
    QList<QVariant> list;
    QSqlQuery       stored;

    if (index.sibling(index.row(), 3).data().toString() == nullptr && root->index() != index){

#ifndef QT_NO_CURSOR
        QApplication::setOverrideCursor(QCursor(QPixmap("data/picture/additionally/wait.png")));
#endif

        list.append((int)index.sibling(index.row(), 1).data().toInt());
        stored.setForwardOnly(true);
        stored = execStored(currentDatabase(), "ReadOneCustomer", storageHashTable(list));

        fillPartnerModel(stored);

#ifndef QT_NO_CURSOR
        QApplication::restoreOverrideCursor();
#endif
        stored.finish();
    } else {
        modelPartner->removeRows(0, modelPartner->rowCount(QModelIndex()), QModelIndex());
        textEditPartnerComment->clear();
    }
}
示例#8
0
void CCustomer::slotCutRecords()
{
    if (currentDatabase().isOpen()) {

        if IS_VALID_PTR(focusedWidget){

            if (focusedWidget->objectName() == treeFaces->objectName()){
                if (modelSelectionFaces->currentIndex() == root->index()){
                    CCommunicate::showing(QString("Не удается выполнить, заказчик не выбран"));
                    return;
                }
            }

            if (focusedWidget->objectName() == treeFaces->objectName()){
                if (!modelSelectionFaces->selection().isEmpty() &&
                    modelSelectionFaces->currentIndex().sibling(modelSelectionFaces->currentIndex().row(), 3).data().toString() != nullptr){
                    CCommunicate::showing(QString("Не удается выполнить, запрещено перемещение группы заказчиков"));
                    return;
                }
            }

            if ((focusedWidget->objectName() == treeFaces->objectName())) {
                mc.idCustomer   =
                        modelSelectionFaces->currentIndex().sibling(modelSelectionFaces->currentIndex().row(), 1).data().toInt();
                mc.nameCustomer =
                        modelSelectionFaces->currentIndex().sibling(modelSelectionFaces->currentIndex().row(), 0).data().toString();
            } else {
                mc.idCustomer    =  -1;
                mc.nameCustomer  =  "";
            }
        } else
            CCommunicate::showing(QString("Не удается выполнить, заказчик не выбран"));
    } else
示例#9
0
void CTaskType::slotCreateEditDialog(const QString &action)
{
    if (currentDatabase().isOpen()) {

        QString::compare(action, "add") == 0 ? act = Action::Add : act = Action::Edit;

        cppsstDialog->setWindowTitle(QString("Задача"));

        emit enabledComboBox(false);

        if (treeCppsst == focusWidget()){
            if (act == Action::Add){

                QList<QString> param;
                if (fillListSelectedRecord(param)){
                    cppsstDialog->fillFormSelectedRecord(param, act);
                    cppsstDialog->show();
                }
            } else if (act == Action::Edit){
                if (!modelSelectionTask->selection().isEmpty()){

                    QList<QString> param;
                    if (fillListSelectedRecord(param)){
                        cppsstDialog->fillFormSelectedRecord(param, act);
                        cppsstDialog->show();
                    }
                } else
                    CCommunicate::showing(QString("Не удается выполнить, запись не выбрана"));
            }
        }else
           CCommunicate::showing(QString("Не удается выполнить, таблица/запись не выбрана"));
    } else
        CCommunicate::showing(QString("Не удается выполнить, база данных не доступна"));
}
示例#10
0
bool CTaskType::fillListSelectedRecord(QList<QString> &param)
{
    QList<QVariant> list;
    QSqlQuery       stored;

    if (act == Action::Add) {

        param.append(QString("%1").arg(-1));
        param.append("Нет данных");
        param.append("Нет данных");

    } else if (act == Action::Edit) {

        const int code = modelSelectionTask->currentIndex().sibling(modelSelectionTask->currentIndex().row(), 0).data().toUInt();

        list.append(code);
        stored.setForwardOnly(true);
        stored = execStored(currentDatabase(), "ReadOneTaskType", storageHashTable(list));

        bool empty(false);
        while (stored.next()){
            empty = true;
        }

        stored = execStored(currentDatabase(), "ReadOneTaskType", storageHashTable(list));

        if (empty) {
            while (stored.next()) {
                const QString name = stored.value(stored.record().indexOf("tt_name")).toString();
                const bool  actual = stored.value(stored.record().indexOf("tt_actual")).toBool();
                const QString user = stored.value(stored.record().indexOf("tt_muser")).toString();
                const QString date = stored.value(stored.record().indexOf("tt_mdate")).toDateTime().toString("yyyy-MM-dd hh:mm:ss");

                param.append(name);
                param.append(QString("%1").arg(-1));
                param.append(QVariant(actual).toString());
                param.append(user);
                param.append(date);
            }
        } else {
            CCommunicate::showing(QString("Не удается выполнить, документ либо его элемент был удален другим пользователем"));
            return false;
        }
    stored.finish();
    }
    return true;
}
示例#11
0
void CCustomer::slotFillGroup(const QModelIndex &index)
{
    QList<QVariant> list;
    QSqlQuery       stored;

#ifndef QT_NO_CURSOR
        QApplication::setOverrideCursor(QCursor(QPixmap("data/picture/additionally/wait.png")));
#endif

    if (modelFaces->hasChildren(index)){
        modelFaces->removeRows(0, modelFaces->rowCount(index), index);
    }

    list.append((int)GROUP_TYPE_CUSTOMER);
    list.append((int)actualRecords);
    list.append((int)SKIP); // parameter skip
    stored.setForwardOnly(true);
    stored = execStored(currentDatabase(), "ReadAllReferenceGroups", storageHashTable(list));

    fillFacesModel(index, stored);

    if (root->index() != index){
        if(list.size() > 0)
           list.clear();

        list.append((int)actualRecords);
        list.append((int)index.sibling(index.row(), 1).data(Qt::DisplayRole).toInt());
        list.append(QVariant::Invalid);
        list.append(QVariant::Invalid);
        list.append(QVariant::Invalid);
        list.append(QVariant::Invalid);
        stored.setForwardOnly(true);
        stored = execStored(currentDatabase(), "ReadAllCustomers", storageHashTable(list));

    fillFacesModel(index, stored);
    }

#ifndef QT_NO_CURSOR
        QApplication::restoreOverrideCursor();
#endif
    stored.finish();
}
示例#12
0
void TerraStat::empiricalBayesAction_activated()
{
	if (currentDatabase() && currentView() && currentLayer() && currentTheme() )
	{
		BayesWindow *bayes = new BayesWindow();
	  bayes->exec();
		  delete bayes;
	  return;
	}

	QString msg;
	if(currentDatabase() == 0)
		msg = tr("Select a database!");
	else if(currentLayer() == 0)
		msg = tr("Select a layer!");
	else if(currentView() == 0)
		msg = tr("Select a view!");
	else if(currentTheme()  == 0)
		msg = tr("Select a theme!");

	QMessageBox::warning(this, tr("Warning"), msg);
}
示例#13
0
void CTaskType::slotInsertOrUpdateRecords(const QList<QString> &param)
{
    QList<QVariant> list;
    QSqlQuery       stored;

    int code = modelSelectionTask->currentIndex().sibling(modelSelectionTask->currentIndex().row(), 0).data().toUInt();

    list.append(code);
    list.append(param.at(0));
    list.append(QVariant(param.at(2)).toBool());

    if (act == Action::Add) {
        list.removeAt(0);
        stored = execStored(currentDatabase(), "InsertTaskType", storageHashTable(list));
    }
    else if (act == Action::Edit) {
        stored = execStored(currentDatabase(), "UpdateTaskType", storageHashTable(list));
    }
    stored.finish();

    slotRefreshRecords();
    CDictionaryCore::clearEditDialog(cppsstDialog);
}
示例#14
0
CCustomer::~CCustomer()
{
// drop #temporary table
    QString query ("DROP TABLE #GroupCustomerDiscounts"
                   "DROP TABLE #CustomerSubdiller");
    QSqlQuery temporary(currentDatabase());
    temporary.exec(query);

    if (IS_VALID_PTR(focusedWidget))        { delete focusedWidget;            focusedWidget  = nullptr;   }

    if (IS_VALID_PTR(customerDialog))       { delete customerDialog;           customerDialog = nullptr;   }
    if (IS_VALID_PTR(discountDialog))       { delete discountDialog;           discountDialog = nullptr;   }
    if (IS_VALID_PTR(customer_gDialog))     { delete customer_gDialog;         customer_gDialog = nullptr; }

    if (IS_VALID_PTR(ui))                   { delete ui;                       ui             = nullptr;   }
}
示例#15
0
void Priorities::slotDeleteRecords(void)
{
    QList<QVariant> list;
    QSqlQuery       stored;
    QString         m_name;

    unsigned i(0);
    unsigned m_code = m_selectionModel->currentIndex().sibling(m_selectionModel->currentIndex().row(), i).data(Qt::DisplayRole).toUInt();

    if (m_selectionModel->currentIndex().column() != 1){
         m_name = m_selectionModel->currentIndex().sibling(m_selectionModel->currentIndex().row(), 1).data(Qt::DisplayRole).toString();
    } else {
         m_name = m_selectionModel->currentIndex().data(Qt::DisplayRole).toString();
    }

    if (m_selectionModel->isSelected(m_selectionModel->currentIndex())){
        QMessageBox answer;
                    answer.setText(QString(tr("Подтверждаете удаление <b>%1</b>?").arg(m_name)));
                    answer.setWindowTitle(QString(tr("Удаление")));
                    answer.setIcon(QMessageBox::Question);

        QPushButton *m_delete = answer.addButton(QString(tr("Удалить")), QMessageBox::ActionRole);
        QPushButton *m_cancel = answer.addButton(QString(tr("Отмена")),  QMessageBox::ActionRole);

        answer.exec();

        if (answer.clickedButton() == m_delete){
            list.append(m_code);
            stored = execStored(currentDatabase(), "DeletePriorityType", storageHashTable(list));
            stored.finish();

            slotRefreshRecords();

        } else if (answer.clickedButton() == m_cancel){
            treeView->clearSelection();
            answer.reject();
        }
    } else {
        Communicate::showing(QString("Не удается удалить,\n запись не выбрана"), 3000);
    }
    m_selectedItem = false;
}
示例#16
0
void CTaskType::slotFillTask()
{
    QList<QVariant> list;
    QSqlQuery       stored;

#ifndef QT_NO_CURSOR
    QApplication::setOverrideCursor(QCursor(QPixmap("data/picture/additionally/wait.png")));
#endif

    if (modelTask->rowCount() > 0){
        modelTask->removeRows(0, modelTask->rowCount());
    }

    list.append((int)actualRecords);
    stored.setForwardOnly(true);
    stored = execStored(currentDatabase(), "ReadAllTaskType", storageHashTable(list));

    fillTaskModel(stored);

#ifndef QT_NO_CURSOR
    QApplication::restoreOverrideCursor();
#endif
    stored.finish();
}
示例#17
-1
CCustomer::CCustomer(QWidget *parent) :
    QWidget(parent)
  , actualRecords(false)
  , ui(new Ui::CCustomer)
  , customerDialog(new CCustomerDialog(this)), customer_gDialog(new CCustomer_gDialog(this))
  , discountDialog(new CDiscountDialog(this))
  , addItem(new CAddItem(this))
  , focusedWidget(nullptr)
{
    ui->setupUi(this);

// model
    modelFaces    = new QStandardItemModel(this);
    modelPartner  = new QStandardItemModel(this);
    modelHuman    = new QStandardItemModel(this);

    modelSelectionFaces   = new QItemSelectionModel(modelFaces);
    modelSelectionPartner = new QItemSelectionModel(modelPartner);
    modelSelectionHuman   = new QItemSelectionModel(modelHuman);

// create #temporary table
    QString query ("SELECT * INTO #GroupCustomerDiscounts FROM ViewGroupCustomerDiscounts"
                   "SELECT * INTO #CustomerSubdiller FROM ViewCustomerSubdiller");
    QSqlQuery temporary(currentDatabase());
    temporary.exec(query);

    QSplitter *hSplitter = new QSplitter(Qt::Horizontal);
    QSplitter *vSplitter = new QSplitter(Qt::Vertical);

    QWidget *w1 = new QWidget(this);
    QWidget *w2 = new QWidget(this);

    treeFaces          = new QTreeView (this);
    treePartner        = new CCustomerTreeView (this);
    textEditPartnerComment = new QTextEdit (this);
    textEditPartnerComment->setMaximumWidth(100);
    textEditPartnerComment->setReadOnly(true);
    treeHuman          = new CCustomerTreeView (this);
    textEditHumanComment   = new QTextEdit (this);
    textEditHumanComment->setMaximumWidth(100);
    textEditHumanComment->setReadOnly(true);

    QHBoxLayout *hboxPartner = new QHBoxLayout(w1);
                 hboxPartner->setMargin(0);
                 hboxPartner->addWidget(treePartner);
                 hboxPartner->addWidget(textEditPartnerComment);

    QHBoxLayout *hboxHuman = new QHBoxLayout(w2);
                 hboxHuman->setMargin(0);
                 hboxHuman->addWidget(treeHuman);
                 hboxHuman->addWidget(textEditHumanComment);

    vSplitter->addWidget(w1);
    vSplitter->addWidget(w2);
    vSplitter->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);

    ui->vLayoutUnionPartnerHuman->addWidget(vSplitter);

    hSplitter->addWidget(treeFaces);
    hSplitter->addWidget(vSplitter);
    hSplitter->setStretchFactor(1, 3);
    hSplitter->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);

    ui->hLayoutUnionViews->addWidget(hSplitter);

    treeFaces->setObjectName("treeViewFaces");
    treeFaces->setModel(modelFaces);
    treeFaces->setSelectionModel(modelSelectionFaces);
    treeFaces->setEditTriggers(QAbstractItemView::NoEditTriggers);
    treeFaces->installEventFilter(this);

    treePartner->setObjectName("treeViewPartner");
    treePartner->setRootIsDecorated(false);
    treePartner->setAlternatingRowColors(true);
    treePartner->setModel(modelPartner);
    treePartner->setSelectionModel(modelSelectionPartner);
    treePartner->setEditTriggers(QAbstractItemView::NoEditTriggers);
    treePartner->installEventFilter(this);

    treeHuman->setObjectName("treeViewHuman");
    treeHuman->setRootIsDecorated(false);
    treeHuman->setAlternatingRowColors(true);
    treeHuman->setModel(modelHuman);
    treeHuman->setSelectionModel(modelSelectionHuman);
    treeHuman->setEditTriggers(QAbstractItemView::NoEditTriggers);
    treeHuman->installEventFilter(this);

    filter = new CFilter(this);
    filter->setObjectName("filter");
    filter->setPlaceholderText("Введите наименование");
    filter->installEventFilter(this);
    filter->setValidator(new QRegExpValidator(QRegExp(trUtf8("[а-яА-Яa-zA-Z0-9_]+")), this));
    ui->hLayoutSearchToItem->addWidget(filter);

    QToolButton *telephone = new QToolButton(this);
    QPixmap pixmapTelephone("data/picture/additionally/telephone.png");

    telephone->setIcon(QIcon(pixmapTelephone));
    telephone->setIconSize(QSize(24, 24));
    telephone->setCursor(Qt::PointingHandCursor);
    telephone->setStyleSheet("QToolButton { border: none; padding: 0px; }");
    ui->hLayoutSearchToItem->addWidget(telephone);

    QToolButton *meeting = new QToolButton(this);
    QPixmap pixmapMeeting("data/picture/additionally/meeting.png");

    meeting->setIcon(QIcon(pixmapMeeting));
    meeting->setIconSize(QSize(24, 24));
    meeting->setCursor(Qt::PointingHandCursor);
    meeting->setStyleSheet("QToolButton { border: none; padding: 0px; }");
    ui->hLayoutSearchToItem->addWidget(meeting);

    QToolButton *event = new QToolButton(this);
    QPixmap pixmapEvent("data/picture/additionally/event.png");

    event->setIcon(QIcon(pixmapEvent));
    event->setIconSize(QSize(24, 24));
    event->setCursor(Qt::PointingHandCursor);
    event->setStyleSheet("QToolButton { border: none; padding: 0px; }");
    ui->hLayoutSearchToItem->addWidget(event);

    QToolButton *task = new QToolButton(this);
    QPixmap pixmapTask("data/picture/additionally/task.png");

    task->setIcon(QIcon(pixmapTask));
    task->setIconSize(QSize(24, 24));
    task->setCursor(Qt::PointingHandCursor);
    task->setStyleSheet("QToolButton { border: none; padding: 0px; }");
    ui->hLayoutSearchToItem->addWidget(task);

    ui->labelCurrentUser->setText(QString("Пользователь: <b><u>" + currentUser() + "</u></b>"));

    mc.idCustomer      = -1;
    mc.nameCustomer    = QString("");

    root = new QStandardItem(QString("Заказчики"));
    root->setIcon(QIcon("data/picture/additionally/root.png"));
    modelFaces->insertColumns(0, FACES_MODEL_COLUMN_COUNT);
    modelFaces->setItem(0, 0, root);

    QFont font(treeFaces->font());
          font.setBold (true);
    modelFaces->setData(modelFaces->index(0, 0), font, Qt::FontRole);
    modelFaces->setHeaderData(0, Qt::Horizontal, QObject::tr("Наименование"));

    QVector<int> storage;
                 storage.append(1);
                 storage.append(2);
                 storage.append(3);
    CDictionaryCore::columnHidden(treeFaces, modelFaces, storage);
                 storage.clear();

    root->setChild(modelFaces->rowCount(root->index()), new QStandardItem("Загрузка..."));

    modelPartner->insertColumns(0, PARTNER_MODEL_COLUMN_COUNT);

    modelPartner->setHeaderData(0, Qt::Horizontal, "Контрагенты");
    modelPartner->setHeaderData(1, Qt::Horizontal, "Клиентский №");
    modelPartner->setHeaderData(2, Qt::Horizontal, "Телефон");
    modelPartner->setHeaderData(3, Qt::Horizontal, "Город");
    modelPartner->setHeaderData(4, Qt::Horizontal, "Web");
    modelPartner->setHeaderData(5, Qt::Horizontal, "Руководитель");

    modelHuman->insertColumns(0, HUMAN_MODEL_COLUMN_COUNT);

    modelHuman->setHeaderData(0, Qt::Horizontal, "ФИО");
    modelHuman->setHeaderData(1, Qt::Horizontal, "Отдел");
    modelHuman->setHeaderData(2, Qt::Horizontal, "Должность");
    modelHuman->setHeaderData(3, Qt::Horizontal, "Телефон");
    modelHuman->setHeaderData(4, Qt::Horizontal, "Приоритет");

//    connect(filter, SIGNAL(textChanged(QString)), SLOT(slotFindCities(QString)));
    connect(treeFaces, SIGNAL(expanded(QModelIndex)),  SLOT(slotFillGroup(QModelIndex)));
    connect(treeFaces, SIGNAL(collapsed(QModelIndex)), SLOT(slotClearGroup(QModelIndex)));
    connect(treeFaces, SIGNAL(clicked(QModelIndex)),   SLOT(slotFillPartner(QModelIndex)));

//    connect(treeViewCountry, SIGNAL(clicked(QModelIndex)),
//            this, SLOT(slotDataChanged(QModelIndex)));
//    connect(editDialogCountry, SIGNAL(saveDataChanged()), this, SLOT(slotInsertOrUpdateRecords()));
//    connect(editDialogCity, SIGNAL(saveDataChanged()), this, SLOT(slotInsertOrUpdateRecords()));
//    connect(addItem->ui->buttonSave, SIGNAL(clicked()), countryDialog, SLOT(show()));

    connect(addItem->ui->buttonSave, SIGNAL(clicked()), SLOT(slotShowEditDialog()));
    connect(addItem->ui->buttonSave, SIGNAL(clicked()), addItem, SLOT(close()));

    actualRecords
             ? ui->labelViewState->setText(QString(tr("Отображаются записи: <b><u>Актуальные</u></b>")))
             :
               ui->labelViewState->setText(QString(tr("Отображаются записи: <b><u>Все</u></b>")));
}