Results 1 to 4 of 4

Thread: Giving reference to QThread

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Giving reference to QThread

    Hello Friends,

    I try today to give a thread a reference from a std::map. The thread have to fill the map but the run finction say that the reference variable are not declared in that scope ..

    so the constructor looks like this
    Qt Code:
    1. using namespace std;
    2. ....
    3.  
    4. MyThread::MyThread(map <int> &p_Map,
    5. QObject* parent): QThread(parent)
    6. {
    7. }
    8.  
    9. MyThread::run()
    10. {
    11. //using p_Map;
    12. }
    To copy to clipboard, switch view to plain text mode 

    and I try to use it in run()

    is giving a reference to thread not allowed???


    Or what is the best method to fill a map or a vector within a thread????
    Last edited by codeman; 24th March 2010 at 22:02.

Similar Threads

  1. Replies: 2
    Last Post: 5th March 2010, 18:38
  2. giving main window a name?
    By oji in forum Qt Programming
    Replies: 2
    Last Post: 16th November 2009, 11:13
  3. Layout not giving space equally
    By gruszczy in forum Qt Programming
    Replies: 1
    Last Post: 2nd January 2009, 22:49
  4. QFontMetrics not giving proper dimension
    By Gopala Krishna in forum Qt Programming
    Replies: 3
    Last Post: 7th October 2006, 15:00
  5. Suggestions in giving to my application a cool look
    By SkripT in forum Qt Programming
    Replies: 8
    Last Post: 2nd May 2006, 18:30

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.