Results 1 to 3 of 3

Thread: QApplication::Session ID problem

  1. #1
    Join Date
    Jun 2010
    Posts
    137
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default QApplication::Session ID problem

    Hi,

    I want to get the session id of my app.For this I have used the QApplication class, but I can't able to get the id infact my app stops working when it get to the QApplication line. Here is my code used for the session id.

    Qt Code:
    1. QString session_ID = app->sessionId();
    2. qDebug()<< session_ID;
    To copy to clipboard, switch view to plain text mode 

    Am I doing anything wrong or missing something.

    Thank You,
    Baluk

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QApplication::Session ID problem

    Yes, what you are doing wrong is simple - 'app' is an invalid pointer (possibly NULL)

    Please look at the various example code for how to properly use QApplication

  3. #3
    Join Date
    Jun 2010
    Posts
    137
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QApplication::Session ID problem

    Thank You squidge. I got the solution. I have to assign "qApp" to my "app" variable. Then I can access the with sessionID();

Similar Threads

  1. Replies: 3
    Last Post: 9th July 2010, 20:55
  2. Replies: 0
    Last Post: 25th November 2009, 15:07
  3. Like a session in PHP
    By wirasto in forum Qt Programming
    Replies: 4
    Last Post: 17th November 2009, 16:55
  4. Problem with QApplication::applicationVersion()
    By Tondog in forum Qt Programming
    Replies: 1
    Last Post: 9th July 2009, 10:25
  5. QApplication shut down problem
    By gsmiko in forum Qt Programming
    Replies: 7
    Last Post: 8th April 2009, 06:58

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.