Graphviz
13.0.0~dev.20241222.1117
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
19
QT_BEGIN_NAMESPACE
20
class
QAction;
21
class
QLabel;
22
class
QMenu;
23
class
QScrollArea;
24
class
QScrollBar;
25
class
MdiChild
;
26
QT_END_NAMESPACE
27
28
class
ImageViewer
:
public
QMainWindow
29
{
30
Q_OBJECT
31
32
public
:
33
ImageViewer
();
34
MdiChild
*
graphWindow
;
35
QMdiSubWindow*
subWindowRef
;
//reference to its wrapping sub window
36
public
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
46
private
slots:
47
48
private
:
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
};
ImageViewer
Definition
imageviewer.h:29
ImageViewer::open
bool open(const QString &fileName)
Definition
imageviewer.cpp:37
ImageViewer::subWindowRef
QMdiSubWindow * subWindowRef
Definition
imageviewer.h:35
ImageViewer::closeEvent
void closeEvent(QCloseEvent *event)
Definition
imageviewer.cpp:211
ImageViewer::print
void print()
Definition
imageviewer.cpp:55
ImageViewer::about
void about()
Definition
imageviewer.cpp:106
ImageViewer::ImageViewer
ImageViewer()
Definition
imageviewer.cpp:16
ImageViewer::zoomIn
void zoomIn()
Definition
imageviewer.cpp:80
ImageViewer::graphWindow
MdiChild * graphWindow
Definition
imageviewer.h:34
ImageViewer::zoomOut
void zoomOut()
Definition
imageviewer.cpp:85
ImageViewer::fitToWindow
void fitToWindow()
Definition
imageviewer.cpp:96
ImageViewer::normalSize
void normalSize()
Definition
imageviewer.cpp:90
MdiChild
Definition
mdichild.h:19
fileName
char * fileName(ingraph_state *sp)
Return name of current file being processed.
Definition
ingraphs.c:156
cmd
gvedit
imageviewer.h
Generated by
1.9.8