Tatsh NFO Viewer
0.2.0
A simple NFO viewer.
Loading...
Searching...
No Matches
nfoviewer.h
Go to the documentation of this file.
1
2
#pragma once
3
4
#include <QMainWindow>
5
#include <QSettings>
6
#include <QString>
7
8
class
QAction
;
9
class
QCloseEvent
;
10
class
QTextEdit
;
11
class
QToolBar
;
12
14
class
MainWindow :
public
QMainWindow
{
15
Q_OBJECT
16
17
public
:
18
MainWindow();
19
24
void
openInitialFile
(
const
QString
&fileName);
25
26
protected
:
27
void
closeEvent(
QCloseEvent
*
event
)
override
;
28
29
private
:
31
void
createActions();
33
void
createToolBar();
35
void
readSettings();
37
void
openFile();
42
void
loadFile(
const
QString
&fileName);
44
void
applyLineSpacing();
52
int
contentWindowWidth(qreal textWidthPixels)
const
;
58
void
fitWidthToContents();
60
void
applyDefaultWidth();
62
void
applyViewSettings();
64
void
applyWrapMode();
69
void
onWrapToggled(
bool
enabled
);
71
void
openSettings();
76
int
baseFontSize()
const
;
81
void
changeTextSize(
int
deltaPixels);
83
void
increaseTextSize();
85
void
decreaseTextSize();
87
void
resetTextSize();
92
void
setCurrentFile(
const
QString
&fileName);
94
void
about();
99
void
warn(
const
QString
&message);
100
101
QTextEdit
*text_;
102
QString
currentFile_;
104
QString
embeddedFontFamily_;
109
int
fontSizeOffset_ = 0;
115
bool
contentFittable_ =
false
;
120
bool
wrapEnabled_ =
false
;
125
bool
autoFitEnabled_ =
true
;
126
QToolBar
*toolBar_;
127
QAction
*openAct_;
128
QAction
*copyAct_;
129
QAction
*increaseTextSizeAct_;
130
QAction
*decreaseTextSizeAct_;
131
QAction
*resetTextSizeAct_;
132
QAction
*wrapAct_;
133
QAction
*settingsAct_;
134
QAction
*aboutAct_;
135
QSettings
settings_;
136
};
MainWindow::openInitialFile
void openInitialFile(const QString &fileName)
Load the given file on startup, or prompt for one when the path is empty.
Definition
nfoviewer.cpp:173
QAction
QCloseEvent
QMainWindow::QMainWindow
QMainWindow(QWidget *parent, Qt::WindowFlags flags)
QMainWindow::event
virtual bool event(QEvent *event) override
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QSettings
QString
QTextEdit
QToolBar
QWidget::enabled
enabled
src
nfoviewer.h
Generated by
1.15.0