Boost logo

Boost-Build :

From: Alo Sarv (alo17_at_[hidden])
Date: 2005-08-01 19:22:56


Vladimir Prus wrote:

>>Open issues:
>>
>> The newly-generated interface headers are also passed to moc, however
>>they no longer include any moccable code,
>>
>>
>
>I was away too long ;-) Do you mean the header defines some classes, but that
>class does not have "Q_OBJECT" macro? And how signals and slots work then?
>Could it be the Q_OBJECT is added only if you specify some signals/slots in
>QDesigner?
>
>
I'm attaching a sample output from one of the default dialogs from
designer. Basically, as you can see,
only the actual layouting is generated, no Q_OBJECT macro is used.
Signals are connected to whoever
calls setupUi function; as such, there's no longer need for moc'ing the
file.

Alo

 --------------010107010502080003010001 Content-Type: text/plain;
name="test.h"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="test.h"

#ifndef TEST_H
#define TEST_H

#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QDialog>
#include <QtGui/QHBoxLayout>
#include <QtGui/QPushButton>
#include <QtGui/QSpacerItem>
#include <QtGui/QWidget>

class Ui_Dialog
{
public:
QWidget *layoutWidget;
QHBoxLayout *hboxLayout;
QSpacerItem *spacerItem;
QPushButton *okButton;
QPushButton *cancelButton;

void setupUi(QDialog *Dialog)
{
Dialog->setObjectName(QString::fromUtf8("Dialog"));
Dialog->resize(QSize(400, 300).expandedTo(Dialog->minimumSizeHint()));
layoutWidget = new QWidget(Dialog);
layoutWidget->setObjectName(QString::fromUtf8("layoutWidget"));
layoutWidget->setGeometry(QRect(20, 250, 351, 33));
hboxLayout = new QHBoxLayout(layoutWidget);
hboxLayout->setSpacing(6);
hboxLayout->setMargin(0);
hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum);

hboxLayout->addItem(spacerItem);

okButton = new QPushButton(layoutWidget);
okButton->setObjectName(QString::fromUtf8("okButton"));

hboxLayout->addWidget(okButton);

cancelButton = new QPushButton(layoutWidget);
cancelButton->setObjectName(QString::fromUtf8("cancelButton"));

hboxLayout->addWidget(cancelButton);

retranslateUi(Dialog);
QObject::connect(okButton, SIGNAL(clicked()), Dialog, SLOT(accept()));
QObject::connect(cancelButton, SIGNAL(clicked()), Dialog, SLOT(reject()));

QMetaObject::connectSlotsByName(Dialog);
} // setupUi

void retranslateUi(QDialog *Dialog)
{
Dialog->setWindowTitle(QApplication::translate("Dialog", "Dialog"));
okButton->setText(QApplication::translate("Dialog", "OK"));
cancelButton->setText(QApplication::translate("Dialog", "Cancel"));
Q_UNUSED(Dialog);
} // retranslateUi

};

namespace Ui {
class Dialog: public Ui_Dialog {};
} // namespace Ui

#endif // TEST_H
 --------------010107010502080003010001--


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk