I'm so impressed with QSqlDatabase. If I set like this..

Qt Code:
  1. QSqlDatabase db=QSqlDatabase::addDatabase(...);
  2. db.setHostName("abc");
To copy to clipboard, switch view to plain text mode 

Then, I can get value "abc" in everywhere with

Qt Code:
  1. qDebug() << QSqlDatabase::database().hostName()
To copy to clipboard, switch view to plain text mode 

I think that is like set $_SESSION["hostName"]="abc" in PHP.
How to create like that with Qt ?