Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-10348

In Action Editor goto slot... triggered creates method in incorrect class

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • Qt Creator 3.0.0-rc1
    • Qt Creator 2.8.1, Qt Creator 3.0.0-rc1
    • C/C++/Obj-C++ Support
    • None
    • Windows 8, 64 bit
      Qt creator 2.8.1 (Based on Qt 4.8.4 (MSVC 2010, 32bit))
    • 204cc21f0cc10fe268c1ab6b54e9916e8c98a316

      If you have a class in the header of a UI file (i.e. MainWindow.h) and that class has a pointer to the Ui class then slots generated by the designer are put in that class in stead of the Ui class.

      Consider this example:

      header file:

      namespace Ui {
      class MainWindow;
      }
      
      class MainWindow;
      class MyClass
      {
      public:
        MainWindow *mainWindow;
      };
      
      class MainWindow
      {
      ...
      };
      

      If you add an action to MainWindow and in the designer select 'goto slot... triggered', the method is added to MyClass and not MainWindow.

      result header:

      namespace Ui {
      class MainWindow;
      }
      
      class MainWindow;
      class MyClass
      {
      public:
        MainWindow *mainWindow;
      private slots:
        void on_actionTest_triggered(); //this actually should be in MainWindow
      };
      
      class MainWindow
      {
      ...
      };
      

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

            kosjar Nikolai Kosjar
            woomla Wo Om Laq
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes