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/Make.inc

Template for your Makefile.am

        include $(top_srcdir)/src/roseExtensions/qtWidgets/Make.inc

        # Compile only when configured with --with-roseQt
        if ROSE_WITH_ROSEQT

        # Includes have to use += , because INCLUDES is already set in Make.inc
        INCLUDES += $(ROSE_INCLUDES)

        endif
    

Usage of moc

You can find the general documentation of moc here: http://doc.qtsoftware.com/4.5/moc.html

Example Makefile.am - 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 http://doc.qtsoftware.com/4.5/uic.html and http://doc.qtsoftware.com/4.5/designer-using-a-ui-file.html

Example Makefile.am, 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: http://doc.trolltech.com/4.5/resources.html

Example Makefile.am, 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