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


C++ setCacheMode函数代码示例

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


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

示例1: CardZone

PileZone::PileZone(Player *_p, const QString &_name, bool _isShufflable, bool _contentsKnown, QGraphicsItem *parent)
    : CardZone(_p, _name, false, _isShufflable, _contentsKnown, parent)
{
    setCacheMode(DeviceCoordinateCache); // Do not move this line to the parent constructor!
#if QT_VERSION < 0x050000
    setAcceptsHoverEvents(true);
#else
    setAcceptHoverEvents(true);
#endif
    setCursor(Qt::OpenHandCursor);
    
    setTransform(QTransform().translate((float) CARD_WIDTH / 2, (float) CARD_HEIGHT / 2).rotate(90).translate((float) -CARD_WIDTH / 2, (float) -CARD_HEIGHT / 2));
}
开发者ID:Akira586,项目名称:Cockatrice,代码行数:13,代码来源:pilezone.cpp

示例2: QGraphicsView

AniPreviewView::AniPreviewView(AniPreviewWnd* pParent) : QGraphicsView(pParent), m_pWnd(pParent)
{
	AniPreviewScene *scene = new AniPreviewScene(this);
	setScene(scene);
	scene->setSceneRect(-2000, -2000, 4000, 4000);
	
	setRenderHint(QPainter::Antialiasing);
	setCacheMode(CacheBackground);
	setViewportUpdateMode(BoundingRectViewportUpdate);
	setRenderHint(QPainter::Antialiasing);
	setTransformationAnchor(AnchorUnderMouse);
	centerOn(QPoint(0, 0));
}
开发者ID:MichaelMiao,项目名称:Totem,代码行数:13,代码来源:AniPreviewWnd.cpp

示例3: setCacheMode

void DesktopWidget::spin()
{
    d->angle += 18;
    setCacheMode(ItemCoordinateCache);
    QPointF center = boundingRect().center();
    QTransform mat = QTransform();
    mat.translate(center.x() ,  center.y());
    mat.rotate(d->angle, Qt::YAxis);
    mat.translate(- center.x() ,  - center.y());
    setTransform(mat);
    if (d->angle >= 180) {
        if (state() == BACKSIDE) {
            setState(NORMALSIDE);
        } else {
            setState(BACKSIDE);
        }
        d->spintimer->stop();
        resetMatrix();
        setCacheMode(DeviceCoordinateCache);
        d->angle = 0;
    }
}
开发者ID:chanux,项目名称:plexydesk,代码行数:22,代码来源:desktopwidget.cpp

示例4: QGraphicsObject

RoundRectItem::RoundRectItem(const QRectF &bounds,
                             const QColor &color,
                             QGraphicsItem *parent)
    : QGraphicsObject(parent),
      m_bounds(bounds)
{
    setCacheMode(ItemCoordinateCache);

    m_gradient.setStart(bounds.topLeft());
    m_gradient.setFinalStop(bounds.bottomRight());
    m_gradient.setColorAt(0, color);
    m_gradient.setColorAt(1, color.dark(200));
}
开发者ID:manmetplok,项目名称:plokkify,代码行数:13,代码来源:roundrectitem.cpp

示例5: setCacheMode

//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
tAbstractSideBar::~tAbstractSideBar()
{
    if (m_pAnimationTimer != 0)
    {
        m_pAnimationTimer->stop();
    }

#ifdef TICONITEM_USE_CACHE
    // need to set the cache mode to NoCache to ensure the the QPixmapCache is flushed
    // not doing this can result in new tIconItems residing at the same address getting a false cache hit
    setCacheMode( QGraphicsItem::NoCache );
#endif
}
开发者ID:dulton,项目名称:53_hero,代码行数:16,代码来源:AbstractSideBar.cpp

示例6: QGraphicsRectItem

canvas_flag::canvas_flag(canvas_view *i_oGraphWidget, canvas_item *i_oFrom)
	: QGraphicsRectItem(), m_oGraph(i_oGraphWidget)
{
	setFlags(NULL);
	m_oItem = i_oFrom;
	setRect(0, 0, 19, 19);

	/* set the z value to 51 */
	setZValue(51);

	i_oGraphWidget->scene()->addItem(this);
	setParentItem(m_oItem);
	setCacheMode(QGraphicsItem::DeviceCoordinateCache);
}
开发者ID:alessandrostone,项目名称:semantik,代码行数:14,代码来源:canvas_flag.cpp

示例7: setFlag

// +-----------------------------------------------------------
ft::FaceFeatureNode::FaceFeatureNode(int iID, FaceWidget *pFaceWidget)
{
	m_pFaceWidget = pFaceWidget;

    setFlag(ItemIsMovable);
    setFlag(ItemSendsGeometryChanges);
	setFlag(ItemIsSelectable);
    setCacheMode(DeviceCoordinateCache);

	setSelected(false);
	setAcceptHoverEvents(true);

	m_iID = iID;
}
开发者ID:flair2005,项目名称:Facial-Landmarks-Annotation-Tool,代码行数:15,代码来源:facefeaturenode.cpp

示例8: QGraphicsItem

TraceGraphPoint::TraceGraphPoint(TraceGraphItem* i_parent,
				 TraceGraphPoint::PointPosition i_position)
  : QGraphicsItem(i_parent),
    m_positionOnTrace(i_position),
    m_isBeingMoved(false),
    m_startPointAtMouseDown(QPointF(0.0,0.0)) {
  setFlag(QGraphicsItem::ItemIsSelectable, true);
  setFlag(QGraphicsItem::ItemIsMovable);
  setFlag(QGraphicsItem::ItemSendsGeometryChanges);
  setCacheMode(QGraphicsItem::DeviceCoordinateCache);
  setCursor(Qt::CrossCursor);
  LOG_DEBUG("Constructing a TraceGraphPoint");
  updatePositionOnScene(i_parent->getTracePointer().lock());
}
开发者ID:Kaldie,项目名称:GeRoBot,代码行数:14,代码来源:TraceGraphPoint.cpp

示例9: QGraphicsView

/*!
    \brief The constructor initializes everything needed for the 3D animation.
 */
AboutDialogGraphicsView::AboutDialogGraphicsView(AboutDialog *aboutDialog, QWidget *parentWindow) : QGraphicsView(parentWindow)
	, _aboutDialog(NULL)
	, _graphicsProxyWidget(NULL)
	, _parentWindow(NULL)
	, _timeLine(NULL)
	, _aboutDialogAsSplashScreen(NULL)
{
    _parentWindow = parentWindow;
    setWindowFlags(Qt::SplashScreen);

#ifdef Q_OS_LINUX
    QRect availableGeometry = QApplication::desktop()->availableGeometry();
    QRect newGeometry = QRect( availableGeometry.x(), availableGeometry.y(), availableGeometry.width(), availableGeometry.height() );
#else
    QRect newGeometry = QRect( -1,-1, QApplication::desktop()->rect().width()+2, QApplication::desktop()->rect().height()+2 );
#endif
    setGeometry( newGeometry );

    _aboutDialog = aboutDialog;

    _windowTitleBarWidth = 0;
    _windowPosOffset = 0;

    QGraphicsScene *scene = new QGraphicsScene(this);
    setSceneRect( newGeometry );
    _aboutDialogAsSplashScreen = new QSplashScreen(this);
    _graphicsProxyWidget = scene->addWidget(_aboutDialogAsSplashScreen);
    _graphicsProxyWidget->setWindowFlags( Qt::ToolTip );

    setScene( scene );
    setRenderHint(QPainter::Antialiasing);

    setCacheMode(QGraphicsView::CacheBackground);
    setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);

    connect(_aboutDialog, SIGNAL(finished(int)), this, SLOT(hide()));

    //setWindowOpacity(0.9);

    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setStyleSheet("AboutDialogGraphicsView { border: 0px; }");

    _timeLine = new QTimeLine(1000, this);
    _timeLine->setFrameRange(270, 0);
    //_timeLine->setUpdateInterval(10);
    //_timeLine->setCurveShape(QTimeLine::EaseInCurve);
    connect(_timeLine, SIGNAL(frameChanged(int)), this, SLOT(updateStep(int)));
}
开发者ID:Coder-666,项目名称:UniversalIndentGUI,代码行数:52,代码来源:AboutDialogGraphicsView.cpp

示例10: graph

Node::Node(GraphWidget *graphWidget, QColor qtColor)
    : graph(graphWidget)
{
    setFlag(ItemIsMovable);
    setFlag(ItemSendsGeometryChanges);
    setCacheMode(DeviceCoordinateCache);
    setZValue(-1);
    //setOpacity(0.10);
    nodeOpacity = false;
    bckColor = qtColor;
     //connect(this, SIGNAL(choixStation(QString)), graph, SLOT(clickinfo(QString)));
    connect(this, &Node::choixStation, graph, &GraphWidget::clickinfo );
    connect(this, &Node::nodeA, graph, &GraphWidget::stDebut );
    connect(this, &Node::nodeB, graph, &GraphWidget::stFin );
}
开发者ID:sepiropht,项目名称:caltopo,代码行数:15,代码来源:node.cpp

示例11: setFlag

Node::Node(QSpinBox *sb)
{
    setFlag(ItemIsMovable);
    setFlag(ItemSendsGeometryChanges);
    setCacheMode(DeviceCoordinateCache);
    setZValue(-1);

    qsb = sb;
    bPressed  = false;
    centerX   = true;
    centerY   = true;
    fixedX    = false;
    fixedY    = false;
    ballSize = DEFAULT_BALL_SIZE;
}
开发者ID:Isaac96,项目名称:eepe,代码行数:15,代码来源:node.cpp

示例12: QGraphicsView

View::View(QWidget *parent)
    : QGraphicsView(parent)
    , m_zoomFactor(1.0)
{
    setBackgroundBrush(QBrush(s_backgroundColor));
    setCacheMode(QGraphicsView::CacheBackground);
    setRenderHints(QPainter::Antialiasing);
    setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate);
    setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
    setDragMode(QGraphicsView::RubberBandDrag);

    setAttribute(Qt::WA_AcceptTouchEvents);
    grabGesture(Qt::PanGesture);
    grabGesture(Qt::PinchGesture);
}
开发者ID:eliemichel,项目名称:ZodiacGraph,代码行数:15,代码来源:view.cpp

示例13: TikzItem

PathItem::PathItem(tikz::core::Path * path, QGraphicsItem * parent)
    : TikzItem(parent)
    , d(new PathPrivate())
{
    d->path = path;

    // setPos needed?
    setPos(0, 0);

    setFlag(QGraphicsItem::ItemIsSelectable, true);
    setCacheMode(QGraphicsItem::DeviceCoordinateCache);

    // forward changed() signal
    connect(d->path, SIGNAL(changed()), this, SIGNAL(changed()));
}
开发者ID:KDE,项目名称:tikzkit,代码行数:15,代码来源:PathItem.cpp

示例14: QGraphicsScene

StoryLineWidget::StoryLineWidget(){
	QGraphicsScene *scene = new QGraphicsScene(this);
	scene->setItemIndexMethod(QGraphicsScene::NoIndex);
	scene->setSceneRect(QRectF(0, 0, 3200, 300));
	setScene(scene);
	setCacheMode(CacheBackground);
	setViewportUpdateMode(BoundingRectViewportUpdate);
	setRenderHint(QPainter::Antialiasing);
	setTransformationAnchor(AnchorUnderMouse);

	this->setAlignment(Qt::AlignLeft);

	story_stamp_vec_.clear();
	result_value_map_ = NULL;
}
开发者ID:Edgar324,项目名称:WrfAnalysisPlatform,代码行数:15,代码来源:story_line_widget.cpp

示例15: config

void Clock::clockConfigAccepted()
{
    KConfigGroup cg = config();
    m_showTimezoneString = ui.showTimezoneStringCheckBox->isChecked();
    m_showingTimezone = m_showTimezoneString || shouldDisplayTimezone();
    m_showSecondHand = ui.showSecondHandCheckBox->isChecked();

    if (m_showSecondHand) {
        //We don't need to cache the applet if it update every seconds
        setCacheMode(QGraphicsItem::NoCache);
    } else {
        setCacheMode(QGraphicsItem::DeviceCoordinateCache);
    }

    cg.writeEntry("showSecondHand", m_showSecondHand);
    cg.writeEntry("showTimezoneString", m_showTimezoneString);
    update();

    dataEngine("time")->disconnectSource(currentTimezone(), this);
    connectToEngine();

    constraintsEvent(Plasma::AllConstraints);
    emit configNeedsSaving();
}
开发者ID:mgottschlag,项目名称:kwin-tiling,代码行数:24,代码来源:clock.cpp


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