qt-interest@trolltech.com
[Top] [All Lists]

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

Subject: Re: [Qt-interest] Fwd: problem with signal of QListWidget
From: Stephen Jackson
Date: Sun, 21 Jun 2009 20:15:26 +0100
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

_______________________________________________
Qt-interest mailing list
Qt-interest@xxxxxxxxxxxxx
http://lists.trolltech.com/mailman/listinfo/qt-interest

<Prev in Thread] Current Thread [Next in Thread>