19 #include <QPrintDialog>
30 if (
e->modifiers() & Qt::ControlModifier) {
31 if (
e->angleDelta().y() > 0)
37 QGraphicsView::wheelEvent(
e);
42 : QFrame(
parent),m_frame(nullptr),m_line(nullptr)
47 setFrameStyle(Sunken | StyledPanel);
52 m_graphicsView->setOptimizationFlags(QGraphicsView::DontSavePainterState);
53 m_graphicsView->setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
54 m_graphicsView->setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
56 int size =
style()->pixelMetric(QStyle::PM_ToolBarIconSize);
66 m_zoomInIcon->setIcon(QPixmap(
":/vp1/icons/icons/zoomin.png"));
73 m_zoomOutIcon->setIcon(QPixmap(
":/vp1/icons/icons/zoomout.png"));
116 QHBoxLayout *labelLayout =
new QHBoxLayout;
118 m_label2 =
new QLabel(tr(
"Pointer Mode"));
144 m_printButton->setIcon(QIcon(QPixmap(
":/vp1/icons/icons/fileprint.png")));
146 QButtonGroup *pointerModeGroup =
new QButtonGroup;
147 pointerModeGroup->setExclusive(
true);
151 labelLayout->addWidget(
m_label);
152 labelLayout->addStretch();
158 labelLayout->addStretch();
164 QGridLayout *topLayout =
new QGridLayout;
165 topLayout->addLayout(labelLayout, 0, 0);
184 setLayout(topLayout);
250 QPen pen(
Qt::red, 5, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin);
258 qreal
x1 = sceneRect.left();
259 qreal
y1 = sceneRect.bottom();
261 qreal
x2 = sceneRect.right();
302 VP1Msg::message(
"Warning!! using setPreviewZoom() on a full-size view has no effect.");
324 ? QGraphicsView::RubberBandDrag
325 : QGraphicsView::ScrollHandDrag);
343 #ifndef QT_NO_PRINTER
345 QPrintDialog dialog(&printer,
this);
347 QPainter painter(&printer);