Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
imageviewer.h
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#pragma once
12
13#define QT_NO_PRINTER 1
14
15#include <QtWidgets>
16#include <QMainWindow>
17#include <QPrinter>
18
19QT_BEGIN_NAMESPACE
20class QAction;
21class QLabel;
22class QMenu;
23class QScrollArea;
24class QScrollBar;
25class MdiChild;
26QT_END_NAMESPACE
27
28class ImageViewer : public QMainWindow
29{
30 Q_OBJECT
31
32public:
35 QMdiSubWindow* subWindowRef; //reference to its wrapping sub window
36public slots:
37 bool open(const QString &fileName);
38 void print();
39 void zoomIn();
40 void zoomOut();
41 void normalSize();
42 void fitToWindow();
43 void about();
44
45
46private slots:
47
48private:
49 void createActions();
50 void createMenus();
51 void updateActions();
52 void scaleImage(double factor);
53 void adjustScrollBar(QScrollBar *scrollBar, double factor);
54
55 QLabel *imageLabel;
56 QScrollArea *scrollArea;
57 double scaleFactor;
58
59#ifndef QT_NO_PRINTER
60 QPrinter printer;
61#endif
62
63 QAction *openAct;
64 QAction *printAct;
65 QAction *exitAct;
66 QAction *zoomInAct;
67 QAction *zoomOutAct;
68 QAction *normalSizeAct;
69 QAction *fitToWindowAct;
70 QAction *aboutAct;
71 QAction *aboutQtAct;
72
73 QMenu *viewMenu;
74 protected:
75 void closeEvent(QCloseEvent *event);
76
77};
bool open(const QString &fileName)
QMdiSubWindow * subWindowRef
Definition imageviewer.h:35
void closeEvent(QCloseEvent *event)
MdiChild * graphWindow
Definition imageviewer.h:34
void fitToWindow()
void normalSize()
char * fileName(ingraph_state *sp)
Return name of current file being processed.
Definition ingraphs.c:156