Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-74153

problem on passing pointer to pointer of array to slot and signal

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.12.1
    • Build tools: moc
    • None
    • Windows

    Description

      MainWindow.h--------

      signals:
          void send(int (*data)[6]); 
      public slots:
          void sends(int (*data)[6]); 
      

      MainWindow.cpp

      in constructor of MainWindow : 

      connect(this, &MainWindow::send, this, &MainWindow::sends);
      int (*data2)[6] = new int[3][6] {{1,2,3,4,5,6}, {1,2,3,4,5,6}, {1,2,3,4,5,6}};
      emit send(data2);
      

       

       

      errors occur when one try to compile this code which are something related with

      type casting in moc_mainwindow.cpp.

       

      i fixed this retyping some code in moc_mainwindow.cpp. For example

      line 85 

      case 0: _t->send((*reinterpret_cast< int(*)>(_a[1]))); break;
      

       

      i fixed this to

      case 0: _t->send((*reinterpret_cast<int (**)[6]>(_a[1]))); break;
      

       

      and applied similar solution to the other lines in moc_mainwindow.cpp

       

      now i can complie and run the code without any problem , but whenever i try to rebuild i should repeat this menually.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            kwon852456 ohhyeok kwon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes