diff --git a/examples/scrollbarsettingseditor.cpp b/examples/scrollbarsettingseditor.cpp index 8c0df9b..15b9b0d 100644 --- a/examples/scrollbarsettingseditor.cpp +++ b/examples/scrollbarsettingseditor.cpp @@ -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("
The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.
The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.
The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.
The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.
The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.
The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.
The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.
The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.
"); + 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); diff --git a/examples/scrollbarsettingseditor.h b/examples/scrollbarsettingseditor.h index ea5cd66..fd74539 100644 --- a/examples/scrollbarsettingseditor.h +++ b/examples/scrollbarsettingseditor.h @@ -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