本文整理汇总了C++中setCurrentPage函数的典型用法代码示例。如果您正苦于以下问题:C++ setCurrentPage函数的具体用法?C++ setCurrentPage怎么用?C++ setCurrentPage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setCurrentPage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateButtonState
void Wizard::next()
{
if (currentPageIsComplete() && validateCurrentPage())
{
updateButtonState();
int nId = nextId();
if ((nId == -1) && (m_currentId < m_pages.size()))
{
setCurrentPage(m_currentId + 1);
}
if (nId > -1 && nId < m_pages.size())
{
setCurrentPage(nId);
}
}
}
示例2: connect
void EditGroupWidget::loadGroup(Group* group, bool create, const QSharedPointer<Database>& database)
{
m_group = group;
m_db = database;
m_temporaryGroup.reset(group->clone(Entry::CloneNoFlags, Group::CloneNoFlags));
connect(m_temporaryGroup->customData(), SIGNAL(customDataModified()), SLOT(setModified()));
if (create) {
setHeadline(tr("Add group"));
} else {
setHeadline(tr("Edit group"));
}
if (m_group->parentGroup()) {
addTriStateItems(m_mainUi->searchComboBox, m_group->parentGroup()->resolveSearchingEnabled());
addTriStateItems(m_mainUi->autotypeComboBox, m_group->parentGroup()->resolveAutoTypeEnabled());
} else {
addTriStateItems(m_mainUi->searchComboBox, true);
addTriStateItems(m_mainUi->autotypeComboBox, true);
}
m_mainUi->editName->setText(m_group->name());
m_mainUi->editNotes->setPlainText(m_group->notes());
m_mainUi->expireCheck->setChecked(group->timeInfo().expires());
m_mainUi->expireDatePicker->setDateTime(group->timeInfo().expiryTime().toLocalTime());
m_mainUi->searchComboBox->setCurrentIndex(indexFromTriState(group->searchingEnabled()));
m_mainUi->autotypeComboBox->setCurrentIndex(indexFromTriState(group->autoTypeEnabled()));
if (group->defaultAutoTypeSequence().isEmpty()) {
m_mainUi->autoTypeSequenceInherit->setChecked(true);
} else {
m_mainUi->autoTypeSequenceCustomRadio->setChecked(true);
}
m_mainUi->autoTypeSequenceCustomEdit->setText(group->effectiveAutoTypeSequence());
IconStruct iconStruct;
iconStruct.uuid = m_temporaryGroup->iconUuid();
iconStruct.number = m_temporaryGroup->iconNumber();
m_editGroupWidgetIcons->load(m_temporaryGroup->uuid(), m_db, iconStruct);
m_editWidgetProperties->setFields(m_temporaryGroup->timeInfo(), m_temporaryGroup->uuid());
m_editWidgetProperties->setCustomData(m_temporaryGroup->customData());
for (const ExtraPage& page : asConst(m_extraPages)) {
page.set(m_temporaryGroup.data(), m_db);
}
setCurrentPage(0);
m_mainUi->editName->setFocus();
// Force the user to Save/Discard new groups
showApplyButton(!create);
setModified(false);
}
示例3: setCurrentPage
void PreferencesPanel::clickedPage()
{
for (auto* b : buttons)
{
if (b->getToggleState())
{
setCurrentPage (b->getName());
break;
}
}
}
示例4: setCurrentPage
void PreferencesPanel::buttonClicked (Button*)
{
for (int i = 0; i < buttons.size(); ++i)
{
if (buttons.getUnchecked(i)->getToggleState())
{
setCurrentPage (buttons.getUnchecked(i)->getName());
break;
}
}
}
示例5: sendCommand
void DiscoverAction::execute()
{
RemoteInterface::instance().setActiveThumbnailModel(RemoteInterface::ModelType::Discovery);
if (m_currentSelection.isEmpty())
sendCommand(SearchRequest(SearchType::Images, m_searchInfo));
else
m_model->setCurrentSelection(m_currentSelection, m_allImages);
m_model->setCurrentAction(this);
setCurrentPage(Page::DiscoverPage);
}
示例6: KexiAssistantWidget
KexiImportExportAssistant::KexiImportExportAssistant(
const QAction *action_project_import_export_send_,
const QAction *action_import_project_,
QWidget* parent)
: KexiAssistantWidget(parent)
, action_project_import_export_send(action_project_import_export_send_)
, action_import_project(action_import_project_)
, d(new Private(this))
{
setCurrentPage(d->mainPage());
setFocusProxy(d->mainPage());
}
示例7: switch
bool QTabWidget::qt_invoke( int _id, QUObject* _o )
{
switch ( _id - staticMetaObject()->slotOffset() ) {
case 0: setCurrentPage((int)static_QUType_int.get(_o+1)); break;
case 1: showPage((QWidget*)static_QUType_ptr.get(_o+1)); break;
case 2: removePage((QWidget*)static_QUType_ptr.get(_o+1)); break;
case 3: showTab((int)static_QUType_int.get(_o+1)); break;
default:
return QWidget::qt_invoke( _id, _o );
}
return TRUE;
}
示例8: setCurrentPage
void KviTalWizard::setBackEnabled(QWidget * pWidget,bool bEnabled)
{
KviTalWizardPageData * pData = m_p->findPage(pWidget);
if(!pData)
return;
if(bEnabled)
pData->iEnableFlags |= KviTalWizardPageData::EnableBack;
else
pData->iEnableFlags &= ~KviTalWizardPageData::EnableBack;
if(pData == m_p->pCurrentPage)
setCurrentPage(pData);
}
示例9: ConfigDialog
PreferencesDialog::PreferencesDialog(QWidget *parent)
: ConfigDialog(parent, "PreferencesDialog")
{
iCount++;
server = new ServerSettings(this);
playback = new PlaybackSettings(this);
files = new FileSettings(this);
interface = new InterfaceSettings(this);
context = new ContextSettings(this);
cache = new CacheSettings(this);
scrobbling = new ScrobblingSettings(this);
custom = new CustomActionsSettings(this);
server->load();
playback->load();
files->load();
interface->load();
context->load();
scrobbling->load();
custom->load();
addPage(QLatin1String("collection"), server, i18n("Collection"), Icons::self()->audioFileIcon, i18n("Collection Settings"));
addPage(QLatin1String("playback"), playback, i18n("Playback"), Icons::self()->speakerIcon, i18n("Playback Settings"));
addPage(QLatin1String("files"), files, i18n("Downloaded Files"), Icons::self()->filesIcon, i18n("Downloaded Files Settings"));
addPage(QLatin1String("interface"), interface, i18n("Interface"), Icon("preferences-other"), i18n("Interface Settings"));
addPage(QLatin1String("info"), context, i18n("Info"), Icons::self()->contextIcon, i18n("Info View Settings"));
addPage(QLatin1String("scrobbling"), scrobbling, i18n("Scrobbling"), Icons::self()->lastFmIcon, i18n("Scrobbling Settings"));
#if defined CDDB_FOUND || defined MUSICBRAINZ5_FOUND
audiocd = new AudioCdSettings(0);
audiocd->load();
addPage(QLatin1String("cd"), audiocd, i18n("Audio CD"), Icon("media-optical"), i18n("Audio CD Settings"));
#endif
#ifdef ENABLE_PROXY_CONFIG
proxy = new ProxySettings(0);
proxy->load();
addPage(QLatin1String("proxy"), proxy, i18n("Proxy"), Icon("preferences-system-network"), i18nc("Qt-only", "Proxy Settings"));
#endif
#ifndef ENABLE_KDE_SUPPORT
shortcuts = new ShortcutsSettingsPage(0);
addPage(QLatin1String("shortcuts"), shortcuts, i18nc("Qt-only", "Shortcuts"), Icon(QStringList() << "preferences-desktop-keyboard" << "keyboard"),
i18nc("Qt-only", "Keyboard Shortcut Settings"));
shortcuts->load();
#endif
addPage(QLatin1String("cache"), cache, i18n("Cache"), Icon(QStringList() << "folder-temp" << "folder"), i18n("Cached Items"));
addPage(QLatin1String("custom"), custom, i18n("Custom Actions"), Icon(QStringList() << "fork" << "gtk-execute"), i18n("Custom Actions"));
#ifdef Q_OS_MAC
setCaption(i18n("Cantata Preferences"));
#else
setCaption(i18n("Configure"));
#endif
setAttribute(Qt::WA_DeleteOnClose);
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
setCurrentPage(QLatin1String("collection"));
}
示例10: OtpPage
void MainWindow::createPages() {
//Create pages
m_otpPage = new OtpPage(this);
m_oathPage = new OathPage(this);
m_staticPage = new StaticPage(this);
m_chalRespPage = new ChalRespPage(this);
m_settingPage = new SettingPage(this);
m_toolPage = new ToolPage(this);
m_aboutPage = new AboutPage(this);
//Add pages to the pages widget
ui->pagesWidget->addWidget(m_otpPage);
ui->pagesWidget->addWidget(m_oathPage);
ui->pagesWidget->addWidget(m_staticPage);
ui->pagesWidget->addWidget(m_chalRespPage);
ui->pagesWidget->addWidget(m_settingPage);
ui->pagesWidget->addWidget(m_toolPage);
ui->pagesWidget->addWidget(m_aboutPage);
//Map the values of menu buttons with the indexes of the pages widget
//Create a QMapper
QSignalMapper *mapper = new QSignalMapper(this);
//Connect the clicked signal with the QSignalMapper
connect(ui->otpMenuBtn, SIGNAL(clicked()), mapper, SLOT(map()));
connect(ui->oathHotpMenuBtn, SIGNAL(clicked()), mapper, SLOT(map()));
connect(ui->staticMenuBtn, SIGNAL(clicked()), mapper, SLOT(map()));
connect(ui->chalRespMenuBtn, SIGNAL(clicked()), mapper, SLOT(map()));
connect(ui->settingsMenuBtn, SIGNAL(clicked()), mapper, SLOT(map()));
connect(ui->toolsMenuBtn, SIGNAL(clicked()), mapper, SLOT(map()));
connect(ui->aboutMenuBtn, SIGNAL(clicked()), mapper, SLOT(map()));
//Set a value for each button
mapper->setMapping(ui->otpMenuBtn, Page_Otp);
mapper->setMapping(ui->oathHotpMenuBtn, Page_Oath);
mapper->setMapping(ui->staticMenuBtn, Page_Static);
mapper->setMapping(ui->chalRespMenuBtn, Page_ChalResp);
mapper->setMapping(ui->settingsMenuBtn, Page_Settings);
mapper->setMapping(ui->toolsMenuBtn, Page_Tools);
mapper->setMapping(ui->aboutMenuBtn, Page_About);
//Connect the mapper to the pages widget
//The mapper will set a value to each button and set that value to
//the pages widget
//connect(mapper, SIGNAL(mapped(int)), ui->pagesWidget, SLOT(setCurrentIndex(int)));
connect(mapper, SIGNAL(mapped(int)), this, SLOT(setCurrentPage(int)));
//Set the current page
m_currentPage = 0;
setCurrentPage(Page_About);
}
示例11: setCurrentPage
/**
* Displays a context menu for page operations.
* This slot is connected to the contextMenu() signal, emitted by m_pQueryTabs.
* @param pWidget The page under the mouse
* @param pt The point over which the mouse was clicked in request for
* the context menu
*/
void QueryWidget::slotContextMenu(QWidget* pWidget, const QPoint& pt)
{
// Operations are on the current page, so we must ensure the clicked
// tab becomes the current one
setCurrentPage(pWidget);
QList<QAction*> lActions = m_pPageMenu->actions();
for (int i = 1; i < lActions.count(); lActions.at(i++)->setEnabled(true)) {}
// Show the menu
m_pPageMenu->popup(pt);
}
示例12: showPage
void PreferencesDialog::showPage(const QString &page)
{
QStringList parts=page.split(QLatin1Char(':'));
if (setCurrentPage(parts.at(0))) {
if (parts.count()>1) {
QWidget *cur=getPage(parts.at(0));
if (qobject_cast<InterfaceSettings *>(cur)) {
static_cast<InterfaceSettings *>(cur)->showPage(parts.at(1));
}
}
}
Utils::raiseWindow(this);
}
示例13: KexiAssistantWidget
KexiWelcomeAssistant::KexiWelcomeAssistant(
KexiRecentProjects* projects, KexiMainWindow* parent)
: KexiAssistantWidget(parent)
, d(new Private(this))
{
d->mainWindow = parent;
d->mainWindow->redirectMessagesTo(this);
d->messageWidgetActionNo = 0;
d->messageWidgetActionTryAgain = 0;
d->projects = projects;
setCurrentPage(d->mainWelcomePage());
setFocusProxy(d->mainWelcomePage());
}
示例14: setResizePageToMusic
//-------------------------------------------------------------------------
void QGuidoItemContainer::loadFromOtherContainer( const QGuidoItemContainer * otherContainer )
{
setResizePageToMusic( otherContainer->mGuidoItem->isResizePageToMusic() );
load( otherContainer );
mIsOptimalPageFillOn = otherContainer->mIsOptimalPageFillOn;
mIsProportionalOn = otherContainer->mIsProportionalOn;
mGuidoItem->scale( otherContainer->mGuidoItem->transform().m11() , otherContainer->mGuidoItem->transform().m22() );
updateLayoutSettings();
mGuidoItem->setGridWidth(otherContainer->mGuidoItem->gridWidth());
mGuidoItem->setGridHeight(otherContainer->mGuidoItem->gridHeight());
setCurrentPage( otherContainer->mGuidoItem->firstVisiblePage());
}
示例15: setCurrentPage
void Wizard::addPage(WizardPage* page)
{
m_pages.push_back(page);
m_stack->addWidget(page);
page->setWizard(this);
if (m_currentId == -1)
{
setCurrentPage(0);
}
updateButtonState();
}