[Qt-interest] QPushButton can not be connected

Jan janusius at gmx.net
Sat Jul 24 19:54:54 CEST 2010


A closing bracket too much (Signal) and one is missing at the end? (at 
least in the mail)

Jan

Am 24.07.2010 19:32, schrieb Matthias Pospiech:
> I get the error:
> error: no matching function for call to
> 'DialogMicosController::connect(QPushButton*&, const char*)'
> note: candidates are: static bool QObject::connect(const QObject*, const
> char*, const QObject*, const char*, Qt::ConnectionType)
> note:                 bool QObject::connect(const QObject*, const char*,
> const char*, Qt::ConnectionType) const
>
> but in my code it is just a QPushButton  in the ui, which definitely
> should be derived from QObject.
>
> The class looks like this:
>
> ---------------------->
> #ifndef DIALOGMICOSCONTROLLER_H
> #define DIALOGMICOSCONTROLLER_H
>
> #include<QDialog>
>
> namespace Ui {
>      class DialogMicosController;
> }
>
> class QMicosPolluxController;
>
> class DialogMicosController : public QDialog
> {
>      Q_OBJECT
> public:
>      DialogMicosController(QWidget *parent = 0);
>      ~DialogMicosController();
>
> private:
>      void connectSignalSlots();
>      void initValues();
>
> private slots:
>      void OnPushButtonCloseClicked();
>      void OnControllerError(QString error);
>
> private:
>      Ui::DialogMicosController *ui;
> };
>
> #endif // DIALOGMICOSCONTROLLER_H
> <----------------------
>
> as one can see it is only derived once by QDialog from a QObject.
>
> the connect itself looks like this:
> ---------------------->
> DialogMicosController::DialogMicosController(QWidget *parent)
>      :   QDialog(parent)
>      ,   ui(new Ui::DialogMicosController)
>      ,   controller(new QMicosPolluxController)
> {
>      ui->setupUi(this);
>      initValues();
>      connectSignalSlots();
> }
>
> void DialogMicosController::connectSignalSlots()
> {
>      connect(controller, SIGNAL(errorOccurred(QString)), this,
> SLOT(OnControllerError(QString)));
>      connect(ui->pushButtonClose, SIGNAL(clicked())), this,
> SLOT(OnPushButtonCloseClicked());
> }
> <----------------------
>
> What am I doing wrong?
>
> Matthias
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>



More information about the Qt-interest-old mailing list