Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Problem with querymodel example model

    Mobile and Embedded
    2
    4
    749
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      arinbluse last edited by

      Hi,

      I'm sorry to that did not English well

      I'm studying qt5, this site example.

      Linux

      my problem site link is here.

      qt-project.org/doc/qt-5.0/qtsql/querymodel.html

      but I'dont know why this problem message.

      /////////////////////////////////////////////////////////////////////////////////////////////
      Starting /root/build-model-Desktop_Qt_5_1_0_GCC_32bit-Debug/model...

      (model:2139): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

      QSqlQuery::exec: database not open
      QSqlQuery::exec: database not open
      QSqlQuery::exec: database not open
      OpenGL Warning: Failed to connect to host. Make sure 3D acceleration is enabled for this VM.

      /root/build-model-Desktop_Qt_5_1_0_GCC_32bit-Debug/model exited with code 0

      ////////////////////////////////////////////////////////////////////////////////////////////////

      I want to solve this problem.

      please help me.

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi and welcome to devnet,

        "database not open", did you setup your database correctly ?

        Also, why are you developing as root ? It's very bad practice even if you are the only one using the virtual machine.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • A
          arinbluse last edited by

          Thank you rely SGaist !!

          I'm appreciated your advice.

          you say "your database correctly"

          that what mean ?

          I using database in mysql

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            It means, did you properly use QSqlDatabase to create a connection to your database ? Did you call open ? Check that it succeeded etc...

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply Reply Quote 0
            • First post
              Last post