Results 1 to 2 of 2

Thread: Inherit and Overwrite signals

  1. #1
    Join Date
    Sep 2006
    Posts
    1
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Inherit and Overwrite signals

    Alright, I'm working on a Qt project using C++ compiling with mingw on a windows machine. What I'm trying to do is to create a new QListWidget that takes the signal currentItemChange and make it do something other than the default behavior. Right now I created a class that inherits QListWidget and just redeclared the signal, but it seems that is not a possibility. I get an error in the moc code file saying that it's already been declared.

    Am I thinking about this right? Basically all I'm trying to do is to grab the signal and use it. Any help would be appreciated.

    Thanks ahead of time.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Inherit and Overwrite signals

    Quote Originally Posted by shaselsc
    Right now I created a class that inherits QListWidget and just redeclared the signal, but it seems that is not a possibility. I get an error in the moc code file saying that it's already been declared.
    Yes, it's not possible to override signals.

    Basically all I'm trying to do is to grab the signal and use it. Any help would be appreciated.
    So you could just connect your custom slot (in the subclass) to the signal declared and emitted by the base class.
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    shaselsc (9th October 2006)

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.