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

Ui files work only in namespace Ui

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Not Evaluated
    • None
    • Qt Creator 3.1.0
    • Widget Designer
    • None
    • Windows, Linux

    Description

      Default:

      namespace Ui {
      class MyClass : public QWidget {

      Ui:MyClass *ui;
      }

      This works with Designer. Designer can find the ui file and use slots to implement code in myClass.cpp

      How ever this do not work:

      namespace MyName {
      class MyClass : public QWidget {

      Ui::MyClass *ui;
      }

      And this does not work:

      namespace MyName {
      class MyClass : public QWidget {

      MyName::MyClass *ui;
      }

      Both these examples makes ui files not work anymore for slot mechanism.

      Til esample I have program that uses several namespaces:

      namespace MyApp {
      namespace MyCore {
      namespace MyGuis {

      class MyClass : public QWidget {

      Ui::MyClass *ui;
      }
      }
      }
      }

      And this does not work. The Ui file exepcts to belong in namespace Ui and when defining other namespaces where the ui is produced the compiler cannot work because Ui does not name type. Qt Creator should add code to handle different name spaces when finding a ui class where to add slot.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            jeroi Jeremi Roivas
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes