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

Expand docs on QMetaMethod::tag() and clarify that it does in fact work

    XMLWordPrintable

Details

    Description

      Expand docs on QMetaMethod::tag() and clarify that it does in fact work, following patch shows an example working:

      ==== //depot/qt/4.3/examples/mainwindows/application/main.cpp#1 - d:\work\depot\qt\4.3\examples\mainwindows\application\main.cpp ====
      @@ -12,7 +12,9 @@
      ****************************************************************************/

      #include <QApplication>
      -
      +#include <QMetaObject>
      +#include <QMetaMethod>
      +#include <QDebug>
      #include "mainwindow.h"

      int main(int argc, char *argv[])
      @@ -22,5 +24,7 @@
      QApplication app(argc, argv);
      MainWindow mainWin;
      mainWin.show();
      + QMetaMethod mm = mainWin.metaObject()>method(mainWin.metaObject()>indexOfSlot("newFile()"));
      + qDebug() << mm.tag();
      return app.exec();
      }
      ==== //depot/qt/4.3/examples/mainwindows/application/mainwindow.h#1 - d:\work\depot\qt\4.3\examples\mainwindows\application\mainwindow.h ====
      @@ -20,6 +20,8 @@
      class QMenu;
      class QTextEdit;

      +#define MYTAG /* bleh */
      +
      class MainWindow : public QMainWindow
      {
      Q_OBJECT
      @@ -31,7 +33,7 @@
      void closeEvent(QCloseEvent *event);

      private slots:

      • void newFile();
        + MYTAG void newFile();
        void open();
        bool save();
        bool saveAs();

      This outputs MYTAG

      Attachments

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

        Activity

          People

            teemukat Teemu Katajisto (Inactive)
            anshaw Andy Shaw (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes