QWidget *QStackedWidgetProto::widget(int index) const { QStackedWidget *item = qscriptvalue_cast<QStackedWidget*>(thisObject()); if (item) return item->widget(index); return 0; }
void GoToStackPageAction::slotTriggered() { QStackedWidget *stack = qobject_cast<QStackedWidget*>(m_receiver); if (stack && stack->widget(nextWidgetIndex())) { stack->setCurrentIndex(nextWidgetIndex()); } }
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 ); }
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; }
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; }
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); } }
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; }
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()); } } }