Include horizontal scrollbar in examples

This commit is contained in:
Johannes Hilden 2017-10-30 20:20:59 +03:00
parent caa722c399
commit f092987678
2 changed files with 12 additions and 4 deletions

View File

@ -7,7 +7,8 @@
ScrollBarSettingsEditor::ScrollBarSettingsEditor(QWidget *parent)
: QWidget(parent),
ui(new Ui::ScrollBarSettingsForm),
m_scrollbar(new QtMaterialScrollBar)
m_verticalScrollbar(new QtMaterialScrollBar),
m_horizontalScrollbar(new QtMaterialScrollBar)
{
QVBoxLayout *layout = new QVBoxLayout;
setLayout(layout);
@ -28,11 +29,17 @@ ScrollBarSettingsEditor::ScrollBarSettingsEditor(QWidget *parent)
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_scrollbar);
m_scrollbar->setHideOnMouseOut(false);
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);

View File

@ -20,7 +20,8 @@ protected slots:
private:
Ui::ScrollBarSettingsForm *const ui;
QtMaterialScrollBar *const m_scrollbar;
QtMaterialScrollBar *const m_verticalScrollbar;
QtMaterialScrollBar *const m_horizontalScrollbar;
};
#endif // SCROLLBARSETTINGSEDITOR_H