anfängerfrage
Verfasst: 17. November 2007 15:30
hallo,
ich bekomme folgende Fehlermeldung:
Ich hab folgendes:
main.cpp
programm.h (hab noch eine ui_programm.h - komisch oder?)
test.pro
Was ist falsch? Binn blutiger Anfänger?
2. Frage: *Wo* antworte ich auf Ereignisse?
Danke
bueffel
ich bekomme folgende Fehlermeldung:
Code: Alles auswählen
main.cpp:11: error: no matching function for call to ‘Ui::Dialog::setupUi(QMainWindow*&)’
main.cpp
Code: Alles auswählen
#include <QApplication>
#include <QMainWindow>
#include "ui_programm.h"
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QMainWindow *form = new QMainWindow();
Ui::Dialog hb;
hb.setupUi(form);
form->show();
return app.exec();
}
Code: Alles auswählen
/********************************************************************************
** Form generated from reading ui file 'programm.ui'
**
** Created: Sat Nov 17 15:09:57 2007
** by: Qt User Interface Compiler version 4.3.1
**
** WARNING! All changes made in this file will be lost when recompiling ui file!
********************************************************************************/
#ifndef PROGRAMM_H
#define PROGRAMM_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QDialog>
#include <QtGui/QDialogButtonBox>
class Ui_Dialog
{
public:
QDialogButtonBox *buttonBox;
void setupUi(QDialog *Dialog)
{
if (Dialog->objectName().isEmpty())
Dialog->setObjectName(QString::fromUtf8("Dialog"));
Dialog->resize(400, 300);
buttonBox = new QDialogButtonBox(Dialog);
buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setGeometry(QRect(30, 240, 341, 32));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok);
retranslateUi(Dialog);
QObject::connect(buttonBox, SIGNAL(accepted()), Dialog, SLOT(accept()));
QObject::connect(buttonBox, SIGNAL(rejected()), Dialog, SLOT(reject()));
QMetaObject::connectSlotsByName(Dialog);
} // setupUi
void retranslateUi(QDialog *Dialog)
{
Dialog->setWindowTitle(QApplication::translate("Dialog", "Dialog", 0, QApplication::UnicodeUTF8));
Q_UNUSED(Dialog);
} // retranslateUi
};
namespace Ui {
class Dialog: public Ui_Dialog {};
} // namespace Ui
#endif // PROGRAMM_H
test.pro
Code: Alles auswählen
######################################################################
# Automatically generated by qmake (2.01a) Sat Nov 17 15:10:31 2007
######################################################################
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
# Input
HEADERS += programm.h
FORMS += programm.ui
SOURCES += main.cpp
2. Frage: *Wo* antworte ich auf Ereignisse?
Danke
bueffel