这篇教程C++ updatePath函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中updatePath函数的典型用法代码示例。如果您正苦于以下问题:C++ updatePath函数的具体用法?C++ updatePath怎么用?C++ updatePath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了updatePath函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: scenevoid ArrowAttachItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event){ if (!startItem) return; QPointF endPos = event->scenePos(); QList<QGraphicsItem *> colliding = scene()->items(endPos); ArrowTarget *cursorItem = 0; qreal cursorItemZ = -1; for (int i = colliding.size() - 1; i >= 0; i--) if (qgraphicsitem_cast<CardItem *>(colliding.at(i))) if (colliding.at(i)->zValue() > cursorItemZ) { cursorItem = static_cast<ArrowTarget *>(colliding.at(i)); cursorItemZ = cursorItem->zValue(); } if ((cursorItem != targetItem) && targetItem) targetItem->setBeingPointedAt(false); if (!cursorItem) { fullColor = false; targetItem = 0; updatePath(endPos); } else { fullColor = true; if (cursorItem != startItem) cursorItem->setBeingPointedAt(true); targetItem = cursorItem; updatePath(); } update();}
开发者ID:DeanWay,项目名称:Cockatrice,代码行数:32,
示例2: Q_UNUSEDbool DrawFreehandTool::mouseMoveEvent(QMouseEvent* event, MapCoordF map_coord, MapWidget* widget){ Q_UNUSED(widget); bool mouse_down = containsDrawingButtons(event->buttons()); if (!mouse_down) { if (!editingInProgress()) { setPreviewPointsPosition(map_coord); setDirtyRect(); } } else { if (!editingInProgress()) return false; dragging = true; cur_pos = event->pos(); cur_pos_map = map_coord; updatePath(); } return true;}
开发者ID:FEK10,项目名称:mapper,代码行数:26,
示例3: extractMomentsvoid Cluster::addEvent(Event e){ // add to activity history (eventsPerInterval) int lastEventIndex = (lastEventTS/TIME_WINDOW)%NUM_TIMESLOTS; int index = (e.timeStamp/TIME_WINDOW)%NUM_TIMESLOTS; if(lastEventIndex == index){ // if belonging to same interval, add up int sum = eventsPerInterval->at(index); eventsPerInterval->set(index,sum+1); } else{ //else reset to 0 + 1 eventsPerInterval->set(index,1); } //add event to cluster events->add(e); if(firstEventTS == 0) firstEventTS = e.timeStamp; lifeTime = e.timeStamp - firstEventTS; //extract current central moment extractMoments(&e); //update the cluster path and velocity updatePath(e.timeStamp); //updateVelocity(); lastEventTS = e.timeStamp;}
开发者ID:AndreaCensi,项目名称:dvs_tracking,代码行数:27,
示例4: loadOdfAttributesbool RectangleShape::loadOdf(const KoXmlElement &element, KoShapeLoadingContext &context){ loadOdfAttributes(element, context, OdfMandatories | OdfGeometry | OdfAdditionalAttributes | OdfCommonChildElements); if (element.hasAttributeNS(KoXmlNS::svg, "rx") && element.hasAttributeNS(KoXmlNS::svg, "ry")) { qreal rx = KoUnit::parseValue(element.attributeNS(KoXmlNS::svg, "rx", "0")); qreal ry = KoUnit::parseValue(element.attributeNS(KoXmlNS::svg, "ry", "0")); m_cornerRadiusX = rx / (0.5 * size().width()) * 100; m_cornerRadiusY = ry / (0.5 * size().height()) * 100; } else { QString cornerRadius = element.attributeNS(KoXmlNS::draw, "corner-radius", ""); if (! cornerRadius.isEmpty()) { qreal radius = KoUnit::parseValue(cornerRadius); m_cornerRadiusX = qMin<qreal>(radius / (0.5 * size().width()) * 100, qreal(100)); m_cornerRadiusY = qMin<qreal>(radius / (0.5 * size().height()) * 100, qreal(100)); } } updatePath(size()); updateHandles(); loadOdfAttributes(element, context, OdfTransformation); loadText(element, context); return true;}
开发者ID:KDE,项目名称:calligra,代码行数:26,
示例5: updateKindHandlevoid SpiralShape::setFade(qreal fade){ m_fade = fade; updateKindHandle(); //updateAngleHandles(); updatePath(size());}
开发者ID:woylaski,项目名称:kexi,代码行数:7,
示例6: updatePath void Utils::updatePlaylist(int index) { //TODO FIX! Logger::printOut("updating playlist view"); CStdString path; path.Format("musicdb://3/spotify:playlist:%i/", index); updatePath(path); }
开发者ID:TENFIRE,项目名称:spotyxbmc2,代码行数:7,
示例7: pathValuePathSettingWidget::PathSettingWidget(string &pathValue_, const char *labelText, const char *pathDefaultLabel_, const char *pathBrowseLabel_, const char *pathDefaultValue_) : pathValue(pathValue_) { pathDefaultLabel = pathDefaultLabel_; pathBrowseLabel = pathBrowseLabel_; pathDefaultValue = pathDefaultValue_; layout = new QVBoxLayout; layout->setMargin(0); layout->setSpacing(0); setLayout(layout); label = new QLabel(labelText); layout->addWidget(label); controlLayout = new QHBoxLayout; controlLayout->setSpacing(Style::WidgetSpacing); layout->addLayout(controlLayout); path = new QLineEdit; path->setReadOnly(true); controlLayout->addWidget(path); pathSelect = new QPushButton("Select ..."); controlLayout->addWidget(pathSelect); pathDefault = new QPushButton("Default"); controlLayout->addWidget(pathDefault); connect(pathSelect, SIGNAL(released()), this, SLOT(selectPath())); connect(pathDefault, SIGNAL(released()), this, SLOT(defaultPath())); updatePath();}
开发者ID:LuigiBlood,项目名称:bsnes-plus,代码行数:31,
示例8: origvoid AmeJobMan::setPath(AmeJob *job, wxString &path, bool parent){ //synchronized(job){ if(job->check(jS_DOING)) return; //int status = jFAILED; wxFileName orig(job->getNewFilePath().Length()>0?job->getNewFilePath():job->getAbsolutePath()); wxString name; if(parent){ wxFileName pp = orig.GetPath(); //pp = pp.GetPath(); name += pp.GetFullName()+wxT(FILE_SEPARATOR); } name += orig.GetFullName(); wxString file = path+wxT(FILE_SEPARATOR)+name; if(job->getHealth()==jH_MISSING){ job->find(file); A.m_db->update(dJ, 1, job); } else if(updatePath(job, file)){ if(job->getNewFilePath().Length()>0) job->setStatus(jMOVEWAIT, true); // status = jMOVEWAIT; //else // status = jFINISHED; A.m_db->update(dJ, 1, job); } //}}
开发者ID:arucard21,项目名称:AniDB,代码行数:28,
示例9: QDialogNewProgramDialog::NewProgramDialog(Project *proj, QWidget *parent) : QDialog(parent) , _ui(new Ui::NewProgramDialog) , _project(proj){ _ui->setupUi(this); // Load the help stylesheet and apply it to this widget QFile fp(":/stylesheets/helpdialog.css"); fp.open(QIODevice::ReadOnly | QIODevice::Text); QString style = fp.readAll(); setStyleSheet(style); // Initialise form // Set a default rule name as "Program" _ui->programNameEdit->setText("Program"); // Set the default directory as "${projectDir}/programs" QDir dir = proj->dir(); dir.cd("programs"); _ui->programDirEdit->setText(QDir::toNativeSeparators(dir.path())); // Update the path field updatePath();}
开发者ID:aelliott,项目名称:GP2,代码行数:25,
示例10: Q_Dvoid KoConnectionShape::updateConnections(){ Q_D(KoConnectionShape); bool updateHandles = false; if (d->handleConnected(StartHandle)) { if (d->shape1->hasConnectionPoint(d->connectionPointId1)) { // map connection point into our shape coordinates QPointF p = documentToShape(d->shape1->absoluteTransformation(0).map(d->shape1->connectionPoint(d->connectionPointId1).position)); if (d->handles[StartHandle] != p) { d->handles[StartHandle] = p; updateHandles = true; } } } if (d->handleConnected(EndHandle)) { if (d->shape2->hasConnectionPoint(d->connectionPointId2)) { // map connection point into our shape coordinates QPointF p = documentToShape(d->shape2->absoluteTransformation(0).map(d->shape2->connectionPoint(d->connectionPointId2).position)); if (d->handles[EndHandle] != p) { d->handles[EndHandle] = p; updateHandles = true; } } } if (updateHandles || d->forceUpdate) { update(); // ugly, for repainting the connection we just changed updatePath(QSizeF()); update(); // ugly, for repainting the connection we just changed d->forceUpdate = false; }}
开发者ID:NavyZhao1978,项目名称:QCalligra,代码行数:33,
示例11: updatePathFile::File(const File& orig) { updatePath(orig.path()); setName(orig.getName()); setOwner(orig.getOwner()); setSize(orig.getSize()); setTime(orig.getTime());}
开发者ID:hmenn,项目名称:GTU-2015-CSE241-OOP-HW,代码行数:7,
示例12: QDialogNewGraphDialog::NewGraphDialog(Project *proj, QWidget *parent) : QDialog(parent) , _ui(new Ui::NewGraphDialog) , _project(proj){ _ui->setupUi(this); // Load the help stylesheet and apply it to this widget QFile fp(":/stylesheets/helpdialog.css"); fp.open(QIODevice::ReadOnly | QIODevice::Text); QString style = fp.readAll(); setStyleSheet(style); // Initialise form // Set a default rule name as "Graph" // _ui->graphNameEdit->setText("Graph"); _ui->graphNameEdit->setValidator(new QRegExpValidator(QRegExp("^(//w|//d|//-|_|//.)+$"), this)); // Set the default directory as "${projectDir}/graphs" QDir dir = proj->dir(); dir.cd("graphs"); _ui->graphDirEdit->setText(QDir::toNativeSeparators(dir.path())); // Update the path field updatePath();}
开发者ID:UoYCS-plasma,项目名称:GP2-Editor,代码行数:26,
示例13: prepareGeometryChangevoid UBEditableGraphicsRegularShapeItem::updateHandle(UBAbstractHandle *handle){ prepareGeometryChange(); Delegate()->showFrame(false); QPointF diff = handle->pos() - path().boundingRect().topLeft(); qreal maxSize = handle->radius() * 4; if(diff.x() < maxSize) { handle->setX(handle->pos().x() + (maxSize - diff.x())); } if(diff.y() < maxSize) { handle->setY(handle->pos().y() + (maxSize - diff.y())); } updatePath(handle->pos()); if(hasGradient()) { QLinearGradient g(path().boundingRect().topLeft(), path().boundingRect().topRight()); g.setColorAt(0, brush().gradient()->stops().at(0).second); g.setColorAt(1, brush().gradient()->stops().at(1).second); setBrush(g); }}
开发者ID:hethi,项目名称:Sankore-3.1,代码行数:30,
示例14: maskedRegionvoid RotationDialog::resizeEvent(QResizeEvent *){ QPainterPath p; p.addRoundedRect(rect(), 20, 20); QRegion maskedRegion(p.toFillPolygon().toPolygon()); setMask(maskedRegion); updatePath();}
开发者ID:chenhbzl,项目名称:BooxApp,代码行数:8,
示例15: scenevoid ArrowDragItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event){ // This ensures that if a mouse move event happens after a call to delArrow(), // the event will be discarded as it would create some stray pointers. if (!startItem) return; QPointF endPos = event->scenePos(); QList<QGraphicsItem *> colliding = scene()->items(endPos); ArrowTarget *cursorItem = 0; qreal cursorItemZ = -1; for (int i = colliding.size() - 1; i >= 0; i--) { if (qgraphicsitem_cast<PlayerTarget *>(colliding.at(i)) || qgraphicsitem_cast<CardItem *>(colliding.at(i))) { if (colliding.at(i)->zValue() > cursorItemZ) { cursorItem = static_cast<ArrowTarget *>(colliding.at(i)); cursorItemZ = cursorItem->zValue(); } } } if ((cursorItem != targetItem) && targetItem) { targetItem->setBeingPointedAt(false); targetItem->removeArrowTo(this); } if (!cursorItem) { fullColor = false; targetItem = 0; updatePath(endPos); } else { if (cursorItem != targetItem) { fullColor = true; if (cursorItem != startItem) { cursorItem->setBeingPointedAt(true); cursorItem->addArrowTo(this); } targetItem = cursorItem; } updatePath(); } update(); for (int i = 0; i < childArrows.size(); ++i) { childArrows[i]->mouseMoveEvent(event); }}
开发者ID:Cockatrice,项目名称:Cockatrice,代码行数:46,
示例16: updatePathvoid ArrowItem::updatePath(){ if (!targetItem) return; QPointF endPoint = targetItem->mapToScene(QPointF(targetItem->boundingRect().width() / 2, targetItem->boundingRect().height() / 2)); updatePath(endPoint);}
开发者ID:DeanWay,项目名称:Cockatrice,代码行数:8,
示例17: updatePathvoid RectangleShape::setCornerRadiusY(qreal radius){ if (radius >= 0.0 && radius <= 100.0) { m_cornerRadiusY = radius; updatePath(size()); updateHandles(); }}
开发者ID:KDE,项目名称:calligra,代码行数:8,
示例18: updatePath//!//! Sets the endnode of the connection.//!void ConnectionGraphicsItem::setEndNodeItem ( NodeGraphicsItem *item ){ m_endNodeItem = item; if (m_endNodeItem) { m_endNodeItem->addConnectionItem(this); updatePath(); }}
开发者ID:banduladh,项目名称:levelfour,代码行数:11,
示例19: getPath api_return FavoriteDirectoryApi::handleUpdateDirectory(ApiRequest& aRequest) { auto path = getPath(aRequest); auto info = updatePath(path, aRequest.getRequestBody()); aRequest.setResponseBody(serializeDirectory(info)); return websocketpp::http::status_code::ok; }
开发者ID:pavel-pimenov,项目名称:airgit,代码行数:8,
示例20: QGraphicsPathItemGraphicsInterpolationItem::GraphicsInterpolationItem(AbstractInterpolator *interpolator_, double samplingInterval_, double xscale_, double yscale_, QGraphicsItem *parent) : QGraphicsPathItem(parent), interpolator(interpolator_), samplingInterval(samplingInterval_), xscale(xscale_), yscale(yscale_){ updatePath();}
开发者ID:elektrokokke,项目名称:elektrocillin,代码行数:9,
示例21: setRectvoid CircleObject::setObjectDiameter(qreal diameter){ QRectF circRect; circRect.setWidth(diameter); circRect.setHeight(diameter); circRect.moveCenter(QPointF(0,0)); setRect(circRect); updatePath();}
开发者ID:Allen76,项目名称:Embroidermodder,代码行数:9,
示例22: findIndexvoid PolygonObject::gripEdit(const QPointF& before, const QPointF& after){ gripIndex = findIndex(before); if(gripIndex == -1) return; QPointF a = mapFromScene(after); normalPath.setElementPositionAt(gripIndex, a.x(), a.y()); updatePath(normalPath); gripIndex = -1;}
开发者ID:Kerman,项目名称:Embroidermodder,代码行数:9,
示例23: updatePathvoid QArClient::getPathReceived(Points *path){ // Correct for change in coordinate system (i.e. y = -y) for (list<Point>::iterator i = path->data.begin(); i != path->data.end(); i++) { i->y = -i->y; } emit updatePath(path);}
开发者ID:cfezequiel,项目名称:mscs-thesis,代码行数:9,
示例24: boundingRectvoid QTriangle::paint(QPainter *painter){ if ( m_lastBoundingRect != boundingRect() ){ m_lastBoundingRect.setRect( boundingRect().x(), boundingRect().y(), boundingRect().width(), boundingRect().height() ); updatePath(); } painter->setPen(QPen(m_color)); painter->setBrush(QBrush(m_color)); painter->drawPolygon(m_points, 3, Qt::OddEvenFill);}
开发者ID:livecv,项目名称:livecv,代码行数:9,
示例25: updatePathvoid Walk::start() { Movement::start(); updatePath(); changeItemAnim(); Resources::Location *location = StarkGlobal->getCurrent()->getLocation(); location->startFollowingCharacter();}
开发者ID:Botje,项目名称:residualvm,代码行数:9,
示例26: updatePathvoid SCgPathItem::popPoint(){ if (mPoints.isEmpty()) return; mPoints.pop_back(); updatePath(); updateLastLine(mLastLine.line().p2());}
开发者ID:mcdir,项目名称:sui,代码行数:9,
示例27: QWidgetCommentaire::Commentaire(QWidget *parent, int iC, int iP, Produit *produit, Data *d) : QWidget(parent), ui(new Ui::Commentaire), PageInterface(parent, iC, iP){ ui->setupUi(this); currentProduit = produit; database = d; signalAndSlot(); //on doit remplacer dans ce path les "/" par des "/" => "//" caractére d'échapement //c'est qt qui les mets dans ce sens avec la méthode appicationDirPath() pathSyst = updatePath(QApplication::applicationDirPath()+database->getPathSyst()); pathBA = updatePath(QApplication::applicationDirPath()+database->getPathBA());}
开发者ID:Leymariv,项目名称:Product-Configurator-Qt,代码行数:18,
注:本文中的updatePath函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ updatePixmap函数代码示例 C++ updateParams函数代码示例 |