[Qt-interest] Fwd: problem with signal of QListWidget

Donal O'Connor donaloconnor at gmail.com
Sat Jun 20 14:34:27 CEST 2009


The error only shows when you run the program, it isn't during the compile
stages.

The signatures of the methods/slots are not compatible.

The signal signature must be the same as the slot's.

Have a read of http://doc.trolltech.com/4.5/signalsandslots.html

On Sat, Jun 20, 2009 at 1:20 PM, mierdatutis mi <mmm286 at gmail.com> wrote:

>
> Sorry I don't understand.
>
> I compile with qdevlop and when I compile there is no message of slots.
>
> This is the code that I have:
>
> MainWindowImpl::MainWindowImpl( QWidget * parent, Qt::WFlags f)
>
> : QMainWindow(parent, f)
>
> {
>
> setupUi(this);
>
> connect(boton, SIGNAL(clicked()), this, SLOT(sinopsis()));
>
> connect(lista, SIGNAL( currentItemChanged ( QListWidgetItem *,
> QListWidgetItem *)), this, SLOT(cambio()));
>
> }
>
>  void MainWindowImpl::cambio()
>
> {
>
> QMessageBox msgBox;
>
> msgBox.setText("The document has been modified.");
>
> msgBox.exec();
>
> }
>
>
>
> Thanks
> Regards
>
>
>
>
> ---------- Forwarded message ----------
> From: Alexis Menard <alexis.menard at trolltech.com>
> Date: 2009/6/20
> Subject: Re: [Qt-interest] problem with signal of QListWidget
> To: mierdatutis mi <mmm286 at gmail.com>
> Cc: qt-interest at trolltech.com
>
>
> Look your terminal it should say if it find the slot or not.
> You probably did a mistake in the declaration. As far as i can see the
> signature of the signal/slot doesn't match...
>
> On Jun 20, 2009, at 12:41, mierdatutis mi wrote:
>
>
> Hi,
>
> I'm trying to do a program that when I change the item selected in a list,
> show me in a text the content file (like cat file).
>
> I try to do a signal with a funcion like slot but doesn't works, the
> program doesn't go to the function "cambio".
>
> connect(lista, SIGNAL(currentItemChanged ( QListWidgetItem *,
> QListWidgetItem *)), this,SLOT (cambio()));
>
> Any help?
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090620/7f73910a/attachment.html 


More information about the Qt-interest-old mailing list