void SectionEditor::btnAdd_clicked() { QString name = tr("unnamed"); int i = 0; if(scene) { // lets add a new section while(i < 100 && scene->findSection(name) != -1) { i++; name = tr("unnamed") + QString().sprintf("%d", i); } if(scene->findSection(name) != -1) { QMessageBox::warning(this, tr("Error Encountered"), tr("Unable to add a new section because a non-unique name could be generated.")); return; } ORGraphicsSectionDetail * rsd = new ORGraphicsSectionDetail(scene, scene); rsd->setTitle(name); scene->insertSection(scene->detailSectionCount(), rsd); } else { QMessageBox::warning(this, tr("Error Encountered"), tr("No document was set")); return; } lbSections->addItem(name); lbSections->setCurrentRow(lbSections->count()-1); btnEdit_clicked(); }
void DetailSectionDialog::btnAdd_clicked() { // lets add a new section QString name = tr("unnamed"); int i = 0; if(_gsd) { while(i < 100 && _gsd->findSection(name) != -1) { i++; name = tr("unnamed") + QString().sprintf("%d", i); } if(_gsd->findSection(name) != -1) { QMessageBox::warning(this, tr("Error Encountered"), tr("Unable to add a new group because a non-unique name could be generated.")); return; } ORGraphicsSectionDetailGroup * rsdg = new ORGraphicsSectionDetailGroup(name, _gsd, _gsd); _gsd->insertSection(_gsd->groupSectionCount(), rsdg); } else { QMessageBox::warning(this, tr("Error Encountered"), tr("No document specified.")); return; } lbGroups->addItem(name); lbGroups->setCurrentRow(lbGroups->count()-1); btnEdit_clicked(); }
SectionEditor::SectionEditor(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl) { scene = 0; setupUi(this); // signals and slots connections connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); connect(btnAdd, SIGNAL(clicked()), this, SLOT(btnAdd_clicked())); connect(btnEdit, SIGNAL(clicked()), this, SLOT(btnEdit_clicked())); connect(btnRemove, SIGNAL(clicked()), this, SLOT(btnRemove_clicked())); connect(btnMoveUp, SIGNAL(clicked()), this, SLOT(btnMoveUp_clicked())); connect(brnMoveDown, SIGNAL(clicked()), this, SLOT(brnMoveDown_clicked())); connect(cbReportHeader, SIGNAL(toggled(bool)), this, SLOT(cbReportHeader_toggled(bool))); connect(cbReportFooter, SIGNAL(toggled(bool)), this, SLOT(cbReportFooter_toggled(bool))); connect(cbHeadFirst, SIGNAL(toggled(bool)), this, SLOT(cbHeadFirst_toggled(bool))); connect(cbHeadLast, SIGNAL(toggled(bool)), this, SLOT(cbHeadLast_toggled(bool))); connect(cbHeadEven, SIGNAL(toggled(bool)), this, SLOT(cbHeadEven_toggled(bool))); connect(cbHeadOdd, SIGNAL(toggled(bool)), this, SLOT(cbHeadOdd_toggled(bool))); connect(cbFootFirst, SIGNAL(toggled(bool)), this, SLOT(cbFootFirst_toggled(bool))); connect(cbFootLast, SIGNAL(toggled(bool)), this, SLOT(cbFootLast_toggled(bool))); connect(cbFootEven, SIGNAL(toggled(bool)), this, SLOT(cbFootEven_toggled(bool))); connect(cbFootOdd, SIGNAL(toggled(bool)), this, SLOT(cbFootOdd_toggled(bool))); connect(cbHeadAny, SIGNAL(toggled(bool)), this, SLOT(cbHeadAny_toggled(bool))); connect(cbFootAny, SIGNAL(toggled(bool)), this, SLOT(cbFootAny_toggled(bool))); }
QueryList::QueryList(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl) { setupUi(this); // signals and slots connections connect(lbQuerys, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(editQuery(QListWidgetItem*))); connect(btnEdit, SIGNAL(clicked()), this, SLOT(btnEdit_clicked())); connect(btnDelete, SIGNAL(clicked()), this, SLOT(btnDelete_clicked())); connect(btnAdd, SIGNAL(clicked()), this, SLOT(btnAdd_clicked())); }
LabelDefinitions::LabelDefinitions(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl) { setupUi(this); // signals and slots connections connect(ldList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(editLabelDef(QListWidgetItem*))); connect(btnEdit, SIGNAL(clicked()), this, SLOT(btnEdit_clicked())); connect(btnDelete, SIGNAL(clicked()), this, SLOT(btnDelete_clicked())); connect(btnAdd, SIGNAL(clicked()), this, SLOT(btnAdd_clicked())); connect(btnClose, SIGNAL(clicked()), this, SLOT(close())); }
DetailSectionDialog::DetailSectionDialog(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl) { setupUi(this); // signals and slots connections connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); connect(btnAdd, SIGNAL(clicked()), this, SLOT(btnAdd_clicked())); connect(btnEdit, SIGNAL(clicked()), this, SLOT(btnEdit_clicked())); connect(btnRemove, SIGNAL(clicked()), this, SLOT(btnRemove_clicked())); connect(btnMoveUp, SIGNAL(clicked()), this, SLOT(btnMoveUp_clicked())); connect(brnMoveDown, SIGNAL(clicked()), this, SLOT(brnMoveDown_clicked())); _gsd = 0; lbGroups->clear(); }
void SectionEditor::btnAdd_clicked() { if (m_reportSectionDetail) { // lets add a new section QString name; int i = 0; while (i < 100 && m_reportSectionDetail->indexOfSection(name) != -1) { i++; name = QString().sprintf("unnamed%d", i); } if (m_reportSectionDetail->indexOfSection(name) != -1) { QMessageBox::warning( this, i18n("Error Encountered"), i18n("Unable to add a new group because its name would not be unique")); return; } ReportSectionDetailGroup * rsdg = new ReportSectionDetailGroup(name, m_reportSectionDetail, m_reportSectionDetail); m_reportSectionDetail->insertSection(m_reportSectionDetail->groupSectionCount(), rsdg); lbGroups->addItem(name); lbGroups->setCurrentRow(lbGroups->count() - 1); btnEdit_clicked(); } }