QueryWizard::QueryWizard(QueryResult* result, QWidget* parent /* = NULL */) : QWizard(parent) { initWithFramework(Framework::instance()); setWindowTitle("Query Wizard"); addPages(result); // ui->chooseStorePage->initWithFramework(fw); // ui->finalPage->initWithFramework(fw); // ui->finalPage->setResultData(result); }
void FormMain::createPages() { // m_SoftRole = MaintainCFG::getSoftRole(); //本地操作 m_formIndex[FORMSETTING]=addPages(new FormCfgFile);//配置文件 m_formIndex[FORMLOG] = addPages(new FormLog);//日志查看 m_formIndex[FORMDEVTEST]=addPages(new FormDevTest);//设备测试 m_formIndex[FORMFILEDIALOG]=addPages(new FormFileDialog);//文件传输 //远程操作 m_formIndex[FORMTELNET]=addPages(new FormTelnet);//数据重传 m_formIndex[FORMFILE] = addPages(new FormFile); //文件传输 m_formIndex[FORMUPDATE]=addPages(new FormSoftUpdate);//程序升级 m_formIndex[FORMLOGFTP] =addPages(new FormLogftp);//日志查看 m_formIndex[FORMLOGIN]= addPages(new FormLogin); ui->stackedWidget->setCurrentIndex(m_formIndex.value(FORMLOGIN)); }
void UIScrollPage::addPagesByChildren() { if(!m_ChildrenControls.empty()) { CCArray *layers = CCArray::createWithCapacity(m_ChildrenControls.size()); for(std::list<UIControlBase*>::iterator it = m_ChildrenControls.begin(); it != m_ChildrenControls.end(); it++) { if(dynamic_cast<UILayout*>(*it)) { layers->addObject(static_cast<UILayout*>(*it)->getCurrentNode()); } } addPages(layers); } }
void BooFile::read() { QFile file; mustOpenFile(mFileName, &file); file.seek(mStartPos); QString metaAuthor; QString metaTitle; QString metaSubject; QString metaKeywords; QString title; QList<PageSpec> pagesSpec; while (!file.atEnd()) { QString line = QString::fromUtf8(file.readLine()).trimmed(); if (line.startsWith("@PJL")) { QString command = line.section(' ', 1, 1, QString::SectionSkipEmpty).toUpper(); // Boomaga commands ................................ if (command == "BOOMAGA") { QString subCommand = line.section(' ', 2, -1, QString::SectionSkipEmpty) .section('=', 0, 0, QString::SectionSkipEmpty) .trimmed() .toUpper(); QString value = line.section('=', 1,-1, QString::SectionSkipEmpty).trimmed(); if (value.startsWith('"') || value.startsWith('\'')) value = value.mid(1, value.length()-2); if (subCommand == "META_AUTHOR") metaAuthor = value; else if (subCommand == "META_TITLE") metaTitle = value; else if (subCommand == "META_SUBJECT") metaSubject = value; else if (subCommand == "META_KEYWORDS") metaKeywords = value; else if (subCommand == "JOB_TITLE") title = value; else if (subCommand == "JOB_PAGES") pagesSpec = PageSpec::readPagesSpec(value); else qWarning() << QString("Unknown command '%1' in the line '%2'").arg(subCommand).arg(line); } // Boomaga commands ................................ // PDF stream ...................................... else if (command == "ENTER") { QString subCommand = line.section(' ', 2, -1, QString::SectionSkipEmpty).remove(' ').toUpper(); if (subCommand == "LANGUAGE=PDF") { qint64 startPos = file.pos(); qint64 endPos = 0; while (!file.atEnd()) { QByteArray buf = file.readLine(); if (buf.startsWith("\x1B%-12345X@PJL")) break; endPos = file.pos() - 1; } PdfFile pdf; pdf.load(mFileName, startPos, endPos); Job job; job.setFileName(mFileName); job.setFilePos(startPos, endPos); job.setTitle(title); Job pdfJob = pdf.jobs().first(); // remove wrong pages ................. { int cnt = pdfJob.pageCount(); for (int i=pagesSpec.count()-1; i>=0; --i) { if (pagesSpec.at(i).pageNum >= cnt) pagesSpec.removeAt(i); } } QVector<int> pageNums; pageNums.reserve(pagesSpec.count()); foreach(const PageSpec &spec, pagesSpec) pageNums << spec.pageNum; addPages(pdfJob, pageNums, &job); for(int i=0; i<pagesSpec.count(); ++i) { const PageSpec &spec = pagesSpec.at(i); ProjectPage *page = job.page(i); if (spec.hidden) page->setVisible(false); if (spec.startBooklet) page->setManualStartSubBooklet(true); page->setManualRotation(spec.rotation); } mJobs << job; title.clear(); pagesSpec.clear(); } }
CVideoWindow::CVideoWindow(QWidget* parent, Qt::WFlags flags) { this->parent = parent; ui.setupUi(this); flags |= Qt::FramelessWindowHint; setWindowFlags(flags); QPalette plt = palette(); plt.setColor(QPalette::Background, QColor("black")); setPalette(plt); setGeometry(0, 0, 720, 576); videoButtonlist.append(ui.video_1); videoButtonlist.append(ui.video_2); videoButtonlist.append(ui.video_3); videoButtonlist.append(ui.video_4); videoButtonlist.append(ui.video_5); videoButtonlist.append(ui.video_6); interestLabelList.append(ui.interest_1); interestLabelList.append(ui.interest_2); interestLabelList.append(ui.interest_3); interestLabelList.append(ui.interest_4); interestLabelList.append(ui.interest_5); interestLabelList.append(ui.interest_6); haveLabelList.append(ui.have_1); haveLabelList.append(ui.have_2); haveLabelList.append(ui.have_3); haveLabelList.append(ui.have_4); haveLabelList.append(ui.have_5); haveLabelList.append(ui.have_6); videoLayoutList.append(ui.verticalLayout_1); videoLayoutList.append(ui.verticalLayout_2); videoLayoutList.append(ui.verticalLayout_3); videoLayoutList.append(ui.verticalLayout_4); videoLayoutList.append(ui.verticalLayout_5); videoLayoutList.append(ui.verticalLayout_6); connect(ui.nextButton, SIGNAL(clicked()), this, SLOT(addPages())); connect(ui.nextButton, SIGNAL(clicked()), this, SLOT(showVideos())); connect(ui.previousButton, SIGNAL(clicked()), this, SLOT(subPages())); connect(ui.previousButton, SIGNAL(clicked()), this, SLOT(showVideos())); CConfig::PAGE = 0; showVideos(); connect(ui.backButton, SIGNAL(clicked()), parent, SLOT(backFromContent())); foreach (QToolButton* everyone, videoButtonlist) { QFont font("Microsoft YaHei", 18); font.setBold(true); everyone->setFont(font); if (CConfig::isPlay) { connect(everyone, SIGNAL(clicked()), this, SLOT(play())); } else { connect(everyone, SIGNAL(clicked()), this, SLOT(choose())); } }
XAP_Dialog * XAP_DialogFactory::requestDialog(XAP_Dialog_Id id) { const _dlg_table * dlg = NULL; XAP_Dialog * pDialog = NULL; UT_sint32 index; if(_findDialogInTable(id, &index)) { dlg = m_vec_dlg_table.getNthItem(index); switch (dlg->m_type) { case XAP_DLGT_NON_PERSISTENT: // construct a non-persistent dialog and just return it. goto CreateItSimple; case XAP_DLGT_FRAME_PERSISTENT: // if requested frame-persistent dialog if (m_dialogType == XAP_DLGT_FRAME_PERSISTENT) // from a frame-persistent factory. goto CreateItPersistent; break; case XAP_DLGT_APP_PERSISTENT: // if requested app-persistent dialog if (m_dialogType == XAP_DLGT_APP_PERSISTENT) // if from a app-persistent factory goto CreateItPersistent; if (m_dialogType == XAP_DLGT_FRAME_PERSISTENT) // if from a frame-persistent factory, goto HandToAppFactory; // let the app's factory do it.... break; case XAP_DLGT_MODELESS: // if requested app-persistent dialog if (m_dialogType == XAP_DLGT_APP_PERSISTENT) // if from a app-persistent factory goto CreateItPersistent; if (m_dialogType == XAP_DLGT_FRAME_PERSISTENT) // if from a frame-persistent factory, goto HandToAppFactory; // let the app's factory do it.... break; } } // UT_ASSERT_NOT_REACHED(); return NULL; CreateItSimple: { // create a fresh dialog object and return it -- no strings attached. pDialog = (XAP_Dialog *)((dlg->m_pfnStaticConstructor)(this,id)); if (dlg->m_tabbed) { XAP_NotebookDialog * d = dynamic_cast<XAP_NotebookDialog *>(pDialog); UT_ASSERT(d); addPages(d, id); } return pDialog; } CreateItPersistent: { // see if we already have an instance of this object in our vector. // if so, just return it. otherwise, create a fresh one and remember it. UT_sint32 indexVec = m_vecDialogIds.findItem(index+1); if (indexVec < 0) // not present, create new object and add it to vector { pDialog = (XAP_Dialog *)((dlg->m_pfnStaticConstructor)(this,id)); m_vecDialogIds.addItem(index+1); m_vecDialogs.addItem(pDialog); } else // already present, reuse this object { pDialog = (XAP_Dialog *)m_vecDialogs.getNthItem(indexVec); } if (dlg->m_tabbed) { XAP_NotebookDialog * d = dynamic_cast<XAP_NotebookDialog *>(pDialog); UT_ASSERT(d); addPages(d, id); } // let the dialog object know that we are reusing it. XAP_Dialog_Persistent * pDialogPersistent = (XAP_Dialog_Persistent *)pDialog; pDialogPersistent->useStart(); return pDialog; } HandToAppFactory: { // pass the request to the factory with the appropriate scope. pDialog = XAP_App::getApp()->getDialogFactory()->requestDialog(id); return pDialog; } }