Code Documentation 3.1
Social Network Visualizer
Loading...
Searching...
No Matches
texteditor.h
Go to the documentation of this file.
1
16#ifndef TEXTEDITOR_H
17#define TEXTEDITOR_H
18
19#include <QMainWindow>
20//#include <QMimeData>
21
22class QAction;
23class QMenu;
24class QTextEdit;
25
26class TextEditor : public QMainWindow
27{
28 Q_OBJECT
29
30public:
31 TextEditor(const QString &fileName ,
32 QWidget *parent= Q_NULLPTR , const bool &format=false);
33
34protected:
35 void closeEvent(QCloseEvent *event);
36
37private slots:
38 void newFile();
39 void open();
40 bool save();
41 bool saveAs();
42 void about();
44//protected:
45// bool canInsertFromMimeData(const QMimeData *source) const;
46// void insertFromMimeData(const QMimeData *source) ;
47private:
48 void createActions();
49 void createMenus();
50 void createToolBars();
51 void createStatusBar();
52 void readSettings();
53 void writeSettings();
54 bool maybeSave();
55 void loadFile(const QString &fileName);
56 bool saveFile(const QString &fileName);
57 void setCurrentFile(const QString &fileName);
58 QString strippedName(const QString &fullFileName);
59
60 QTextEdit *textEdit;
61 QString curFile;
63 QMenu *fileMenu;
64 QMenu *editMenu;
65 QMenu *helpMenu;
66 QToolBar *fileToolBar;
67 QToolBar *editToolBar;
68 QAction *newAct;
69 QAction *openAct;
70 QAction *saveAct;
71 QAction *saveAsAct;
72 QAction *exitAct;
73 QAction *cutAct;
74 QAction *copyAct;
75 QAction *pasteAct;
76 QAction *aboutAct;
77 QAction *aboutQtAct;
78
79};
80
81
82
83#endif
Definition texteditor.h:27
QAction * exitAct
Definition texteditor.h:72
bool save()
Definition texteditor.cpp:76
bool saveAs()
Definition texteditor.cpp:85
bool maybeSave()
Definition texteditor.cpp:217
QAction * openAct
Definition texteditor.h:69
void open()
Definition texteditor.cpp:67
QAction * copyAct
Definition texteditor.h:74
QMenu * editMenu
Definition texteditor.h:64
void closeEvent(QCloseEvent *event)
Definition texteditor.cpp:49
void createToolBars()
Definition texteditor.cpp:183
void createActions()
Definition texteditor.cpp:101
void about()
Definition texteditor.cpp:323
void createStatusBar()
Definition texteditor.cpp:196
QAction * saveAct
Definition texteditor.h:70
QAction * cutAct
Definition texteditor.h:73
void readSettings()
Definition texteditor.cpp:201
QAction * newAct
Definition texteditor.h:68
QAction * aboutQtAct
Definition texteditor.h:77
QAction * pasteAct
Definition texteditor.h:75
void setCurrentFile(const QString &fileName)
Definition texteditor.cpp:284
QToolBar * editToolBar
Definition texteditor.h:67
QToolBar * fileToolBar
Definition texteditor.h:66
void newFile()
Definition texteditor.cpp:59
QMenu * helpMenu
Definition texteditor.h:65
bool formatHTML
Definition texteditor.h:62
void writeSettings()
Definition texteditor.cpp:210
QString curFile
Definition texteditor.h:61
QMenu * fileMenu
Definition texteditor.h:63
QAction * aboutAct
Definition texteditor.h:76
bool saveFile(const QString &fileName)
Definition texteditor.cpp:257
QAction * saveAsAct
Definition texteditor.h:71
QTextEdit * textEdit
Definition texteditor.h:60
QString strippedName(const QString &fullFileName)
Definition texteditor.cpp:299
void createMenus()
Definition texteditor.cpp:161
void loadFile(const QString &fileName)
Definition texteditor.cpp:233
void documentWasModified()
Definition texteditor.cpp:96