Results 1 to 4 of 4

Thread: Run database application from Konqueror

  1. #1
    Join Date
    Aug 2007
    Posts
    244
    Thanks
    42
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Run database application from Konqueror

    Maybe my problem is very stupid but when i launch my application, that reads a sqlite3 database file, from the console it works good but if I click on the executable I got an error on db.open() and in my home is created a file whose name is the same of the database.

    Where is the mistake?

    Thanks,
    Giuseppe
    Giuseppe CalÃ

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Run database application from Konqueror

    The mistake is that you didn't post any code .
    So please do...

  3. #3
    Join Date
    Aug 2007
    Posts
    244
    Thanks
    42
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Run database application from Konqueror

    Here the code:

    Qt Code:
    1. bool MainWindow::createConnection()
    2. {
    3. db.setDatabaseName("gmcdb");
    4. if (!db.open()) {
    5. QMessageBox::critical(0, Strings::dbOpenErrorTitle,
    6. Strings::dbOpenErrorContent, QMessageBox::Cancel);
    7. return false;
    8. }
    9. return true;
    10. }
    To copy to clipboard, switch view to plain text mode 

    Thanks
    Giuseppe CalÃ

  4. #4
    Join Date
    Aug 2007
    Posts
    244
    Thanks
    42
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Run database application from Konqueror

    A guy of an other forum helped me finding the solution:

    Qt Code:
    1. db.setDatabaseName(QApplication::applicationDirPath() + QDir::separator() + "gmcdb");
    To copy to clipboard, switch view to plain text mode 

    Bye
    Giuseppe CalÃ

Similar Threads

  1. Threads and database connection
    By probine in forum Qt Programming
    Replies: 9
    Last Post: 7th August 2013, 08:30
  2. QSkinWindows Classes
    By kernel_panic in forum Qt-based Software
    Replies: 45
    Last Post: 20th April 2010, 12:35
  3. dll + application
    By fpujol in forum Qt Programming
    Replies: 11
    Last Post: 15th April 2007, 18:37
  4. My application can't connect to database when deploy it???
    By gtthang in forum Installation and Deployment
    Replies: 1
    Last Post: 15th February 2006, 11:01

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.