当前位置: 首页>>代码示例>>C++>>正文


C++ QStackedLayout::setCurrentIndex方法代码示例

本文整理汇总了C++中QStackedLayout::setCurrentIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ QStackedLayout::setCurrentIndex方法的具体用法?C++ QStackedLayout::setCurrentIndex怎么用?C++ QStackedLayout::setCurrentIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QStackedLayout的用法示例。


在下文中一共展示了QStackedLayout::setCurrentIndex方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updateContent

void EventDetailsDialog::updateContent(const CommitDetails& details)
{
    QStackedLayout *layout = (QStackedLayout *)this->layout();
    layout->setCurrentIndex(INDEX_DETAILS_VIEW);

    model_->setCommitDetails(details);
}
开发者ID:DevCybran,项目名称:seafile-client,代码行数:7,代码来源:event-details-dialog.cpp

示例2: QWidget

toResultPlanAbstr::toResultPlanAbstr(QWidget *parent)
	: QWidget(parent)
	, CursorChildSel(NULL)
	, DisplayChildCombo(false)
	, Explaining(false)
	, Query(NULL)
{
    using namespace ToConfiguration;
    planTreeView = new toResultPlanView(this);
    planTreeText = new QPlainTextEdit(this);
    planTreeText->setReadOnly(true);
    planTreeText->setFont(Utils::toStringToFont(toConfigurationNewSingle::Instance().option(Editor::ConfTextFont).toString()));

    //toExplainTypeButtonSingle::Instance().
    QStackedLayout  *mainLayout = new QStackedLayout;
    mainLayout->setSpacing(0);
    mainLayout->setContentsMargins(0, 0, 0, 0);

    mainLayout->addWidget(planTreeView);
    mainLayout->addWidget(planTreeText);
    mainLayout->setCurrentIndex(0);
    //mainLayout->setStackingMode(QStackedLayout::StackAll);
    setLayout(mainLayout);
}
开发者ID:Daniel1892,项目名称:tora,代码行数:24,代码来源:toresultplan.cpp

示例3: showReposList

void CloudView::showReposList()
{
    QStackedLayout *stack = (QStackedLayout *)(layout());
    stack->setCurrentIndex(INDEX_REPOS_LIST);
}
开发者ID:sebheitzmann,项目名称:seafile-client,代码行数:5,代码来源:cloud-view.cpp

示例4: showLoadingView

void CloudView::showLoadingView()
{
    QStackedLayout *stack = (QStackedLayout *)(layout());

    stack->setCurrentIndex(INDEX_LOADING_VIEW);
}
开发者ID:sebheitzmann,项目名称:seafile-client,代码行数:6,代码来源:cloud-view.cpp

示例5: createPluginHost

void RackWindow::createPluginHost(int position)
{
    //layout settings widget:
    QWidget *settingsWidget = new QWidget;
    settingsWidget->setPalette(QPalette(QColor(0,0,0,160)));
    settingsWidget->setAutoFillBackground(true);

    RPushButton *leftButton = new RPushButton;
    leftButton->setObjectName("rackSettingsLeftArrowButton");
    RPushButton *rightButton = new RPushButton;
    rightButton->setObjectName("rackSettingsRightArrowButton");
    RPushButton *topButton = new RPushButton;
    topButton->setObjectName("rackSettingsTopArrowButton");
    RPushButton *bottomButton = new RPushButton;
    bottomButton->setObjectName("rackSettingsBottomArrowButton");
    RPushButton *closeButton = new RPushButton;
    closeButton->setObjectName("rackSettingsCloseButton");

    //vertical toolbar for plugin buttons:
    QToolBar *pluginHostToolBar = new QToolBar;
    pluginHostToolBar->setObjectName("rackPluginHostToolBar");
    pluginHostToolBar->setOrientation(Qt::Vertical);
    //actiongroup for exclusive handling of buttons:
    QActionGroup *ag = new QActionGroup(pluginHostToolBar);
    ag->setExclusive(true);

    RPushButton *addPluginWidgetButton = new RPushButton(tr("Add Widget ..."));
    addPluginWidgetButton->setObjectName("rackAddPluginWidgetButton");

    QWidget *middleWidget = new QWidget;
    QVBoxLayout *middleLayout = new QVBoxLayout(middleWidget);
    middleLayout->setSpacing(0);
    middleLayout->setContentsMargins(0,0,0,0);
    middleLayout->addWidget(pluginHostToolBar, 0, Qt::AlignHCenter);
    middleLayout->addWidget(addPluginWidgetButton, 0, Qt::AlignHCenter);

    QGridLayout *settingsLayout = new QGridLayout(settingsWidget);
    settingsLayout->setSpacing(0);
    settingsLayout->setContentsMargins(0,0,0,0);
    settingsLayout->addWidget(topButton,0,1, Qt::AlignTop | Qt::AlignHCenter);
    settingsLayout->addWidget(closeButton,0,2, Qt::AlignTop | Qt::AlignRight);
    settingsLayout->addWidget(leftButton,1,0, Qt::AlignLeft);
    settingsLayout->addWidget(rightButton,1,2, Qt::AlignRight);
    settingsLayout->addWidget(bottomButton,2,1, Qt::AlignBottom| Qt::AlignHCenter);
    settingsLayout->addWidget(middleWidget,1,1);

    QStackedWidget *pluginStack = new QStackedWidget;
    pluginStack->setObjectName("rackPluginStack");
    pluginStack->setAutoFillBackground(true);

    QWidget *pluginHost = new QWidget;
    pluginHost->setMinimumSize(200,80);

    QStackedLayout *overlayLayout = new QStackedLayout(pluginHost);
    overlayLayout->setStackingMode(QStackedLayout::StackAll);
    overlayLayout->addWidget(pluginStack);
    overlayLayout->addWidget(settingsWidget);
    overlayLayout->setCurrentIndex(1);

    //enter/leave settings signals:
    QSignalMapper *mapperShowSettingsMode = new QSignalMapper(pluginHost);
    QObject::connect(this, SIGNAL(enterSettingsMode()), mapperShowSettingsMode, SLOT(map()));
    mapperShowSettingsMode->setMapping(this, 1);
    QSignalMapper *mapperHideSettingsMode = new QSignalMapper(pluginHost);
    QObject::connect(this, SIGNAL(leaveSettingsMode()), mapperHideSettingsMode, SLOT(map()));
    mapperHideSettingsMode->setMapping(this, 0);
    QObject::connect(mapperShowSettingsMode, SIGNAL(mapped(int)), overlayLayout, SLOT(setCurrentIndex(int)));
    QObject::connect(mapperHideSettingsMode, SIGNAL(mapped(int)), overlayLayout, SLOT(setCurrentIndex(int)));

    //create plugin host widget signals:
    QSignalMapper *mapperCreatePluginHost = new QSignalMapper(pluginHost);
    QObject::connect(leftButton, SIGNAL(clicked()), mapperCreatePluginHost, SLOT(map()));
    QObject::connect(rightButton, SIGNAL(clicked()), mapperCreatePluginHost, SLOT(map()));
    QObject::connect(topButton, SIGNAL(clicked()), mapperCreatePluginHost, SLOT(map()));
    QObject::connect(bottomButton, SIGNAL(clicked()), mapperCreatePluginHost, SLOT(map()));
    mapperCreatePluginHost->setMapping(leftButton, NewSplitterLeft);
    mapperCreatePluginHost->setMapping(rightButton, NewSplitterRight);
    mapperCreatePluginHost->setMapping(topButton, NewSplitterTop);
    mapperCreatePluginHost->setMapping(bottomButton, NewSplitterBottom);
    QObject::connect(mapperCreatePluginHost, SIGNAL(mapped(int)), SLOT(createPluginHost(int)));

    //load plugin signal:
    QObject::connect(addPluginWidgetButton, SIGNAL(clicked()), m_mapperLoadNewPlugin, SLOT(map()));
    m_mapperLoadNewPlugin->setMapping(addPluginWidgetButton, pluginHost);

    //close plugin host signal:
    QObject::connect(closeButton, SIGNAL(clicked()), m_mapperClosePluginHost, SLOT(map()));
    m_mapperClosePluginHost->setMapping(closeButton, pluginHost);

    //create plugin switch signalmapper
    QSignalMapper *mapperSwitchPlugin = new QSignalMapper(pluginHost);
    mapperSwitchPlugin->setObjectName("rackPluginSwitchMapper");
    QObject::connect(mapperSwitchPlugin, SIGNAL(mapped(QWidget *)), pluginStack, SLOT(setCurrentWidget(QWidget *)));


    ////test show/hide plugin widget

    ////QObject::connect(mapperSwitchPlugin, SIGNAL(mapped(QWidget *)), this, SLOT(showHidePluginWidget(QWidget*)));


//.........这里部分代码省略.........
开发者ID:stemuedendron,项目名称:rack-radio-automation-construction-kit,代码行数:101,代码来源:rackwindow.cpp


注:本文中的QStackedLayout::setCurrentIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。