editor.h

来自「QT是跨平台的GUI开发工具包,本代码是使用QT3.x实现的文本文件编辑器,可以」· C头文件 代码 · 共 39 行

H
39
字号
#ifndef EDITOR_H#define EDITOR_H#include <qtextedit.h>class Editor : public QTextEdit{    Q_OBJECTpublic:    Editor(QWidget *parent = 0, const char *name = 0);    void newFile();    bool open();    bool openFile(const QString &fileName);    bool save();    bool saveAs();    QSize sizeHint() const;signals:    void message(const QString &fileName, int delay);protected:    void closeEvent(QCloseEvent *event);private:    bool maybeSave();    void saveFile(const QString &fileName);    void setCurrentFile(const QString &fileName);    QString strippedName(const QString &fullFileName);    bool readFile(const QString &fileName);    bool writeFile(const QString &fileName);    QString curFile;    bool isUntitled;    QString fileFilters;};#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?