本文整理汇总了C++中QStackedWidget::currentWidget方法的典型用法代码示例。如果您正苦于以下问题:C++ QStackedWidget::currentWidget方法的具体用法?C++ QStackedWidget::currentWidget怎么用?C++ QStackedWidget::currentWidget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QStackedWidget
的用法示例。
在下文中一共展示了QStackedWidget::currentWidget方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: shouldHaveActivateNoWidgetWhenSelectNoContact
void MergeContactInfoWidgetTest::shouldHaveActivateNoWidgetWhenSelectNoContact()
{
MergeContactInfoWidget infoWidget;
Akonadi::Item item(4);
infoWidget.setContact(item);
QStackedWidget *stackedWidget = infoWidget.findChild<QStackedWidget *>(QStringLiteral("stackedwidget"));
QCOMPARE(stackedWidget->currentWidget()->objectName(), QStringLiteral("contactwidget"));
infoWidget.setContact(Akonadi::Item());
QCOMPARE(stackedWidget->currentWidget()->objectName(), QStringLiteral("nocontact"));
}
示例2: currentWidget
QWidget* PagePalette::currentWidget()
{
QStackedWidget* sw = dynamic_cast<QStackedWidget*>(this->widget());
if (sw)
return sw->currentWidget();
return 0;
}
示例3: shouldHaveDefaultValueOnCreation
void MergeContactInfoWidgetTest::shouldHaveDefaultValueOnCreation()
{
MergeContactInfoWidget infoWidget;
QStackedWidget *stackedWidget = infoWidget.findChild<QStackedWidget *>(QStringLiteral("stackedwidget"));
QVERIFY(stackedWidget);
QCOMPARE(stackedWidget->currentWidget()->objectName(), QStringLiteral("nocontact"));
}
示例4:
QWidget *QStackedWidgetProto::currentWidget() const
{
QStackedWidget *item = qscriptvalue_cast<QStackedWidget*>(thisObject());
if (item)
return item->currentWidget();
return 0;
}
示例5: slotTriggered
void RemoveStackPageAction::slotTriggered()
{
if ( !KexiUtils::objectIsA(m_receiver, "QStackedWidget")
&& /* compat */ !KexiUtils::objectIsA(m_receiver, "QWidgetStack"))
{
return;
}
QStackedWidget *stack = qobject_cast<QStackedWidget*>(m_receiver);
QWidget *page = stack->currentWidget();
QWidgetList list;
list.append(page);
KFormDesigner::Command *com = new KFormDesigner::DeleteWidgetCommand(*m_container->form(), list);
// raise prev/next widget
int index = stack->indexOf(page);
if (index > 0) {
index--;
}
else if (index < (stack->count()-1)) {
index++;
}
else {
index = -1;
}
if (index >= 0) {
stack->setCurrentIndex(index);
}
stack->removeWidget(page);
m_container->form()->addCommand(com);
}
示例6: resizeAndUpdateLayout
void YaToolBoxPage::resizeAndUpdateLayout(QSize size)
{
resize(size);
layout()->invalidate();
layout()->activate();
// work-around scrollbars showing at an incorrect place
invokeResized(widget_);
QStackedWidget* stack = dynamic_cast<QStackedWidget*>(widget_);
if (stack && stack->currentWidget()) {
stack->layout()->invalidate();
stack->layout()->activate();
invokeResized(stack->currentWidget());
}
button_->updateMask();
}
示例7: recreate_instruments_widget_from_state
static void recreate_instruments_widget_from_state(vector_t *state){
QStackedWidget* tabs = instruments_widget->tabs;
while(tabs->count()>0)
tabs->removeWidget(tabs->currentWidget());
//vector_t *names = (vector_t*)state->elements[0];
vector_t *pages = (vector_t*)state->elements[0];
for(int i=pages->num_elements-1; i>=0; i--){
QWidget *page = (QWidget*)pages->elements[i];
tabs->insertWidget(0,page);//,(const char*)names->elements[i]);
}
tabs->setCurrentWidget((QWidget*)state->elements[1]);
}
示例8:
static vector_t *create_instruments_widget_state(void){
vector_t *state = (vector_t *)talloc(sizeof(vector_t));
//vector_t *names = (vector_t *)talloc(sizeof(vector_t));
vector_t *pages = (vector_t *)talloc(sizeof(vector_t));
//VECTOR_push_back(state, names);
VECTOR_push_back(state, pages);
QStackedWidget* tabs = instruments_widget->tabs;
for(int i=0;i<tabs->count();i++){
//VECTOR_push_back(names, talloc_strdup(tabs->tabText(i).toUtf8().constData()));
VECTOR_push_back(pages, tabs->widget(i));
}
VECTOR_push_back(state, tabs->currentWidget());
return state;
}
示例9: getCellImp
QWidget *SplitGrid2::getCell(int row, int col) const
{
QStackedWidget* cell = getCellImp( row, col );
Q_ASSERT( cell != 0 );
return cell->currentWidget();
}