Results 1 to 5 of 5

Thread: Calling a method in another class; erro Sqlite.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2015
    Posts
    3

    Default Re: Calling a method in another class; erro Sqlite.

    Quote Originally Posted by anda_skoa View Post
    Where do you call the methods that log the errors?

    Cheers,
    _
    Here after Call:

    Qt Code:
    1. MainSystem *ms= new MainSystem(this);
    2. ms->tableView_listSales();
    To copy to clipboard, switch view to plain text mode 

    I think , that the problem is a connection:


    Qt Code:
    1. #define controller "QSQLITE"
    2.  
    3. bool connection::openBD()
    4. {
    5.  
    6. if(!QSqlDatabase::isDriverAvailable(controller)){
    7. return false;
    8. }
    9. base = QSqlDatabase::addDatabase(controller);
    10. base.setDatabaseName(m_name);
    11. return base.open();
    12. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: Calling a method in another class; erro Sqlite.

    Quote Originally Posted by Soft View Post
    Here after Call:

    Qt Code:
    1. MainSystem *ms= new MainSystem(this);
    2. ms->tableView_listSales();
    To copy to clipboard, switch view to plain text mode 
    You forgot to post the "after" code :-)

    Quote Originally Posted by Soft View Post
    I think , that the problem is a connection:
    Maybe you are accidentally calling it more than once?

    Cheers,
    _

  3. #3
    Join Date
    Aug 2015
    Posts
    3

    Default Re: Calling a method in another class; erro Sqlite.

    Quote Originally Posted by anda_skoa View Post
    You forgot to post the "after" code :-)


    Maybe you are accidentally calling it more than once?

    Cheers,
    _
    I think so .

Similar Threads

  1. Calling a method from a non-member method
    By AndresBarbaRoja in forum Newbie
    Replies: 5
    Last Post: 19th March 2011, 11:38
  2. Replies: 7
    Last Post: 2nd September 2010, 20:42
  3. error calling method using connect
    By jeffmetal in forum Newbie
    Replies: 4
    Last Post: 22nd April 2010, 19:09
  4. Replies: 1
    Last Post: 30th March 2009, 17:07
  5. Replies: 3
    Last Post: 16th May 2007, 12:07

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.