PDA

View Full Version : Example code and metaObject question



bruccutler
12th January 2007, 18:07
Hello,
I'm very new (can you say less than one week) to Qt. I'm going through the tutorials now.

I have two questions:
1. Where can I find more example code than what is on the TrollTech site. If I could find an example of the following, I wouldn't have to ask the question.
2. I want to know if a particular class has a particular slot. I'm attempting to use the following function to determine is slider has a slot called "valueChanged" slider->metaObject()->indexOfSlot("valueChanged");

I know that it has this slot, but the return value from this function is -1. What is the format of the input to indexOfSlot() supposed to be?

- BC

jacek
12th January 2007, 18:34
valueChanged() isn't a slot, but a signal --- that's why it returns -1.

You can find some examples in %QTDIR%\examples directory.