本文整理汇总了C++中setRenderHint函数的典型用法代码示例。如果您正苦于以下问题:C++ setRenderHint函数的具体用法?C++ setRenderHint怎么用?C++ setRenderHint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setRenderHint函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: save
bool SkyQPainter::drawConstellationArtImage(ConstellationsArt *obj)
{
double zoom = Options::zoomFactor();
bool visible = false;
obj->EquatorialToHorizontal(KStarsData::Instance()->lst(), KStarsData::Instance()->geo()->lat());
QPointF constellationmidpoint = m_proj->toScreen(obj, true, &visible);
if ( !visible || !m_proj->onScreen(constellationmidpoint))
return false;
//qDebug() << "o->pa() " << obj->pa();
float positionangle = m_proj->findPA(obj, constellationmidpoint.x(), constellationmidpoint.y());
//qDebug() << " final PA " << positionangle;
float w = obj->getWidth()*60*dms::PI*zoom/10800;
float h = obj->getHeight()*60*dms::PI*zoom/10800;
save();
setRenderHint(QPainter::SmoothPixmapTransform);
translate(constellationmidpoint);
rotate(positionangle);
setOpacity(0.7);
drawImage( QRect(-0.5*w, -0.5*h, w, h), obj->image() );
setOpacity(1);
setRenderHint(QPainter::SmoothPixmapTransform, false);
restore();
return true;
}
开发者ID:seanhoughton,项目名称:kstars,代码行数:33,代码来源:skyqpainter.cpp
示例2: QGraphicsView
GameView::GameView(): QGraphicsView(),
m_scene(new QGraphicsScene(this)),
m_controller(new Controller(m_scene.get())),
m_accelerated(false)
{
// set scene size
m_scene->setSceneRect(0, 0, Globs::SCREEN_WIDTH, Globs::SCREEN_HEIGHT);
setScene(m_scene.get());
setRenderHint(QPainter::Antialiasing);
setRenderHint(QPainter::SmoothPixmapTransform);
// set the view size
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setFixedSize(Globs::SCREEN_WIDTH, Globs::SCREEN_HEIGHT);
// render the tanks
for(auto tank : m_controller->get_tanks())
{
m_scene->addItem(tank.get());
}
for(auto ammo : m_controller->get_ammo())
{
m_scene->addItem(ammo.get());
}
emit m_controller->start_loop(static_cast<int>(1000/Globs::FPS));
}
开发者ID:ayeganov,项目名称:SmartTanks,代码行数:29,代码来源:gameview.cpp
示例3: QGraphicsView
QtTextureViewer::QtTextureViewer(QWidget* parent)
: QGraphicsView(parent)
{
m_scene = new QGraphicsScene();
m_scene->setSceneRect(0, 0, 2048, 2048);
setScene(m_scene);
centerOn(1024, 1024);
m_pixmapItem = new QGraphicsPixmapItem();
m_scene->addItem(m_pixmapItem);
setBackground();
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setRenderHint(QPainter::Antialiasing, false);
setTransformationAnchor(AnchorUnderMouse);
setDragMode(ScrollHandDrag);
viewport()->setCursor(Qt::ArrowCursor);
// Turn this off to make background grid pixmap sharp
setRenderHint(QPainter::SmoothPixmapTransform, false);
// Zoom in out to the current cursor location
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
}
开发者ID:creepydragon,项目名称:r2,代码行数:26,代码来源:QtTextureViewer.cpp
示例4: QGraphicsView
Space::Space(Manager *manager, qulonglong id, QString name, QWidget *parent)
: QGraphicsView(parent)
{
// setup
m_manager = manager;
m_id = id;
m_name = name;
setRenderHint(QPainter::Antialiasing, true);
setRenderHint(QPainter::HighQualityAntialiasing, true);
setScene(new QGraphicsScene());
setMouseTracking(true);
// ... background
QString bg_stylesheet = "QGraphicsView { background: qlineargradient(x1: 0,"
" y1: 0,"
" x2: 0,"
" y2: 1,"
" stop: 0 black,"
" stop: 1 gray);"
"}"
"QScrollBar:vertical {"
"border: none;"
"background: #575757;"
"width: 15px;"
"margin: 15px 0px 15px 0px;"
"}"
"QScrollBar::sub-line:vertical {"
"image: url(:/up_arrow);"
"height: 15px;"
"subcontrol-position: top;"
"subcontrol-origin: margin;"
"}"
"QScrollBar::add-line:vertical {"
"image: url(:/down_arrow);"
"height: 15px;"
"subcontrol-position: bottom;"
"subcontrol-origin: margin;"
"}"
"QScrollBar:horizontal {"
"border: none;"
"background: #575757;"
"width: 15px;"
"margin: 0px 15px 0px 15px;}"
"QScrollBar::sub-line:horizontal {"
"image: url(:/left_arrow);"
"height: 15px;"
"subcontrol-position: left;"
"subcontrol-origin: margin;"
"}"
"QScrollBar::add-line:horizontal {"
"image: url(:/right_arrow);"
"height: 15px;"
"subcontrol-position: right;"
"subcontrol-origin: margin;"
"}";
this->setStyleSheet(bg_stylesheet);
// ... spacebar
QSettings settings;
m_taskbar = new TaskBar(m_manager, this, QGraphicsView::scene(), this);
}
开发者ID:fa5hion,项目名称:quspace,代码行数:59,代码来源:space.cpp
示例5: setRenderHint
void SkyQPainter::begin()
{
QPainter::begin(m_pd);
bool aa = !m_sm->isSlewing() && Options::useAntialias();
setRenderHint(QPainter::Antialiasing, aa );
setRenderHint(QPainter::HighQualityAntialiasing, aa);
m_proj = m_sm->projector();
}
开发者ID:birefringence,项目名称:kstars,代码行数:8,代码来源:skyqpainter.cpp
示例6: DrawingView1
DrawingView1(QWidget* parent=0) : QGraphicsView(parent) {
setGeometry(200,100,600,400);
setWindowTitle("FlAG Game");
setRenderHint(QPainter::Antialiasing);
setRenderHint(QPainter::HighQualityAntialiasing);
setRenderHint(QPainter::TextAntialiasing);
setRenderHint(QPainter::SmoothPixmapTransform);
}
开发者ID:PramodBisht,项目名称:flag-and-county-game,代码行数:8,代码来源:playfiles.cpp
示例7: setRenderHint
void CanvasContainer::setSmoothScale(bool smooth)
{
smoothScaleFlag = smooth;
if (!smoothScaleFlag)
{
setRenderHint(QPainter::Antialiasing, false);
setRenderHint(QPainter::SmoothPixmapTransform, false);
}
}
开发者ID:leosama,项目名称:painttyWidget,代码行数:9,代码来源:canvascontainer.cpp
示例8: View
MainView::MainView(Scene *scene) :
View(scene, nullptr), miniMap(new MiniMap(scene, this)), scaleLevel(SCALING_FACTOR)
{
setRenderHint(QPainter::Antialiasing);
setRenderHint(QPainter::TextAntialiasing);
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
setMiniMapSize(MINIMAP_DEFAULT_WIDTH, MINIMAP_DEFAULT_HEIGHT);
}
开发者ID:JurajKubelka,项目名称:Envision,代码行数:10,代码来源:MainView.cpp
示例9: QGraphicsView
//------------------------------------------------------------------------------
// Name: GraphWidgetBase(QWidget *parent)
//------------------------------------------------------------------------------
GraphWidgetBase::GraphWidgetBase(QWidget *parent) : QGraphicsView(parent) {
setRenderHint(QPainter::Antialiasing);
setRenderHint(QPainter::TextAntialiasing);
setTransformationAnchor(AnchorUnderMouse);
setResizeAnchor(AnchorUnderMouse);
scene_ = new QGraphicsScene(this);
scene_->setItemIndexMethod(QGraphicsScene::BspTreeIndex);
setScene(scene_);
}
开发者ID:DevelopersOfYad64,项目名称:yad64,代码行数:14,代码来源:GraphWidgetBase.cpp
示例10: 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
示例11: setRenderHint
void MyGraphicsView::setAntialiasing(bool antialiasingOn)
{
if (antialiasingOn)
{
setRenderHint(QPainter::Antialiasing, true);
setRenderHint(QPainter::TextAntialiasing, true);
g_settings->labelFont.setStyleStrategy(QFont::PreferDefault);
}
else
{
setRenderHint(QPainter::Antialiasing, false);
setRenderHint(QPainter::TextAntialiasing, false);
g_settings->labelFont.setStyleStrategy(QFont::NoAntialias);
}
}
开发者ID:epruesse,项目名称:Bandage,代码行数:15,代码来源:mygraphicsview.cpp
示例12: QGraphicsView
SchematicSceneViewer::SchematicSceneViewer(QWidget *parent)
: QGraphicsView(parent), m_buttonState(Qt::NoButton), m_oldWinPos(), m_oldScenePos(), m_firstShowing(true)
{
setObjectName("SchematicSceneViewer");
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setDragMode(QGraphicsView::NoDrag);
setTransformationAnchor(QGraphicsView::NoAnchor);
setRenderHint(QPainter::SmoothPixmapTransform);
setRenderHint(QPainter::TextAntialiasing);
setRenderHint(QPainter::Antialiasing);
setInteractive(true);
setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
show();
}
开发者ID:Lisy09Personal,项目名称:opentoonz,代码行数:16,代码来源:schematicviewer.cpp
示例13: QGraphicsView
ChannelViewer::ChannelViewer(QWidget *parent) :
QGraphicsView(parent)
{
if (_extrapolationTypeName.size() == 0) {
QHashIterator<QString, Channel::ExtrapolateType> it(_extrapolationNameType);
while (it.hasNext()) {
it.next();
_extrapolationTypeName[it.value()] = it.key();
}
}
if (_tangentTypeName.size() == 0) {
QHashIterator<QString, Keyframe::TangentType> it(_tangentNameType);
while (it.hasNext()) {
it.next();
_tangentTypeName[it.value()] = it.key();
}
}
_ui = NULL;
_scene = new QGraphicsScene(this);
_scene->setBackgroundBrush(QBrush(QColor(69, 69, 61)));
setScene(_scene);
_innerCurve = NULL;
_outerCurve = NULL;
_mainGrid = NULL;
_grid = NULL;
setRenderHint(QPainter::Antialiasing);
_isDragging = false;
_selectionRect = NULL;
}
开发者ID:skanight,项目名称:Animation,代码行数:29,代码来源:ChannelViewer.cpp
示例14: QGraphicsView
FMSampleTextView::FMSampleTextView ( QWidget* parent )
: QGraphicsView ( parent ),
hasPendingUpdate ( false )
{
#if 0
QGLFormat glfmt;
glfmt.setSampleBuffers ( true );
QGLWidget *glwgt = new QGLWidget ( glfmt );
// qDebug()<<"GL:: A DR S"<<glwgt->format().alpha()<<glwgt->format().directRendering()<<glwgt->format().sampleBuffers();
// setViewport(glwgt);
if ( glwgt->format().sampleBuffers() )
{
setViewport ( glwgt );
qDebug() <<"opengl enabled - DirectRendering("<< glwgt->format().directRendering() <<") - SampleBuffers("<< glwgt->format().sampleBuffers() <<")";
}
else
{
qDebug() <<"opengl disabled - DirectRendering("<< glwgt->format().directRendering() <<") - SampleBuffers("<< glwgt->format().sampleBuffers() <<")";
delete glwgt;
}
#endif
setInteractive ( false );
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
theRect = 0;
fPage = 0;
isSelecting = false;
isPanning = false;
setAlignment ( Qt::AlignTop | Qt::AlignHCenter );
setTransformationAnchor ( QGraphicsView::NoAnchor );
setRenderHint ( QPainter::Antialiasing, true );
setBackgroundBrush(Qt::white);
}
开发者ID:gonboy,项目名称:fontmatrix,代码行数:34,代码来源:fmsampletextview.cpp
示例15: QGraphicsView
GraphView::GraphView(QGraphicsScene * scene, QWidget * parent) : QGraphicsView (scene, parent)
{
yScale=0;
setAttribute(Qt::WA_AcceptTouchEvents);
setDragMode(ScrollHandDrag);
setMouseTracking(true);
setRenderHint(QPainter::Antialiasing, true);
setRenderHint(QPainter::TextAntialiasing, true);
setRenderHint(QPainter::SmoothPixmapTransform, true);
//setAlignment((Qt::AlignRight | Qt::AlignTop));
createGKey();
}
开发者ID:eastcoastkiter,项目名称:Graph,代码行数:16,代码来源:graphView.cpp
示例16: QGraphicsView
GraphGraphicsView::GraphGraphicsView(QWidget *parent) :
QGraphicsView(parent)
{
setScene(&scene);
resize(1000,500);
setBackgroundBrush(Qt::white);
setFocus();
QLinearGradient linearGrad(-500, -500, 500, 500); // átmenetes ecset
linearGrad.setColorAt(0, QColor(255, 255, 255));
linearGrad.setColorAt(1, QColor(192, 192, 192));
setBackgroundBrush(linearGrad);
setRenderHint(QPainter::Antialiasing);
setFrameStyle(QFrame::NoFrame);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
qsrand(QTime::currentTime().msec());
randomGraph();
dDialog = new dijkstraDialog();
source = -1;
destination = -1;
QObject::connect(dDialog, SIGNAL(runDijkstraFromTo(int,int)),
this, SLOT(runDijkstra(int,int)));
}
开发者ID:DaytimeAH,项目名称:DataVisualize,代码行数:28,代码来源:graphgraphicsview.cpp
示例17: QChartView
QTCOMMERCIALCHART_USE_NAMESPACE
ChartView::ChartView(QWidget *parent)
: QChartView(new QChart(), parent),
m_scatter(0),
m_scatter2(0)
{
setRenderHint(QPainter::Antialiasing);
chart()->setTitle("Click to interact with scatter points");
m_scatter = new QScatterSeries();
for(qreal x(0.5); x <= 4.0; x += 0.5) {
for(qreal y(0.5); y <= 4.0; y += 0.5) {
*m_scatter << QPointF(x, y);
}
}
m_scatter2 = new QScatterSeries();
chart()->addSeries(m_scatter2);
chart()->addSeries(m_scatter);
chart()->axisX()->setRange(0, 4.5);
chart()->axisY()->setRange(0, 4.5);
connect(m_scatter, SIGNAL(clicked(QPointF)), this, SLOT(handleClickedPoint(QPointF)));
}
开发者ID:wangyun123,项目名称:Third,代码行数:26,代码来源:chartview.cpp
示例18: QGraphicsView
Overview::Overview(QWidget* parent)
: QGraphicsView(parent),
m_min_scale_level(0),
m_scale_level(0)
{
setWindowTitle(tr("Overview"));
setWindowFlags(Qt::Tool);
setBackgroundBrush(Qt::darkGray);
setBackgroundRole(QPalette::Window);
setRenderHint(QPainter::SmoothPixmapTransform, true);
setDragMode(ScrollHandDrag);
setFrameStyle(NoFrame);
// Create scene
QGraphicsScene* scene = new QGraphicsScene(this);
setScene(scene);
m_pixmap = new QGraphicsPixmapItem;
m_pixmap->setTransformationMode(Qt::SmoothTransformation);
scene->addItem(m_pixmap);
reset();
// Restore geometry
QSettings settings;
if (settings.contains("Overview/Geometry")) {
restoreGeometry(settings.value("Overview/Geometry").toByteArray());
setMinimumSize(size());
} else {
resize(400, 400);
setMinimumSize(size());
}
m_default = settings.value("Overview/Default", true).toBool();
}
开发者ID:gottcode,项目名称:tetzle,代码行数:33,代码来源:overview.cpp
示例19: QGraphicsScene
CodeMiniMap::CodeMiniMap(QWidget *parent)
{
mParent = parent;
mCodeView = 0;
codepixmap = 0;
mScene = new QGraphicsScene(this);
mScene->setItemIndexMethod(QGraphicsScene::BspTreeIndex);
mScene->setSceneRect(-this->geometry().width()/2,-this->geometry().height()/2,this->geometry().width(),this->geometry().height());
setScene(mScene);
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
setRenderHint(QPainter::Antialiasing,true);
m_intrect = new CodeViewInteractiveRect(this);
mScene->addItem(m_intrect);
m_intrect->setPos(QPointF(0.0,0.0));
m_intrect->rect_height = scene()->sceneRect().height();
m_intrect->rect_width = scene()->sceneRect().width();
zoomlevel = 1.0f;
//this->horizontalScrollBar()->hide();
//this->verticalScrollBar()->hide();
this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
}
开发者ID:SoftwareEngineeringToolDemos,项目名称:ICSE-2011-ViewInfinity,代码行数:27,代码来源:CodeMiniMap.cpp
示例20: QGraphicsView
SinglePlayerView::SinglePlayerView( QPixmap prevBg, QWidget *parent ) :
QGraphicsView( parent )
{
scene = new QGraphicsScene;
scene->setItemIndexMethod( QGraphicsScene::NoIndex );
data = olddata = NULL;
model = oldmodel = NULL;
msganimation = NULL;
msgtline = NULL;
loading = NULL;
board = NULL;
msg = NULL;
isloading = false;
currentScore = 0;
timeLeft = 0;
lives = 5;
setScene( scene );
setCacheMode( CacheBackground );
setRenderHint( QPainter::Antialiasing );
setTransformationAnchor( QGraphicsView::AnchorUnderMouse );
setResizeAnchor( QGraphicsView::AnchorViewCenter );
setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
setViewportUpdateMode( QGraphicsView::SmartViewportUpdate );
setOptimizationFlag( QGraphicsView::DontClipPainter );
setMouseTracking( true );
prevbg = new QGraphicsPixmapItem( prevBg );
prevbg->setZValue( 0 );
scene->addItem( prevbg );
}
开发者ID:rockdreamer,项目名称:tarta,代码行数:34,代码来源:singleplayerview.cpp
注:本文中的setRenderHint函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论