Results 1 to 2 of 2

Thread: Connect two signal to function

  1. #1
    Join Date
    Apr 2014
    Location
    PÅ‚ock, Poland
    Posts
    13
    Thanks
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Connect two signal to function

    How to connect two signal from XMLListModel to one function (if xmllistmodel1 and xmllistmodel2 have status=ready run function, if not=wait)
    Qt Code:
    1. onStatusChanged: if ( xmlModelReceived.status == XmlListModel.Ready && xmlModelSended.status== XmlListModel.Ready)
    2. {
    3. function();
    4. }
    To copy to clipboard, switch view to plain text mode 
    This is work, but now always, because sometimes xmllistmodel2 is not ready, so function doesn't wait.
    Thanks for reply.
    Last edited by updaterr; 13th June 2014 at 18:04.

  2. #2
    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: Connect two signal to function

    You could move the check into the function and then call it from the onStatusChanged of both models.

    Cheers,
    _

Similar Threads

  1. Replies: 2
    Last Post: 26th October 2013, 05:40
  2. How to connect signal to signal in QWidget correctly
    By Mint87 in forum Qt Programming
    Replies: 2
    Last Post: 6th February 2013, 00:06
  3. Replies: 4
    Last Post: 14th August 2011, 15:37
  4. Replies: 13
    Last Post: 30th November 2010, 12:47
  5. Connect signal/signal in Qt Designer
    By jlemaitre in forum Newbie
    Replies: 1
    Last Post: 22nd September 2010, 15:53

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.