• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setCurrentRow函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: switch

void ListWidget::keyPressEvent(QKeyEvent *event) //On key press. Handles enter key, up arrow, down arrow.
{
    switch (event->key()) {
    case Qt::Key_Enter: //Enter/return key
    case Qt::Key_Return:
        emit attemptedSelect();
        break;
    case Qt::Key_Up: //Up arrow
        if (currentRow() != 0)
            setCurrentRow(currentRow());
        else {
            selectionModel()->clearSelection();
            m_CompletionBox->activateWindow();
            m_CompletionBox->setFocus();
        }
        break;
    case Qt::Key_Down: //Down arrow
        if (currentRow() != count() - 1)
            setCurrentRow(currentRow());
        else {
            selectionModel()->clearSelection();
            m_CompletionBox->activateWindow();
            m_CompletionBox->setFocus();
        }
        break;
    case Qt::Key_Escape:
        hide();
        break;
    }
    QListWidget::keyPressEvent(event);
}
开发者ID:gamingboss232,项目名称:symphony-browser,代码行数:31,代码来源:listwidget.cpp


示例2: QTableWidgetItem

void Formamendweight::DataEntered(int nWeight, int nAxls)
{
    //TODO:计算超重率/
    //表格显示数据

    if(flag1==true)
    {
        if(table->rowCount()<=0 || table->currentRow()<=0)
        {
            ui->tableWidget->insertRow(0);
            ui->tableWidget->setItem(0, 6, new QTableWidgetItem("输入"));
            ui->tableWidget->setItem(0, 5, new QTableWidgetItem(QString::number(0)));
            ui->tableWidget->setItem(0, 4, new QTableWidgetItem(QString::number(OverWeightRate(nWeight,nAxls)/10.0)));
            ui->tableWidget->setItem(0, 3, new QTableWidgetItem(QString::number(nWeight)));
            ui->tableWidget->setItem(0, 2, new QTableWidgetItem(QString::number(getWeightLimit(nAxls)/1000)));
            ui->tableWidget->setItem(0, 1, new QTableWidgetItem(QString::number(nAxls)));
        }
        else
        {
            int tmp = table->currentRow();
            ui->tableWidget->insertRow(tmp);
            ui->tableWidget->setItem(tmp, 6, new QTableWidgetItem("输入"));
            ui->tableWidget->setItem(tmp, 5, new QTableWidgetItem(QString::number(0)));
            ui->tableWidget->setItem(tmp, 4, new QTableWidgetItem(QString::number(OverWeightRate(nWeight,nAxls)/10.0)));
            ui->tableWidget->setItem(tmp, 3, new QTableWidgetItem(QString::number(nWeight)));
            ui->tableWidget->setItem(tmp, 2, new QTableWidgetItem(QString::number(getWeightLimit(nAxls)/1000)));
            ui->tableWidget->setItem(tmp, 1, new QTableWidgetItem(QString::number(nAxls)));
        }
        setCurrentRow(table->currentRow());
        FormWtInfo *Pwt=NULL;
        getWidgetByType(emFormWtInfo, (QWidget**)&Pwt);
        //轴数 限载 总重 超限率
        Pwt->inexitFormWtInfohead(nAxls,getWeightLimit(nAxls)/1000,nWeight,OverWeightRate(nWeight,nAxls));
        Pwt->inexitFormWtInfo(nAxls,getWeightLimit(nAxls)/1000,nWeight,OverWeightRate(nWeight,nAxls),0,tr("输入"));
        showHHeadNum();
        flag1=false;
    }
    else if(flag2 == false && flag1 == false)
    {
        TWtVehicle veh;
        TWtDataMgr vehMgr;
        int nRlt = table->currentRow();
        ui->tableWidget->insertRow(nRlt);
        ui->tableWidget->setItem(nRlt, 6, new QTableWidgetItem("称重"));
        ui->tableWidget->setItem(nRlt, 5, new QTableWidgetItem(QString::number(veh.getSpeed())));
        ui->tableWidget->setItem(nRlt, 4, new QTableWidgetItem(QString::number(veh.GetOverloadRate()/10.0)));
        ui->tableWidget->setItem(nRlt, 3, new QTableWidgetItem(QString::number(veh.GetWeight())));
        ui->tableWidget->setItem(nRlt, 2, new QTableWidgetItem(QString::number(veh.GetLimitWeight()/1000)));
        ui->tableWidget->setItem(nRlt, 1, new QTableWidgetItem(QString::number(vehMgr.GetVehicleCount())));
        setCurrentRow(table->currentRow());
        FormWtInfo *Pwt=NULL;
        getWidgetByType(emFormWtInfo, (QWidget**)&Pwt);
        //轴数 限载 总重 超限率
//        Pwt->inexitFormWtInfohead(nAxls,getWeightLimit(nAxls)/1000,nWeight,OverWeightRate(nWeight,nAxls));
//        Pwt->inexitFormWtInfo(nAxls,getWeightLimit(nAxls)/1000,nWeight,OverWeightRate(nWeight,nAxls),0,tr("输入"));
        showHHeadNum();
    }
//    TWtVehicle veh;
}
开发者ID:eilin1208,项目名称:QT_Test,代码行数:59,代码来源:formamendweight.cpp


示例3: width

/**
 * Make sure the current tab visible. If it is not visible the tabbar scrolls
 * so that it is visible.
 */
void KTinyTabBar::makeCurrentTabVisible()
{
    if( !m_activeButton || m_activeButton->isVisible() )
        return;

    //BEGIN copy of resizeEvent
    int tabbar_width = width() - ( 4 - ( numRows()>3?3:numRows() ) ) * m_navigateSize;
    int tabs_per_row = tabbar_width / minimumTabWidth();
    if( tabs_per_row == 0 )
        tabs_per_row = 1;

    int tab_width = minimumTabWidth();

    int needed_rows = m_tabButtons.count() / tabs_per_row;
    if( needed_rows * tabs_per_row < (int)m_tabButtons.count() )
        ++needed_rows;

    // if we do not need more rows than available we can increase the tab
    // buttons' width up to maximumTabWidth.
    if( needed_rows <= numRows() )
    {
        // use available size optimal, but honor maximumTabWidth()
        tab_width = tabbar_width * numRows() / m_tabButtons.count();

        if( tab_width > maximumTabWidth() )
            tab_width = maximumTabWidth();

        tabs_per_row = tabbar_width / tab_width;

        // due to rounding fuzzys we have to increase the tabs_per_row if
        // the number of tabs does not fit.
        if( tabs_per_row * numRows() < (int)m_tabButtons.count() )
            ++tabs_per_row;
    }
    //END copy of resizeEvent

    int index = m_tabButtons.indexOf( m_activeButton );
    int firstVisible = currentRow() * tabs_per_row;
    int lastVisible = ( currentRow() + numRows() ) * tabs_per_row - 1;

    if( firstVisible >= m_tabButtons.count() )
        firstVisible = m_tabButtons.count() - 1;

    if( lastVisible >= m_tabButtons.count() )
        lastVisible = m_tabButtons.count() - 1;

    if( index < firstVisible )
    {
        setCurrentRow( index / tabs_per_row );
    }
    else if( index > lastVisible )
    {
        const int diff = index / tabs_per_row - ( numRows() - 1 );
        setCurrentRow( diff );
    }
}
开发者ID:azat-archive,项目名称:kate,代码行数:60,代码来源:ktinytabbar.cpp


示例4: currentRow

void KCompletionBox::up()
{
    const int row = currentRow();
    if (row > 0) {
        setCurrentRow(row - 1);
        return;
    }

    const int lastRow = count() - 1;
    if (lastRow > 0) {
        setCurrentRow(lastRow);
    }
}
开发者ID:vasi,项目名称:kdelibs,代码行数:13,代码来源:kcompletionbox.cpp


示例5: switch

void CtrlRegisterList::keydownEvent(wxKeyEvent& evt)
{
	switch (evt.GetKeyCode())
	{
	case WXK_UP:
		setCurrentRow(std::max<int>(currentRows[category]-1,0));
		break;
	case WXK_DOWN:
		setCurrentRow(std::min<int>(currentRows[category]+1,cpu->getRegisterCount(category)-1));
		break;
	case WXK_TAB:
		category = (category+1) % cpu->getRegisterCategoryCount();
		Refresh();
		break;
	}
}
开发者ID:Aced14,项目名称:pcsx2,代码行数:16,代码来源:CtrlRegisterList.cpp


示例6: setCurrentRow

void QcListWidget::setCurrentRowWithoutAction( int row )
{
  bool b = _emitAction;
  _emitAction = false;
  setCurrentRow( row );
  _emitAction = b;
}
开发者ID:acamari,项目名称:supercollider,代码行数:7,代码来源:QcListWidget.cpp


示例7: currentPlaylistWidget

void PlaylistWindow::selectNext()
{
    auto qdp = currentPlaylistWidget();
    int index = qdp->currentRow();
    if (index < qdp->count())
        qdp->setCurrentRow(index + 1);
}
开发者ID:Frechdachs,项目名称:mpc-qt,代码行数:7,代码来源:playlistwindow.cpp


示例8: save_dialog

void SyntaxHighlightingList::reload(QString i){
    if(!m_issaved){
        QMessageBox save_dialog(QMessageBox::Warning,"Jeu de couleur modifié","Le jeu de couleur "+m_current_file+"a été modifé. Voulez-vous l'enregistrer?",QMessageBox::Save|QMessageBox::Abort,this);
        if(save_dialog.exec()==QMessageBox::Save) save();
    }

    // _lex = HighlightingThemeRegistry::get()->filterByLanguage(_lex.language()).value(i);

    //on remplit le QListWidget
    clear();

    /*
    foreach (HighlightingFormat format, _lex) {
        QListWidgetItem* item =new QListWidgetItem(format.formatName(), this);
        QFont f = item->font();
        f.setBold(format.currentFormat().font().bold());
        f.setItalic(format.currentFormat().font().bold());
        f.setUnderline(format.currentFormat().font().bold());
        item->setFont(f);
        item->setForeground(format.currentFormat().foreground());
        item->setBackground(format.currentFormat().background());
        addItem(item);
    }
    */
    setCurrentRow(0);

    m_issaved=true;
}
开发者ID:intelligide,项目名称:UnicornEdit,代码行数:28,代码来源:HighlighterSettings.cpp


示例9: switch

    void ListTable::createNewRow()
    {

      QListWidgetItem * item = 0;
      switch (type_)
      {
      case ListEditor::INT:
        item = new QListWidgetItem("0");
        break;

      case ListEditor::FLOAT:
        item = new QListWidgetItem("0.0");
        break;

      default:
        item = new QListWidgetItem("");
      }
      item->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter);
      item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
      addItem(item);
      setItemSelected(item, true);
      setCurrentRow(row(item));
      itemActivated(item);
      edit(currentIndex());
    }
开发者ID:BioITer,项目名称:OpenMS,代码行数:25,代码来源:ListEditor.C


示例10: setHeadline

void EditEntryWidget::loadEntry(Entry* entry, bool create, bool history, const QString& parentName,
                                Database* database)
{
    m_entry = entry;
    m_database = database;
    m_create = create;
    m_history = history;

    if (history) {
        setHeadline(QString("%1 > %2").arg(parentName, tr("Entry history")));
    }
    else {
        if (create) {
            setHeadline(QString("%1 > %2").arg(parentName, tr("Add entry")));
        }
        else {
            setHeadline(QString("%1 > %2 > %3").arg(parentName, entry->title(), tr("Edit entry")));
        }
    }

    setForms(entry);

    setCurrentRow(0);
    setRowHidden(m_historyWidget, m_history);
}
开发者ID:BlueIce,项目名称:keepassx,代码行数:25,代码来源:EditEntryWidget.cpp


示例11: setHeadline

void EditGroupWidget::loadGroup(Group* group, bool create, Database* database)
{
    m_group = group;
    m_database = database;

    if (create) {
        setHeadline(tr("Add group"));
    }
    else {
        setHeadline(tr("Edit group"));
    }

    m_mainUi->editName->setText(m_group->name());
    m_mainUi->editNotes->setPlainText(m_group->notes());
    m_mainUi->expireCheck->setChecked(group->timeInfo().expires());
    m_mainUi->expireDatePicker->setDateTime(group->timeInfo().expiryTime().toLocalTime());
    m_mainUi->searchComboBox->setCurrentIndex(indexFromTriState(group->searchingEnabled()));
    m_mainUi->autotypeComboBox->setCurrentIndex(indexFromTriState(group->autoTypeEnabled()));

    IconStruct iconStruct;
    iconStruct.uuid = group->iconUuid();
    iconStruct.number = group->iconNumber();
    m_editGroupWidgetIcons->load(group->uuid(), database, iconStruct);

    m_editWidgetProperties->setFields(group->timeInfo(), group->uuid());

    setCurrentRow(0);

    m_mainUi->editName->setFocus();
}
开发者ID:BlueIce,项目名称:keepassx,代码行数:30,代码来源:EditGroupWidget.cpp


示例12: signalsBlocked

void KCompletionBox::insertItems( const QStringList& items, int index )
{
    bool block = signalsBlocked();
    blockSignals( true );
    KListWidget::insertItems( index, items );
    blockSignals( block );
    setCurrentRow(-1);
}
开发者ID:vasi,项目名称:kdelibs,代码行数:8,代码来源:kcompletionbox.cpp


示例13: item

void SettingsList::selectFirst(){
  QListWidgetItem* list_item;
  list_item = item(0);
  if (list_item){
    setCurrentRow(0);
  }
  emit(itemActivated(list_item));
}
开发者ID:Hramchenko,项目名称:userdatadefence,代码行数:8,代码来源:SettingsList.cpp


示例14: setCurrentRow

void TToolbarEditor::onLeftButtonClicked() {

	int row = active_actions_table->currentRow();
	if (row >= 0) {
		active_actions_table->removeRow(row);
		setCurrentRow(row);
	}
}
开发者ID:wilbert2000,项目名称:wzplayer,代码行数:8,代码来源:toolbareditor.cpp


示例15: Q_UNUSED

void PartsBinListView::setSelected(int position, bool doEmit) {
	Q_UNUSED(doEmit);
	if(position > -1 && position < count()) {
		item(position)->setSelected(true);
	} else {
		setCurrentRow(position);
	}
}
开发者ID:himanshuchoudhary,项目名称:cscope,代码行数:8,代码来源:partsbinlistview.cpp


示例16: swapRows

void TToolbarEditor::onUpButtonClicked() {

	int row = active_actions_table->currentRow();
	if (row > 0) {
		swapRows(row - 1, row);
		setCurrentRow(row - 1);
	}
}
开发者ID:wilbert2000,项目名称:wzplayer,代码行数:8,代码来源:toolbareditor.cpp


示例17: nextChar

bool MorkParser::parseTable()
{
    bool Result = true;
    QString TextId;
    int Id = 0, Scope = 0;

    char cur = nextChar();

    // Get id
    while (cur != '{' && cur != '[' && cur != '}' && cur) {
        if (!isWhiteSpace(cur)) {
            TextId += cur;
        }

        cur = nextChar();
    }

    parseScopeId(TextId, Id, Scope);

    // Parse the table
    while (Result && cur != '}' && cur) {
        if (!isWhiteSpace(cur)) {
            switch (cur) {
            case '{':
                Result = parseMeta('}');
                break;
            case '[':
                Result = parseRow(Id, Scope);
                break;
            case '-':
            case '+':
                break;
            default: {
                QString JustId;
                while (!isWhiteSpace(cur) && cur) {
                    JustId += cur;
                    cur = nextChar();

                    if (cur == '}') {
                        return Result;
                    }
                }

                int JustIdNum = 0, JustScopeNum = 0;
                parseScopeId(JustId, JustIdNum, JustScopeNum);

                setCurrentRow(Scope, Id, JustScopeNum, JustIdNum);
            }
            break;
            }
        }

        cur = nextChar();
    }

    return Result;
}
开发者ID:KDE,项目名称:kdepim,代码行数:57,代码来源:MorkParser.cpp


示例18: QListWidget

ListBox::ListBox(imli_context_t ctx, std::vector<SylString>& wordlist, QTextCharFormat& f, QWidget* parent)
    : QListWidget(parent),
      ctx_(ctx), 
      data_(wordlist),
      format_(f)
{
    CreateItems();
    setCurrentRow(0);
}
开发者ID:anandtrex,项目名称:imli-s60,代码行数:9,代码来源:ListBox.cpp


示例19: clear

void QcListWidget::setItems( const QVariantList & items )
{
  _emitAction = false;
  clear();
  Q_FOREACH( const QVariant & item, items )
      addItem( item.toString() );
  setCurrentRow( 0 );
  _emitAction = true;
}
开发者ID:acamari,项目名称:supercollider,代码行数:9,代码来源:QcListWidget.cpp


示例20: clear

void VerticesList::resetMesh() {
	clear();
	for (int i=0; i<mesh->getVSize(); i++)
		addItem(new VertexItem(mesh->getV(i)));
	if (count() > 0) {
		setCurrentRow(0);
		sendInfo(currentItem());
	}
}
开发者ID:Jigarsenjallia,项目名称:Aztec,代码行数:9,代码来源:verticeslist.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setCurrentState函数代码示例发布时间:2022-05-30
下一篇:
C++ setCurrentPage函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap