Include horizontal scrollbar in examples
This commit is contained in:
parent
caa722c399
commit
f092987678
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue