[education/rkward] /: Fix accordeon table not expanding

Thomas Friedrichsmeier null at kde.org
Wed Apr 6 21:43:08 BST 2022


Git commit 56139918d378b9e6ae60cecfe36714c65274ab24 by Thomas Friedrichsmeier.
Committed on 06/04/2022 at 20:43.
Pushed by tfry into branch 'master'.

Fix accordeon table not expanding

M  +1    -0    ChangeLog
M  +3    -2    rkward/misc/rkaccordiontable.cpp
M  +1    -2    rkward/plugins/data/recode_categorical.xml

https://invent.kde.org/education/rkward/commit/56139918d378b9e6ae60cecfe36714c65274ab24

diff --git a/ChangeLog b/ChangeLog
index 89d021cd..0bc343ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,5 @@
 --- Version 0.7.3 - UNRELEASED
+- Fixed: Accordeon control (used in "Recode categorical data") never expanded
 - "Spontaneous" output, such as from running examples in the enhanced help system in R 4.2.0, is shown in the R Console
 - Fix compilation with the upcoming R 4.2.0
 - Support for switching color schemes, including basic support for dark mode
diff --git a/rkward/misc/rkaccordiontable.cpp b/rkward/misc/rkaccordiontable.cpp
index 2ed89911..a6eff4ce 100644
--- a/rkward/misc/rkaccordiontable.cpp
+++ b/rkward/misc/rkaccordiontable.cpp
@@ -68,7 +68,8 @@ public:
 			if (index.internalId () == trailing_item_id) return (Qt::ItemIsEnabled);
 			return (Qt::NoItemFlags);
 		}
-		return (QAbstractProxyModel::flags (index));
+		auto ret = QAbstractProxyModel::flags(index).setFlag(Qt::ItemNeverHasChildren, false);
+		return ret;
 	}
 
 	int rowCount (const QModelIndex& parent = QModelIndex ()) const override {
@@ -77,7 +78,7 @@ public:
 		return sourceModel ()->rowCount (mapToSource (parent)) + add_trailing_rows;
 	}
 
-    QVariant data (const QModelIndex& proxyIndex, int role = Qt::DisplayRole) const override {
+	QVariant data (const QModelIndex& proxyIndex, int role = Qt::DisplayRole) const override {
 		if (isFake (proxyIndex)) {
 			if (proxyIndex.internalId () == trailing_item_id) {
 				if (role == Qt::DisplayRole) {
diff --git a/rkward/plugins/data/recode_categorical.xml b/rkward/plugins/data/recode_categorical.xml
index 69e11b33..923f6936 100644
--- a/rkward/plugins/data/recode_categorical.xml
+++ b/rkward/plugins/data/recode_categorical.xml
@@ -105,7 +105,6 @@
 				<option value="custom" label="Custom value:"/>
 			</radio>
 			<embed id="other_custom" component="rkward::multi_input"/>
-			<stretch/>
 		</tab>
 	</tabbook></dialog>
-</document>
\ No newline at end of file
+</document>


More information about the rkward-tracker mailing list