Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. qt6 migration issue
Forum Updated to NodeBB v4.3 + New Features

qt6 migration issue

Scheduled Pinned Locked Moved Unsolved General and Desktop
35 Posts 4 Posters 3.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Actarus

    @JonB Mine, it had been edited wrongly to fix a previous error message.

    I have fixed tons of parts now but I'm still struggling with around 15 errors like this:

    error: qualified-id in declaration before '(' token
    error: qualified-id in declaration before '(' token
    | void ChartsAxis::sectionHasBeenClicked(int logicalIndex)
    |

    Here the example code:

    void ChartsAxis::sectionHasBeenClicked(int logicalIndex)
    {
        if((isComp)&&(logicalIndex > 0))
        {
            bool found = false;
            int index = 0;
            for(int is = 0; is < pStructComp->size(); is++)
            {
                for(int il = 0; il < pStructComp->at(is)->giri.size(); il++)
                {
                    index++;
                    if(index == logicalIndex)
                    {
                        QFont f;
                        f.setBold(true);
                        if(this->width()-frame->width() >= 600)
                        {
                            labelOffset->setGeometry((this->width()-frame->width())/2 - 300, 0, 600, 20);
                            f.setPixelSize(15);
                        }
                        else if(this->width()-frame->width() >= 380)
                        {
                            labelOffset->setGeometry((this->width()-frame->width())/2 - 190, 0, 380, 20);
                            f.setPixelSize(11);
                        }
                        else
                        {
                            labelOffset->setGeometry(0, 0, (this->width()-frame->width()), 20);
                            f.setPixelSize(11);
                        }
                        labelOffset->setFont(f);
                        labelOffset->show();
                        found = true;
                        emit setOffsetIndex(is, il);
                        break;
                    }
                }
                if(found)
                    break;
            }
        }
    }
    

    838bf5ff-e5f9-493b-90ec-c1172a822e6a-image.png

    JonBJ Offline
    JonBJ Offline
    JonB
    wrote on last edited by
    #16

    @Actarus
    The error message is complaining on the method definition line, so showing its body is not relevant as it does not get that far. For "Function definition not allowed here" you may have to look back a few lines for context, e.g. (only an example) if previous function not properly terminated with a } it might generate this message. Make sure it marries with the included header declaration too.

    A 1 Reply Last reply
    0
    • JonBJ JonB

      @Actarus
      The error message is complaining on the method definition line, so showing its body is not relevant as it does not get that far. For "Function definition not allowed here" you may have to look back a few lines for context, e.g. (only an example) if previous function not properly terminated with a } it might generate this message. Make sure it marries with the included header declaration too.

      A Offline
      A Offline
      Actarus
      wrote on last edited by Actarus
      #17

      @JonB Thanks Jon, all sorted with } a few lines above.

      Can you help in correcting the sintax for QT6 for the following line of QTableWidgetItem:

      colorPicker = new QColorDialog(ui->table->item(r, 0)->backgroundColor(), nullptr
      

      I corrected replacing backgroundColor with background, but I can't get the correct sintax.

      I still have only 2 last errors to fix, the first is the one above and the last one is this below, for which I can't find anything online:

      d5bd3b9d-3904-456a-a5bb-156d8d73442a-image.png

      Thanks

      jsulmJ 1 Reply Last reply
      0
      • A Actarus

        @JonB Thanks Jon, all sorted with } a few lines above.

        Can you help in correcting the sintax for QT6 for the following line of QTableWidgetItem:

        colorPicker = new QColorDialog(ui->table->item(r, 0)->backgroundColor(), nullptr
        

        I corrected replacing backgroundColor with background, but I can't get the correct sintax.

        I still have only 2 last errors to fix, the first is the one above and the last one is this below, for which I can't find anything online:

        d5bd3b9d-3904-456a-a5bb-156d8d73442a-image.png

        Thanks

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #18

        @Actarus said in qt6 migration issue:

        and the last one is this below

        This is not the error message.
        Please post the real error which is above that line...
        It is also better to post error as text not images.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        A 1 Reply Last reply
        1
        • jsulmJ jsulm

          @Actarus said in qt6 migration issue:

          and the last one is this below

          This is not the error message.
          Please post the real error which is above that line...
          It is also better to post error as text not images.

          A Offline
          A Offline
          Actarus
          wrote on last edited by
          #19

          @jsulm This is what above that line in Compile Output window:

          g++ -c -fno-keep-inline-dllexport -g -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DCHARTDIR_HIDE_OBSOLETE -D_CRT_SECURE_NO_WARNINGS -DQT_PRINTSUPPORT_LIB -DQT_QUICKWIDGETS_LIB -DQT_WIDGETS_LIB -DQT_QUICK_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE5COMPAT_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_QMLINTEGRATION_LIB -DQT_BLUETOOTH_LIB -DQT_NETWORK_LIB -DQT_SQL_LIB -DQT_SERIALPORT_LIB -DQT_POSITIONING_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../Test -I. -I../Test/Charts -I../Test/Charts/Tables -I../Test/Charts/JSONObjects -I../Test/Archivio -I../Test/Comp -I../Test/Parse -I../Test/Bluetooth -I../Test/MD5 -I../Test/Devs -I../Test/Devs/DevicesFactory -I../Test/Conf -I../Test/Usb -I../Test/Triggers -I../Test/SubClass -I../Test/Server -I../Test/Exporter -I../Test/Wifi -IC:/Projects/QT_Project/Test/ZipPack/include -IC:/Projects/QT_Project/Test/LimeReport/Release/include -I../include -I../../../Qt/6.5.0/mingw_64/include -I../../../Qt/6.5.0/mingw_64/include/QtPrintSupport -I../../../Qt/6.5.0/mingw_64/include/QtQuickWidgets -I../../../Qt/6.5.0/mingw_64/include/QtWidgets -I../../../Qt/6.5.0/mingw_64/include/QtQuick -I../../../Qt/6.5.0/mingw_64/include/QtOpenGL -I../../../Qt/6.5.0/mingw_64/include/QtGui -I../../../Qt/6.5.0/mingw_64/include/QtCore5Compat -I../../../Qt/6.5.0/mingw_64/include/QtQmlModels -I../../../Qt/6.5.0/mingw_64/include/QtQml -I../../../Qt/6.5.0/mingw_64/include/QtQmlIntegration -I../../../Qt/6.5.0/mingw_64/include/QtBluetooth -I../../../Qt/6.5.0/mingw_64/include/QtNetwork -I../../../Qt/6.5.0/mingw_64/include/QtSql -I../../../Qt/6.5.0/mingw_64/include/QtSerialPort -I../../../Qt/6.5.0/mingw_64/include/QtPositioning -I../../../Qt/6.5.0/mingw_64/include/QtXml -I../../../Qt/6.5.0/mingw_64/include/QtCore -Idebug -I. -I/include -I../../../Qt/6.5.0/mingw_64/mkspecs/win32-g++ -o debug\chartmappa.o ..\Test\Charts\chartmappa.cpp
          mingw32-make[1]: *** [Makefile.Debug:32897: debug/colorrange.o] Error 1

          JonBJ 1 Reply Last reply
          0
          • A Actarus

            @jsulm This is what above that line in Compile Output window:

            g++ -c -fno-keep-inline-dllexport -g -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DCHARTDIR_HIDE_OBSOLETE -D_CRT_SECURE_NO_WARNINGS -DQT_PRINTSUPPORT_LIB -DQT_QUICKWIDGETS_LIB -DQT_WIDGETS_LIB -DQT_QUICK_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE5COMPAT_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_QMLINTEGRATION_LIB -DQT_BLUETOOTH_LIB -DQT_NETWORK_LIB -DQT_SQL_LIB -DQT_SERIALPORT_LIB -DQT_POSITIONING_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../Test -I. -I../Test/Charts -I../Test/Charts/Tables -I../Test/Charts/JSONObjects -I../Test/Archivio -I../Test/Comp -I../Test/Parse -I../Test/Bluetooth -I../Test/MD5 -I../Test/Devs -I../Test/Devs/DevicesFactory -I../Test/Conf -I../Test/Usb -I../Test/Triggers -I../Test/SubClass -I../Test/Server -I../Test/Exporter -I../Test/Wifi -IC:/Projects/QT_Project/Test/ZipPack/include -IC:/Projects/QT_Project/Test/LimeReport/Release/include -I../include -I../../../Qt/6.5.0/mingw_64/include -I../../../Qt/6.5.0/mingw_64/include/QtPrintSupport -I../../../Qt/6.5.0/mingw_64/include/QtQuickWidgets -I../../../Qt/6.5.0/mingw_64/include/QtWidgets -I../../../Qt/6.5.0/mingw_64/include/QtQuick -I../../../Qt/6.5.0/mingw_64/include/QtOpenGL -I../../../Qt/6.5.0/mingw_64/include/QtGui -I../../../Qt/6.5.0/mingw_64/include/QtCore5Compat -I../../../Qt/6.5.0/mingw_64/include/QtQmlModels -I../../../Qt/6.5.0/mingw_64/include/QtQml -I../../../Qt/6.5.0/mingw_64/include/QtQmlIntegration -I../../../Qt/6.5.0/mingw_64/include/QtBluetooth -I../../../Qt/6.5.0/mingw_64/include/QtNetwork -I../../../Qt/6.5.0/mingw_64/include/QtSql -I../../../Qt/6.5.0/mingw_64/include/QtSerialPort -I../../../Qt/6.5.0/mingw_64/include/QtPositioning -I../../../Qt/6.5.0/mingw_64/include/QtXml -I../../../Qt/6.5.0/mingw_64/include/QtCore -Idebug -I. -I/include -I../../../Qt/6.5.0/mingw_64/mkspecs/win32-g++ -o debug\chartmappa.o ..\Test\Charts\chartmappa.cpp
            mingw32-make[1]: *** [Makefile.Debug:32897: debug/colorrange.o] Error 1

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #20

            @Actarus said in qt6 migration issue:

            debug/colorrange.o] Error 1

            Strange, because that colorrage.o file is not even mentioned on the previous line, which may have been completed successfully. make may be moving on to build the next file alphabetically. Errno 1 would be "EPERM". Does debug/colorrange.o already exist? Are you able to delete it?

            A 2 Replies Last reply
            0
            • JonBJ JonB

              @Actarus said in qt6 migration issue:

              debug/colorrange.o] Error 1

              Strange, because that colorrage.o file is not even mentioned on the previous line, which may have been completed successfully. make may be moving on to build the next file alphabetically. Errno 1 would be "EPERM". Does debug/colorrange.o already exist? Are you able to delete it?

              A Offline
              A Offline
              Actarus
              wrote on last edited by
              #21

              @JonB No, it doesn't exist at all.

              1 Reply Last reply
              0
              • JonBJ JonB

                @Actarus said in qt6 migration issue:

                debug/colorrange.o] Error 1

                Strange, because that colorrage.o file is not even mentioned on the previous line, which may have been completed successfully. make may be moving on to build the next file alphabetically. Errno 1 would be "EPERM". Does debug/colorrange.o already exist? Are you able to delete it?

                A Offline
                A Offline
                Actarus
                wrote on last edited by
                #22

                @JonB Can it be related to the error message on the top of the editor window?
                Stating:
                Error:Could not decode "colorrange.cpp" with "UTF-8"-encoding. Editing not possible.

                JonBJ 1 Reply Last reply
                0
                • A Actarus

                  @JonB Can it be related to the error message on the top of the editor window?
                  Stating:
                  Error:Could not decode "colorrange.cpp" with "UTF-8"-encoding. Editing not possible.

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by
                  #23

                  @Actarus
                  That's not good! There would appear to be a problem if editor says the .cpp is not editable I would be worried :) Which may lead to a problem when trying to compile it to the .o file....

                  A 2 Replies Last reply
                  0
                  • JonBJ JonB

                    @Actarus
                    That's not good! There would appear to be a problem if editor says the .cpp is not editable I would be worried :) Which may lead to a problem when trying to compile it to the .o file....

                    A Offline
                    A Offline
                    Actarus
                    wrote on last edited by
                    #24

                    @JonB I've just checked and I have the same message on the other PC with QT5 but, in that case, it compiles without errors and I can find the colorrange.o file in the debug folder.

                    JonBJ 1 Reply Last reply
                    0
                    • JonBJ JonB

                      @Actarus
                      That's not good! There would appear to be a problem if editor says the .cpp is not editable I would be worried :) Which may lead to a problem when trying to compile it to the .o file....

                      A Offline
                      A Offline
                      Actarus
                      wrote on last edited by
                      #25

                      @JonB Jon, just opened it with text editor and saved it in UTF-8, the encoding error disappeared but the Error 1 is still present.

                      1 Reply Last reply
                      0
                      • A Actarus

                        @JonB I've just checked and I have the same message on the other PC with QT5 but, in that case, it compiles without errors and I can find the colorrange.o file in the debug folder.

                        JonBJ Offline
                        JonBJ Offline
                        JonB
                        wrote on last edited by
                        #26

                        @Actarus
                        I would delete the debug folder and do a full, clean rebuild from scratch. If it errors look carefully at the compile output, because what you show seems "strange".

                        A 1 Reply Last reply
                        0
                        • JonBJ JonB

                          @Actarus
                          I would delete the debug folder and do a full, clean rebuild from scratch. If it errors look carefully at the compile output, because what you show seems "strange".

                          A Offline
                          A Offline
                          Actarus
                          wrote on last edited by Actarus
                          #27

                          @JonB Did it but it didn't change, but the colorrange.cpp file is "casually" the same where I have the error mentioned above about backgroundcolor that is the last one code issue that had not yet been corrected.

                          Could you please give me a tip about it and maybe it fixes also the Error1?

                          "Can you help in correcting the sintax for QT6 for the following line of QTableWidgetItem:

                          colorPicker = new QColorDialog(ui->table->item(r, 0)->backgroundColor(), nullptr
                          

                          I corrected replacing backgroundColor with background, but I can't get the correct sintax."

                          Thanks.

                          JonBJ 1 Reply Last reply
                          0
                          • A Actarus

                            @JonB Did it but it didn't change, but the colorrange.cpp file is "casually" the same where I have the error mentioned above about backgroundcolor that is the last one code issue that had not yet been corrected.

                            Could you please give me a tip about it and maybe it fixes also the Error1?

                            "Can you help in correcting the sintax for QT6 for the following line of QTableWidgetItem:

                            colorPicker = new QColorDialog(ui->table->item(r, 0)->backgroundColor(), nullptr
                            

                            I corrected replacing backgroundColor with background, but I can't get the correct sintax."

                            Thanks.

                            JonBJ Offline
                            JonBJ Offline
                            JonB
                            wrote on last edited by
                            #28

                            @Actarus
                            The line you show simply seems to be missing the trailing );. Other than that I don't think it has changed from Qt5. If you get an error copy & paste exactly what the compiler shows you about it.

                            A 3 Replies Last reply
                            0
                            • JonBJ JonB

                              @Actarus
                              The line you show simply seems to be missing the trailing );. Other than that I don't think it has changed from Qt5. If you get an error copy & paste exactly what the compiler shows you about it.

                              A Offline
                              A Offline
                              Actarus
                              wrote on last edited by Actarus
                              #29

                              @JonB Sorry, just didn't pasted here the ); but it's in the code.
                              Actually in QT6 it's no longer possible to use 'backgroundColor', indeed I replaced it with 'background' in all the other situations where I had the same error message and it worked.

                              The error text is the following:

                              error: 'class QTableWidgetItem' has no member named 'backgroundColor'; did you mean 'background'?
                              307 | colorPicker = new QColorDialog(ui->table->item(r, 0)->backgroundColor(), nullptr/ui->table/);
                              | ^~~~~~~~~~~~~~~
                              | background

                              But replacing it with 'background', then I get the message :

                              colorrange.cpp:307:27: No matching constructor for initialization of 'QColorDialog'
                              qcolordialog.h:36:14: candidate constructor not viable: no known conversion from 'QBrush' to 'const QColor' for 1st argument
                              qcolordialog.h:35:14: candidate constructor not viable: allows at most single argument 'parent', but 2 arguments were provided
                              :74:20: note: candidate constructor not viable: requires 1 argument, but 2 were provided

                              1 Reply Last reply
                              0
                              • JonBJ JonB

                                @Actarus
                                The line you show simply seems to be missing the trailing );. Other than that I don't think it has changed from Qt5. If you get an error copy & paste exactly what the compiler shows you about it.

                                A Offline
                                A Offline
                                Actarus
                                wrote on last edited by
                                #30

                                @JonB Jon, fixed both with the correct sintax:

                                colorPicker = new QColorDialog(ui->table->item(r, 0)->background().color(), nullptr);
                                

                                This also fixed the error1 and now the .o file is generated

                                1 Reply Last reply
                                0
                                • JonBJ JonB

                                  @Actarus
                                  The line you show simply seems to be missing the trailing );. Other than that I don't think it has changed from Qt5. If you get an error copy & paste exactly what the compiler shows you about it.

                                  A Offline
                                  A Offline
                                  Actarus
                                  wrote on last edited by Actarus
                                  #31

                                  @JonB Jon, now that I fixed all the errors, if I compile I suddenly get around 1600 errors like the following one but in QT5 it has always compiled and run perfectly.

                                  error: conversion from 'const char [2]' to 'QChar' is ambiguous
                                  : conversion from 'const char [2]' to 'QChar' is ambiguous
                                  933 | if(formula.at(i) == "'" && i+1 < formula.length())
                                  | ^~~

                                  Invalid operands to binary expression ('const QChar' and 'const char[2]')
                                  qchar.h:582:34: candidate function not viable: no known conversion from 'const char[2]' to 'QChar' for 2nd argument

                                  Here the code:

                                  QString can;
                                                                              for(int i = 0; i < formula.size(); i++)
                                                                              {
                                                                                  if(formula.at(i) == "'" && i+1 < formula.length())
                                                                                  {
                                                                                      i += 1;
                                                                                      while(i < formula.length() && formula.at(i) != "'")
                                                                                      {
                                                                                          can.append(formula.at(i));
                                                                                          i += 1;
                                                                                      }
                                                                                      if(cBoxChannel_1->findText(can) != -1)
                                                                                      {
                                                                                          nChannels += 1;
                                                                                          if(nChannels == 1)
                                                                                              cBoxChannel_1->setCurrentIndex(cBoxChannel_1->findText(can));
                                                                                          else
                                                                                              if(nChannels == 2)
                                                                                                  cBoxChannel_2->setCurrentIndex(cBoxChannel_2->findText(can));
                                                                                              else
                                                                                                  if(nChannels == 3)
                                                                                                      cBoxChannel_3->setCurrentIndex(cBoxChannel_3->findText(can));
                                                                                                  else
                                                                                                      if(nChannels == 4)
                                                                                                          cBoxChannel_4->setCurrentIndex(cBoxChannel_4->findText(can));
                                                                                                      else
                                                                                                          if(nChannels == 5)
                                                                                                              cBoxChannel_5->setCurrentIndex(cBoxChannel_5->findText(can));
                                                                                                          else
                                                                                                              if(nChannels == 6)
                                                                                                                  cBoxChannel_6->setCurrentIndex(cBoxChannel_6->findText(can));
                                                                                                              else
                                                                                                                  if(nChannels == 7)
                                                                                                                      cBoxChannel_7->setCurrentIndex(cBoxChannel_7->findText(can));
                                                                                                                  else
                                                                                                                      if(nChannels == 8)
                                                                                                                          cBoxChannel_8->setCurrentIndex(cBoxChannel_8->findText(can));
                                                                                      }
                                                                                      can.clear();
                                                                                  }
                                                                              }
                                  

                                  The claimed part is the ==:

                                  if(formula.at(i) == "'" && i+1 < formula.length())

                                  Christian EhrlicherC 1 Reply Last reply
                                  0
                                  • A Actarus

                                    @JonB Jon, now that I fixed all the errors, if I compile I suddenly get around 1600 errors like the following one but in QT5 it has always compiled and run perfectly.

                                    error: conversion from 'const char [2]' to 'QChar' is ambiguous
                                    : conversion from 'const char [2]' to 'QChar' is ambiguous
                                    933 | if(formula.at(i) == "'" && i+1 < formula.length())
                                    | ^~~

                                    Invalid operands to binary expression ('const QChar' and 'const char[2]')
                                    qchar.h:582:34: candidate function not viable: no known conversion from 'const char[2]' to 'QChar' for 2nd argument

                                    Here the code:

                                    QString can;
                                                                                for(int i = 0; i < formula.size(); i++)
                                                                                {
                                                                                    if(formula.at(i) == "'" && i+1 < formula.length())
                                                                                    {
                                                                                        i += 1;
                                                                                        while(i < formula.length() && formula.at(i) != "'")
                                                                                        {
                                                                                            can.append(formula.at(i));
                                                                                            i += 1;
                                                                                        }
                                                                                        if(cBoxChannel_1->findText(can) != -1)
                                                                                        {
                                                                                            nChannels += 1;
                                                                                            if(nChannels == 1)
                                                                                                cBoxChannel_1->setCurrentIndex(cBoxChannel_1->findText(can));
                                                                                            else
                                                                                                if(nChannels == 2)
                                                                                                    cBoxChannel_2->setCurrentIndex(cBoxChannel_2->findText(can));
                                                                                                else
                                                                                                    if(nChannels == 3)
                                                                                                        cBoxChannel_3->setCurrentIndex(cBoxChannel_3->findText(can));
                                                                                                    else
                                                                                                        if(nChannels == 4)
                                                                                                            cBoxChannel_4->setCurrentIndex(cBoxChannel_4->findText(can));
                                                                                                        else
                                                                                                            if(nChannels == 5)
                                                                                                                cBoxChannel_5->setCurrentIndex(cBoxChannel_5->findText(can));
                                                                                                            else
                                                                                                                if(nChannels == 6)
                                                                                                                    cBoxChannel_6->setCurrentIndex(cBoxChannel_6->findText(can));
                                                                                                                else
                                                                                                                    if(nChannels == 7)
                                                                                                                        cBoxChannel_7->setCurrentIndex(cBoxChannel_7->findText(can));
                                                                                                                    else
                                                                                                                        if(nChannels == 8)
                                                                                                                            cBoxChannel_8->setCurrentIndex(cBoxChannel_8->findText(can));
                                                                                        }
                                                                                        can.clear();
                                                                                    }
                                                                                }
                                    

                                    The claimed part is the ==:

                                    if(formula.at(i) == "'" && i+1 < formula.length())

                                    Christian EhrlicherC Offline
                                    Christian EhrlicherC Offline
                                    Christian Ehrlicher
                                    Lifetime Qt Champion
                                    wrote on last edited by Christian Ehrlicher
                                    #32

                                    error: conversion from 'const char [2]' to 'QChar' is ambiguous
                                    : conversion from 'const char [2]' to 'QChar' is ambiguous

                                    We already discussed this problem ...

                                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                                    Visit the Qt Academy at https://academy.qt.io/catalog

                                    A 1 Reply Last reply
                                    0
                                    • Christian EhrlicherC Christian Ehrlicher

                                      error: conversion from 'const char [2]' to 'QChar' is ambiguous
                                      : conversion from 'const char [2]' to 'QChar' is ambiguous

                                      We already discussed this problem ...

                                      A Offline
                                      A Offline
                                      Actarus
                                      wrote on last edited by Actarus
                                      #33

                                      @Christian-Ehrlicher Thanks, fixed.

                                      I'm facing a couple of situations that in QT5 compile without problem but not in QT6:

                                      connect(xychart->m_ChartViewer, &QChartViewer::needTrackLineXYChart, this, &AnalysisWindow::trackLineAxis);
                                      

                                      and

                                      connect(m_ChartViewer, &QChartViewer::MouseIsPressed, this, &BaseViewPortComp::mousePressEvent);
                                      

                                      In both cases the problem is error:
                                      static assertion failed: Signal and slot arguments are not compatible.
                                      214 | static_assert((QtPrivate::CheckCompatibleArguments<typename SignalType::Arguments, typename SlotType::Arguments>::value),

                                      I assume it's because it's not possible to connect a QPointerEvent to a QMouseEvent, but how to get out of this?

                                      Christian EhrlicherC 1 Reply Last reply
                                      0
                                      • A Actarus

                                        @Christian-Ehrlicher Thanks, fixed.

                                        I'm facing a couple of situations that in QT5 compile without problem but not in QT6:

                                        connect(xychart->m_ChartViewer, &QChartViewer::needTrackLineXYChart, this, &AnalysisWindow::trackLineAxis);
                                        

                                        and

                                        connect(m_ChartViewer, &QChartViewer::MouseIsPressed, this, &BaseViewPortComp::mousePressEvent);
                                        

                                        In both cases the problem is error:
                                        static assertion failed: Signal and slot arguments are not compatible.
                                        214 | static_assert((QtPrivate::CheckCompatibleArguments<typename SignalType::Arguments, typename SlotType::Arguments>::value),

                                        I assume it's because it's not possible to connect a QPointerEvent to a QMouseEvent, but how to get out of this?

                                        Christian EhrlicherC Offline
                                        Christian EhrlicherC Offline
                                        Christian Ehrlicher
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #34

                                        Qt has no class named QChartViewer so I don't know this class. Most likely the signature of the signals changed so you have to adjust your slots accordingly - normal developer stuff.

                                        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                                        Visit the Qt Academy at https://academy.qt.io/catalog

                                        A 1 Reply Last reply
                                        1
                                        • Christian EhrlicherC Christian Ehrlicher

                                          Qt has no class named QChartViewer so I don't know this class. Most likely the signature of the signals changed so you have to adjust your slots accordingly - normal developer stuff.

                                          A Offline
                                          A Offline
                                          Actarus
                                          wrote on last edited by
                                          #35

                                          @Christian-Ehrlicher Thanks Christian, fixed adjusting slots.

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved