Results 1 to 10 of 10

Thread: How can I get the thread ID out of QThread

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Join Date
    May 2006
    Posts
    32
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Cool Re: How can I get the thread ID out of QThread

    Maybe, I misunsterstood what you want but... Since the manual tells:

    Quote:
    Warning: The handle returned by this function is used for internal purposes and should not be used in any application code. On Windows, the returned value is a pseudo-handle for the current thread that cannot be used for numerical comparison.
    what about subclassing QThread and pass and int value in the constructor and call THAT value you threadId? After all you can safely use an int getId() function that returns that integer..

    Ok, maybe everybody already thought about this but I had to try
    On Windows, the returned value is a pseudo-handle for the current thread that cannot be used for numerical comparison.
    If so,it behaves as windows api
    HANDLE GetCurrentThread(VOID);
    you can then call DuplicateHandle to thanslate it to real id.
    refer MSDN for dedails.

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

    Artschi (30th May 2006)

Similar Threads

  1. [QT4] QThread and printing a QList<QPixmap>
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 21:44
  2. Workload in a QThread blocks main application's event loop ?
    By 0xBulbizarre in forum Qt Programming
    Replies: 14
    Last Post: 9th April 2006, 21:55
  3. Is it possible to create a QThread without inheriting ?
    By probine in forum Qt Programming
    Replies: 6
    Last Post: 23rd March 2006, 22:51
  4. QProcess in a QThread
    By chombium in forum Qt Programming
    Replies: 2
    Last Post: 11th January 2006, 15:52
  5. Replies: 2
    Last Post: 6th January 2006, 21:15

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.