PDA

View Full Version : QApplication::Session ID problem



baluk
8th December 2010, 21:28
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.



QApplication *app;
QString session_ID = app->sessionId();
qDebug()<< session_ID;


Am I doing anything wrong or missing something.

Thank You,
Baluk

squidge
8th December 2010, 21:43
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

baluk
9th December 2010, 09:55
Thank You squidge. I got the solution. I have to assign "qApp" to my "app" variable. Then I can access the with sessionID();