int main(int argc, char *argv[]) { QApplication a(argc, argv); Summary w; w.show(); return a.exec(); }
void QRPlot::plotLine(QString propertyName, QString dataTitle) { qDebug() << "Plotting " << propertyName; Summary summary = getSummaryWithTitle(dataTitle); Property xProp = summary.getProperties().getProperty("TIME"); Property yProp = summary.getProperties().getProperty(propertyName); PlotLine newLine = PlotLine(xProp.getValues(), yProp.getValues(), propertyName, yProp.getUnit(), dataTitle); this->graph.addLine(newLine); this->updatePlottedPropertiesList(); }
NumericVector summary_compute(const NumericVector& x, Summary summary) { int n = x.size(); for(int i = 0; i < n; ++i) { summary.push(x[i], 1); } int m = summary.size(); NumericVector out(m); for(int i = 0; i < m; ++i) { out[i] = summary.compute(i); } return out; }
TEST( SummaryTest, DefaultSummary ) { const char *head = "<qtitle>f1 doc</qtitle>"; const char *body = "<p>cucumber</p>\n" "<a href=\"f3.html\">snegl</a>\n" "snegl\n"; char input[MAX_BUF_SIZE]; std::sprintf(input, HTML_FORMAT, head, body); Summary summary; generateSummary(summary, input, "banana", "http://www.example.com/"); EXPECT_STREQ( "cucumber. snegl snegl", summary.getSummary() ); }
TEST( SummaryTest, DISABLED_BUGEllipsisAdded ) { const char *body = "Giraffe on rollerblades. Penguin on skateboard. The giraffe is way faster than that plumb bird with pathetic wings.\n"; char input[MAX_BUF_SIZE]; std::sprintf(input, "%s", body); Summary summary; generateSummary(summary, input, "giraffe", "http://www.example.com/"); /// @todo ALC we're adding ellipsis even with a full sentence. EXPECT_STREQ( "Giraffe on rollerblades. Penguin on skateboard. The giraffe is way faster than that plumb bird with pathetic wings.", summary.getSummary() ); }
TEST( SummaryTest, StripSamePunct ) { const char *body = "<pre>" "---------------------------------------------------------------------------------\n" "| Name | Total Donations |\n" "---------------------------------------------------------------------------------\n" "| JENNI STANLEY | $10.00 |\n" "---------------------------------------------------------------------------------\n" "| CANDRA BUDGE | $22.00 |\n" "---------------------------------------------------------------------------------\n" "| JESSE NICLEY | $34.00 |\n" "---------------------------------------------------------------------------------\n" "| SHARON YOKLEY | $45.00 |\n" "---------------------------------------------------------------------------------\n" "</pre>"; char input[MAX_BUF_SIZE]; std::sprintf(input, HTML_FORMAT, "", body); Summary summary; generateSummary(summary, input, "jesse budge", "http://www.example.com/"); EXPECT_STREQ("CANDRA BUDGE | $22.00 | … | JESSE NICLEY | $34.00 …", summary.getSummary()); }
TEST( SummaryTest, DISABLED_BUGNoEllipsisAdded ) { const char *head = "<title>Instrument prices by Acme Inc.</title>\n" "<meta name=\"description\" content=\"Unorthodox musical instrument value estimation\">\n"; const char *body = "<h1>Unusual saxophone valuation</h1>\n" "<p>Looking for knowing how much your saxophone is worth and what an appropriate insurance should be?. We provide that and other relevant information such as procedures, locations and time tables</p>\n" "<p>We also provide valuation for other musical instrucments.</p>\n"; char input[MAX_BUF_SIZE]; std::sprintf(input, HTML_FORMAT, head, body); Summary summary; generateSummary(summary, input, "saxophone", "http://www.example.com/"); /// @todo ALC we're not adding ellipsis here due to lack of space. we should take one less word instead and add ellipsis. EXPECT_STREQ( "Unusual saxophone valuation. Looking for knowing how much your saxophone is worth and what an appropriate insurance should be?. We provide that and other relevant information …", summary.getSummary() ); }
static void generateSummary( Summary &summary, char *htmlInput, const char *queryStr, const char *urlStr ) { Xml xml; ASSERT_TRUE(xml.set(htmlInput, strlen(htmlInput), 0, CT_HTML)); Words words; ASSERT_TRUE(words.set(&xml, true)); Bits bits; ASSERT_TRUE(bits.set(&words)); Url url; url.set(urlStr); Sections sections; ASSERT_TRUE(sections.set(&words, &bits, &url, "", CT_HTML)); Query query; ASSERT_TRUE(query.set2(queryStr, langEnglish, true)); LinkInfo linkInfo; memset ( &linkInfo , 0 , sizeof(LinkInfo) ); linkInfo.m_lisize = sizeof(LinkInfo); Title title; ASSERT_TRUE(title.setTitle(&xml, &words, 80, &query, &linkInfo, &url, NULL, 0, CT_HTML, langEnglish)); Pos pos; ASSERT_TRUE(pos.set(&words)); Bits bitsForSummary; ASSERT_TRUE(bitsForSummary.setForSummary(&words)); Phrases phrases; ASSERT_TRUE(phrases.set(&words, &bits)); Matches matches; matches.setQuery(&query); ASSERT_TRUE(matches.set(&words, &phrases, §ions, &bitsForSummary, &pos, &xml, &title, &url, &linkInfo)); summary.setSummary(&xml, &words, §ions, &pos, &query, 180, 3, 3, 180, &url, &matches, title.getTitle(), title.getTitleLen()); }
void MainWindow::makeTree(int start_year, int end_year, QString CSV_type){ int count=0; if(CSV_type=="Teaching"){ ui->treeWidget->headerItem()->setText(0,""); ui->treeWidget->headerItem()->setText(1,"Academic Year"); ui->treeWidget->headerItem()->setText(2,"Hours"); ui->treeWidget->headerItem()->setText(3,"Students"); } else if(CSV_type=="Presentations"){ ui->treeWidget->headerItem()->setText(0,""); ui->treeWidget->headerItem()->setText(1,"Academic Year"); ui->treeWidget->headerItem()->setText(2,"# of Presentations"); ui->treeWidget->headerItem()->setText(3,""); } else if(CSV_type=="Publications"){ ui->treeWidget->headerItem()->setText(0,""); ui->treeWidget->headerItem()->setText(1,"Type of Publication "); ui->treeWidget->headerItem()->setText(2,"Total"); ui->treeWidget->headerItem()->setText(3,""); } else if (CSV_type == "Grants"){ ui->treeWidget->headerItem()->setText(0,""); ui->treeWidget->headerItem()->setText(1,"Funding or Grant Type"); ui->treeWidget->headerItem()->setText(2,"Total #"); ui->treeWidget->headerItem()->setText(3,"Total $"); } //get data for vectors Summary* summary = new Summary(); QVector<double> Tier_1_Tot, Tier_2_Tot, Tier_3_Tot; QVector<QString> Tier_1_Fields, Tier_2_Fields, Tier_3_Fields; QString faculty=ui->lineEdit->text(); //TEACHING if (CSV_type == "Teaching") { Tier_1_Fields = {"PME", "CME", "UME", "Other"}; //sets a one year range from start_year to end_year and stores each range in Tier_2_Fields for (int y = start_year; y <= end_year; y++) { Tier_2_Fields.insert(y-start_year,QString::number(y)); QCoreApplication::processEvents(); } if(faculty==""){ Tier_1_Tot=(summary->getTier1(Tier_1_Fields[0] ,start_year ,end_year ,CSV_type)); pme = root(Tier_1_Fields[0], Tier_1_Tot); Tier_1_Tot=(summary->getTier1(Tier_1_Fields[1] ,start_year ,end_year ,CSV_type)); cme = root(Tier_1_Fields[1], Tier_1_Tot); Tier_1_Tot=(summary->getTier1(Tier_1_Fields[2] ,start_year ,end_year ,CSV_type)); ume = root(Tier_1_Fields[2], Tier_1_Tot); Tier_1_Tot=(summary->getTier1(Tier_1_Fields[3] ,start_year ,end_year ,CSV_type)); teaching_other = root(Tier_1_Fields[3], Tier_1_Tot); } else{ Tier_1_Tot=(summary->getTier1Filter(Tier_1_Fields[0] ,faculty ,start_year ,end_year ,CSV_type)); pme = root(Tier_1_Fields[0], Tier_1_Tot); Tier_1_Tot=(summary->getTier1Filter(Tier_1_Fields[1] ,faculty ,start_year ,end_year ,CSV_type)); cme = root(Tier_1_Fields[1], Tier_1_Tot); Tier_1_Tot=(summary->getTier1Filter(Tier_1_Fields[2] ,faculty ,start_year ,end_year ,CSV_type)); ume = root(Tier_1_Fields[2], Tier_1_Tot); Tier_1_Tot=(summary->getTier1Filter(Tier_1_Fields[3] ,faculty ,start_year ,end_year ,CSV_type)); teaching_other = root(Tier_1_Fields[3], Tier_1_Tot); } //iterate once on each Tier_2 element for (int i = 0; i < Tier_2_Fields.length(); i++) { QCoreApplication::processEvents(); count++; QTreeWidgetItem *t2_pme; QTreeWidgetItem *t2_cme; QTreeWidgetItem *t2_ume; QTreeWidgetItem *t2_other; if(faculty==""){ Tier_2_Tot=(summary->getTier2(Tier_1_Fields[0], Tier_2_Fields[i], start_year, end_year, CSV_type)); t2_pme = tier2_root(pme, Tier_2_Fields[i], Tier_2_Tot); Tier_2_Tot=(summary->getTier2(Tier_1_Fields[1], Tier_2_Fields[i], start_year, end_year, CSV_type)); t2_cme = tier2_root(cme, Tier_2_Fields[i], Tier_2_Tot); Tier_2_Tot=(summary->getTier2(Tier_1_Fields[2], Tier_2_Fields[i], start_year, end_year, CSV_type)); t2_ume = tier2_root(ume, Tier_2_Fields[i], Tier_2_Tot); Tier_2_Tot=(summary->getTier2(Tier_1_Fields[3], Tier_2_Fields[i], start_year, end_year, CSV_type)); t2_other = tier2_root(teaching_other, Tier_2_Fields[i], Tier_2_Tot); } else{ Tier_2_Tot=(summary->getTier3(Tier_1_Fields[0], Tier_2_Fields[i], faculty, start_year, end_year, CSV_type)); t2_pme = tier2_root(pme, Tier_2_Fields[i], Tier_2_Tot); Tier_2_Tot=(summary->getTier3(Tier_1_Fields[1], Tier_2_Fields[i], faculty, start_year, end_year, CSV_type)); t2_cme = tier2_root(cme, Tier_2_Fields[i], Tier_2_Tot); Tier_2_Tot=(summary->getTier3(Tier_1_Fields[2], Tier_2_Fields[i], faculty, start_year, end_year, CSV_type)); t2_ume = tier2_root(ume, Tier_2_Fields[i], Tier_2_Tot); Tier_2_Tot=(summary->getTier3(Tier_1_Fields[3], Tier_2_Fields[i], faculty, start_year, end_year, CSV_type)); t2_other = tier2_root(teaching_other, Tier_2_Fields[i], Tier_2_Tot); } //This function from Summary will return the names/faculties involved Tier_1_Fields[x] and Tier_2_Fields[y] Tier_3_Fields = (summary->getFaculty(Tier_1_Fields[0], Tier_2_Fields[i], start_year, end_year, CSV_type)); for (int j = 0; j < Tier_3_Fields.length(); j++) { QCoreApplication::processEvents(); count++; if(faculty=="" || faculty==Tier_3_Fields[j]){ Tier_3_Tot=(summary->getTier3(Tier_1_Fields[0], Tier_2_Fields[i], Tier_3_Fields[j], start_year, end_year, CSV_type)); tier3_root(t2_pme, Tier_3_Fields[j], Tier_3_Tot); } } Tier_3_Fields = (summary->getFaculty(Tier_1_Fields[1], Tier_2_Fields[i], start_year, end_year, CSV_type)); for (int j = 0; j < Tier_3_Fields.length(); j++) { QCoreApplication::processEvents(); count++; if(faculty=="" || faculty==Tier_3_Fields[j]){ Tier_3_Tot=(summary->getTier3(Tier_1_Fields[1], Tier_2_Fields[i], Tier_3_Fields[j], start_year, end_year, CSV_type)); tier3_root(t2_cme, Tier_3_Fields[j], Tier_3_Tot); } } Tier_3_Fields = (summary->getFaculty(Tier_1_Fields[2], Tier_2_Fields[i], start_year, end_year, CSV_type)); for (int j = 0; j < Tier_3_Fields.length(); j++) { QCoreApplication::processEvents(); count++; if(faculty=="" || faculty==Tier_3_Fields[j]){ Tier_3_Tot=(summary->getTier3(Tier_1_Fields[2], Tier_2_Fields[i], Tier_3_Fields[j], start_year, end_year, CSV_type)); tier3_root(t2_ume, Tier_3_Fields[j], Tier_3_Tot); } } Tier_3_Fields = (summary->getFaculty(Tier_1_Fields[3], Tier_2_Fields[i], start_year, end_year, CSV_type)); for (int j = 0; j < Tier_3_Fields.length(); j++) { QCoreApplication::processEvents(); count++; if(faculty=="" || faculty==Tier_3_Fields[j]){ Tier_3_Tot=(summary->getTier3(Tier_1_Fields[3], Tier_2_Fields[i], Tier_3_Fields[j], start_year, end_year, CSV_type)); tier3_root(t2_other, Tier_3_Fields[j], Tier_3_Tot); } } } } //GRANTS else if (CSV_type == "Grants"){ Tier_1_Fields = {"Grants", "Clinical Trials"}; Tier_2_Fields = {"Peer Reviewed", "Industry Sponsored"}; if(faculty==""){ Tier_1_Tot=(summary->getTier1(Tier_1_Fields[0] ,start_year ,end_year ,CSV_type)); grants = root(Tier_1_Fields[0], Tier_1_Tot); Tier_1_Tot=(summary->getTier1(Tier_1_Fields[1] ,start_year ,end_year ,CSV_type)); funding = root(Tier_1_Fields[1], Tier_1_Tot); } else{ Tier_1_Tot=(summary->getTier1Filter(Tier_1_Fields[0] ,faculty, start_year ,end_year ,CSV_type)); grants = root(Tier_1_Fields[0], Tier_1_Tot); Tier_1_Tot=(summary->getTier1Filter(Tier_1_Fields[1] ,faculty, start_year ,end_year ,CSV_type)); funding = root(Tier_1_Fields[1], Tier_1_Tot); } //iterate once on each Tier_2 element for (int i = 0; i < Tier_2_Fields.length(); i++) { QCoreApplication::processEvents(); count++; QTreeWidgetItem *t2_grants; QTreeWidgetItem *t2_funding; if(faculty==""){ Tier_2_Tot=(summary->getTier2(Tier_1_Fields[0], Tier_2_Fields[i], start_year, end_year, CSV_type)); t2_grants = tier2_root(grants, Tier_2_Fields[i], Tier_2_Tot); Tier_2_Tot=(summary->getTier2(Tier_1_Fields[1], Tier_2_Fields[i], start_year, end_year, CSV_type)); t2_funding = tier2_root(funding, Tier_2_Fields[i], Tier_2_Tot); } else{ Tier_2_Tot=(summary->getTier3(Tier_1_Fields[0], Tier_2_Fields[i], faculty, start_year, end_year, CSV_type)); t2_grants = tier2_root(grants, Tier_2_Fields[i], Tier_2_Tot); Tier_2_Tot=(summary->getTier3(Tier_1_Fields[1], Tier_2_Fields[i], faculty, start_year, end_year, CSV_type)); t2_funding = tier2_root(funding, Tier_2_Fields[i], Tier_2_Tot); } //This function from Summary will return the names/faculties involved Tier_1_Fields[x] and Tier_2_Fields[y] Tier_3_Fields = (summary->getFaculty(Tier_1_Fields[0], Tier_2_Fields[i], start_year, end_year, CSV_type)); for (int j = 0; j < Tier_3_Fields.length(); j++) { QCoreApplication::processEvents(); count++; if(faculty=="" || faculty==Tier_3_Fields[j]){ Tier_3_Tot=(summary->getTier3(Tier_1_Fields[0], Tier_2_Fields[i], Tier_3_Fields[j], start_year, end_year, CSV_type)); tier3_root(t2_grants, Tier_3_Fields[j], Tier_3_Tot); } } Tier_3_Fields = (summary->getFaculty(Tier_1_Fields[1], Tier_2_Fields[i], start_year, end_year, CSV_type)); for (int j = 0; j < Tier_3_Fields.length(); j++) { QCoreApplication::processEvents(); count++; if(faculty=="" || faculty==Tier_3_Fields[j]){ Tier_3_Tot=(summary->getTier3(Tier_1_Fields[1], Tier_2_Fields[i], Tier_3_Fields[j], start_year, end_year, CSV_type)); tier3_root(t2_funding, Tier_3_Fields[j], Tier_3_Tot); } } } } //PUBLICATIONS else if (CSV_type == "Publications"){ Tier_1_Fields = {"Publications"}; Tier_2_Fields = {"Published Abstracts", "Journal Articles", "Books", "Book Chapters", "Letters to Editor"}; if(faculty==""){ Tier_1_Tot=(summary->getTier1(Tier_1_Fields[0] ,start_year ,end_year ,CSV_type)); pub = root(Tier_1_Fields[0], Tier_1_Tot); } else{ Tier_1_Tot=(summary->getTier1Filter(Tier_1_Fields[0] ,faculty ,start_year ,end_year ,CSV_type)); pub = root(Tier_1_Fields[0], Tier_1_Tot); } //iterate once on each Tier_2 element for (int i = 0; i < Tier_2_Fields.length(); i++) { QCoreApplication::processEvents(); count++; QTreeWidgetItem *t2_pub; if(faculty==""){ Tier_2_Tot=(summary->getTier2(Tier_1_Fields[0], Tier_2_Fields[i], start_year, end_year, CSV_type)); t2_pub = tier2_root(pub, Tier_2_Fields[i], Tier_2_Tot); } else{ Tier_2_Tot=(summary->getTier3(Tier_1_Fields[0], Tier_2_Fields[i], faculty, start_year, end_year, CSV_type)); t2_pub = tier2_root(pub, Tier_2_Fields[i], Tier_2_Tot); } //This function from Summary will return the names/faculties involved Tier_1_Fields[x] and Tier_2_Fields[y] Tier_3_Fields = (summary->getFaculty(Tier_1_Fields[0], Tier_2_Fields[i], start_year, end_year, CSV_type)); for (int j = 0; j < Tier_3_Fields.length(); j++) { QCoreApplication::processEvents(); count++; if(faculty=="" || faculty==Tier_3_Fields[j]){ Tier_3_Tot=(summary->getTier3(Tier_1_Fields[0], Tier_2_Fields[i], Tier_3_Fields[j], start_year, end_year, CSV_type)); tier3_root(t2_pub, Tier_3_Fields[j], Tier_3_Tot); } } } } //PRESENTATIONS else if (CSV_type == "Presentations") { Tier_1_Fields = {"Invited Lectures", "Abstracts Presented", "Other"}; //sets a one year range from start_year to end_year and stores each range in Tier_2_Fields for (int y = start_year; y <= end_year; y++){ QCoreApplication::processEvents(); count++; Tier_2_Fields.insert(y-start_year,QString::number(y)); } if(faculty==""){ count++; Tier_1_Tot=(summary->getTier1(Tier_1_Fields[0] ,start_year ,end_year ,CSV_type)); invite = root("Invited Lectures", Tier_1_Tot); Tier_1_Tot=(summary->getTier1(Tier_1_Fields[1] ,start_year ,end_year ,CSV_type)); abstract = root("Abstracts Presented", Tier_1_Tot); Tier_1_Tot=(summary->getTier1(Tier_1_Fields[2] ,start_year ,end_year ,CSV_type)); pres_other = root("Other", Tier_1_Tot); } else{ count++; Tier_1_Tot=(summary->getTier1Filter(Tier_1_Fields[0] ,faculty ,start_year ,end_year ,CSV_type)); invite = root("Invited Lectures", Tier_1_Tot); Tier_1_Tot=(summary->getTier1Filter(Tier_1_Fields[1] ,faculty ,start_year ,end_year ,CSV_type)); abstract = root("Abstracts Presented", Tier_1_Tot); Tier_1_Tot=(summary->getTier1Filter(Tier_1_Fields[2] ,faculty ,start_year ,end_year ,CSV_type)); pres_other = root("Other", Tier_1_Tot); } //iterate once on each Tier_2 element for (int i = 0; i < Tier_2_Fields.length(); i++) { QCoreApplication::processEvents(); count++; QTreeWidgetItem *t2_invite; QTreeWidgetItem *t2_abstract; QTreeWidgetItem *t2_next; if(faculty==""){ Tier_2_Tot=(summary->getTier2(Tier_1_Fields[0], Tier_2_Fields[i], start_year, end_year, CSV_type)); t2_invite = tier2_root(invite, Tier_2_Fields[i], Tier_2_Tot); Tier_2_Tot=(summary->getTier2(Tier_1_Fields[1], Tier_2_Fields[i], start_year, end_year, CSV_type)); t2_abstract = tier2_root(abstract, Tier_2_Fields[i], Tier_2_Tot); Tier_2_Tot=(summary->getTier2(Tier_1_Fields[2], Tier_2_Fields[i], start_year, end_year, CSV_type)); t2_next = tier2_root(pres_other, Tier_2_Fields[i], Tier_2_Tot); } else{ Tier_2_Tot=(summary->getTier3(Tier_1_Fields[0], Tier_2_Fields[i], faculty, start_year, end_year, CSV_type)); t2_invite = tier2_root(invite, Tier_2_Fields[i], Tier_2_Tot); Tier_2_Tot=(summary->getTier3(Tier_1_Fields[1], Tier_2_Fields[i], faculty, start_year, end_year, CSV_type)); t2_abstract = tier2_root(abstract, Tier_2_Fields[i], Tier_2_Tot); Tier_2_Tot=(summary->getTier3(Tier_1_Fields[2], Tier_2_Fields[i], faculty, start_year, end_year, CSV_type)); t2_next = tier2_root(pres_other, Tier_2_Fields[i], Tier_2_Tot); } //This function from Summary will return the names/faculties involved Tier_1_Fields[x] and Tier_2_Fields[y] Tier_3_Fields = (summary->getFaculty(Tier_1_Fields[0], Tier_2_Fields[i], start_year, end_year, CSV_type)); for (int j = 0; j < Tier_3_Fields.length(); j++) { QCoreApplication::processEvents(); count++; if(faculty=="" || faculty==Tier_3_Fields[j]){ Tier_3_Tot=(summary->getTier3(Tier_1_Fields[0], Tier_2_Fields[i], Tier_3_Fields[j], start_year, end_year, CSV_type)); tier3_root(t2_invite, Tier_3_Fields[j], Tier_3_Tot); } } Tier_3_Fields = (summary->getFaculty(Tier_1_Fields[1], Tier_2_Fields[i], start_year, end_year, CSV_type)); for (int j = 0; j < Tier_3_Fields.length(); j++) { QCoreApplication::processEvents(); count++; if(faculty=="" || faculty==Tier_3_Fields[j]){ Tier_3_Tot=(summary->getTier3(Tier_1_Fields[1], Tier_2_Fields[i], Tier_3_Fields[j], start_year, end_year, CSV_type)); tier3_root(t2_abstract, Tier_3_Fields[j], Tier_3_Tot); } } Tier_3_Fields = (summary->getFaculty(Tier_1_Fields[2], Tier_2_Fields[i], start_year, end_year, CSV_type)); for (int j = 0; j < Tier_3_Fields.length(); j++) { QCoreApplication::processEvents(); count++; if(faculty=="" || faculty==Tier_3_Fields[j]){ Tier_3_Tot=(summary->getTier3(Tier_1_Fields[2], Tier_2_Fields[i], Tier_3_Fields[j], start_year, end_year, CSV_type)); tier3_root(t2_next, Tier_3_Fields[j], Tier_3_Tot); } } } } //resize columns for(int n = 0; n < 4; n++) { count++; ui->treeWidget->resizeColumnToContents(n); } }
foreach (Summary summary, summaries) { if (summary.getTitle() == title) return summary; }
void eXpenses::showSummary() { Summary * sum = new Summary(); sum->show();//showMaximized(); }
void PeriodicTransfer::initializeStep(int prev) { QString message; bool cB; bool bB; QString cM; QString bM; switch(prev) { case 0: { message = Step1::stepMessage; cB = Step1::confButton; bB = Step1::backButton; cM = Step1::confMessage; bM = Step1::backMessage; static_cast<Step1 *>(stack->currentWidget())->closeError(); static_cast<Step1 *>(stack->currentWidget())->closeInvalid(); } break; case 1: { message = Step2::stepMessage; cB = Step2::confButton; bB = Step2::backButton; cM = Step2::confMessage; bM = Step2::backMessage; static_cast<Step2 *>(stack->currentWidget())->setAccount(rec_card); static_cast<Step2 *>(stack->currentWidget())->setName(rec_name); } break; case 2: { message = Step3::stepMessage; cB = Step3::confButton; bB = Step3::backButton; cM = Step3::confMessage; bM = Step3::backMessage; static_cast<Step3 *>(stack->currentWidget())->closeError(); static_cast<Step3 *>(stack->currentWidget())->closeInvalid(); } break; case 3: { message = Step4::stepMessage; cB = Step4::confButton; bB = Step4::backButton; cM = Step4::confMessage; bM = Step4::backMessage; static_cast<Step4 *>(stack->currentWidget())->closeDateError(); } break; case 4: { message = Summary::stepMessage; cB = Summary::confButton; bB = Summary::backButton; cM = Summary::confMessage; bM = Summary::backMessage; Summary * s = dynamic_cast<Summary *>(stack->currentWidget()); s->setCardNumber(rec_card); s->setName(rec_name); s->setSum(sum); s->setStartDate(start_date); s->setFrequency(freq); s->closeError(); } break; default: break; } ui->stepDescrLabel->setText(message); ui->backButton->setEnabled(bB); ui->confirmButton->setEnabled(cB); ui->backLabel->setText(bM); ui->confLabel->setText(cM); }