//создания действий void MainForm::createActions() { newPlanAct = new QAction(tr("Новый"), 0, this); newPlanAct->setIconSet(QPixmap::fromMimeSource("document_16.png")); openPlanAct = new QAction(tr("Открыть"), 0, this); openPlanAct->setIconSet(QPixmap::fromMimeSource("folder_16.png")); removePlanAct = new QAction(tr("Удалить"), 0, this); removePlanAct->setIconSet(QPixmap::fromMimeSource("delete_16.png")); //closePlanAct = new QAction(tr("Закрыть"), 0, this); //closePlanAct->setIconSet(QPixmap::fromMimeSource("")); quitAct = new QAction(tr("Выход"), 0, this); quitAct->setIconSet(QPixmap::fromMimeSource("shutdown_16.png")); addTopicAct = new QAction(tr("Добавить"), 0, this); addTopicAct->setIconSet(QPixmap::fromMimeSource("plus_16.png")); addTopicAct->setEnabled(false); editTopicAct = new QAction(tr("Редактировать"), 0, this); editTopicAct->setIconSet(QPixmap::fromMimeSource("pencil_16.png")); editTopicAct->setEnabled(false); removeTopicAct = new QAction(tr("Удалить"), 0, this); removeTopicAct->setIconSet(QPixmap::fromMimeSource("delete_16.png")); removeTopicAct->setEnabled(false); filterAct = new QAction(tr("Фильтр"), 0, this); filterAct->setIconSet(QPixmap::fromMimeSource("funnel_16.png")); filterAct->setEnabled(false); refExecutiveAct = new QAction(tr("Исполнители"), 0, this); refExecutiveAct->setIconSet(QPixmap::fromMimeSource("user_16.png")); refSkbAct = new QAction(tr("СКБ"), 0, this); refSkbAct->setIconSet(QPixmap::fromMimeSource("gear_16.png")); outAct = new QAction(tr("Вывод в MS Word"), 0, this); outAct->setIconSet(QPixmap::fromMimeSource("office_16.png")); outAct->setEnabled(false); connectAct = new QAction(tr("Подключение к БД"), 0, this); connectAct->setIconSet(QPixmap::fromMimeSource("plug_16.png")); connect(newPlanAct, SIGNAL(activated()), this, SLOT(newPlanActivated())); connect(openPlanAct, SIGNAL(activated()), this, SLOT(openPlanActivated())); connect(removePlanAct, SIGNAL(activated()), this, SLOT(removePlanActivated())); //connect(closePlanAct, SIGNAL(activated()), this, SLOT(closePlanActivated())); connect(quitAct, SIGNAL(activated()), qApp, SLOT(closeAllWindows())); connect(addTopicAct, SIGNAL(activated()), this, SLOT(addTopicActivated())); connect(editTopicAct, SIGNAL(activated()), this, SLOT(editTopicActivated())); connect(removeTopicAct, SIGNAL(activated()), this, SLOT(removeTopicActivated())); connect(filterAct, SIGNAL(activated()), this, SLOT(filterActivated())); connect(refExecutiveAct, SIGNAL(activated()), this, SLOT(openReferenceExecutiveActivated())); connect(refSkbAct, SIGNAL(activated()), this, SLOT(openReferenceSkbActivated())); connect(outAct, SIGNAL(activated()), this, SLOT(outInWordActivated())); connect(connectAct, SIGNAL(activated()), this, SLOT(settingsActivated())); connect(topicTable, SIGNAL(clicked(int, int, int, const QPoint&)), this, SLOT(enableActActivated())); }
void FilterWidget::filterButton_clicked() { TQueryMap opts; Attr *a = 0; for( int i = 0; i < attrList.size(); i++ ) { QApplication::processEvents(); a = attrList.at(i); if ( widgetMap.contains( a->getName() ) ) { QWidget *w = widgetMap[a->getName() ]; if ( false == w->isEnabled() ) continue; QString v = getWidgetData( a, w ); if ( !v.isEmpty() ) { int flag = Like | Case; bool ok; v.toInt(&ok, 10); if ( ok ) { flag = Equal; } if (a->getType() == Attr::Bool) { flag = Equal; } if ( opts.size() > 0 ) { flag |= And; } opts.insert(a->getName(),keeper->prepareParam(flag, v)); } } } emit filterActivated(opts); }
void FilterWidget::clearButton_clicked() { TQueryMap opts; emit filterActivated(opts); }