Page 2 of 2 FirstFirst 12
Results 21 to 27 of 27

Thread: Dynamically created buttons.

  1. #21
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Thumbs up Re: Dynamically created buttons.

    hi,
    should I use disconnect() to disconnect all signals
    u should disconnect all the buttons.
    one button's disconnect will disconnect only that signal.

    hope it helps
    Bala

  2. #22
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Dynamically created buttons.

    Quote Originally Posted by BalaQT View Post
    u should disconnect all the buttons.
    one button's disconnect will disconnect only that signal.
    I suggest you do that experiment as well, BalaQT.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #23
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Dynamically created buttons.

    hi wysota,
    thnks fr ur reply
    I suggest you do that experiment as well, BalaQT.
    i tried and following are the outputs.
    when i try
    Qt Code:
    1. disconnect(btn[0],0,0,0); //disconnect single buttons
    2. sigMap->disconnect(); //disconnect all signals from sigMap
    To copy to clipboard, switch view to plain text mode 

    @Tomasz: should I use disconnect() to disconnect all signals (from created buttons) from slots.
    so to disconnect all signals , use sigMap->disconnect();

    Bala

  4. #24
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Dynamically created buttons.

    That was not the point. Delete all the objects and see if the connections are still valid.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #25
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Dynamically created buttons.

    Quote Originally Posted by wysota View Post
    That was not the point. Delete all the objects and see if the connections are still valid.
    hi wysota,
    i tried and when we delete all the objects, connections are also deleted.

    Bala

  6. #26
    Join Date
    Jul 2010
    Location
    Poland
    Posts
    184
    Thanks
    70
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Dynamically created buttons.

    Quote Originally Posted by wysota View Post
    That was not the point. Delete all the objects and see if the connections are still valid.
    You're right. Nice feature of qDeleteAll().

    Thanks again!
    best regards
    Tomasz

  7. #27
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Dynamically created buttons.

    It's not a feature of qDeleteAll, when you delete a particular object, its connections are always broken. qDeleteAll is an equivalent of:
    Qt Code:
    1. foreach(item *i, container){
    2. delete i;
    3. }
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. The following user says thank you to wysota for this useful post:

    Tomasz (2nd December 2010)

Similar Threads

  1. Dynamically creating buttons from Xml file
    By chandru@080 in forum Newbie
    Replies: 5
    Last Post: 25th November 2010, 10:34
  2. PaintEvent() in a dynamically created and destroyed objet not working.
    By savaliya_ambani in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 20th October 2010, 08:49
  3. Check has created with new
    By wirasto in forum Qt Programming
    Replies: 5
    Last Post: 16th March 2010, 16:02
  4. QMainWindow ignores dynamically created, floating QDockWidget
    By stefanadelbert in forum Qt Programming
    Replies: 1
    Last Post: 2nd March 2010, 01:06
  5. Line not being created
    By Kapil in forum Newbie
    Replies: 4
    Last Post: 30th March 2006, 06:49

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.