Results 1 to 2 of 2

Thread: how to convert QThread::currentThread() to QString?

  1. #1
    Join Date
    May 2010
    Location
    slovakia
    Posts
    47
    Thanks
    10
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Maemo/MeeGo

    Lightbulb how to convert QThread::currentThread() to QString?

    how to convert QThread::currentThread() to Qstring? i want to use it as unique identificator (for example (0x22ff48)) for each 'game room' where each is running in separate thread.

  2. #2
    Join Date
    Apr 2010
    Location
    Rostov-na-Donu, Russia
    Posts
    153
    Thanks
    2
    Thanked 26 Times in 23 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to convert QThread::currentThread() to QString?

    Qt Code:
    1. QString( "0x%1" ).arg( (int)QThread::currentThread(), 16 );
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to borisbn for this useful post:

    daemonna (15th July 2010)

Similar Threads

  1. how can we convert QByteArray to Qstring?
    By learning_qt in forum Qt Programming
    Replies: 2
    Last Post: 21st July 2009, 14:05
  2. Determine if QThread::currentThread is main thread?
    By chaoticbob in forum Qt Programming
    Replies: 2
    Last Post: 17th December 2008, 06:26
  3. convert QString to int
    By mattia in forum Newbie
    Replies: 2
    Last Post: 4th January 2008, 09:10
  4. how to convert int to QString?
    By phillip_Qt in forum Newbie
    Replies: 2
    Last Post: 5th October 2007, 08:07
  5. How to convert Int to QString in QT4?
    By drake1983 in forum Newbie
    Replies: 2
    Last Post: 11th March 2007, 06:58

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.