changeset 32003:81de46cd091b

Minor changes for compatibility with Qt6. * libgui/src/main-window.cc (main_window::request_new_function): QString::rightRef has been removed from Qt6. Use QString::right instead. Remove QKeySequence using the deprecated operator+ that is not used anyway. * src/octave-qsvghandler.h: Include QStringRef. (parsePathDataFast): Avoid ambiguous assignment operator error with Qt6.
author Markus Mützel <markus.muetzel@gmx.de>
date Thu, 13 Apr 2023 09:04:29 +0200
parents 939e5d952675
children c5b57a82a17c
files libgui/src/main-window.cc src/octave-qsvghandler.h
diffstat 2 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/main-window.cc	Wed Apr 12 15:34:43 2023 -0700
+++ b/libgui/src/main-window.cc	Thu Apr 13 09:04:29 2023 +0200
@@ -1372,7 +1372,7 @@
   if (ok && new_name.length () > 0)
     {
       // append suffix if it does not already exist
-      if (new_name.rightRef (2) != ".m")
+      if (new_name.right (2) != ".m")
         new_name.append (".m");
       // check whether new files are created without prompt
       if (! settings.bool_value (ed_create_new_file))
@@ -2268,8 +2268,6 @@
 {
   QMenu *edit_menu = m_add_menu (p, tr ("&Edit"));
 
-  QKeySequence ctrl_shift = Qt::ControlModifier + Qt::ShiftModifier;
-
   gui_settings settings;
 
   m_undo_action
--- a/src/octave-qsvghandler.h	Wed Apr 12 15:34:43 2023 -0700
+++ b/src/octave-qsvghandler.h	Thu Apr 13 09:04:29 2023 +0200
@@ -45,6 +45,7 @@
 // --------------------------------------------------------------------------
 
 #include <QPainterPath>
+#include <QStringRef>
 
 static inline bool isDigit(ushort ch)
 {
@@ -435,7 +436,7 @@
         QChar pathElem = *str;
         ++str;
         QChar endc = *end;
-        *const_cast<QChar *>(end) = 0; // parseNumbersArray requires 0-termination that QStringRef cannot guarantee
+        *const_cast<QChar *>(end) = QChar{0}; // parseNumbersArray requires 0-termination that QStringRef cannot guarantee
         QVarLengthArray<qreal, 8> arg;
         parseNumbersArray(str, arg);
         *const_cast<QChar *>(end) = endc;