qdbuscpp2xml uses moc-qt3 instead of moc-qt4

Bug #208556 reported by Andres J. Riofrio
4
Affects Status Importance Assigned to Milestone
qt4-x11 (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: qt4-dev-tools

When I run qdbuscpp2xml on my application.h it does not work. In the source package (qt4-x11-4.3.2/tools/qdbus/tools/qdbuscpp2xml/qdbuscpp2xml.cpp) it references the executable "moc" (on line 394) which by default (or at least on my system, in which I haven't changed anything concerning QT) is a symlink to moc-qt3. And this causes the parser to not recognize "public slots" or "signals" (although it does recognize "public Q_SLOTS" and "Q_SIGNALS").

I use Ubuntu 7.10, And I have installed the kde4 package from the PPA.

I think this is fixed upstream in Debian: http://lists.debian.org/debian-qt-kde/2007/03/msg00143.html

description: updated
description: updated
Revision history for this message
Andres J. Riofrio (andresjriofrio) wrote :

This can be fixed by replacing "/moc" with "/moc-qt4" on line 394 of qt4-x11-4.3.2/tools/qdbus/tools/qdbuscpp2xml/qdbuscpp2xml.cpp (or at least that's how the Debian guys fixed it). I'm not sure how the dpatch and/or patch system works, though, so I was not able to create a patch.

Revision history for this message
Rich Johnson (nixternal) wrote :

sudo update-alternatives --config moc

Select the Qt4 version. This is a packaging bug and not a bug with Qt. If there was only one version of Qt, then we would install moc-qt4 as moc. Prior to the Qt4 releases, moc-qt3 was just moc. So it is no coding issue with Qt whatsoever, however it is a bit of a mistake possibly in setting the alternatives --install priority in the libqt4-dev.postinst in the package. Will have Jonathan Riddell look into this. Thanks!

Changed in qt4-x11:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Rich Johnson (nixternal) wrote :

Actually, qdbuscpp2xml does use moc-qt4. Our Qt4 has a patch (03_launch_moc-qt4.diff) which addresses this.

Changed in qt4-x11:
status: Confirmed → Fix Released
Revision history for this message
Rich Johnson (nixternal) wrote :

author: Brian Nelson <email address hidden>

Ensure the Qt4 version of moc is launched.

--- a/tools/qdbus/tools/qdbuscpp2xml/qdbuscpp2xml.cpp
+++ b/tools/qdbus/tools/qdbuscpp2xml/qdbuscpp2xml.cpp
@@ -391,7 +391,7 @@
         else {
             // run moc on this file
             QProcess proc;
- proc.start(QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/moc"), QStringList() << QFile::decodeName(argv[i]), QIODevice::ReadOnly | QIODevice::Text);
+ proc.start(QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/moc-qt4"), QStringList() << QFile::decodeName(argv[i]), QIODevice::ReadOnly | QIODevice::Text);

             if (!proc.waitForStarted()) {
                 fprintf(stderr, PROGRAMNAME ": could not execute moc! Aborting.\n");

Revision history for this message
Andres J. Riofrio (andresjriofrio) wrote :

Well in the end it was just my own ignorance... The patch was there but I just did "apt-src install qt4-x11" and saw that the file referenced "/moc" instead of "/moc-qt4", without knowing that the patches in debian/patches/ weren't gonna be applied until build time... I feel embarrased now. :D

And the reason it wasn't working for me is because I was using KUrl instead of QString for a public slot I wanted to export to DBUS...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.