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

Stephen Jackson spjackson42 at gmail.com
Sun Jun 21 21:15:26 CEST 2009


On Sun, Jun 21, 2009 at 10:50 AM, mierdatutis mi wrote:
>
> Thanks..
>
> This is the full code:
>

Erm, no it isn't.

> #include "ui_mainwindow.h"

We don't have the .ui file to generate this. So I make my own project and...

In file included from main.cpp:2:
mainwindowimpl.h:12: error: ‘QListWidgetItem’ has not been declared

So I fix that and...

> MainWindowImpl::MainWindowImpl( QWidget * parent, Qt::WFlags f)
> : QMainWindow(parent, f)
> {
> setupUi(this);
> connect(boton, SIGNAL(clicked()), this, SLOT(sinopsis()));
> connect(lista, SIGNAL( itemClicked(QListWidgetItem*) ), this, SLOT(
> cambio(QListWidgetItem*) ) );
> }
>

> #include "ui_mainwindow.h"

mainwindowimpl.cpp:15: error: ‘boton’ was not declared in this scope
mainwindowimpl.cpp:16: error: ‘lista’ was not declared in this scope

Therein lies a tale. Your main.cpp contains an object (not a pointer)
called lista, but that definitely isn't in scope here.

Somewhere in code that you are refusing to show, you must be declaring
a QListWidget pointer called lista (and also a pointer called boton).

I asked you for "a complete minimal compilable example". If you want
help. please cooperate.

Regards,

Stephen Jackson




More information about the Qt-interest-old mailing list