[Qt-interest] Signal Slot not working

tang ke tangk at lemote.com
Wed Jun 23 09:49:08 CEST 2010


于 2010年06月21日 05:09, Matthias Pospiech 写道:
> I have a dll emitting error messages:
>
> void QMicosPolluxController::Error(const char * errorMessage)
> {
>     emit errorOccurred(toQString(errorMessage));
> }
>
>
> which is handled in the gui (using the dll)
> void DialogMicosController::connectSignalSlots()
> {
>     connect(controller, SIGNAL(errorOccurred(QString)), this, 
> SLOT(OnControllerError()));
>   
you should write the next:

    connect(controller, SIGNAL(errorOccurred()), this, 
SLOT(OnControllerError()));


> }
> void DialogMicosController::OnControllerError(QString error)
> {
>     ui->labelError->setText(error);
> }
>
> However the function OnControllerError is never called.
> If I copy all classes to the gui project (thus no dll), the effect is 
> exactly the same.
> The SLOT is never called.
>
> 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