[education/rkward/kf5] rkward: Fix more compile time and runtime warnings

Thomas Friedrichsmeier null at kde.org
Wed Apr 10 16:12:08 BST 2024


Git commit 752da5a915c5fc18840c7d2eb2d45818e07a091d by Thomas Friedrichsmeier.
Committed on 05/04/2024 at 21:03.
Pushed by tfry into branch 'kf5'.

Fix more compile time and runtime warnings

M  +2    -2    rkward/misc/rkxmlguipreviewarea.cpp
M  +4    -4    rkward/rbackend/rkrsupport.cpp

https://invent.kde.org/education/rkward/-/commit/752da5a915c5fc18840c7d2eb2d45818e07a091d

diff --git a/rkward/misc/rkxmlguipreviewarea.cpp b/rkward/misc/rkxmlguipreviewarea.cpp
index 4c3c5e74d..1cf82fa70 100644
--- a/rkward/misc/rkxmlguipreviewarea.cpp
+++ b/rkward/misc/rkxmlguipreviewarea.cpp
@@ -1,6 +1,6 @@
 /*
 rkxmlguipreviewarea - This file is part of RKWard (https://rkward.kde.org). Created: Wed Feb 03 2016
-SPDX-FileCopyrightText: 2016-2022 by Thomas Friedrichsmeier <thomas.friedrichsmeier at kdemail.net>
+SPDX-FileCopyrightText: 2016-2024 by Thomas Friedrichsmeier <thomas.friedrichsmeier at kdemail.net>
 SPDX-FileContributor: The RKWard Team <rkward-devel at kde.org>
 SPDX-License-Identifier: GPL-2.0-or-later
 */
@@ -92,7 +92,7 @@ RKXMLGUIPreviewArea::RKXMLGUIPreviewArea (const QString &label, QWidget* parent)
 	hl->addWidget(lab);
 	hl->addWidget(tb);
 	hl->addStretch();
-	internal_layout = new QVBoxLayout(this);
+	internal_layout = new QVBoxLayout();
 	vl->addLayout(internal_layout);
 
 	menubar = new QMenuBar(nullptr); // it is important that the menubar never is a child of the main window, not even indirectly! https://bugs.kde.org/show_bug.cgi?id=416911
diff --git a/rkward/rbackend/rkrsupport.cpp b/rkward/rbackend/rkrsupport.cpp
index b9d8e9066..72895a908 100644
--- a/rkward/rbackend/rkrsupport.cpp
+++ b/rkward/rbackend/rkrsupport.cpp
@@ -135,16 +135,16 @@ SEXP RKRSupport::QVariantToSEXP(const QVariant& var) {
 
 	if (var.isNull()) return R_NilValue;
 
-	QMetaType::Type t = (QMetaType::Type) var.type();
-	if (t == QMetaType::Bool) {
+	QMetaType t = var.metaType();
+	if (t == QMetaType(QMetaType::Bool)) {
 		SEXP ret = Rf_allocVector(LGLSXP, 1);
 		LOGICAL(ret)[0] = var.toBool();
 		return ret;
-	} else if (t == QMetaType::Int) {
+	} else if (t == QMetaType(QMetaType::Int)) {
 		SEXP ret = Rf_allocVector(INTSXP, 1);
 		INTEGER(ret)[0] = var.toInt();
 		return ret;
-	} else if (t != QMetaType::QString && t != QMetaType::QStringList) {
+	} else if (t != QMetaType(QMetaType::QString) && t != QMetaType(QMetaType::QStringList)) {
 		Rf_warning("unsupported QVariant type in QVariantToSEXP");
 	}
 	QStringList list = var.toStringList();



More information about the rkward-tracker mailing list