0
我的工作環境:的Qt 5.8 MSVC2015 64位,QT GraphicsView,Windows 7的64位QT的QGraphicsView放大,縮小發行
我有如下派生我的課:
class MainWindow : public QMainWindow
class mySquare : public QGraphicsRectItem
class GraphicsView : public QGraphicsView
class Scene : public QGraphicsScene
我有在裏面繪製帶有文字的Sqaure。 變焦的變焦&出我用下面的代碼:
void GraphicsView::mouseMoveEvent(QMouseEvent *event)
{
//temp raise mouse movement signal start
QPointF movment = mapToScene (event->pos());
emit sendMousePoint(movment);
if (_pan) // it get enable when control button is pressed.
{
horizontalScrollBar()->setValue(horizontalScrollBar()->value() - (event->x() - _panStartX));
verticalScrollBar()->setValue(verticalScrollBar()->value() - (event->y() - _panStartY));
_panStartX = event->x();
_panStartY = event->y();
event->accept();
// qDebug() <<"Mouse X" << QString::number(event->pos().x()) << " Y:" << QString::number(event->pos().y());
return;
}
//temp raise mouse movement signal end
event->ignore();
QGraphicsView::mousePressEvent(event);
}
但是,當我在&縮小它超出焦點&的創建白色空白屏幕。
任何線索我失去了什麼在放大& out代碼?