本文整理汇总了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));
}
示例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));
}
示例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;
}
}
示例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));
}
示例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
}
示例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);
}
示例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;
}
示例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());
}
示例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)));
}
示例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 );
}
示例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;
}
示例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);
}
示例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()));
}
示例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;
}
示例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();
}