diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-08-24 13:04:10 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-08-24 13:04:10 -0400 |
| commit | 0f712305c840bc509fa8f00eebf2a2a4bbf28bfd (patch) | |
| tree | 81087d9f70c83ea43d0f1a8e706bf307e7631019 /src/expanderwidget.cpp | |
| parent | 2ffad7edf2946e66585a67c4ab58c0522cd8e412 (diff) | |
added settings for QTabWidget, checkable QAbstractButton and ExpanderWidget
removed directInterface() from mod info conflicts
Diffstat (limited to 'src/expanderwidget.cpp')
| -rw-r--r-- | src/expanderwidget.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/expanderwidget.cpp b/src/expanderwidget.cpp index 2f47da5b..a9d045a5 100644 --- a/src/expanderwidget.cpp +++ b/src/expanderwidget.cpp @@ -52,3 +52,30 @@ bool ExpanderWidget::opened() const { return opened_; } + +QByteArray ExpanderWidget::saveState() const +{ + QByteArray result; + QDataStream stream(&result, QIODevice::WriteOnly); + + stream << opened(); + + return result; +} + +void ExpanderWidget::restoreState(const QByteArray& a) +{ + QDataStream stream(a); + + bool opened = false; + stream >> opened; + + if (stream.status() == QDataStream::Ok) { + toggle(opened); + } +} + +QToolButton* ExpanderWidget::button() const +{ + return m_button; +} |
