PDA

View Full Version : Missing slots



Mariane
4th February 2006, 23:42
In a file called mazebox.h I have defined signals and slots. But when I run
the program it says "No such slot QWidget::trySlot()".

When I looked back in the Designer, I saw that I couldn't use "Edit" "Connections"
there either. It doesn't show my slots (or signals) and the "Edit slots" option is
grayed out. In fact, the only file the Designer is apparently ready to modify is
this .ui.h file. I didn't manage to tell it to look at my mazebox.h file and list the
signals and slots written there...

How can I do this, please?

Mariane

Mariane
5th February 2006, 02:50
Got it!

In mazebox.h I needed

class MazeBox: public QWidget {
Q_OBJECT
public:
void trySlotInMazeBox();
etc...


and I had forgotten to write Q_OBJECT ... It still compiled but it needed a def
in mazebox.cpp to compile

(By def I mean even an empty def like
void MazeBox::trySignalFromMazebox() {} )

Took me ages, because of course I kept staring at the signal definition and
not a few lignes above...

2H55 AM, going to bed, so good night to everyone in the same time zone.

Mariane