-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScrollableTextDialog.h
More file actions
44 lines (34 loc) · 1015 Bytes
/
ScrollableTextDialog.h
File metadata and controls
44 lines (34 loc) · 1015 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef SCROLLABLETEXTDIALOG_H
#define SCROLLABLETEXTDIALOG_H
#include "cppGUI_global.h"
#include <QDialog>
#include <QTextOption>
namespace Ui {
class ScrollableTextDialog;
}
//Dialog that shows a scrollable text area
class CPPGUISHARED_EXPORT ScrollableTextDialog
: public QDialog
{
Q_OBJECT
public:
//Constructor
ScrollableTextDialog(QWidget* parent = nullptr, QString title = "");
~ScrollableTextDialog();
//Sets text
void setText(const QString& text);
//Appends a line (adds a newline before it)
void appendLine(const QString& line);
//Appends lines (adds a newline before earch line)
void appendLines(QStringList& lines);
//Set word wrap mode (default is QTextOption::WrapAtWordBoundaryOrAnywhere)
void setWordWrapMode(QTextOption::WrapMode mode);
//Sets read only property (default is true)
void setReadOnly(bool read_only);
protected:
//Sets the cursor to the start of the text
void setCursorToStart();
private:
Ui::ScrollableTextDialog* ui_;
};
#endif // SCROLLABLETEXTDIALOG_H