Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.3.2
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