本文整理汇总了C++中setRenderHint函数的典型用法代码示例。如果您正苦于以下问题:C++ setRenderHint函数的具体用法?C++ setRenderHint怎么用?C++ setRenderHint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setRenderHint函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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));
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例7: setRenderHint
void CanvasContainer::setSmoothScale(bool smooth)
{
smoothScaleFlag = smooth;
if (!smoothScaleFlag)
{
setRenderHint(QPainter::Antialiasing, false);
setRenderHint(QPainter::SmoothPixmapTransform, false);
}
}
示例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);
}
示例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_);
}
示例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));
}
示例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);
}
}
示例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();
}
示例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;
}
示例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);
}
示例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();
}