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

QMenu separator addition in Designer - Generated code does not have QAction defined for separator action

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P5: Not important
    • Some future release
    • 4.6.2
    • None
    • Windows Vista x64 Ultimate, VS2008, Qt VS2008 addon. Qt 4.6.2 Open Source

    Description

      When creating a menu separator for a QMenu in Designer (for QMainWindow subclass), the Property editor shows the QObject::objectName, but the generated code does not include a QAction for the separator.

      Generated code just adds the separator but throws away the created QAction.
      There is no QAction *recentFileSeparator; declared in the ui_whatever.h file. (See attached image and file)

      Example:

      ...
      QAction *action_Settings;
      QAction *actionE_xit;
      QAction *action_OpenLayout;
      QAction *action_About;
      QAction *actionAbout_Qt;
      ...
      menu_File->addAction(action_OpenLayout);
      menu_File->addSeparator();
      menu_File->addAction(actionE_xit);
      ...
      

      Solution would be for Designer to generate a separate QAction for the menu separator too:

      ...
      QAction *recentFileSeparator;
      ...
      menu_File->addAction(action_OpenLayout);
      recentFileSeparator = menu_File->addSeparator();
      menu_File->addAction(actionE_xit);
      ...
      

      Another issue is that the value of objectName in Property editor and in the Object Inspector is not consistent. (See image)

      Attachments

        1. menu_separator.png
          menu_separator.png
          144 kB
        2. ui_whatever.h
          7 kB

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              timara Andras Timar
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes