forked from laserpants/qt-material-widgets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscrollbarsettingseditor.cpp
61 lines (47 loc) · 2.41 KB
/
scrollbarsettingseditor.cpp
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "scrollbarsettingseditor.h"
#include <QVBoxLayout>
#include <QColorDialog>
#include <QtWidgets/QTextEdit>
#include <qtmaterialscrollbar.h>
ScrollBarSettingsEditor::ScrollBarSettingsEditor(QWidget *parent)
: QWidget(parent),
ui(new Ui::ScrollBarSettingsForm),
m_verticalScrollbar(new QtMaterialScrollBar),
m_horizontalScrollbar(new QtMaterialScrollBar)
{
QVBoxLayout *layout = new QVBoxLayout;
setLayout(layout);
QWidget *widget = new QWidget;
layout->addWidget(widget);
QWidget *canvas = new QWidget;
canvas->setStyleSheet("QWidget { background: white; }");
layout->addWidget(canvas);
ui->setupUi(widget);
layout->setContentsMargins(20, 20, 20, 20);
layout = new QVBoxLayout;
canvas->setLayout(layout);
canvas->setMaximumHeight(400);
QTextEdit *edit = new QTextEdit;
edit->setText("<p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p>");
edit->setLineWrapMode(QTextEdit::NoWrap);
edit->update();
edit->setMaximumHeight(200);
edit->setVerticalScrollBar(m_verticalScrollbar);
edit->setHorizontalScrollBar(m_horizontalScrollbar);
//m_verticalScrollbar->setHideOnMouseOut(false);
//m_horizontalScrollbar->setHideOnMouseOut(false);
m_horizontalScrollbar->setOrientation(Qt::Horizontal);
layout->addWidget(edit);
layout->setAlignment(edit, Qt::AlignHCenter);
setupForm();
}
ScrollBarSettingsEditor::~ScrollBarSettingsEditor()
{
delete ui;
}
void ScrollBarSettingsEditor::setupForm()
{
}
void ScrollBarSettingsEditor::updateWidget()
{
}