本文整理汇总了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;
}
示例2: slotTriggered
void GoToStackPageAction::slotTriggered()
{
QStackedWidget *stack = qobject_cast<QStackedWidget*>(m_receiver);
if (stack && stack->widget(nextWidgetIndex())) {
stack->setCurrentIndex(nextWidgetIndex());
}
}
示例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 );
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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());
}
}
}