您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ updateCursor函数代码示例

51自学网 2021-06-03 09:13:28
  C++
这篇教程C++ updateCursor函数代码示例写得很实用,希望能帮到您。

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

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

示例1: updateCursor

void KoZoomTool::mouseMoveEvent(KoPointerEvent *event){    updateCursor(event->modifiers() & Qt::ControlModifier);    if (currentStrategy()) {        currentStrategy()->handleMouseMove(event->point, event->modifiers());    }}
开发者ID:AninaRJ,项目名称:krita,代码行数:8,


示例2: assert

void SDLFontGL::setupColors(std::vector<SDL_Color> colors) {	assert(!colors.empty());	m_colors = colors;	updateColors();	// cursor does a manual color lookup	updateCursor();}
开发者ID:RyanHope,项目名称:wTerm,代码行数:8,


示例3: updateCursor

void CursorManager::cancelTarget() {    if (target_) {        target_->onCancel();        target_.reset();        updateCursor();    }}
开发者ID:abnr,项目名称:fluorescence,代码行数:8,


示例4: QPoint

void AbstractSelection::mouseReleaseEvent(QMouseEvent *event, ImageArea &imageArea){    int right = mTopLeftPoint.x() > mBottomRightPoint.x() ? mTopLeftPoint.x() : mBottomRightPoint.x();    int bottom = mTopLeftPoint.y() > mBottomRightPoint.y() ? mTopLeftPoint.y() : mBottomRightPoint.y();    int left = mTopLeftPoint.x() < mBottomRightPoint.x() ? mTopLeftPoint.x() : mBottomRightPoint.x();    int top = mTopLeftPoint.y() < mBottomRightPoint.y() ? mTopLeftPoint.y() : mBottomRightPoint.y();    mBottomRightPoint = QPoint(right, bottom);    mTopLeftPoint = QPoint(left, top);    if (mIsSelectionExists)    {        updateCursor(event, imageArea);        if (mButton == Qt::RightButton && !mIsMouseMoved)        {            showMenu(imageArea);            paint(imageArea);            drawBorder(imageArea);            mIsPaint = false;            mIsSelectionMoving = mIsImageSelected = false;        }        else if (mIsSelectionMoving)        {            imageArea.setImage(mImageCopy);            completeMoving(imageArea);            paint(imageArea);            drawBorder(imageArea);            mIsPaint = false;            mIsSelectionMoving = false;        }        else if (mIsSelectionResizing)        {            imageArea.setImage(mImageCopy);            paint(imageArea);            completeResizing(imageArea);            paint(imageArea);            drawBorder(imageArea);            mIsPaint = false;            mIsSelectionResizing = false;        }    }    if (mIsPaint)    {        if (event->button() == Qt::LeftButton)        {            imageArea.setImage(mImageCopy);            if (mTopLeftPoint != mBottomRightPoint)            {                imageArea.setImage(mImageCopy);                paint(imageArea);                completeSelection(imageArea);                paint(imageArea);                mIsSelectionExists = true;            }            drawBorder(imageArea);            mIsPaint = false;        }    }    mIsSelectionAdjusting = false;}
开发者ID:3rt,项目名称:EasyPaint,代码行数:58,


示例5: readCommand

void readCommand(){	clearBuffer();	int pos = 0, line=((typeOffset/2)/VGA_W); //%VGA_H;	clearLine();	updateCursor(typeOffset/2);	key next;	while(1){		if(key_queue_is_empty()) continue;		next = remove_key();		/*printint(next.scancode);		print(" ");		continue;*/		if(next.scancode==75 && pos>0){pos--;}			//left arrow		if(next.scancode==77 && pos<bufferLength()-1){pos++;}	//right arrow		if(next.scancode==72) {			lookupHistory();			pos=k_strlen(textBuffer);		}//up arrow		if(next.scancode==80) {			lookdownHistory();			pos=k_strlen(textBuffer);		}//down arrow		if(next.key=='/n') {			if(typeOffset>(VGA_H-1)*VGA_W*2) {scroll();typeOffset-=2*VGA_W;}			typeOffset=(typeOffset+VGA_W*2)-(typeOffset/2)%VGA_W*2;			return;		}else if(next.key=='/b') {if(pos==0) continue; else charFromBuffer(pos--);}		else if(next.key=='/t') {			int num = splitString(textBuffer, ' ');			int i;			for(i =0;i<num;i++){argv[i]=stringArray[i];}			char *ac = autoComp(argv[i-1]);			while(*ac!=0) {charToBuffer(*ac,pos++); ac++;}		}else if(next.key!=0) {if(pos>(BUFFERSIZE)/2-4) continue; else charToBuffer(next.key, pos++);}		if(line==VGA_H-1 && bufferLength()>=VGA_W){scroll();line--;}		typeOffset = line*VGA_W*2;		typePrompt();		int save = typeOffset;		print(textBuffer);		clearLine();		typeOffset = save+pos*2;		updateCursor(typeOffset/2);	}}
开发者ID:thigley,项目名称:THOS,代码行数:45,


示例6: connect

void QWindowCompositor::setCursorSurface(QWaylandSurface *surface, int hotspotX, int hotspotY){    if ((m_cursorSurface != surface) && surface)        connect(surface, SIGNAL(damaged(QRect)), this, SLOT(updateCursor()));    m_cursorSurface = surface;    m_cursorHotspotX = hotspotX;    m_cursorHotspotY = hotspotY;}
开发者ID:locusf,项目名称:qtwayland,代码行数:9,


示例7: qDebug

bool QDragManager::drag( QDragObject * o, QDragObject::DragMode mode ){#ifdef DEBUG_QDND_SRC    qDebug( "QDragManager::drag ( %p, %d )", o, mode );#endif    if ( object == o || !o || !o->parent() )        return false;    if ( object ) {        cancel();        qApp->removeEventFilter( this );        beingCancelled = false;    }    object = o;    drag_mode = mode;    updatePixmap();    willDrop = FALSE;#ifndef QT_NO_ACCESSIBILITY    QAccessible::updateAccessibility( this, 0, QAccessible::DragDropStart );#endif    DWORD dwEffect, dwOKEffect;    QOleDataObject *obj = new QOleDataObject( o );    QOleDropSource *qsrc = new QOleDropSource();    src = o->target();    dwOKEffect = translateToWinDragEffects ( mode );    updateCursor();#ifdef Q_OS_TEMP    HRESULT r = 0;    resultEffect = 0;#else    HRESULT r = DoDragDrop( obj, qsrc, dwOKEffect, &dwEffect );#endif#ifndef QT_NO_CURSOR    QApplication::restoreOverrideCursor();    restoreCursor = false;#endif    // clean up    obj->releaseQt();    obj->Release();        // Will delete obj if refcount becomes 0    qsrc->Release();       // Will delete src if refcount becomes 0    object = 0;#ifndef QT_NO_ACCESSIBILITY    QAccessible::updateAccessibility( this, 0, QAccessible::DragDropEnd );#endif    return true;}
开发者ID:Miguel-J,项目名称:eneboo-core,代码行数:57,


示例8: createExtra

void QWidget::setCursor( const QCursor &cursor ){    createExtra();    delete extra->curs;    extra->curs = new QCursor(cursor);    setWState( WState_OwnCursor );    if ( isVisible() )	updateCursor( paintableRegion() );}
开发者ID:Miguel-J,项目名称:eneboo-core,代码行数:9,


示例9: refresh

void NYView::guiSetup(){    if(marginLeft > 0 && !getLocalBooleanOption("number")) {        marginLeft = 0;    }    refresh();    updateCursor();}
开发者ID:sandsmark,项目名称:yzis,代码行数:9,


示例10: updateCursor

void ImageViewer::mouseReleaseEvent ( QMouseEvent * event ){    velocityTracker->handleMouseRelease(event);    if(event->button() & Qt::LeftButton){        leftMousePressed = false;        updateCursor();    }}
开发者ID:404neko,项目名称:ezviewer-1,代码行数:9,


示例11: cancel

Qt::DropAction QDragManager::drag(QDrag *o){    if (object == o || !o || !o->source())        return Qt::IgnoreAction;    if (object) {        cancel();        qApp->removeEventFilter(this);        beingCancelled = false;    }    object = drag_object = o;    qt_qws_dnd_deco = new QShapedPixmapWidget();    oldstate = Qt::NoModifier; // #### Should use state that caused the drag//    drag_mode = mode;    willDrop = false;    updatePixmap();    updateCursor();    restoreCursor = true;    object->d_func()->target = 0;    qApp->installEventFilter(this);    global_accepted_action = Qt::CopyAction;#ifndef QT_NO_CURSOR    qApp->setOverrideCursor(Qt::ArrowCursor);    restoreCursor = true;    updateCursor();#endif    qt_qws_dnd_dragging = true;    eventLoop = new QEventLoop;    (void) eventLoop->exec();    delete eventLoop;    eventLoop = 0;    delete qt_qws_dnd_deco;    qt_qws_dnd_deco = 0;    qt_qws_dnd_dragging = false;    return global_accepted_action;}
开发者ID:tsuibin,项目名称:emscripten-qt,代码行数:44,


示例12: nvgBoxGradient

void Console::draw(NVGcontext* ctx){    Widget::draw(ctx);      //Screen *sc = dynamic_cast<Screen *>(this->window()->parent());    // Draw rounded rectangel around text area ////////////////////    NVGpaint paint = nvgBoxGradient(        ctx, mPos.x() + 1, mPos.y() + 1,        mSize.x()-2, mSize.y(), 3, 4, Color(0, 32), Color(0, 92));    nvgBeginPath(ctx);    nvgRoundedRect(ctx, mPos.x(), mPos.y(), mSize.x(), mSize.y(), 3);    nvgFillPaint(ctx, paint);    nvgFill(ctx);    ///////////////////////////////////////////////////////////////        nvgFontSize(ctx, 18.0f);    nvgFontFace(ctx, "sans");    nvgTextAlign(ctx, NVG_ALIGN_LEFT|NVG_ALIGN_TOP);    float x, y, linew, lineh;    nvgTextMetrics(ctx, nullptr, nullptr, &lineh);    x = mPos.x();    y = mPos.y();    linew = mSize.x();        mNumRows = mSize.y()/lineh ; // make sure that the size of console is updated    //setSize(Vector2i(mSize.x(), nrows*lineh)); // this code does not work. It    //changes size each frame. Move from draw into one time function.        // init console output     if(mInit) {        initBuffer(ctx, linew);        mInit = false;    }    //typedef std::deque<std::string> Buffer_t;    //temp solution: when buffer is not full. Move this to updateFunction.    for(auto it = mBuffer.begin();it!=mBuffer.end();++it) {        nvgBeginPath(ctx);        nvgFillColor(ctx, nvgRGBA(255,255,255,16));        nvgRect(ctx, x, y, linew, lineh);        nvgFill(ctx);        nvgFillColor(ctx, nvgRGBA(255,255,255,255));        nvgText(ctx, x, y, it->c_str(), nullptr);                y += lineh;    }       updateCursor(ctx, lineh);    //update cursor and draw    //mCaret.onClick(ctx, lineh, mMouseDownPos - mPos);    mCaret.draw(ctx, lineh, mPos);}
开发者ID:Kodomass,项目名称:nanogui,代码行数:56,


示例13: updateCursor

void ByteArrayColumnViewPrivate::blinkCursor(){    // skip the cursor drawing?    if( mCursorPaused || mValueEditor->isInEditMode() )        return;    // switch the cursor state    mBlinkCursorVisible = !mBlinkCursorVisible;    updateCursor( *mActiveColumn );}
开发者ID:ShermanHuang,项目名称:kdesdk,代码行数:10,


示例14: clearWState

void QWidget::unsetCursor(){    if ( extra ) {	delete extra->curs;	extra->curs = 0;    }    clearWState( WState_OwnCursor );    if ( isVisible() )	updateCursor( paintableRegion() );}
开发者ID:Miguel-J,项目名称:eneboo-core,代码行数:10,


示例15: SbVec2s

void QCtkXipSGWidget::mousePressEvent(QMouseEvent *event){  if(mInteractingField)    mInteractingField->setValue(1);  // store old pos for delta mode  mOldPos = SbVec2s(event->pos().x(), event->pos().y());  event->accept();  // Pass the QT mouse button event to open inventor  SbTime time;  time.setToTimeOfDay();  SoMouseButtonEvent e;  e.setTime(time);  switch (event->button())  {  default:  case Qt::LeftButton:    e.setButton(SoMouseButtonEvent::BUTTON1); break;  case Qt::MidButton:        e.setButton(SoMouseButtonEvent::BUTTON2); break;  case Qt::RightButton:    e.setButton(SoMouseButtonEvent::BUTTON3); break;  }  if (event->modifiers() & Qt::ShiftModifier)    e.setShiftDown(TRUE);  if (event->modifiers() & Qt::ControlModifier)    e.setCtrlDown(TRUE);  e.setState(SoButtonEvent::DOWN);  e.setPosition(SbVec2s(event->pos().x(), mHeight - event->pos().y()));  if (mSceneManager->processEvent(&e))  {    //processDelayQueue();    //repaint();    updateCursor(true);  }  else  {    updateCursor(false);  }}
开发者ID:ivowolf,项目名称:vtkIvPropProject,代码行数:43,


示例16: calcScaleRatio

void ImageViewer::layoutImage(){    if(hasPicture()) {        calcScaleRatio();        calcTopLeft();        calcShift();    }    updateCursor();}
开发者ID:404neko,项目名称:ezviewer-1,代码行数:10,


示例17: updateCursor

void ScriptEdit::TextEdit::keyPressEvent(QKeyEvent *e){    updateCursor();    switch(e->key())    {//    case Qt::Key_Space://        if(!(e->modifiers() & Qt::ControlModifier)) QTextEdit::keyPressEvent(e);//        else Kernel::run(document()->toPlainText()); break;    case Qt::Key_Tab: insert("    "); break;    case Qt::Key_ParenLeft:        if(!curChar().isLetterOrNumber()) { insert("()"); moveCursor(-1); }        else QTextEdit::keyPressEvent(e); break;    case Qt::Key_ParenRight:        if(curChar() == ')') moveCursor(1);        else QTextEdit::keyPressEvent(e); break;    case Qt::Key_BraceLeft:        insert("{}"); moveCursor(-1); break;    case Qt::Key_BraceRight:        if(curChar() == '}') moveCursor(1);        else QTextEdit::keyPressEvent(e); break;    case Qt::Key_Return:    {        QString text = document()->toPlainText(), space = "";        int n = 0;        for(int i = 0; i < pos(); i++) if(text.at(i) == '{') n++; else if(text.at(i) == '}') n--;        space.fill(' ', 4*n);        if(prevChar() == '{')        {            insert("/n" + space);            if(curChar() == '}')            {                insert("/n" + space.left(space.length()-4));                moveCursor(3-4*n);            }            break;        }        else if(curChar() == '}') { insert("/n" + space.left(space.length()-4)); break; }        else { insert("/n" + space); break; }        QTextEdit::keyPressEvent(e); break;    }    default: QTextEdit::keyPressEvent(e);    }}
开发者ID:ArthurGoodman,项目名称:ProjectCell,代码行数:54,


示例18: XOJ_CHECK_TYPE

void Cursor::setMouseSelectionType(CursorSelectionType selectionType){	XOJ_CHECK_TYPE(Cursor);	if (this->selectionType == selectionType)	{		return;	}	this->selectionType = selectionType;	updateCursor();}
开发者ID:gitter-badger,项目名称:xournalpp,代码行数:11,


示例19: updateCursor

void DisassemblyView::setCursorPosition(int x, int y){  if (!SetCursor(x, y))    return;  _cursorTimer.start();  _cursorBlink = false;  updateCursor();  emit cursorAddressUpdated(GetCursorAddress());}
开发者ID:GrimDerp,项目名称:medusa,代码行数:11,


示例20: updateChangeTime

void CTimelineControl::_OnMouseMove( uiMouseEvent mouseEvent, int x, int y ){	if ( m_changeTimeAndValue )	{		if ( m_lbuttonDown )		{			if ( m_mouseActionState == k_mouseActionChangeTime )			{				// drag to change time				updateChangeTime( x, y );			}			else if ( m_mouseActionState == k_mouseActionChangeValue )			{				// drag to change value				updateChangeValue( x,y );			}			else			{				// drag				m_currentTime = getTimeValue( x - OFFSET_X + m_crollX );				checkSelectTime( x, y );			}			update();		}				}	if ( m_rbuttonDown )	{		int nWidth = getClientWidth();		float timeWidth = m_lengthPixel*m_timeLength;		int limitW = (int)timeWidth + OFFSET_X * 2;		if ( nWidth < limitW )		{			int dx = x - m_x;						m_crollX -= dx;						if ( m_crollX < 0 )				m_crollX = 0;			else if ( nWidth + m_crollX > limitW  )			{				m_crollX = limitW - nWidth;			}		}		update();	}	m_x = x;	m_y = y;	// update cursor icon	updateCursor( x, y);}
开发者ID:codeman001,项目名称:gsleveleditor,代码行数:54,


示例21: connect

void ChannelListWidget::setActive(bool active){    if (m_active == active)        return;    m_active = active;    if (active) {        connect(m_yellowPage, SIGNAL(updateDone(YellowPage *, bool)),                this, SLOT(done(YellowPage *, bool)));        updateCursor();        updateActions();    } else {
开发者ID:PyYoshi,项目名称:QPeerCastYP,代码行数:11,


示例22: updateCursor

void KisVisualColorSelectorShape::setColor(KoColor c){    //qDebug() << this  << "KisVisualColorSelectorShape::setColor";    if (c.colorSpace() != m_d->colorSpace) {        c.convertTo(m_d->colorSpace);    }    m_d->currentColor = c;    updateCursor();    m_d->imagesNeedUpdate = true;    update();}
开发者ID:KDE,项目名称:krita,代码行数:12,


示例23: updateHand

 void updateHand(Hand * p) {     if(hands.find(p->id) == hands.end())return;     if(p->population != 1)     {         removeHand(p);     }     else     {         updateCursor(p);     } }
开发者ID:mediosInteractivos,项目名称:OF-TangibleFramework,代码行数:12,


示例24: setupte

static void setupte(int filenum){	int newfile = filenum<0?1:0;	int i;	for(i=0;i<VGA_W*VGA_H;i++) file_buffer[i]= 0;	clearScreen();	if(filenum>=0){load(filenum);}	typeOffset=0;	updateCursor(typeOffset);	}
开发者ID:thigley,项目名称:THOS,代码行数:12,


示例25: switch

bool LineEdit::onKeyPressed(const sf::Event::KeyEvent &evt){	Widget::onKeyPressed(evt);	if(m_inputison)	{		switch(evt.code)		{			case sf::Keyboard::Return:				if(m_func)					m_func(getString());				m_inputison = false;				break;			case sf::Keyboard::Left:				if(m_positioncursor > 0)					m_positioncursor--;				break;			case sf::Keyboard::Right:				if(m_positioncursor < m_text.getString().getSize())					m_positioncursor++;				break;			case sf::Keyboard::BackSpace:				//erase character				if(m_positioncursor > 0)				{					sf::String temp(m_text.getString());					temp.erase(m_positioncursor - 1, 1);					m_text.setString(temp);					m_positioncursor--;				}				break;			case sf::Keyboard::Delete:				//erase character				if(m_positioncursor < m_text.getString().getSize())				{					sf::String temp(m_text.getString());					temp.erase(m_positioncursor, 1);					m_text.setString(temp);				}				break;			default:				break;		}		updateCursor();		return true;	}	return false;}
开发者ID:Senzaki,项目名称:tipne_net,代码行数:53,


示例26: updateCursor

	void PointerContextManager::removeContext(const std::string& _name)	{		for (VectorContext::iterator item = mContexts.begin(); item != mContexts.end(); ++item)		{			if (_name == (*item)->getResourceName())			{				mContexts.erase(item);				break;			}		}		updateCursor();	}
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:13,


示例27: QPixmap

void Canvas::onColorPicker(bool in){    if(in){        inPicker = true;        QPixmap icon = QPixmap("iconset/color-picker.png");        setCursor(QCursor(icon, 0, icon.height()));    }else{        inPicker = false;        //        setCursor(Qt::CrossCursor);        updateCursor(brush_->width());        emit pickColorComplete();    }}
开发者ID:pm19960106,项目名称:painttyWidget,代码行数:13,



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


C++ updateData函数代码示例
C++ updateCurrentItem函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。