Specifications
SHARP CORPORATION
Sharp SL-series Zaurus “Qtopia” Development Start-up Guide
Ver 1.11, February 28, 2003, 19/63
2.2.2. uic
The “uic” is a “User Interface Compiler” tool that generates source file(s) for the C++ compiler from the *.ui GUI
information file(s) created by Qt Designer.
In order to generate a header file, you may want to execute;
$ uic baseform.ui –o baseform.h
and in order to generate a source file, you may want to execute;
$ uic baseform.ui –i baseform.h –o baseform.cpp
2.2.3. moc
The “moc” is a “Meta Object Compiler” tool that generates source file(s) for the C++ compiler from the file(s) that
defines Qt event process (SIGNAL/SLOT).
The C++ compiler cannot handle keywords such as “Q_OBJECT”, “signal” or “slot”, while the class libraries
provided by Qt already defines SIGNAL and SLOT, or these keywords are usually used to include SIGNAL or
SLOT in the class definition. The “moc” is used here so that it generates source file(s) for the C++ compiler to
handle these definitions correctly. The following is a header file example that uses the keywords mentioned
above.
class MyTestClass : public Qobject
{
Q_OBJECT
...
signals:
// SIGNAL
public slots:
// public SLOT
private slots:
In order to generate a source file by using “moc”, you may want to execute;
$ moc mytestclass.h –o moc-mytestclass.cpp
By executing the above, you will have the source file so that you can compile link. Alternatively, you may create
*.moc file by “moc” tool, and then include the created *.moc file in the source.