Setup Qt with autotools buildsystem

Setup of BuildSystem

Since ROSE uses the autotools buildsystem, and it's not trivial to build Qt applications with autotools a include file for your Makefile is available. It contains all rules for invocation of Qt's metacompilers and sets the INCLUDES variable correctly. You can find this file at src/roseExtensions/qtWidgets/

Template for your

        include $(top_srcdir)/src/roseExtensions/qtWidgets/

        # Compile only when configured with --with-roseQt

        # Includes have to use += , because INCLUDES is already set in


Usage of moc

You can find the general documentation of moc here:

Example - entry, assuming you have a Widget.h and Widget.cpp

            yourBin_SOURCES = Widget.cpp
            nodist_yourBin_SOURCES = moc_Widget.cpp

Handling of ui-files

To get an idea of what the uic does, and how to use it look at and

Example, assuming you have a Widget.ui

            nodist_yourBin_SOURCES = ui_Widget.h

            BUILT_SOURCES = ui_Widget.h

Warning: This setup described above is not optimal. The dependency of Widget.h on Widget.ui is not handled right.
The ui_Widget.h is generated once in the all target. When you've changed the .ui file you have to do a make clean first.

Handling of resource-files

If you want to use custom icons, or other resources you can use Qt's resourcecompiler rcc.
A detailed description how to use resource files you can find here:

Example, assuming your file is named res.qrc

            nodist_yourBin_SOURCES = qrc_res.cpp

Generated on Tue Sep 15 14:48:47 2009 for RoseQtWidgets by  doxygen 1.4.7