From 0f712305c840bc509fa8f00eebf2a2a4bbf28bfd Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Sat, 24 Aug 2019 13:04:10 -0400 Subject: added settings for QTabWidget, checkable QAbstractButton and ExpanderWidget removed directInterface() from mod info conflicts --- src/expanderwidget.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/expanderwidget.cpp') 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; +} -- cgit v1.3.1