Results 1 to 4 of 4

Thread: array of QPushButton

  1. #1
    Join Date
    Jul 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default array of QPushButton

    Hello folks,

    how can I manage, that every button sends some idenification (e.g. his index in the array) to the console, when it is clicked?

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 268 Times in 268 Posts
    Wiki edits
    20

    Default Re: array of QPushButton

    There are a couple of ways to do this:

    1. Subclass QPushbutton, create a setting for an ID, implement custom signals etc...
    2. Use a QDialogButtonBox
    3. Use a QSignalMapper
    4. Use the sender() function to know who sent the signal

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 334 Times in 317 Posts

    Default Re: array of QPushButton

    You can also use objectName or some custom property to identify the button

  4. #4
    Join Date
    Jul 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: array of QPushButton

    Hi folks,

    many thanks for your answers! I could solve the problem.

    Erich

Similar Threads

  1. declare an array of QSemaphore and array of slot functions
    By radeberger in forum Qt Programming
    Replies: 11
    Last Post: 2nd May 2010, 13:24
  2. Replies: 0
    Last Post: 22nd February 2010, 09:30
  3. 2D Array
    By ctote in forum Qt Programming
    Replies: 5
    Last Post: 27th January 2010, 10:57
  4. Min and Max value in array
    By Benjamin in forum Qt Programming
    Replies: 13
    Last Post: 27th February 2009, 14:19
  5. Replies: 3
    Last Post: 26th September 2006, 12:16

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
  •  
Qt is a trademark of The Qt Company.