mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 05:49:53 +08:00

Use QTextBrowser to display file in read mode and VEdit to display file in edit mode. Signed-off-by: Le Tan <tamlokveer@gmail.com>
34 lines
506 B
C++
34 lines
506 B
C++
#ifndef VEDIT_H
|
|
#define VEDIT_H
|
|
|
|
#include <QTextEdit>
|
|
#include <QString>
|
|
#include "vconstants.h"
|
|
#include "vnotefile.h"
|
|
|
|
class VEdit : public QTextEdit
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
VEdit(VNoteFile *noteFile, QWidget *parent = 0);
|
|
void beginEdit();
|
|
bool tryEndEdit();
|
|
|
|
// begin: sync the buffer to noteFile->content;
|
|
// end: setModified(false)
|
|
void beginSave();
|
|
void endSave();
|
|
|
|
void reloadFile();
|
|
|
|
signals:
|
|
|
|
public slots:
|
|
|
|
|
|
private:
|
|
VNoteFile *noteFile;
|
|
};
|
|
|
|
#endif // VEDIT_H
|