Results 1 to 3 of 3

Thread: Connection doesn't work

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

    Default Connection doesn't work

    Hi,

    Why this code don't connect,
    Qt Code:
    1. bool bC1 = connect(this,SIGNAL(emetreImatge(const HImage&,bool,int,int)),
    2. (QObject*)m_pqMagicQt,SLOT(PintarImatge(const HImage&,bool,int,int)),
    3. Qt::QueuedConnection);
    To copy to clipboard, switch view to plain text mode 

    and this other one connect:
    Qt Code:
    1. bool bC1 = connect(this,SIGNAL(emetreImatge(HImage,bool,int,int)),
    2. (QObject*)m_pqMagicQt,SLOT(PintarImatge(HImage,bool,int,int)),
    3. Qt::QueuedConnection);
    To copy to clipboard, switch view to plain text mode 

    I have redefined the slot with "const HImage&" in the first way but it doesn't going well.

    I have looked at "examples/threads/mandelbrot" and I am doing the same: conecting one working Thread with the Main Thread(for GUI displaying).

    I also have registered the "HImage" with:
    Qt Code:
    1. int iIDRImatge = qRegisterMetaType<HImage>("HImage");
    To copy to clipboard, switch view to plain text mode 


    Any idea?

    Thanks,
    Last edited by jacek; 20th March 2007 at 21:24. Reason: wrapped too long lines
    Òscar Llarch i Galán

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

    Default Re: Connection doesn't work

    A wild guess is that the signal or slot doesn't send/accept a reference. What warning message do you get during connection?

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

    Default Re: Connection doesn't work

    Hi,

    Sorry wysota, I have forgiven to redefine the signal in the header file:
    Qt Code:
    1. void emetreImatge(const HImage&,bool,int,int);
    To copy to clipboard, switch view to plain text mode 

    Now it connects perfectly.

    Thanks for your reply
    Òscar Llarch i Galán

Similar Threads

  1. Threads and database connection
    By probine in forum Qt Programming
    Replies: 9
    Last Post: 7th August 2013, 08:30
  2. Replies: 3
    Last Post: 22nd June 2006, 16:27
  3. How do I keep the client connection open ?
    By probine in forum Newbie
    Replies: 2
    Last Post: 25th March 2006, 19:06
  4. Replies: 10
    Last Post: 6th March 2006, 16:08
  5. Can I launch a dial-up connection in Windows?
    By gtthang in forum Qt Programming
    Replies: 3
    Last Post: 9th February 2006, 12:32

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.