Results 1 to 2 of 2

Thread: Example code and metaObject question

  1. #1
    Join Date
    Jan 2007
    Posts
    91
    Thanks
    21
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Example code and metaObject question

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Example code and metaObject question

    valueChanged() isn't a slot, but a signal --- that's why it returns -1.

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.