Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Query a sqlite database from QML and/or Javascript?
Forum Update on Monday, May 27th 2025

Query a sqlite database from QML and/or Javascript?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 1.1k Views
  • 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.
  • B Offline
    B Offline
    bundito
    wrote on 5 Aug 2018, 21:50 last edited by
    #1

    Hi! First post!

    I'm trying to develop a desktop widget for KDE Plasma using QML. I've got a bunch of text (random quotes and sayings) in a sqlite database.

    Is there any way I can query this database?

    I know I could write a Qt/C++ backend, but the fact that it needs to be compiled makes distributing it a lot more complicated.

    Any suggestions?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 5 Aug 2018, 21:53 last edited by
      #2

      Hi and welcome to the forums.
      There is
      http://doc.qt.io/qt-5/qtquick-localstorage-qmlmodule.html
      which is pure QML.

      1 Reply Last reply
      1
      • B Offline
        B Offline
        bundito
        wrote on 6 Aug 2018, 11:18 last edited by
        #3

        Right, I've studied that. But there's no way to place an existing database into "LocalStorage", is there?

        M 1 Reply Last reply 6 Aug 2018, 12:17
        0
        • B bundito
          6 Aug 2018, 11:18

          Right, I've studied that. But there's no way to place an existing database into "LocalStorage", is there?

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 6 Aug 2018, 12:17 last edited by
          #4

          @bundito
          Hi
          Tbh, im not sure, but it seem to work out for this poster
          https://forum.qt.io/topic/66567/import-an-external-sqlite-database-to-my-project

          1 Reply Last reply
          0

          1/4

          5 Aug 2018, 21:50

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved