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


C++ currentIndexChanged函数代码示例

本文整理汇总了C++中currentIndexChanged函数的典型用法代码示例。如果您正苦于以下问题:C++ currentIndexChanged函数的具体用法?C++ currentIndexChanged怎么用?C++ currentIndexChanged使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: checkPlaylist

void MediaPlayer :: checkPlaylist(int currentIndex)
{
    // this fires on startup with index -1 for some reason
    if(currentIndex != -1)
    {
        setArtist(plModel->data(plModel->index(currentIndex), plModel->Artist).toString());
        setTitle(plModel->data(plModel->index(currentIndex), plModel->Title).toString());

        qDebug() << "currIndex: " << currentIndex;

        emit currentIndexChanged();

        if(autoQueue)
        {
            //check if current item is the last in list
            if(currentIndex == (playlist->mediaCount() -1))
            {
                //insert random item next
                tracker->randomItem();
            }
        }
    }
}
开发者ID:r0kk3rz,项目名称:SirenSong-Media-Player,代码行数:23,代码来源:mediaplayer.cpp

示例2: FormGenChoiceCompositionContainer

FormGenChoiceCompositionComboListContainer::FormGenChoiceCompositionComboListContainer(bool listMode, QWidget *parent)
    : FormGenChoiceCompositionContainer(parent)
    , mComboBox(nullptr)
    , mListView(nullptr)
    , mListModel(nullptr)
    , mElementContainer(new QWidget)
    , mElementLayout(new QStackedLayout)
{
    mElementContainer->setLayout(mElementLayout);

    auto outerLayout = new QGridLayout;
    outerLayout->setContentsMargins(0, 0, 0, 0);

    if( listMode ) {
        mListView = new QListView;
        mListModel = new QStringListModel;
        mListView->setModel(mListModel);
        connect(mListView->selectionModel(), &QItemSelectionModel::currentChanged,
                [this] ()
        {
            const int row = mListView->selectionModel()->currentIndex().row();
            mElementLayout->setCurrentIndex(row);
            emit currentIndexChanged(row);
        });
        outerLayout->addWidget(mListView, 0, 0, 1, 2);
    } else {
        mComboBox = new QComboBox;
        connect(mComboBox, SIGNAL(currentIndexChanged(int)), mElementLayout, SLOT(setCurrentIndex(int)));
        connect(mComboBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(currentIndexChanged(int)));
        outerLayout->addWidget(mComboBox, 0, 0, 1, 2);
    }

    outerLayout->addItem(new QSpacerItem(s_frameSubContentMargin, 1), 1, 0);
    outerLayout->addWidget(mElementContainer, 1, 1);

    setLayout(outerLayout);
}
开发者ID:z-s-e,项目名称:FormGenWidgets-Qt,代码行数:37,代码来源:formgencompositionwidgets.cpp

示例3: switch

bool HelpDialog::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: showTopic((int)static_QUType_int.get(_o+1),(QListBoxItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3))); break;
    case 1: showTopic((int)static_QUType_int.get(_o+1),(QListViewItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3))); break;
    case 2: showTopic((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 3: loadIndexFile(); break;
    case 4: insertContents(); break;
    case 5: setupFullTextIndex(); break;
    case 6: currentTabChanged((const QString&)static_QUType_QString.get(_o+1)); break;
    case 7: currentIndexChanged((QListBoxItem*)static_QUType_ptr.get(_o+1)); break;
    case 8: showTopic(); break;
    case 9: searchInIndex((const QString&)static_QUType_QString.get(_o+1)); break;
    case 10: addBookmark(); break;
    case 11: removeBookmark(); break;
    case 12: currentBookmarkChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 13: currentContentsChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 14: startSearch(); break;
    case 15: showSearchHelp(); break;
    case 16: initialize(); break;
    case 17: toggleContents(); break;
    case 18: toggleIndex(); break;
    case 19: toggleBookmarks(); break;
    case 20: toggleSearch(); break;
    case 21: lastWinClosed(); break;
    case 22: showResultPage((int)static_QUType_int.get(_o+1),(QListBoxItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3))); break;
    case 23: showResultPage((QListBoxItem*)static_QUType_ptr.get(_o+1)); break;
    case 24: setIndexingProgress((int)static_QUType_int.get(_o+1)); break;
    case 25: showItemMenu((QListBoxItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2))); break;
    case 26: showItemMenu((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2))); break;
    case 27: insertBookmarks(); break;
    case 28: processEvents(); break;
    default:
	return HelpDialogBase::qt_invoke( _id, _o );
    }
    return TRUE;
}
开发者ID:AliYousuf,项目名称:univ-aca-mips,代码行数:37,代码来源:moc_helpdialogimpl.cpp

示例4: QDialog

NewGameDialog::NewGameDialog(QWidget* parent)
	: QDialog(parent),
	  ui(new Ui::NewGameDialog)
{
	ui->setupUi(this);

	m_engines = new EngineConfigurationModel(
		CuteChessApplication::instance()->engineManager(), this);

	connect(ui->m_configureWhiteEngineButton, SIGNAL(clicked(bool)), this,
		SLOT(configureWhiteEngine()));
	connect(ui->m_configureBlackEngineButton, SIGNAL(clicked(bool)), this,
		SLOT(configureBlackEngine()));

	connect(ui->m_timeControlBtn, SIGNAL(clicked()),
		this, SLOT(showTimeControlDialog()));

	m_proxyModel = new EngineConfigurationProxyModel(this);
	m_proxyModel->setSourceModel(m_engines);
	m_proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
	m_proxyModel->sort(0);
	m_proxyModel->setDynamicSortFilter(true);

	ui->m_whiteEngineComboBox->setModel(m_proxyModel);
	ui->m_blackEngineComboBox->setModel(m_proxyModel);

	ui->m_variantComboBox->addItems(Chess::BoardFactory::variants());
	connect(ui->m_variantComboBox, SIGNAL(currentIndexChanged(QString)),
		this, SLOT(onVariantChanged(QString)));

	int index = ui->m_variantComboBox->findText("standard");
	ui->m_variantComboBox->setCurrentIndex(index);

	m_timeControl.setMovesPerTc(40);
	m_timeControl.setTimePerTc(300000);
	ui->m_timeControlBtn->setText(m_timeControl.toVerboseString());
}
开发者ID:coyotte508,项目名称:cutechess,代码行数:37,代码来源:newgamedlg.cpp

示例5: QDialog

DataPlotUI::DataPlotUI(int deploymentId, QWidget *parent)
    : QDialog(parent) {
    ui.setupUi(this);

    this->deploymentId = deploymentId;

    // init combo boxes
    initComboArea();

    // connect signals and slots
    connect(ui.cbMeasurementProfileID, SIGNAL(currentIndexChanged(QString)), this, SLOT(measurementProfileChanged()));
    connect(ui.btnClose, SIGNAL(clicked()), this, SLOT(closeButtonClicked()));

    //ui.plData->setTitle("Data");
    ui.plData->setAxisTitle(QwtPlot::xBottom, "Time");
    ui.plData->setAxisTitle(QwtPlot::yLeft, "Temperature [Celsius]");
    ui.plData->setCanvasBackground(Qt::white);

    curve1 = new QwtPlotCurve("Measurements");
    curve1->attach(ui.plData);
    curve1->setPen(QPen(Qt::black, 1, Qt::SolidLine));

    ui.plData->replot();
}
开发者ID:lachlan007,项目名称:iassist,代码行数:24,代码来源:DataPlotUI.cpp

示例6: QLabel

void PropertiesManager::createEventPortProperties(EventPortTextItem *ep)
{
    //move up down
    root->actionMove_Up->setEnabled(true);
    root->actionMove_Down->setEnabled(true);
    root->actionDeleteItems->setEnabled(true);

    QLabel *label = new QLabel("<b>Edit Event Port</b>");
    addRow(label);

    QComboBox *mode = new QComboBox();
    mode->addItem("Send");
    mode->addItem("Receive");
    EventPortMode m = ep->getPortMode();
    switch(m){
    case(EventSendPort):{
        mode->setCurrentIndex(0);
        break;
    }
    case(EventRecvPort):{
        mode->setCurrentIndex(1);
        break;
    }
    default:{
        mode->setCurrentIndex(-1);
    }
    }
    connect(mode, SIGNAL(currentIndexChanged(QString)), ep, SLOT(setPortMode(QString)));
    addRow(tr("Event &Mode:"), mode);

    QLineEdit *name = new QLineEdit();
    name->installEventFilter(&eventFilterObject);
    name->setText(ep->getName());
    name->setValidator(validator);
    connect(name, SIGNAL(textEdited(QString)), ep, SLOT(setName(QString)));
    addRow(tr("&Name:"),name);
}
开发者ID:ABRG-Models,项目名称:SpineCreator,代码行数:37,代码来源:propertiesmanager.cpp

示例7: QWidget

processByDignityWidget::processByDignityWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::processByDignityWidget),
    fechaModel(new QSqlTableModel),
    resultModel(new QSqlTableModel),
    noaaResultModel(new QSqlTableModel),
    information(new dataProcessor)
{
    ui->setupUi(this);
    QStringList items;

    connect(ui->filterButton, SIGNAL(clicked()), this, SLOT(doCalc()));
    connect(ui->dignityFilterButton, SIGNAL(clicked()), this, SLOT(calcDignity()));

    connect(ui->addButton, SIGNAL(clicked()), this, SLOT(add()));
    connect(ui->delButton, SIGNAL(clicked()), this, SLOT(del()));

    items << "Normal" << "Luna llena" << "Luna nueva" << "Equinoccios" << "Solsticios";
    ui->tipoComboBox->addItems(items);
    fechaModel->setTable("view_estadotiempos");
    fechaModel->select();
    //resultModel->setTable("validweather");
    resultModel->setTable("view_estadotiempos");
    noaaResultModel->setTable("estadotiempos_diarios");
    ui->tableView->setModel(resultModel);
    ui->noaaTableView->setModel(noaaResultModel);
    ui->fechaComboBox->setModel(fechaModel);
    ui->fechaComboBox->setModelColumn(0);
    dateTypeChanged("Normal");
    setWindowTitle("Procesar por Dignidades");
    connect(ui->tipoComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(dateTypeChanged(QString)));

    ui->noaaTableView->setContextMenuPolicy(Qt::CustomContextMenu);
    ui->tableView->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(ui->noaaTableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(noaaMenu(QPoint)));
    connect(ui->tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(dailyMenu(QPoint)));
}
开发者ID:jacapoduri,项目名称:MeteoAstrologia,代码行数:37,代码来源:processbydignitywidget.cpp

示例8: MusicAbstractMoveDialog

MusicUserDialog::MusicUserDialog(QWidget *parent)
    : MusicAbstractMoveDialog(parent),
      ui(new Ui::MusicUserDialog)
{
    ui->setupUi(this);

    m_userModel = new MusicUserModel(this);

    MusicTime::timeSRand();
    changeVerificationCode();

    ui->topTitleCloseButton->setIcon(QIcon(":/share/searchclosed"));
    ui->topTitleCloseButton->setStyleSheet(MusicUIObject::MToolButtonStyle03);
    ui->topTitleCloseButton->setCursor(QCursor(Qt::PointingHandCursor));
    ui->topTitleCloseButton->setToolTip(tr("Close"));
    connect(ui->topTitleCloseButton, SIGNAL(clicked()), SLOT(close()));

    firstStatckWidget();
    secondStatckWidget();
    thirdStatckWidget();

    ui->userComboBox->addItems(m_userModel->getAllUsers());
    connect(ui->userComboBox, SIGNAL(currentIndexChanged(QString)),
                              SLOT(userComboBoxChanged(QString)));
    connect(ui->userComboBox, SIGNAL(editTextChanged(QString)),
                              SLOT(userEditTextChanged(QString)));
    m_userName = ui->userComboBox->currentText();
    readFromUserConfig();

    QButtonGroup *buttonGroup = new QButtonGroup(this);
    buttonGroup->addButton(ui->useTencentLogin, 0);
    buttonGroup->addButton(ui->useRenrenLogin, 1);
    buttonGroup->addButton(ui->useWechatLogin, 2);
    buttonGroup->addButton(ui->useSinaLogin, 3);
    connect(buttonGroup, SIGNAL(buttonClicked(int)), SLOT(buttonClicked(int)));
}
开发者ID:AndyQsmart,项目名称:TTKMusicplayer,代码行数:36,代码来源:musicuserdialog.cpp

示例9: currentPaperChanged

void PaperManager::paperClosed( const QVariant & var )
{
    QQuickItem *paper = var.value<QQuickItem*>();
    if( p->buffer.indexOf(paper) == 0 && p->current != 0 )
    {
        paper->setProperty( "x" ,paper->property("closeX") );
        return;
    }

    if( p->current >= p->papers.count() )
        QMetaObject::invokeMethod( paper, "save" );

    p->current++;
    emit currentPaperChanged();
    emit currentIndexChanged();

    if( p->current == 1 )
    {
        p->buffer.last()->setProperty( "visible" ,true );
        load_buffers();
        return;
    }

    QQuickItem *top = p->buffer.takeFirst();
    p->buffer << top;
    reindexBuffer();

    top->setProperty( "anim" ,false );
    top->setProperty( "x" ,0 );

    top->setProperty( "opacity", 0 );
    QMetaObject::invokeMethod( top, "startAnimation" );
    top->setProperty( "opacity", 1 );

    load_buffers();
}
开发者ID:Aseman-Land,项目名称:Papyrus,代码行数:36,代码来源:papermanager.cpp

示例10: Q_UNUSED

QWidget* Strings::createEditor(QWidget * parent, const QModelIndex & index)
{
    Q_UNUSED(index);
    QStringList variants = propertyVariants();
    if (!variants.isEmpty()) {
        QComboBox * cb = new QComboBox(parent);
        cb->addItems(variants);
        connect(cb, SIGNAL(currentIndexChanged(QString)), this, SLOT(setValue(QString)));
        return cb;
    } else {
        QLineEdit *le = new QLineEdit(parent);
        if (validator(QVariant::String))
        {
            validator(QVariant::String)->setObject(object());
            validator(QVariant::String)->setProperty(objectPropertyName());
            le->setValidator(validator(QVariant::String));
        }
        le->setText(value().toString());
        connect(le, SIGNAL(textChanged(const QString&)), this, SLOT(setValue(const QString&)));
        le->setFrame(false);
        return le;
    }

}
开发者ID:Jinxiaohai,项目名称:QT,代码行数:24,代码来源:strings.cpp

示例11: QMainWindow

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    ontology_viewer.show();
    label_viewer.show();
    tracker_output_viewer.show();

    // Action menu for opening the files
    connect(this->ui->actionOpen_ontology, SIGNAL(triggered()), this, SLOT(openOntology()));
    connect(this->ui->actionOpen_dialogs, SIGNAL(triggered()), this, SLOT(openDialogs()));
    connect(this->ui->actionOpen_tracker_output, SIGNAL(triggered()), this, SLOT(openTrackerOutput()));

    // Leave on quit
    connect(this->ui->actionQuit, SIGNAL(triggered()), this, SLOT(close()));

    // Show an help message when requested
    connect(this->ui->actionManual, SIGNAL(triggered()), this, SLOT(showTips()));

    // Detecting that a new dialog is selected
    connect(this->ui->dialog_combBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(changeDialog(QString)));

    // Browsing the dialogs
    connect(this->ui->dialog_prevButton, SIGNAL(clicked()), this, SLOT(prev_dialog()));
    connect(this->ui->dialog_nextButton, SIGNAL(clicked()), this, SLOT(next_dialog()));

    // Using the possibility to filter the dialogs by a prefix
    connect(this->ui->dialog_prefix_lineedit, SIGNAL(textChanged(QString)), this, SLOT(dialog_prefix_textChanged(QString)));

    // Getting the info the tracker output wants to be sync to the mainwindow session id
    connect(&tracker_output_viewer, SIGNAL(sig_sync_to_dialog(bool)), this, SLOT(sync_tracker_output_to_session(bool)));


}
开发者ID:jeremyfix,项目名称:dstc,代码行数:36,代码来源:mainwindow.cpp

示例12: setupUi

void AddNetworkSinkDialog::initializeGUI()
{
    setupUi(this);
    connect(mCbNAPIImpl, SIGNAL(currentIndexChanged(QString)), this, SLOT(NAPISelectionChanged(QString)));

    if (!CONF.DebuggingEnabled())
    {
        mGbRequirements->hide();
        mGbInterface->hide();
        // minimize layout
        ShrinkWidgetToMinimumSize();
    }
    if ((mDataType != DATA_TYPE_VIDEO) && (mDataType != DATA_TYPE_AUDIO))
    {
        mCbRtp->hide();
    }

    // is the source something different than a muxer?
    if (!mMediaSource->SupportsMuxing())
    {// the input stream from the source has to relayed, without RTP an additional encapsulation
        mCbRtp->setChecked(false);
        mCbRtp->setEnabled(false);
    }
}
开发者ID:Lethea,项目名称:Homer-Conferencing,代码行数:24,代码来源:AddNetworkSinkDialog.cpp

示例13: QWidget

startDialog::startDialog(QApplication *a, int argc, char *argv[], QWidget *parent) : QWidget(parent) {
    ui = new Ui::Form;
    ui->setupUi(this);
    app = a;
    scanSkins();
    loadSettings();
    bool st = false;
    for (int i = 0; i < argc; i++) {
        QString cur = argv[i];
        if ((cur == "-i") || (cur == "--ip"))
            ui->lineEdit_2->setText(argv[i + 1]);
        else if ((cur == "-p") || (cur == "--port"))
            ui->spinBox->setValue(QString(argv[i + 1]).toInt());
        else if ((cur == "-n") || (cur == "--name"))
            ui->lineEdit->setText(QString(argv[i + 1]));
        else if ((cur == "-s") || (cur == "--start"))
            st = true;
        else if ((cur == "-h") || (cur == "--help")) {
            printf("Welcome to labyrus-client documentation\n");
            printf("-i --ip int.int.int.int        to set ip address\n");
            printf("-p --port int                  to set port number\n");
            printf("-n --name name                 to set name of player\n");
            printf("-s --start                     to auto start game\n");
            printf("-h --help                      to show this help\n");
            exit(0);
        }
    }

    if (st) {
        QTimer::singleShot(100, this, SLOT(start()));
    } else {
        QObject::connect(ui->commandLinkButton, SIGNAL(clicked()), this, SLOT(start()));
        QObject::connect(ui->comboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(setPix(QString)));
    }
    ui->commandLinkButton->setFocus();
}
开发者ID:anonymouse1,项目名称:Labyrus,代码行数:36,代码来源:startdialog.cpp

示例14: Q_ASSERT

void KNCategoryTabBar::setCurrentIndex(int buttonIndex)
{
    Q_ASSERT(buttonIndex>-1 && buttonIndex<m_buttonList.size());
    //If the current index is button clicked, do nothing.
    if(m_locked || buttonIndex==m_currentIndex)
    {
        return;
    }
    KNCategoryButton *button;
    //Reset the old current index button, check the index first.
    if(m_currentIndex!=-1 && m_currentIndex<m_buttonList.size())
    {
        button=m_buttonList.at(m_currentIndex);
        button->setChecked(false);
    }
    //Set to the current index.
    m_currentIndex=buttonIndex;
    button=m_buttonList.at(m_currentIndex);
    button->setChecked(true);
    //Lock the tabbed
    m_locked=true;
    //Emit index changed signal.
    emit currentIndexChanged(m_currentIndex);
}
开发者ID:EAGzzyCSL,项目名称:Mu,代码行数:24,代码来源:kncategorytabbar.cpp

示例15: QDialog

// AppearanceSettings ----------------------------------------------------
AppearanceSettings::AppearanceSettings( QWidget* parent, Qt::WFlags fl )
    : QDialog(parent, fl),
    mIsStatusView(false), mIsFromActiveProfile(false)
{
    setupUi();
    readThemeSettings();
    readColorSchemeSettings();

    // Populate the first combo box (theme).
    populate();

    // Select the theme to populate the other combo boxes.
    // Note that they are not connected yet, so no preview is requested.
    themeSelected(mActiveThemeIndex);

    // Connect the combo boxes.
    connect( mThemeCombo, SIGNAL(currentIndexChanged(int)),
            this, SLOT(themeSelected(int)) );
    connect( mColorCombo, SIGNAL(currentIndexChanged(int)),
            this, SLOT(colorSelected(int)) );
    connect( mBgCombo, SIGNAL(currentIndexChanged(QString)),
            this, SLOT(backgroundSelected(QString)) );
    connect( mLabelCkBox, SIGNAL(toggled(bool)),
            this, SLOT(labelToggled(bool)) );

    connect( qApp, SIGNAL(appMessage(QString,QByteArray)),
        this, SLOT(receive(QString,QByteArray)) );

    // Re-select the theme to request the previews.
    themeSelected(mActiveThemeIndex);

    QSoftMenuBar::menuFor( this )->addAction
        ( QIcon( ":icon/Note" ), tr( "Add to current profile" ), this, SLOT(pushSettingStatus()) );
    QSoftMenuBar::menuFor( this )->addAction
        ( QIcon( ":image/homescreen/homescreen" ), tr( "Homescreen Settings..." ), this, SLOT(openHomescreenSettings()) );
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:37,代码来源:appearance.cpp


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