本文整理汇总了C++中resetTransform函数的典型用法代码示例。如果您正苦于以下问题:C++ resetTransform函数的具体用法?C++ resetTransform怎么用?C++ resetTransform使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了resetTransform函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: QRect
void TablePile::setSize(double width, double height)
{
m_cardsDisplayRegion = QRect(0, 0, width, height);
m_numCardsVisible = width / G_COMMON_LAYOUT.m_cardNormalHeight + 1;
resetTransform();
translate(-width / 2, -height / 2);
}
示例3: resetTransform
void
AnimatorView::systemReset ()
{
m_currentZoomFactor = 1;
resetTransform ();
}
示例4: reader
bool QSanSelectableItem::_load(const QString &filename, QSize size, bool useNewSize, bool center_as_origin)
{
bool success = _m_mainPixmap.load(filename);
if (!success) {
QImageReader reader(filename);
QString error_string = reader.errorString();
QString warning = tr("Can not load image %1[%2], error string is %3")
.arg(filename).arg(metaObject()->className()).arg(error_string);
QMessageBox::warning(NULL, tr("Warning"), warning);
} else {
if (useNewSize) {
_m_width = size.width();
_m_height = size.height();
} else {
_m_width = _m_mainPixmap.width();
_m_height = _m_mainPixmap.height();
}
if (center_as_origin) {
resetTransform();
setTransform(QTransform::fromTranslate(-_m_width / 2, -_m_height / 2), true);
} else
this->prepareGeometryChange();
}
return success;
}
示例5: scene
void ProfileGraphicsView::clear()
{
scene()->clear();
resetTransform();
zoomLevel = 0;
toolTip = 0;
}
示例6: resetTransform
void ImageView::setScaleFactor(double factor) {
if(factor != scaleFactor_) {
scaleFactor_ = factor;
resetTransform();
scale(factor, factor);
queueGenerateCache();
}
}
示例7: changeScale
PathBlock* PathBlock::scale(float scaleX, float scaleY)
{
changeScale(scaleX, scaleY);
resetTransform();
return this;
}
示例8: resetTransform
PathBlock* PathBlock::rotate(const Angle& angle)
{
rotation += angle;
resetTransform();
return this;
}
示例9: resetTransform
void SceneView::setScene(Scene * scene)
{
if (m_scene != NULL) delete m_scene;
m_scene = scene;
resetTransform();
emit updateGL();
}
示例10: resetTransform
void MainRSTView::rePort()
{
resetTransform();
centerOn(father_->fx_, father_->fy_);
scale(father_->sc_, father_->sc_);
emit portChanged(width() / father_->sc_, height() / father_->sc_);
}
示例11: scene
void FormView::showForm(AbstractForm * form)
{
QGraphicsScene *s = scene();
s->clear();
resetTransform();
if(form == 0){
return;
}
if(form->get_number_of_points() <= 0) {
return;
}
int factor = 100;
QPolygonF polygon;
for(int i=0; i<form->get_number_of_points(); ++i){
Point point = form->get_point_at_index(i);
polygon.push_back(QPointF(point.get_x()*factor, point.get_y()*factor));
}
s->addPolygon(polygon, QPen(), QBrush(Qt::SolidPattern));
QRectF bound = polygon.boundingRect();
s->setSceneRect(bound);
float realwidth = container->width() - 50;
float width = bound.width();
float realheight = container->height() - 50;
float height = bound.height();
float relw = 1;
if(width > 0){
relw = realwidth / width;
}
float relh = 1;
if(height > 0){
relh = realheight / height;
}
float rel = relw;
if(relh < relw){
rel = relh;
}
scale(rel,rel);
}
示例12: Fl_Gl_Window
MyWindow::MyWindow() : Fl_Gl_Window(1024, 768, "Pinocchio"), flatShading(true), floor(true), skeleton(false)
{
size_range(20, 20, 5000, 5000);
end();
resetTransform();
win = this;
Fl::add_idle(idle);
}
示例13: resetTransform
void RenderArea::openFile(QFile &svgFile)
{
graphicsScene->clear();
resetTransform();
QGraphicsItem *loadItem;
loadItem = new QGraphicsSvgItem(svgFile.fileName());
graphicsScene->addItem(loadItem);
}
示例14: resetTransform
void PianoKeybd::setRotation(int r)
{
if (r != m_rotation) {
m_rotation = r;
resetTransform();
rotate(m_rotation);
fitInView(m_scene->sceneRect(), Qt::KeepAspectRatio);
}
}
示例15: markable
QSanSelectableItem::QSanSelectableItem(bool center_as_origin)
: markable(false), marked(false)
{
if (center_as_origin) {
resetTransform();
setTransform(QTransform::fromTranslate(-_m_mainPixmap.width() / 2, -_m_mainPixmap.height() / 2), true);
}
_m_width = _m_height = 0;
}