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


C++ QStackedWidget::widget方法代码示例

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


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

示例1:

QWidget *QStackedWidgetProto::widget(int index)                 const
{
  QStackedWidget *item = qscriptvalue_cast<QStackedWidget*>(thisObject());
  if (item)
    return item->widget(index);
  return 0;
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:7,代码来源:qstackedwidgetproto.cpp

示例2: slotTriggered

void GoToStackPageAction::slotTriggered()
{
    QStackedWidget *stack = qobject_cast<QStackedWidget*>(m_receiver);
    if (stack && stack->widget(nextWidgetIndex())) {
        stack->setCurrentIndex(nextWidgetIndex());
    }
}
开发者ID:TheTypoMaster,项目名称:calligra,代码行数:7,代码来源:KexiStandardContainerFormWidgets.cpp

示例3: getCellImp

void SplitGrid2::setCell(QWidget * w, int row, int col)
{
    Q_ASSERT( w != 0 );

    QStackedWidget* cell = getCellImp( row, col );
    Q_ASSERT( cell != 0 );
    if( cell->count() > 0 )
        cell->removeWidget( cell->widget(0) );
    cell->addWidget( w );
}
开发者ID:Wushaowei001,项目名称:NAF,代码行数:10,代码来源:SplitGrid2.cpp

示例4:

Audio_instrument_widget *get_audio_instrument_widget(struct Patch *patch){
  QStackedWidget* tabs = g_instruments_widget->tabs;

  for(int i=0;i<tabs->count();i++){
    Audio_instrument_widget *instrument = dynamic_cast<Audio_instrument_widget*>(tabs->widget(i));
    if(instrument!=NULL && instrument->_patch.data()==patch)
      return instrument;
  }

  return NULL;
}
开发者ID:kmatheussen,项目名称:radium,代码行数:11,代码来源:Qt_instruments.cpp

示例5: wrapQWidget

SEXP 
qt_qremoveWidgetFromStack(SEXP x, SEXP index) {
    int i = asInteger(index);
    QStackedWidget *s = unwrapQObject(x, QStackedWidget);
    QWidget *w;
    if (i > 0 && i <= s->count()) {
	w = s->widget(i - 1);
	s->removeWidget(w);
	return wrapQWidget(w);
    }    
    return R_NilValue;
}
开发者ID:rforge,项目名称:qtinterfaces,代码行数:12,代码来源:containers.cpp

示例6: QAction

GoToStackPageAction::GoToStackPageAction(Direction direction,
                                         KFormDesigner::Container *container,
                                         QWidget *receiver, QObject *parent)
    : QAction(QIcon::fromTheme(direction == Previous ? koIconName("go-previous") : koIconName("go-next")),
              direction == Previous ? xi18nc("Go to Previous Page of a Stacked Widget", "Go to Previous Page")
                                    : xi18nc("Go to Next Page of a Stacked Widget", "Go to Next Page"),
              parent)
    , m_direction(direction)
    , m_container(container)
    , m_receiver(receiver)
{
    connect(this, SIGNAL(triggered()), this, SLOT(slotTriggered()));
    QStackedWidget *stack = qobject_cast<QStackedWidget*>(m_receiver);
    if (!stack || !stack->widget(nextWidgetIndex())) {
        setEnabled(false);
    }
}
开发者ID:TheTypoMaster,项目名称:calligra,代码行数:17,代码来源:KexiStandardContainerFormWidgets.cpp

示例7:

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;
}
开发者ID:onukore,项目名称:radium,代码行数:20,代码来源:undo_instruments_widget.cpp

示例8: GFX_update_all_instrument_widgets

void GFX_update_all_instrument_widgets(void){
  QStackedWidget* tabs = g_instruments_widget->tabs;

  //printf("*(((((((((( Calling. Update all %d:\n",tabs->count());
  for(int i=0;i<tabs->count();i++){
    MIDI_instrument_widget *midi_instrument = dynamic_cast<MIDI_instrument_widget*>(tabs->widget(i));
    Audio_instrument_widget *audio_instrument = dynamic_cast<Audio_instrument_widget*>(tabs->widget(i));
    //printf("Update all %d: %p/%p\n",i,midi_instrument,audio_instrument);

    if(midi_instrument!=NULL){

      if(midi_instrument->patch->patchdata!=NULL)
        update_midi_instrument_widget(midi_instrument,midi_instrument->patch.data());

    }else if(audio_instrument!=NULL){

      if(audio_instrument->_patch->patchdata!=NULL)
        update_audio_instrument_widget(audio_instrument,audio_instrument->_patch.data());

    }
  }
}
开发者ID:kmatheussen,项目名称:radium,代码行数:22,代码来源:Qt_instruments.cpp


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