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

mierdatutis mi mmm286 at gmail.com
Mon Jun 22 07:12:33 CEST 2009


Sorry Stephen

I'm newbie and I havent realised.
The ui have:

object:Mainwindow Class:QMainWindow
object centralwidget: class: QWidget
object: boton class QPushButton
object: lista class QListWidget
object: text class QTextEdit

I attach the ui file

Many thanks!!!!
Regards


2009/6/21 Stephen Jackson <spjackson42 at gmail.com>

> 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 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/20090622/5ad482d2/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mainwindow.ui
Type: application/octet-stream
Size: 1501 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090622/5ad482d2/attachment.obj 


More information about the Qt-interest-old mailing list