Results 1 to 20 of 29

Thread: Need 2 widgets without a parent to comunicate

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    70
    Thanked 59 Times in 57 Posts

    Default Re: Need 2 widgets without a parent to comunicate

    Hi,

    Why are you using singals and slots? You have access to "m_winA" and "m_winB" pointers that can be used directly:
    Qt Code:
    1. public slots:
    2. void incoming()
    3. {
    4. if ((m_count++ % 3) == 0)
    5. {
    6. m_winA->show();
    7. m_winB->hide();
    8. }
    9. else
    10. {
    11. m_winA->hide();
    12. m_winB->show();
    13. }
    14. }
    To copy to clipboard, switch view to plain text mode 
    Òscar Llarch i Galán

  2. The following user says thank you to ^NyAw^ for this useful post:

    boblatino (23rd July 2010)

  3. #2
    Join Date
    Jul 2010
    Posts
    23
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows
    Thanks
    13

    Default Re: Need 2 widgets without a parent to comunicate

    Yes, I know that. Its just to depict a simpler case. In my Controller class I have a separate thread that is calling the emit. So the reason to do it is for Qt to process the events in its graphical thread. If I call it directly, QT throws invalid thread exception.

    Thanks
    Ramiro

Similar Threads

  1. Replies: 7
    Last Post: 12th January 2011, 23:01
  2. Replies: 1
    Last Post: 22nd April 2010, 15:34
  3. Replies: 2
    Last Post: 22nd April 2010, 12:44
  4. Replies: 3
    Last Post: 29th May 2008, 14:50
  5. initialize child widgets within parent?
    By ucomesdag in forum Newbie
    Replies: 6
    Last Post: 6th June 2006, 09:11

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