本文整理汇总了C++中setCacheMode函数的典型用法代码示例。如果您正苦于以下问题:C++ setCacheMode函数的具体用法?C++ setCacheMode怎么用?C++ setCacheMode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setCacheMode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: setRenderHint
void GraphicsView::init(GraphicsScene* scene)
{
mIsPressed = false;
setRenderHint(QPainter::Antialiasing, false);
connect(this, SIGNAL(sizeChange(int, int)), scene, SLOT(changeSceneRect(int, int)));
connect(this, SIGNAL(zoom(int, QPointF)), scene, SLOT(zoom(int, QPointF)));
connect(this, SIGNAL(move(QPointF)), scene, SLOT(move(QPointF)));
//setOptimizationFlag(QGraphicsView::DontSavePainterState);
setViewportUpdateMode(FullViewportUpdate);
setCursor(Qt::OpenHandCursor);
setDragMode(QGraphicsView::ScrollHandDrag);
setCacheMode(CacheBackground);
setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
}
开发者ID:duxiaodong,项目名称:graduate-pro,代码行数:15,代码来源:graphicsview.cpp
示例17: graphicsWidget
Node::Node( GraphicsWidget* gw, int num, int size,
QString col, QString shape, bool numIn,
int ldist, int ndist, QPointF p
) : graphicsWidget (gw)
{
Q_UNUSED(p);
graphicsWidget->scene()->addItem(this); //Without this nodes don't appear on the screen...
//ItemSendsGeometryChanges introduced in Qt 4.6...
#if QT_VERSION >= 0x040600
setFlags(ItemSendsGeometryChanges | ItemIsSelectable | ItemIsMovable);
setCacheMode(QGraphicsItem::ItemCoordinateCache); //QT < 4.6 if a cache mode is set, nodes do not respond to hover events
//DeviceCoordinateCache
#else
setFlags(ItemIsSelectable | ItemIsMovable ); //Without this, the node cannot move nor be selected ...
setCacheMode(QGraphicsItem::NoCache); //QT < 4.6 if a cache mode is set, nodes do not respond to hover events
#endif
setAcceptHoverEvents(true);
m_num=num;
m_size=size;
m_hasLabel=false;
m_hasNumber=false;
m_isNumberInside = numIn;
m_shape=shape;
m_col_str=col;
m_col=QColor(col);
m_nd=ndist;
m_ld=ldist;
m_poly_t=new QPolygon(3);
m_poly_d=new QPolygon(4);
qDebug()<< "Node: constructor: initial position at: "
<< this->x()<<", "<<this->y()
<< " Will move at: "<< p.x()<<", "<<p.y();;
}
开发者ID:Iownnoname,项目名称:qt,代码行数:36,代码来源:node.cpp
示例18: m_codeminimap
CodeViewInteractiveRect::CodeViewInteractiveRect(CodeMiniMap *minimap)
: m_codeminimap(minimap)
{
setFlags(ItemIsMovable);
this->setAcceptHoverEvents(true);
this->setAcceptedMouseButtons(Qt::LeftButton);
setFlag(ItemSendsGeometryChanges);
setCacheMode(DeviceCoordinateCache);
setZValue(-1);
rect_active = false;
//rect_height = 0.0;
//rect_width = 0.0;
}
开发者ID:SoftwareEngineeringToolDemos,项目名称:ICSE-2011-ViewInfinity,代码行数:15,代码来源:CodeViewInteractiveRect.cpp
示例19: QGraphicsView
QTextPanel::QTextPanel(QWidget * parent)
: QGraphicsView(parent),
onPrintRender(false),BASE_TEXT(new QTextPanelLayerControl(0))
{
/* BASE_TEXT must start at first to play the QRect from scene*/
QApplication::restoreOverrideCursor();
QPalette p = palette();
p.setColor(QPalette::Window,Qt::lightGray);
p.setColor(QPalette::Base,Qt::lightGray);
setPalette(p);
scene = new GraphicsScene(rectToScene(),this); /* QRect from page tot BASE_TEXT */
setCacheMode(CacheBackground);
setScene(scene);
pageClear(); /* clear all item and reinit */
}
开发者ID:SorinS,项目名称:fop-miniscribus,代码行数:15,代码来源:qtextpanel.cpp
示例20: QGraphicsView
QGraphicViewDm::QGraphicViewDm(QWidget *parent) :
QGraphicsView(parent)
{
int iWidth , iHeight ;
// iWidth = width( );
// iHeight = height( );
iWidth = 600 ;
iHeight = 230 ;
QGraphicsScene *scene = new QGraphicsScene(this);
scene->setSceneRect(-iWidth/2,-iHeight/2,iWidth,iHeight);
setScene(scene);
setCacheMode(CacheBackground);
//加一个矩形
QRectF r = QRectF(-iWidth/2,-iHeight/2,iWidth,iHeight);
// qDebug( ) << r.topLeft() << r.bottomRight() ;
QRectF r1 = r.adjusted( 20, 20, -20, -20 );
// qDebug( ) << r1.topLeft() << r1.bottomRight() ;
QGraphicsRectItem * pRect = scene->addRect( r1 ); //创建用的是对象座标
pRect->setPos( 0, 0 ); //给的是场景座标
pItemDm = new ItemDm ;
// 4/5 的宽度 2/3的高度
float fAdjust1, fAdjust2 ;
fAdjust1 = 1.0 / 10.0 * iWidth ;
fAdjust2 = 1.0 / 6.0 * iHeight ;
// qDebug( ) << fAdjust1 << fAdjust2 << r.adjusted( fAdjust1 , fAdjust2, -1*fAdjust1, -1*fAdjust2 ) ;
pItemDm->init( r.adjusted( fAdjust1 , fAdjust2, -1*fAdjust1, -1*fAdjust2 ) );
pItemDm->setWater( 1250.00 );
scene->addItem( pItemDm );
pItemDm->setPos( 0, 0 );
//制作
QRectF rectFish( 0, 0, 15, 5 );
pFish = scene->addEllipse( rectFish );
pFish->setPos( 0, 0 );
//pFish->setBrush( QBrush(Qt::red) );
pFish->setBrush( QBrush(Qt::green) );
}
开发者ID:shenyl,项目名称:ldcl,代码行数:48,代码来源:graphicviewdm.cpp
注:本文中的setCacheMode函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论