PDA

View Full Version : QT+error



Fastman
24th July 2007, 16:26
I place the button on the form, I click 2 times on it, and I receive a mistake:
http://212.98.173.99/qt.jpg



#ifndef UI_HSM_H
#define UI_HSM_H

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

class Ui_HSMClass
{
public:
QPushButton *pushButton;

void setupUi(QDialog *HSMClass)
{
if (HSMClass->objectName().isEmpty())
HSMClass->setObjectName(QString::fromUtf8("HSMClass"));
HSMClass->setWindowModality(Qt::ApplicationModal);
QSize size(762, 517);
size = size.expandedTo(HSMClass->minimumSizeHint());
HSMClass->resize(size);
HSMClass->setContextMenuPolicy(Qt::NoContextMenu);
pushButton = new QPushButton(HSMClass);
pushButton->setObjectName(QString::fromUtf8("pushButton"));
pushButton->setGeometry(QRect(80, 140, 75, 24));

retranslateUi(HSMClass);

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

void retranslateUi(QDialog *HSMClass)
{
HSMClass->setWindowTitle(QApplication::translate("HSMClass", "HSM", 0, QApplication::UnicodeUTF8));
pushButton->setText(QApplication::translate("HSMClass", "PushButton", 0, QApplication::UnicodeUTF8));
Q_UNUSED(HSMClass);
} // retranslateUi

};

namespace Ui {
class HSMClass: public Ui_HSMClass {};
} // namespace Ui

#endif // UI_HSM_H


:confused:

marcel
24th July 2007, 17:54
This is no error. It means that you do not have any class in the back that represents this form. This means the class that inherits from the generated UI class or contains a member of the UI class.

Once you add that class, double clicking on the button in form design will automatically create a slot in that class connected to the button's clicked signal.

So, create that class and the problem will go away.

Regards