Ich bin zur Zeit in einem Praktikum und muss dafür QT 4 lernen ,leider hate ich in QT, sowie C++ nie programmiert. Ich hab zu allem übel nur ein QT3 Buch zum lesen und da sind einige Teile veraltet ,bisher konnte ich das sehr gut lösen aber bei einer Stelle haperts ,da komm ich nicht weiter...
ich poste mal meinen code
finddialog.h
Code: Alles auswählen
/*
* main.h
* QT_FE_2_1
*
* Created by Alexander on 17.02.09.
* Copyright 2009 __MyCompanyName__. All rights reserved.
*
*/
#ifndef FINDDIALOG_H
#define FINDDIALOG_H
#include <qdialog.h>
class QCheckBox;
class QLabel;
class QLineEdit;
class QPushButton;
class FindDialog : public QDialog
{
Q_OBJECT
public:
FindDialog(QWidget *parent = 0, const char *name = 0);
signals:
void findNext(const QString &str, bool caseSensitive);
void findPrev(const QString &str, bool caseSensitive);
private slots:
void findClicked();
void enableFindButton(const QString &text);
private:
QLabel *label;
QLineEdit *lineEdit;
QCheckBox *caseCheckBox;
QCheckBox *backwardCheckBox;
QPushButton *findButton;
QPushButton *closeButton;
};
#endif
hier meine finddialog.cpp
Code: Alles auswählen
/*
* main.cpp
* QT_FE_2_1
*
* Created by Alexander on 17.02.09.
* Copyright 2009 __MyCompanyName__. All rights reserved.
*
*/
#include <qcheckbox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include "finddialog.h"
FindDialog::FindDialog(QWidget *parent,const char *name) : QDialog(parent,name)
//Hier tritt der Fehler auf
{
setWindowTitle(tr("Find"));
label = new QLabel(tr("Find &what:"), this);
lineEdit = new QLineEdit(this);
label->setBuddy(lineEdit);
caseCheckBox = new QCheckBox(tr("Match &case"), this);
backwardCheckBox = new QCheckBox (tr("Search &backward"), this);
findButton = new QPushButton(tr("&Find"), this);
findButton->setDefault(true);
findButton->setEnabled(false);
closeButton = new QPushButton(tr("Close"), this);
connect(lineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(enableFindButton(<#const QString#> &)));
connect(findButton, SIGNAL(clicked()), this, SLOT(findclicked()));
connect(closeButton, SIGNAL(clicked()),this,SLOT(close()));
QHBoxLayout *topLeftLayout = new QHBoxLayout;
topLeftLayout->addWidget(label);
topLeftLayout->addWidget(lineEdit);
QVBoxLayout *leftLayout = new QVBoxLayout;
leftLayout->addLayout(topLeftLayout);
leftLayout->addWidget(caseCheckBox);
leftLayout->addWidget(backwardCheckBox);
QVBoxLayout *rightLayout = new QVBoxLayout;
rightLayout->addWidget(findButton);
rightLayout->addWidget(closeButton);
rightLayout->addStretch(1);
QHBoxLayout *mainLayout = new QHBoxLayout(this);
mainLayout->setMargin(11);
mainLayout->setSpacing(6);
mainLayout->addLayout(leftLayout);
mainLayout->addLayout(rightLayout);
}
der fehler erscheint bei meinem Kommentat,der Compiller meldet:
no matching function for Call to 'QDialog::QDialog(QWidget*&, const char*&)'
Hat jemand von euch vielleicht jemand einen Rat wie ich das lösen kann ?
Was besagt diese Fehlermeldung genau und wodurch tritt der Fehler auf ?
zur Information, das Buch um welches es sich handelt ist: C++ Gui Programming with Qt3
von Jasmin Blanchette
und Mark Summerfield
Vielen Dank für Eure Antworten im Vorraus