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

C++ previous函数代码示例

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

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



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

示例1: while

bool EdgeArray::hasPrevious(std::vector<EdgeIF*>::const_iterator & iterator,
		Connectivity const connectivity) {
	while (hasPrevious(iterator)
			&& (connectivity != Connectivity::BOTH
					&& !current(iterator)->isInState(connectivity))) {
		previous(iterator);
	}
	return hasPrevious(iterator);
}
开发者ID:PWrGitHub194238,项目名称:BinaryRIMST,代码行数:9,代码来源:EdgeArray.cpp


示例2: current

void networkDialog::refreshButtonClicked(void) {
    QString a=ui->serversComboBox->currentText();
    QHostAddress current(a);
    QHostAddress previous(gpib->getServerAddress());
    gpib->setServerAddress(current);
    gpib->serverGetStatus();
    gpib->serverGetInterval();
    gpib->setServerAddress(previous);
}
开发者ID:uazure,项目名称:qlabnetview,代码行数:9,代码来源:networkDialog.cpp


示例3: peekNext

 T& peekNext(unsigned int jump = 0) {
     jump++;
     for (unsigned int ij = 1; ij < jump; ij++)
         next();
     T& t = next();
     for (unsigned int ij = 0; ij < jump; ij++)
         previous();
     return t;
 }
开发者ID:cagelight,项目名称:Flamingo,代码行数:9,代码来源:qreversiblelistiterator.hpp


示例4: moved

  // 2006-08-24 AF, changed so the function returns a boolean value, true if
  // the cursor is moved.
  bool CellCursor::moveUp()
  {
    // 2006-08-24 AF,
        bool moved( false );

    // 2006-04-27 AF,
    cursorIsMoved();

    if( !hasPrevious() )
    {
      if( parentCell()->hasParentCell() )
      {
        moveBefore( parentCell() );
        moved = true;
      }
    }
    else
    {
      //previous() exists.
      if(previous()->hasChilds())
      {
        if(!previous()->isClosed())
        {
          moveToLastChild(previous());
          moved = true;
        }
        else
        {
          moveBefore(previous());
          moved = true;
        }
      }
      else
      {
        moveBefore(previous());
        moved = true;
      }
    }
    emit positionChanged(x(), y(), 5,5);

    // TMP EMIT
    emit changedPosition();
    return moved;
  }
开发者ID:adrpo,项目名称:OMNotebook,代码行数:46,代码来源:cellcursor.cpp


示例5: add_package

void add_package(package_t* package)
{
   variable_t* evar;
   variable_t* vvar;
   list_node* enode;
   list_node* vnode;
   list_node* rnode;
   group_t* group;
   char* name;
   int got_one;
   char* text;
   
   if (package->requires)
   {
      DEBUG(stderr, "(pre-using required packages list)\n");

      for (rnode=list_tail(package->requires) ; rnode ; rnode=previous(rnode))
      {
         name = (char*) get_value(rnode);

         if (group = get_group(name))
            use_group(group);
         else
            use_package(name);
      }
   }

   for (vnode = head(package->variables) ; vnode ; vnode = next(vnode))
   {
      vvar = get_value(vnode);
      got_one = 0;
      for (enode = head(the_environment) ; enode ; enode = next(enode))
      {
         evar = get_value(enode);
         if (!strcmp(vvar->name, evar->name))
         {
            remove_node(the_environment, enode, 0);
            add_to_tail(the_environment, update_var(evar, vvar));
            got_one = 1;
            break;
         }
      }
      if (!got_one)
      {
         enode = get_into_env(vvar);
         evar = get_value(enode);
         set_value(enode, update_var(evar, vvar));
      }
   }
   
   for (vnode = head(package->scripts) ; vnode ; vnode = next(vnode))
   {
      text = ((script_t*) get_value(vnode))->text;
      add_to_tail(the_scripts, (void*) text);
   }   
}
开发者ID:rpavlik,项目名称:usepackage,代码行数:56,代码来源:usepackage.c


示例6: Q_D

//! returns the previous boundary from given index, including the index in the search.
//! If index is a boundary, it is returned and current is decreased by one,
//! otherwise works as previous()
int MIcuBreakIterator::previousInclusive(int index)
{
    Q_D(MIcuBreakIterator);
    if (isBoundary(index)) {
        d->current = index - 1;
        return index;
    } else {
        return previous(index);
    }
}
开发者ID:arcean,项目名称:libmeegotouch-framework,代码行数:13,代码来源:micubreakiterator.cpp


示例7: previous

/**
 * Removes the Object last returned by the next() or previous() methods;
 * @return the removed Object pointer
 **/
void* txListIterator::remove() {
  void* obj = 0;
  if (currentItem) {
    obj = currentItem->objPtr;
    txList::ListItem* item = currentItem;
    previous();  //-- make previous item the current item
    list->remove(item);
    delete item;
  }
  return obj;
}  //-- remove
开发者ID:jasonLaster,项目名称:gecko-dev,代码行数:15,代码来源:txList.cpp


示例8: next

void InterlinearChunkEditor::keyReleaseEvent(QKeyEvent *event)
{
    if( event->key() == Qt::Key_PageDown )
    {
        next();
    } else if ( event->key() == Qt::Key_PageUp )
    {
        previous();
    }
    QWidget::keyReleaseEvent(event);
}
开发者ID:adamb924,项目名称:Gloss,代码行数:11,代码来源:interlinearchunkeditor.cpp


示例9: QWidget

AddressBook::AddressBook(QWidget *parent)
    : QWidget(parent)
{
    QLabel *nameLabel = new QLabel(tr("Name:"));
    nameLine = new QLineEdit;
    nameLine->setReadOnly(true);

    QLabel *addressLabel = new QLabel(tr("Address:"));
    addressText = new QTextEdit;
    addressText->setReadOnly(true);
    
    addButton = new QPushButton(tr("&Add"));
    addButton->show();
    submitButton = new QPushButton(tr("&Submit"));
    submitButton->hide();
    cancelButton = new QPushButton(tr("&Cancel"));
    cancelButton->hide();
//! [navigation pushbuttons]
    nextButton = new QPushButton(tr("&Next"));
    nextButton->setEnabled(false);
    previousButton = new QPushButton(tr("&Previous"));
    previousButton->setEnabled(false);
//! [navigation pushbuttons]

    connect(addButton, SIGNAL(clicked()), this, SLOT(addContact()));
    connect(submitButton, SIGNAL(clicked()), this, SLOT(submitContact()));
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancel()));
//! [connecting navigation signals]    
    connect(nextButton, SIGNAL(clicked()), this, SLOT(next()));
    connect(previousButton, SIGNAL(clicked()), this, SLOT(previous()));
//! [connecting navigation signals]

    QVBoxLayout *buttonLayout1 = new QVBoxLayout;
    buttonLayout1->addWidget(addButton, Qt::AlignTop);
    buttonLayout1->addWidget(submitButton);
    buttonLayout1->addWidget(cancelButton);
    buttonLayout1->addStretch();
//! [navigation layout]
    QHBoxLayout *buttonLayout2 = new QHBoxLayout;
    buttonLayout2->addWidget(previousButton);
    buttonLayout2->addWidget(nextButton);
//! [ navigation layout]
    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->addWidget(nameLabel, 0, 0);
    mainLayout->addWidget(nameLine, 0, 1);
    mainLayout->addWidget(addressLabel, 1, 0, Qt::AlignTop);
    mainLayout->addWidget(addressText, 1, 1);
    mainLayout->addLayout(buttonLayout1, 1, 2);
//! [adding navigation layout]
    mainLayout->addLayout(buttonLayout2, 3, 1);
//! [adding navigation layout]
    setLayout(mainLayout);
    setWindowTitle(tr("Simple Address Book"));
}
开发者ID:elProxy,项目名称:qtbase,代码行数:54,代码来源:addressbook.cpp


示例10: previous

void OutfitWindow::wearPreviousOutfit(const bool all)
{
    previous();
    if (!all && mCurrentOutfit >= 0 && mCurrentOutfit
        < static_cast<int>(OUTFITS_COUNT))
    {
        bool fromStart = false;
        while (!mItemsUnequip[mCurrentOutfit])
        {
            previous();
            if (mCurrentOutfit == 0)
            {
                if (!fromStart)
                    fromStart = true;
                else
                    return;
            }
        }
    }
    wearOutfit(mCurrentOutfit);
}
开发者ID:nashley,项目名称:ManaPlus,代码行数:21,代码来源:outfitwindow.cpp


示例11: current

/**
 * Advances the iterator either forward or backward the specified number of steps.
 * Negative values move backward, and positive values move forward.  This is
 * equivalent to repeatedly calling next() or previous().
 * @param n The number of steps to move.  The sign indicates the direction
 * (negative is backwards, and positive is forwards).
 * @return The character offset of the boundary position n boundaries away from
 * the current one.
 */
int32_t BreakIterator::next(int32_t n) {
    int32_t result = current();
    while (n > 0) {
        result = next();
        --n;
    }
    while (n < 0) {
        result = previous();
        ++n;
    }
    return result;
}
开发者ID:Gin-Rye,项目名称:duibrowser,代码行数:21,代码来源:rbbi.cpp


示例12: parentCell

  void CellCursor::removeFromCurrentPosition()
  {
    //remove all widgets from parents layout.
    Cell *par = parentCell();
    par->removeCellWidgets();

    if(parentCell()->child() == this)
      parentCell()->setChild(next());

    if(parentCell()->last() == this)
      parentCell()->setLast(previous());

    if(hasNext())
      next()->setPrevious(previous());

    if(hasPrevious())
      previous()->setNext(next());

    //Insert all widgets again.
    par->addCellWidgets();
  }
开发者ID:adrpo,项目名称:OMNotebook,代码行数:21,代码来源:cellcursor.cpp


示例13: qDebug

void MusicWidget::setupSensors()
{
    QSensorGestureManager manager;
    QStringList gestureIds = manager.gestureIds();
    qDebug() << gestureIds;
    if(gestureIds.contains("QtSensors.shake2"))
    {
        qDebug() << "setup shake 2 sensor";
        m_shakeGesture = new QSensorGesture(
                    QStringList() << "QtSensors.shake2"
                    , this);
        connect(m_shakeGesture, SIGNAL(shakeUp()),
                m_playlist, SLOT(previous()));
        connect(m_shakeGesture, SIGNAL(shakeDown()),
                m_playlist, SLOT(next()));
        connect(m_shakeGesture, SIGNAL(shakeLeft()),
                m_playlist, SLOT(previous()));
        connect(m_shakeGesture, SIGNAL(shakeRight()),
                m_playlist, SLOT(next()));

    }
    else if(gestureIds.contains("QtSensors.shake"))
    {
        qDebug() << "setup shake sensor";
        m_shakeGesture = new QSensorGesture(
                    QStringList() << "QtSensors.shake"
                    , this);
        connect(m_shakeGesture, SIGNAL(shake()),
                m_playlist, SLOT(next()));
    }
    if(gestureIds.contains("QtSensors.turnover"))
    {
        m_turnoverGesture = new QSensorGesture(
                    QStringList("QtSensors.turnover")
                    ,this
                    );
        connect(m_turnoverGesture, SIGNAL(turnover()),
                this, SLOT(onTurnover()));
    }
}
开发者ID:Pengfei-Gao,项目名称:develop-reference-data,代码行数:40,代码来源:musicWidget.cpp


示例14: QMainWindow

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    m_areaMode( Default ),
    m_extractor(new VideoExtractor() ),
    m_isHandleActived(true),
    m_isPlay(false),
    m_subImage(nullptr),
    m_subImageSource1(nullptr),
    m_subImageSource2(nullptr),
    m_subResults(nullptr),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    ui->mdiArea->setMainWindow(this);

    connect(ui->actionQuitter, SIGNAL(triggered()), qApp, SLOT( quit() ) );

    connect(ui->buttonPrevious, SIGNAL(clicked()), m_extractor, SLOT(previous()));
    connect(ui->buttonNext, SIGNAL(clicked()), m_extractor, SLOT(next()));

    ui->mdiAreaMode->addItem("Default", Default);
    ui->mdiAreaMode->addItem("Tabulation", Tabulation);
    ui->mdiAreaMode->addItem("Libre", Free);

    int max = 1<<(sizeof(int)*8-2) ;

    m_extractor->changeHandleParameters( new ComboBox("Traitement", VirtualHandle::getAllHandleName(),
                                                      MainHandle),
                                            ui->parametersArea );
    m_extractor->changePeriodeParameters( new Slider("Time", 200000000, 0, max) ,
                                          ui->parametersArea );

    /* obligatoire, à n'appeler qu'une unique fois et dans une fonction /!\ */
    qRegisterMetaType<ImageDataPtr>("ImageDataPtr");
    connect( m_extractor, SIGNAL(imageHandled(ImageDataPtr,ImageDataPtr,ImageDataPtr) ),
             this, SLOT(setImage(ImageDataPtr,ImageDataPtr,ImageDataPtr) ) );
    connect( m_extractor, SIGNAL(streamFinished()), this, SLOT(playPause()));

    VideoReader * cam1 = new VideoReader();
    cam1->useCamera(); //or FolderReader * cam1 = new FolderReader("img/");

    m_extractor->useSource(cam1, 0);
    m_extractor->showParameters( ui->parametersArea );

    ui->mdiAreaMode->setCurrentIndex( ui->mdiAreaMode->findData(m_areaMode) );
    VirtualHandle::setView(ui->mdiArea);

    ui->sliderCurseur->setTracking(true);

    m_extractor->start();
    updateSeek();
}
开发者ID:lilemon63,项目名称:ProjetSI2,代码行数:52,代码来源:mainwindow.cpp


示例15: Q_UNUSED

void EPGRuler::paintEvent( QPaintEvent *event )
{
    Q_UNUSED( event );
    const QSize margin( 0, contentsMargins().top() );
    const QSize header( 0, maximumHeight() - contentsMargins().top() );
    const int spacing = m_scale * 3600;
    QPainter p( this );

    QDateTime localStartTime;
    localStartTime = m_startTime.addSecs( m_offset / m_scale );

    QDateTime diff( localStartTime );
    diff.setTime( QTime( localStartTime.time().hour(), 0, 0, 0 ) );

    int secondsToHour = localStartTime.secsTo( diff );

    /* draw hour blocks, with right bound being hourmark */
    QPoint here( secondsToHour * m_scale, margin.height() );
    QPoint previous( -1, 0 );
    QDateTime current( localStartTime.addSecs( secondsToHour ) );
    current = current.addSecs( -3600 );

    QColor fillColor;
    while ( here.rx() < width() + spacing )
    {
        QRect area( QPoint( previous.x() + 1, margin.height() ), here );
        area.adjust( 0, 0, 0, header.height() );
        QString timeString = current.toString( "hh'h'" );
        /* Show Day */
        if ( current.time().hour() == 0 )
            timeString += current.date().toString( " ddd dd" );

        if ( m_startTime.date().daysTo( current.date() ) % 2 == 0 )
            fillColor = palette().color( QPalette::Window );
        else
            fillColor = palette().color( QPalette::Dark );
        p.fillRect( area, fillColor );
        p.drawLine( area.topRight(), area.bottomRight() );
        p.drawText( area, Qt::AlignLeft, timeString );
        previous = here;
        here.rx() += spacing;
        current = current.addSecs( 3600 );
    }

    /* draw current time line */
    here.rx() = localStartTime.secsTo( QDateTime::currentDateTime() ) * m_scale;
    if ( here.x() <= width() && here.x() >= 0 )
    {
        p.setPen( QPen( QColor( 255, 0 , 0, 128 ) ) );
        p.drawLine( here, QPoint( here.x(), here.y() + header.height() ) );
    }
}
开发者ID:371816210,项目名称:vlc_vlc,代码行数:52,代码来源:EPGRuler.cpp


示例16: QDialog

DialogNewB::DialogNewB(QWidget *parent, MainWindow *_mw, QString _num, QString _code,
                       QString _ville, QString _type, int _piece, double _surfaceT, double _surfaceH,
                       QString _nom, QString _prenom, QString _mail, QString _tel, QString _typeV, double _prix,
                       QString _titre, QString _descr, QString _image1, QString _image2, QString _image3, QString _image4) :
    QDialog(parent),
    ui(new Ui::DialogNewB)
{
    ui->setupUi(this);

    /* récupération des données entre les pages */
    mw=_mw;
    num = _num;
    code = _code;
    ville = _ville;
    type = _type;
    piece = _piece;
    surfaceT = _surfaceT;
    surfaceH = _surfaceH;
    nom = _nom;
    prenom = _prenom;
    mail = _mail;
    tel = _tel;
    typeV = _typeV;
    prix = _prix;
    titre = _titre;
    descr = _descr;
    image1 = _image1;
    image2 = _image2;
    image3 = _image3;
    image4 = _image4;

    /* réaffichage des données entre les pages */
    ui->lineEdit_Titre->insert(titre);
    ui->plainTextEdit_Description->insertPlainText(descr);
    actualiseImgs(image1, image2, image3, image4);


    /* PushButtons: Insérer l'image 1, 2, 3 et 4 */
    QObject::connect(ui->pushButton_ImgSelect,SIGNAL(clicked()),this,SLOT(addImg1()));
    QObject::connect(ui->pushButton_ImgSelect_2,SIGNAL(clicked()),this,SLOT(addImg2()));
    QObject::connect(ui->pushButton_ImgSelect_3,SIGNAL(clicked()),this,SLOT(addImg3()));
    QObject::connect(ui->pushButton_ImgSelect_4,SIGNAL(clicked()),this,SLOT(addImg4()));

    /* PushButton: Précédent */
    QObject::connect(ui->pushButton_Precedent_2,SIGNAL(clicked()),this,SLOT(previous()));

    /* PushButton: Valider */
    QObject::connect(ui->pushButton_Valid_2,SIGNAL(clicked()),this,SLOT(add()));

    /* PushButton: Annuler */
    QObject::connect(ui->pushButton_Annuler_2,SIGNAL(clicked()),this,SLOT(close()));
}
开发者ID:Kodstok,项目名称:QtProjet,代码行数:52,代码来源:dialognewb.cpp


示例17: QWidget

AddressBook::AddressBook(QWidget *parent)
    : QWidget(parent)
{
    QLabel *nameLabel = new QLabel(tr("Name:"));         // создаем объект  QLabel nameLabel
    nameLine = new QLineEdit;
    nameLine->setReadOnly(true);    // устанавливаем в режим только для чтения

    QLabel *addressLabel = new QLabel(tr("Address:"));  // создаем объект  QLabel addressLabel
    addressText = new QTextEdit;
    addressText->setReadOnly(true); // устанавливаем в режим только для чтения

    addButton = new QPushButton(tr("&Add"));        //  создаем экземпляр кнопоки
    addButton->show();                              //  устанавливаем ее отображение на экране после вызова функции show
    submitButton = new QPushButton(tr("&Submit"));  //  создаем экземпляр кнопоки
    submitButton->hide();                           //  устанавливаем ее отображение на экране после вызова функции hide(после нажатия кнопки "Add")
    cancelButton = new QPushButton(tr("&Cancel"));  //  создаем экземпляр кнопоки
    cancelButton->hide();                           //  устанавливаем ее отображение на экране после вызова функции hide(после нажатия кнопки "Add")

    nextButton = new QPushButton(tr("&Next"));      //  создаем экземпляр кнопки
    nextButton->setEnabled(false);                  //  отключаем ее
    previousButton = new QPushButton(tr("&Previous"));
    previousButton->setEnabled(false);

    connect(addButton, SIGNAL(clicked()), this, SLOT(addContact()));            //
    connect(submitButton, SIGNAL(clicked()), this, SLOT(submitContact()));      // Соединяем кнопки с соответствующими им слотами
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancel()));             //

    connect(nextButton, SIGNAL(clicked()), this, SLOT(next()));
    connect(previousButton, SIGNAL(clicked()), this, SLOT(previous()));

    QVBoxLayout *buttonLayout1 = new QVBoxLayout;       //
    buttonLayout1->addWidget(addButton, Qt::AlignTop);  //  Расположение кнопок виджета
    buttonLayout1->addWidget(submitButton);             //
    buttonLayout1->addWidget(cancelButton);             //
    buttonLayout1->addStretch();                        //  чтобы расположить кнопки ближе к верхней части виджета

    QHBoxLayout *buttonLayout2 = new QHBoxLayout;
    buttonLayout2->addWidget(previousButton);
    buttonLayout2->addWidget(nextButton);

    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->addWidget(nameLabel, 0, 0);
    mainLayout->addWidget(nameLine, 0, 1);
    mainLayout->addWidget(addressLabel, 1, 0, Qt::AlignTop);
    mainLayout->addWidget(addressText, 1, 1);
    mainLayout->addLayout(buttonLayout1, 1, 2);
    mainLayout->addLayout(buttonLayout2, 3, 1);

    setLayout(mainLayout);
    setWindowTitle(tr("Simple Address Book"));

}
开发者ID:MaximRadionov,项目名称:CourseWork,代码行数:52,代码来源:addressbook.cpp


示例18: main

int main(void)
{
	int one  = head(my_array);
	int prev = previous(&my_array[1]);
	int two = f2()(my_array);
	f();
	f_pointer()();
	printf("Head of array => %d\n", one);
	printf("Head of array => %d\n", prev);
	printf("Head of array => %d\n", two);

	return 0;
}
开发者ID:dterei,项目名称:Scraps,代码行数:13,代码来源:arrays.c


示例19: connect

void MainWindow::changePlayerConnections(bool connected)
{
    if(connected)
    {
        nextConnection = connect(bar,SIGNAL(nextClicked()),&player,SLOT(next()));
        previousConnection =  connect(bar,SIGNAL(previousClicked()),&player,SLOT(previous()));
    }
    else
    {
        disconnect(nextConnection);
        disconnect(previousConnection);
    }
}
开发者ID:raf924,项目名称:iniTunes,代码行数:13,代码来源:mainwindow.cpp


示例20: previous

bool ImageFileParser::previous(cv::Mat& image) {
	if (index <= 0) {
		return false;
	}

	image = cv::imread(files[--index], CV_LOAD_IMAGE_UNCHANGED);

	if (!image.data) {
		std::cout << "Not an image : " << files[index] << std::endl;
		return previous(image);
	}

	std::cout << "Loaded : " << files[index] << std::endl;
	return true;
}
开发者ID:yasarhalimkaya,项目名称:roiextractor,代码行数:15,代码来源:ImageFileParser.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ previousBlockState函数代码示例发布时间:2022-05-30
下一篇:
C++ preview函数代码示例发布时间: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