Hi, I've been struggling for a few hours with this error now so I joined these boards. I would be most obliged if you could help me figure this out. I'm posting this in the newbie forum because this is my first Qt program and it seems I'm making some silly mistake.

I have a MainForm class, which has various QWidgets as members and a DotListBox class, which inherits from QListBox. When I try to connect the DotListBox::currentChanged() signal to the MainForm::currentChanged slot, I get a "no such signal error" at run-time.

This is mainform.h. The program's main function just constructs this object and calls MainForm::execute().

Qt Code:
  1. class MainForm : public QObject
  2. {
  3. Q_OBJECT
  4. private:
  5. Points points;
  6. QHBox hbox;
  7. QVBox vbox;
  8. DotListBox listbox;
  9. QPushButton remove;
  10. DotWidget dots;
  11. public slots:
  12. void currentChanged(QListBoxItem *);
  13. void removeClicked();
  14. public:
  15. MainForm(int argc, char *argv[]);
  16. ~MainForm();
  17. int Execute();
  18. };
To copy to clipboard, switch view to plain text mode 

This is the constructor of MainForm:

Qt Code:
  1. MainForm::MainForm(int argc, char *argv[])
  2. : points()
  3. , app(argc, argv)
  4. , hbox(0)
  5. , vbox(&hbox)
  6. , listbox(&vbox, &points)
  7. , remove("&Remove", &vbox)
  8. , quit("&Quit", &vbox)
  9. , dots(&hbox, &points)
  10. {
  11. QObject::connect(
  12. &quit, SIGNAL(clicked()),
  13. &app, SLOT(quit())
  14. );
  15. QObject::connect(
  16. &listbox, SIGNAL(currentChanged()),
  17. this, SLOT(currentChanged())
  18. );
  19. QObject::connect(
  20. &remove, SIGNAL(clicked()),
  21. this, SLOT(removeClicked())
  22. );
  23. }
To copy to clipboard, switch view to plain text mode 

The signals related to the quit and remove buttons connect fine to their slots.

This is the dotlistbox.h header file:

Qt Code:
  1. class DotListBox : public QListBox, public Observer
  2. {
  3. private:
  4. Points *points;
  5. public:
  6. DotListBox(QWidget *parent, Points *p = NULL);
  7. virtual ~DotListBox();
  8. void Update();
  9. };
To copy to clipboard, switch view to plain text mode 

As you can see, it also inherits from an Observer class, of which it implements the Update() function. The problem is that I can't connect the currentChanged() signal of my derived listbox to the currentChanged() slot of MainForm.

Qt Code:
  1. ./dots
  2. Xlib: extension "XInputExtension" missing on display ":1.0".
  3. Failed to get list of devices
  4. QObject::connect: No such signal QListBox::currentChanged()
  5. QObject::connect: (sender name: 'mylistbox')
  6. QObject::connect: (receiver name: 'unnamed')
To copy to clipboard, switch view to plain text mode 

(The Xlib error seems to be FreeBSD specific, I'm blissfully ignoring that for the moment.)

My hunch is that the problem is that DotListBox is derived from QListBox and that the signal slots don't get inherited, but I'm not sure.

Thanks in advance for any help.