Results 1 to 3 of 3

Thread: Mouse events in multiple labels

  1. #1
    Join Date
    Jun 2013
    Posts
    46
    Thanks
    24
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Windows

    Question Mouse events in multiple labels

    Good Day,

    I have promoted a label (Label_1) to a class that incorporates
    mouse functions(mouse position, mouse clicked and so forth).

    I have multiple labels that should do the same functionality as the "label_1",
    however different signals must be passed when using different labels

    How do I promote more than 1 label to a class, yet I know which label is being used to pass the different signals.
    Or do I have to create multiple classes for each label.

    Whats the way forward...
    Much appreciated

    Kind Regards

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Mouse events in multiple labels

    QSignalMapper (at least I think that is what your post was trying to ask).

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

    2lights (6th January 2014)

  4. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Mouse events in multiple labels

    Alternatively, since this is your own subclass, just let your signals contain whatever data you need to differentiate the source.

    Cheers,
    _

  5. The following user says thank you to anda_skoa for this useful post:

    2lights (15th January 2014)

Similar Threads

  1. Replies: 1
    Last Post: 17th April 2012, 11:16
  2. Replies: 3
    Last Post: 8th October 2011, 09:46
  3. Designer Plugin - multiple labels button
    By tihoulas in forum Qt Programming
    Replies: 2
    Last Post: 7th October 2010, 20:32
  4. Replies: 2
    Last Post: 10th June 2010, 05:58
  5. mouse moving don't produce mouse events
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2006, 06:13

Tags for this Thread

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.