本文整理汇总了C++中setViewportUpdateMode函数的典型用法代码示例。如果您正苦于以下问题:C++ setViewportUpdateMode函数的具体用法?C++ setViewportUpdateMode怎么用?C++ setViewportUpdateMode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setViewportUpdateMode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: setViewportUpdateMode
void PhotoKitView::setRenderingSystem()
{
QWidget *viewport = 0;
#ifndef QT_NO_OPENGL
if (Config::openGlRendering) {
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
QGLWidget *glw = new QGLWidget(QGLFormat(QGL::SampleBuffers));
if (Config::noScreenSync)
glw->format().setSwapInterval(0);
glw->setAutoFillBackground(false);
viewport = glw;
setCacheMode(QGraphicsView::CacheNone);
if (Config::verbose)
ezlog_debug("- using OpenGL");
} else // software rendering
#endif
{
// software rendering
setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate);
viewport = new QWidget;
setCacheMode(QGraphicsView::CacheBackground);
if (Config::verbose)
ezlog_debug("- using software rendering");
}
setViewport(viewport);
}
开发者ID:BIbiLion,项目名称:PhotoKit,代码行数:28,代码来源:PhotoKitView.cpp
示例2: QGraphicsView
EditorGraphicsView::EditorGraphicsView(QWidget * parent)
: QGraphicsView(parent)
, m_canZoom(true)
, m_scaleFactor(1.)
, m_autoResize(false)
{
setInteractive(true);
setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform );
setCacheMode(QGraphicsView::CacheBackground);
setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
setOptimizationFlags(QGraphicsView::DontSavePainterState);
setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
setTransformationAnchor(AnchorUnderMouse);
setResizeAnchor(AnchorViewCenter);
//setFrameStyle(QFrame::NoFrame);
//setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
//setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setBackgroundBrush(Qt::gray);
setDragMode(QGraphicsView::RubberBandDrag);
// use own style for drawing the RubberBand (opened on the viewport)
viewport()->setStyle(new RubberBandStyle);
}
开发者ID:TritonSailor,项目名称:livepro,代码行数:28,代码来源:EditorGraphicsView.cpp
示例3: setViewportUpdateMode
void CanvasView::debugOverlayEnabled(bool enabled)
{
if (enabled)
{
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
}
else
{
setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate);
}
}
开发者ID:SiteView,项目名称:NNMQT,代码行数:11,代码来源:canvasview.cpp
示例4: setViewportUpdateMode
void DesktopView::enableOpenGL(bool state)
{
if (state) {
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
setViewport(new QGLWidget(new QGLContext(QGL::StencilBuffer | QGL::AlphaChannel)));
d->openglOn = true;
} else {
setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
setViewport(new QWidget);
d->openglOn = false;
}
}
开发者ID:varuna,项目名称:plexydesk,代码行数:12,代码来源:desktopview.cpp
示例5: ScaledGraphicsView
ScaledGraphicsView(QWidget *parent=0) : QGraphicsView(parent)
{
setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform );
setCacheMode(QGraphicsView::CacheBackground);
setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
setOptimizationFlags(QGraphicsView::DontSavePainterState);
setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
setTransformationAnchor(AnchorUnderMouse);
setResizeAnchor(AnchorViewCenter);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
}
开发者ID:TritonSailor,项目名称:livepro,代码行数:12,代码来源:SlideShowWindow.cpp
示例6: QGraphicsView
/*!
*/
BoardView::BoardView(QWidget *parent)
: QGraphicsView(parent)
{
setCacheMode(CacheBackground);
setMouseTracking(true);
setRenderHint(QPainter::Antialiasing);
setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
setBackgroundBrush(QColor(230, 200, 167));
if (isRunningOnDesktop()) {
// run on PC desktop.
m_scene = new QGraphicsScene(-225, -225, 450, 450);
} else {
// run on a phone/mobile device.
m_scene = new QGraphicsScene(-90, -90, 180, 180);
}
setScene(m_scene);
m_grid = new GridItem(9);
m_scene->addItem(m_grid);
//
PathFinder::instance()->init(m_grid->dim());
// initializes the ball items provider
BallItemsProvider::instance()->init(m_grid);
//
BallItemsProvider::instance()->nextBalls(true);
}
开发者ID:FlorinLozneanu,项目名称:lines,代码行数:34,代码来源:boardview.cpp
示例7: QGraphicsView
Widget::Widget(const QString& name, Scene::Type type, const Widget* shareWidget)
: QGraphicsView(),
m_name(name),
m_state(0),
m_view()
{
QGLWidget* glShared = 0;
if (shareWidget)
glShared = (QGLWidget*) shareWidget->viewport();
m_glWidget = new GLWidget(0, glShared);
setViewport(m_glWidget);
setViewportUpdateMode(FullViewportUpdate);
m_glWidget->makeCurrent();
m_glWidget->initializeGL();
if (type == Scene::ImageSceneType)
m_state = new widget_states::ImageWidget(*this);
else if (type == Scene::MeshSceneType)
m_state = new widget_states::MeshWidget(*this);
setScene(getScene());
setMinimumSize(250, 250);
setContentsMargins(1, 1, 1, 1);
#ifdef DEBUG
std::cout << "create graphicView: " << name.toStdString() << std::endl;
#endif
}
开发者ID:TheSamos,项目名称:pdpSmithDr,代码行数:31,代码来源:Widget.cpp
示例8: QGraphicsView
//! [0]
GraphWidget::GraphWidget(QWidget *parent)
: QGraphicsView(parent), timerId(0)
{
//初始化场景
QGraphicsScene *scene = new QGraphicsScene(this);
scene->setItemIndexMethod(QGraphicsScene::NoIndex);
//设置场景
setScene(scene);
//缓存背景模式,提高绘制效率,防止闪屏
setCacheMode(CacheBackground);
setViewportUpdateMode(BoundingRectViewportUpdate);
//设置抗锯齿,平滑图像或字体边缘
setRenderHints(QPainter::Antialiasing|QPainter::TextAntialiasing|QPainter::SmoothPixmapTransform);
//允许节点位置动态调整
setTransformationAnchor(AnchorUnderMouse);
//允许上下文菜单
setContextMenuPolicy(Qt::ActionsContextMenu);
//允许拖拽滚屏
setDragMode( QGraphicsView::ScrollHandDrag);
setInteractive(true);
setMinimumSize(Default_width, Default_height);
}
开发者ID:kyyblabla,项目名称:spinnery-system,代码行数:34,代码来源:graphwidget.cpp
示例9: QGraphicsView
MapView::MapView(QWidget *parent)
: QGraphicsView(parent)
{
settings_ = Settings::sharedInstance();
setBackgroundBrush(Qt::lightGray);
setAcceptDrops(true);
setFocusPolicy(Qt::StrongFocus);
setViewportUpdateMode(FullViewportUpdate);
//setAlignment(Qt::AlignLeft | Qt::AlignTop);
setScene(new MapScene(this));
//setSceneRect(0, 0, 0, 0);
updateGridPixmap();
connect(settings_, SIGNAL(showGridChanged(bool)),
this, SLOT(updateGridPixmap()));
connect(settings_, SIGNAL(finalGridSizeChanged(QSizeF)),
this, SLOT(updateGridPixmap()));
connect(settings_, SIGNAL(zoomChanged(double)),
this, SLOT(onZoomChanged(double)));
onZoomChanged(settings_->zoom());
}
开发者ID:zmeyc,项目名称:mapmaker,代码行数:25,代码来源:MapView.cpp
示例10: QGraphicsView
MyGraphicsView::MyGraphicsView(QObject * /*parent*/) :
QGraphicsView(), m_rotation(0.0)
{
setDragMode(QGraphicsView::RubberBandDrag);
setAntialiasing(g_settings->antialiasing);
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
}
开发者ID:epruesse,项目名称:Bandage,代码行数:7,代码来源:mygraphicsview.cpp
示例11: QGraphicsView
SCgView::SCgView(QWidget *parent, SCgWindow *window) :
QGraphicsView(parent),
mActionChangeContent(0),
mActionShowContent(0),
mActionShowAllContent(0),
mActionHideAllContent(0),
mActionDeleteContent(0),
mActionChangeIdtf(0),
mActionDelete(0),
mActionContourDelete(0),
mActionSwapPairOrient(0),
mActionCopy(0),
mActionCut(0),
mActionPaste(0),
mActionSelectAll(0),
mContextMenu(0),
mContextObject(0),
mWindow(window),
isSceneRectControlled(false)
{
setCacheMode(CacheNone);//CacheBackground);
setViewportUpdateMode(BoundingRectViewportUpdate);
setRenderHint(QPainter::Antialiasing);
setTransformationAnchor(AnchorUnderMouse);
setResizeAnchor(AnchorViewCenter);
setOptimizationFlag(DontAdjustForAntialiasing);
setDragMode(QGraphicsView::RubberBandDrag);
setAcceptDrops(true);
connect(mWindow->undoStack(), SIGNAL(indexChanged(int)), this, SLOT(updateActionsState(int)) );
createActions();
}
开发者ID:pkkazantsev,项目名称:kbe,代码行数:31,代码来源:scgview.cpp
示例12: QGraphicsView
FormEditorGraphicsView::FormEditorGraphicsView(QWidget *parent) :
QGraphicsView(parent)
{
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
setResizeAnchor(QGraphicsView::AnchorViewCenter);
setCacheMode(QGraphicsView::CacheNone);
// setCacheMode(QGraphicsView::CacheBackground);
setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
setOptimizationFlags(QGraphicsView::DontSavePainterState);
// setViewportUpdateMode(QGraphicsView::NoViewportUpdate);
setRenderHint(QPainter::Antialiasing, false);
setFrameShape(QFrame::NoFrame);
setAutoFillBackground(true);
setBackgroundRole(QPalette::Window);
const int checkerbordSize= 20;
QPixmap tilePixmap(checkerbordSize * 2, checkerbordSize * 2);
tilePixmap.fill(Qt::white);
QPainter tilePainter(&tilePixmap);
QColor color(220, 220, 220);
tilePainter.fillRect(0, 0, checkerbordSize, checkerbordSize, color);
tilePainter.fillRect(checkerbordSize, checkerbordSize, checkerbordSize, checkerbordSize, color);
tilePainter.end();
setBackgroundBrush(tilePixmap);
viewport()->setMouseTracking(true);
}
开发者ID:yinyunqiao,项目名称:qtcreator,代码行数:30,代码来源:formeditorgraphicsview.cpp
示例13: QGLWidget
void View::setOpenGL( const bool enabled )
{
if ( enabled == hasOpenGL_ )
return;
hasOpenGL_ = enabled;
if (hasOpenGL_)
{
viewport_ = new QGLWidget( QGLFormat(QGL::SampleBuffers), this );
setViewport(viewport_);
viewport_->makeCurrent();
glClearColor( 0, 0, 0, 1.0 );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
// glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
glPolygonMode( GL_FRONT, GL_FILL );
glPolygonMode( GL_BACK, GL_LINE );
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset( 1.0, 2.0 );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
}
else
{
defaultVP_ = new QWidget(this);
setViewport(defaultVP_);
}
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
setCacheMode(QGraphicsView::CacheNone);
setRenderHints(QPainter::Antialiasing|QPainter::SmoothPixmapTransform);
setForegroundBrush(Qt::NoBrush);
setBackgroundBrush(Qt::NoBrush);
}
开发者ID:0xd0d9e,项目名称:anthracitarium,代码行数:33,代码来源:view.cpp
示例14: QGraphicsView
SchemaEditor::SchemaEditor(QWidget *parent, SchemaGui *schemaGui, Engine * engine, PanelScrollView *panelScrollView) :
QGraphicsView(schemaGui, parent),
_contextMenuPos(0,0),
_contextGear(NULL),
_engine(engine),
_schemaGui(schemaGui),
_scale(1),
_panelScrollView(panelScrollView),
_maxZValue(1),
_selectionChangeBypass(false)
{
_schemaGui->setSchemaEditor(this);
setDragMode(QGraphicsView::RubberBandDrag);
setRenderHint(QPainter::Antialiasing, true);
setFrameStyle(Sunken | StyledPanel);
setOptimizationFlags(QGraphicsView::DontSavePainterState | QGraphicsView::IndirectPainting);
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
// render with OpenGL
if(0)
setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
resetTransform();
setAcceptDrops(TRUE);
}
开发者ID:jukea,项目名称:drone,代码行数:29,代码来源:SchemaEditor.cpp
示例15: QGraphicsView
View::View(QGraphicsScene *parent) : QGraphicsView(parent) {
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
_topBar = new TopBar;
_topBar->setPos(0, 0);
scene()->addItem(_topBar);
_cptArticles = 0;
}
开发者ID:avary,项目名称:DigitalNews,代码行数:7,代码来源:view.cpp
示例16: PowerInterface
void GameView::setUpUI()
{
powerUi = new PowerInterface(am);
powerUi->setX(0);
powerUi->setY(0);
powerUi->setMana(P_INITIAL_MANA);
ressUi = new RessourcesInterface(am);
ressUi->setX(0);
ressUi->setY(280);
ressUi->bt50Pressed();
const PowerCountDown &pcd = powerUi->getCountDownManager();
connect(&pcd,SIGNAL(powerFinishing(ACTIONS,Node*,Node*)),this,SLOT(onPowerFinishing(ACTIONS,Node*,Node*)));
connect(&pcd,SIGNAL(powerStarting(ACTIONS,Node*,Node*)),this,SLOT(onPowerStarting(ACTIONS,Node*,Node*)));
connect(&am,SIGNAL(doAction(ACTIONS,Node*)),this,SLOT(onDoAction(ACTIONS,Node*)));
connect(&am,SIGNAL(doAction(ACTIONS,Node*,Node*)),this,SLOT(onDoAction(ACTIONS,Node*,Node*)));
// Désactivation des scrollbars
setVerticalScrollBarPolicy ( Qt::ScrollBarAlwaysOff );
setHorizontalScrollBarPolicy ( Qt::ScrollBarAlwaysOff );
setViewportUpdateMode( QGraphicsView::BoundingRectViewportUpdate);
setRenderHint( QPainter::Antialiasing, true);
setScene(scene);
scene->addItem(powerUi);
scene->addItem(ressBar);
scene->addItem(ressUi);
}
开发者ID:LukasBitter,项目名称:P2,代码行数:30,代码来源:gameview.cpp
示例17: setHorizontalScrollBarPolicy
WeatherWidgetGraphicsView::WeatherWidgetGraphicsView()
{
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setWindowFlags(Qt::FramelessWindowHint);
setAttribute(Qt::WA_TranslucentBackground,true);
setAttribute(Qt::WA_ContentsPropagated,true);
setCacheMode(CacheBackground);
setViewportUpdateMode(FullViewportUpdate);
setRenderHints(QPainter::Antialiasing |
QPainter::SmoothPixmapTransform |
QPainter::TextAntialiasing);
// transparent background
QPalette palette = this->palette();
palette.setBrush(QPalette::Base, Qt::transparent);
setPalette(palette);
setAttribute(Qt::WA_OpaquePaintEvent, false); // trasmit color
setFrameStyle(QFrame::NoFrame);
iScene = new QGraphicsScene(this);
setScene(iScene);
resize(KWindowWidth+KExtraStrech,KWindowHeight+KExtraStrech);
// Create main window which holds weather data
iMainWindow = new WeatherGraphicsWindow(this);
iScene->addItem(iMainWindow);
iMainWindow->setZValue(0);
iMainWindow->setObjectName("mainwindow");
connect(iMainWindow,SIGNAL(minimize()),
this,SLOT(on_mainwindow_minimize()));
connect(iMainWindow,SIGNAL(temperatureUpdated(const QString&)),
this,SLOT(setWindowTitle(const QString&)));
}
开发者ID:tvespasian,项目名称:weatherwidget2,代码行数:35,代码来源:WeatherWidgetGraphicsView.cpp
示例18: QGraphicsScene
void ChangeTableLens::SetData(TransMapData* data) {
this->dataset_ = data;
if (sorting_item_ == NULL) {
sorting_item_ = new ChangeSortingItem;
}
sorting_item_->SetData(dataset_);
if (scene_ == NULL) {
scene_ = new QGraphicsScene(this);
scene_->setItemIndexMethod(QGraphicsScene::NoIndex);
setScene(scene_);
setCacheMode(CacheBackground);
setViewportUpdateMode(BoundingRectViewportUpdate);
setRenderHint(QPainter::Antialiasing);
setTransformationAnchor(AnchorUnderMouse);
this->setBackgroundBrush(Qt::color0);
this->autoFillBackground();
scene_->addItem(sorting_item_);
}
this->update();
}
开发者ID:Edgar324,项目名称:ScatterPointGlyph,代码行数:26,代码来源:change_table_lens.cpp
示例19: QGraphicsView
GraphView::GraphView(QWidget *parent) :
QGraphicsView(parent)
{
setMinimumHeight(200);
setMinimumWidth(250);
// TODO: mouse icon
// setDragMode(QGraphicsView::ScrollHandDrag);
_menu = new QMenu(this);
QAction *addIsolatedVertex = _menu->addAction("Додати ізольовану вершину");
// QAction *addSelectAdj = _menu->addAction("Додати суміжну з виділеними вершинами");
QAction *removeSelected = _menu->addAction("Видалити обрані вершини");
connect(addIsolatedVertex, &QAction::triggered,
this, &GraphView::action_addIsolatedVertex);
// connect(addSelectAdj, &QAction::triggered,
// this, &GraphView::action_addToSelect);
connect(removeSelected, &QAction::triggered,
this, &GraphView::removeSelectedVertex);
setViewportUpdateMode(SmartViewportUpdate);
setRenderHint(QPainter::Antialiasing);
}
开发者ID:valsid,项目名称:Graph,代码行数:27,代码来源:graphview.cpp
示例20: setCacheMode
CItemBoxView::CItemBoxView( QWidget *parent /*= 0*/ )
:QGraphicsView(parent)
{
setCacheMode(QGraphicsView::CacheBackground);//ÉèÖûº´æ±³¾°£¬ÕâÑù¿ÉÒÔ¼Ó¿ìäÖȾËÙ¶È/
//setDragMode(QGraphicsView::ScrollHandDrag);
setRenderHint(QPainter::Antialiasing);// ʹÓÿ¹¾â³ÝäÖȾ
setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
//setBackgroundBrush(QColor(0, 200, 0));
setWindowTitle(QObject::tr(DEFVALUE_String_CItemBoxView_Title.c_str()));
m_pItemBoxScene = NULL;
m_pItemBoxScene = new CItemBoxScene(NULL);
m_pItemBoxScene->setSceneRect(0, 0, DEFVALUE_Int_Wide_CItemBoxView - 1, DEFVALUE_Int_Hight_CItemBoxView - 1);
QRectF rectItem = QRectF(DEF_VALUE_InfomationRectItem_X, DEF_VALUE_InfomationRectItem_Y, DEF_VALUE_InfomationRectItem_Width, DEF_VALUE_InfomationRectItem_Height);
CRectItemInBox* pRectItemInBox = NULL;
CTextItemInBox* pTextItemInBox = NULL;
pTextItemInBox = new CTextItemInBox(NULL, m_pItemBoxScene);
pTextItemInBox->setPos(20, 20);
m_pItemBoxScene->addItem(pTextItemInBox);
pTextItemInBox = NULL;
pRectItemInBox = new CRectItemInBox(rectItem, NULL, m_pItemBoxScene);
pRectItemInBox->setItemPos(QPointF(20, 100));
m_pItemBoxScene->addItem(pRectItemInBox);
pRectItemInBox = NULL;
this->setScene(m_pItemBoxScene);
this->resize(DEFVALUE_Int_Wide_CItemBoxView, DEFVALUE_Int_Hight_CItemBoxView);
}
开发者ID:shenglonglinapple,项目名称:slin_code,代码行数:31,代码来源:ItemBoxView.cpp
注:本文中的setViewportUpdateMode函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论