mirror of
https://github.com/Indy970/QtHPConnect
synced 2024-12-25 21:59:15 +01:00
38 lines
760 B
C++
38 lines
760 B
C++
#ifndef TEXTEDITOR_H
|
|
#define TEXTEDITOR_H
|
|
|
|
#include <QTextEdit>
|
|
|
|
class textEditor : public QTextEdit
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit textEditor(QWidget *parent = 0);
|
|
~textEditor();
|
|
void newFile();
|
|
bool loadFile(const QString &fileName);
|
|
bool save();
|
|
bool saveAs();
|
|
bool saveFile(const QString &fileName);
|
|
QString userFriendlyCurrentFile();
|
|
QString currentFile() { return curFile; }
|
|
|
|
|
|
protected:
|
|
void closeEvent(QCloseEvent *event) override;
|
|
|
|
private slots:
|
|
void documentWasModified();
|
|
|
|
private:
|
|
QWidget * wParent;
|
|
bool maybeSave();
|
|
void setCurrentFile(const QString &fileName);
|
|
QString strippedName(const QString &fullFileName);
|
|
|
|
QString curFile;
|
|
bool isUntitled;
|
|
};
|
|
|
|
#endif // TEXTEDITOR_H
|