Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. database
    Log in to post

    • UNSOLVED Qt C++ FireBase Update Unique Value
      General and Desktop • c++ qt5 database firebase • • OguzhanOzturk  

      2
      0
      Votes
      2
      Posts
      94
      Views

      Hi, Not knowing the FreeBase API it's hard to answer. Do you have a link of it ? In any case, the worst case scenario would be to fetch the whole data, change the fields you want and then send again the whole data.
    • SOLVED QSqlTableModel removeRow() not removing records from some tables ?
      General and Desktop • database sqlite qsqltablemodel qsqlite • • R-P-H  

      5
      0
      Votes
      5
      Posts
      158
      Views

      The QSqlTableModel needs a real PK, yes.
    • SOLVED How to insert Qxlsx data into sqlite database table?
      QML and Qt Quick • database qsqldatabase sqlite database qml qxlsx dat • • Joshika_Namani  

      16
      0
      Votes
      16
      Posts
      612
      Views

      @JonB sorry for that, insert into Dataset(AT) values(?): I know nothing about SQLite. Dataset(AT) is a (syntactically valid) table to insert into, is it? Yes, it is valid statement in sqlite. Also QSqlQuery::prepare() returns a bool for success/failure, which you should be checking. Returns true if the query is prepared successfully; otherwise returns false. Plus, you check QSqlDatabase::lastError() after QSqlQuery::exec() fails, but that says yes, I got error. like QSqlError("","",""); I checked again there was a problem in database but it solved thanks alot. Now, I'm able to insert data into database from QXlsx file.
    • UNSOLVED GUI Freeze on Multi-Thread Application
      General and Desktop • database serial port threading freeze multi-thread • • mvsri  

      5
      0
      Votes
      5
      Posts
      333
      Views

      Hi, What kind of popup are triggering the freeze ?
    • UNSOLVED MySQL Connection failed,but i entered correct info of server
      General and Desktop • c++ database server qt6.0.1 msyql • • ELEMENTICY  

      16
      0
      Votes
      16
      Posts
      598
      Views

      @ELEMENTICY said in MySQL Connection failed,but i entered correct info of server: I tried it,it doesnt work. Can you help again xD You need to provide details of what you tried and what errors you got. Without the details, we can't help you.
    • SOLVED QT MySQL Databese connect fail
      General and Desktop • c++ mysql database qt5.9.2 localhost • • ELEMENTICY  

      4
      0
      Votes
      4
      Posts
      243
      Views

      @Christian-Ehrlicher yes,i just realize i forget to add sql to QT += core gui sql thanks for respone anyway
    • SOLVED QSQLITE app no connect to database after deploy
      General and Desktop • database deploy qsqlite • • Piotrek102  

      13
      0
      Votes
      13
      Posts
      478
      Views

      @Piotrek102 said in QSQLITE app no connect to database after deploy: But what I sent you is not the main application file. It's part of the class I wrote It doesn't matter. What @JonB wrote applies.
    • UNSOLVED Architectural advice ... DB, Server, REST Api and Qt Apps
      General and Desktop • database rest m2m • • Heinz  

      7
      0
      Votes
      7
      Posts
      335
      Views

      Regarding your stack : Internet server with Windows : I really think Windows really have no added value in this area. Installing a DBMS like MySQL or MSSQL : you might be interested in NoSQL kind of database as you probably have limited relations between your data. I think some database also integrate out of the shelves a Rest or Curl API, at least that used to be the case with couchDb for instance No direct access to the database from outside for safety reasons Instead writing an API that runs on the server and allows indirect DB Access via predefined (HTTP?) Requests. if possible, aim for HTTPS right from the start. Regarding the authentification, for a pet project I have been relying on Wordpress to manage user management through REST, I am not sure tough it is actually a good solution but at least it is cheap and quite easy to set up.
    • SOLVED SQLite database creation
      General and Desktop • mysql database qsqlite sqllite • • Giggon  

      6
      0
      Votes
      6
      Posts
      410
      Views

      @Giggon said in SQLite database creation: Thread to be closed Please go and mark the post as solved. Thanks
    • UNSOLVED QTabWidget, how to load some data in QScrollArea from a database inside QTabWidget
      General and Desktop • database sqlite qtabwidget qscrollarea • • moslehuddin  

      2
      0
      Votes
      2
      Posts
      204
      Views

      @moslehuddin You should be more precise when asking a question. What exactly are you asking? How to get data from a database? How to show it? Both? How to use QScrollArea? Qt SQL: https://doc-snapshots.qt.io/qt5-5.14/qtsql-index.html How to show the data: https://doc.qt.io/qt-5/qsqltablemodel.html and https://doc.qt.io/qt-5/qtableview.html How to use QScrollArea: https://doc.qt.io/qt-5/qscrollarea.html
    • SOLVED Building QT with "windeployqt": not connect to database (ODBC)
      Installation and Deployment • build database windeployqt odbc • • AndreaCT  

      24
      0
      Votes
      24
      Posts
      1047
      Views

      @JSher said in Building QT with "windeployqt": not connect to database (ODBC): Its connecting to an OBDC entry in windows by the looks of it. I do not use ODBC much but the way I understand it is you have to make the entry on each machine....Thats why I use the standard mysql connector, then you do not. I could be off:) Ok thank you very much!!! I evaluate the transition to the mysql connector
    • Problem with SQLite Database and threads "Database is locked"
      General and Desktop • database thread • • davidesalvetti  

      14
      0
      Votes
      14
      Posts
      3238
      Views

      @davidesalvetti Hmm, I am not very confident in your solution. I would create a helper class to create/use right connection according to current thread. Something like this (it is just a skeleton, not sure it is working as it is): #include <QSqlDatabase> #include <QThread> class MyBDConnection { QString m_dbPath; QString m_dbName; Q_DISABLE_COPY(MyBDConnection) public: explicit MyBDConnection(const QString &sqlitePath, const QString &cnxName): m_dbPath(sqlitePath), m_dbName(cnxName) {} QSqlDatabase getDBConnection() { // Starting with Qt 5.11, sharing the same connection between threads is not allowed. // Use a dedicated connection for each thread requiring access to the database, // using the thread address as connection name. QSqlDatabase cnx; QString dbName = QStringLiteral("%1_%2").arg(m_dbName).arg(qintptr(QThread::currentThreadId()), 0, 16); if(QSqlDatabase::contains(dbName)) { cnx = QSqlDatabase::database(dbName); } else { cnx = QSqlDatabase::addDatabase(QStringLiteral("QSQLITE"), dbName); cnx.setDatabaseName(m_dbPath); if (!cnx.isValid() || !cnx.open()) { qDebug() << "DB connection creation error!"; } } return cnx; } } And the only create on instance of this class and pass the pointer to each class which need connection to DB.
    • SOLVED Showing data from multiple SQLite tables
      General and Desktop • database model-view sqlite view • • Pl45m4  

      7
      0
      Votes
      7
      Posts
      1262
      Views

      @Christian-Ehrlicher Hm ok... That's not what I wanted to hear :D Thank you anyway. I think, I will subclass QSqlQueryModel then and write functions to make the model writable...
    • SOLVED cannot execute queries on a database
      General and Desktop • database qtsql • • user4592357  

      8
      0
      Votes
      8
      Posts
      1509
      Views

      @EdwinSA said in cannot execute queries on a database: but the queries are not running And what does this mean? btw: QSqlQuery has some functions to get the error string - you should use them.
    • SOLVED How to share database connection parameters between multiple QSqlTableModel objects?
      QML and Qt Quick • database qsqltablemodel qsqldatabase models model binding • • ivarec  

      6
      0
      Votes
      6
      Posts
      873
      Views

      From the looks of it, you have to re-create the models when you change these settings.
    • SOLVED what is the correct way to implement a Database class in a application
      General and Desktop • qt5.5 database desktop sqlite • • realhamidrezakp  

      10
      0
      Votes
      10
      Posts
      1399
      Views

      What do you mean by modify the model ? i mean updating model , like a search window that needs to update model every time user change input. You can see how to handle QtSQL models and views in the QtSQL modules examples. i saw it, and figure out some of examples. but i need to read more about MVC in qt. thanks you.
    • UNSOLVED check date called from firebase against calendar?
      General and Desktop • qml database calendar firebase date • • Ldweller  

      10
      0
      Votes
      10
      Posts
      1498
      Views

      @mrjj I have moved forward from calling my saved dates to receive the following: Read Value: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object] for key: dates (one for each date saved) when adding if(success) { console.log(JSON.stringify(value)) } I can also read the saved dates in the format of: [{"date":"2018-10-01T21:17:00.926"},{"date":"2018-10-02T12:00:00.000"},{"date":"2018-10-03T12:00:00.000"},{"date":"2018-10-06T12:00:00.000"},{"date":"2018-10-07T12:00:00.000"},{"date":"2018-10-08T12:00:00.000"}] now how would I determine these dates are saved in my calendar to add the marker? I have tried adding a property bool to the marker so the read value equals isMarked = true yet this either marks every date on the calendar or none at all depending on how I am working this?!? How would I convert the JSON string to individual date reads?
    • UNSOLVED QMYSQL driver not loaded in os windows
      Persian • c++ mysql database qt5.9 • • javad935  

      3
      0
      Votes
      3
      Posts
      1787
      Views

      I have add C:\mysql\mysql-5.7.21-winx64\lib into path variable. but don't work!
    • SOLVED Best approach to create a media library
      General and Desktop • sql database qtmultimedia music • • Euclide  

      3
      0
      Votes
      3
      Posts
      1054
      Views

      @mrjj Many thanks mrjj for your answer. I'll make more researches about SQLite and Taglib.
    • UNSOLVED How do you persist and update your models?
      QML and Qt Quick • database model • • deleted602  

      4
      0
      Votes
      4
      Posts
      1441
      Views

      @tskardal said in How do you persist and update your models?: I'm thinking that the goal is having "plain" models that are not QObjects. That's a quite normal thing to do. Let the Qt model be just an intermediary between actual data model/tree and the GUI. If your implementation works, then it's OK I guess. I'm not sure if there any actual question to answer here :-)
    • SOLVED QtRpt report from Databse
      QML and Qt Quick • qt creator database qtrpt • • Neel 0  

      13
      0
      Votes
      13
      Posts
      2881
      Views

      @aha_1980 Unfortunately the link http://www.qtrpt.tk is no more working. To get official source of the project please use https://sourceforge.net/p/qtrpt/discussion/general/
    • SOLVED Connection to a MySQL database with Qt Creator on Windows
      General and Desktop • qtcreator mysql database • • Justin_Ahinon  

      11
      0
      Votes
      11
      Posts
      7401
      Views

      Hi, Are you aware of the implications of moving from MySQL to SQLite ? One of which is: you are using a relative path for your SQLite database which won't work if your users install your application in e.g. Program Files as it's a read-only location.
    • UNSOLVED Getting database values into QStringList
      General and Desktop • qtcreator database qstringlist value • • Lasith  

      3
      0
      Votes
      3
      Posts
      2502
      Views

      Hi, To add to @dream_captain, in case of an error, at least print the error string from the query so you know what went wrong.
    • UNSOLVED Is there any way to use Apollo graphql client with qt, qtquick/qml ?
      3rd Party Software • database videoplayback swift apollo graphql • • Kjetil  

      1
      1
      Votes
      1
      Posts
      1640
      Views

      No one has replied

    • UNSOLVED Which system do you recommend for cloud based realtime database?
      Brainstorm • database cloud realtime iot • • ideadesigner  

      4
      0
      Votes
      4
      Posts
      1347
      Views

      The most compatible with qt is GE Predix (https://www.predix.io/) - https://github.com/IndeemaSoftware/QPredix
    • SOLVED Making Qtableview cell autosize
      General and Desktop • qtableview database autosize retrieve • • Kushan  

      4
      0
      Votes
      4
      Posts
      1102
      Views

      @Kushan Or you can use resizeColumnsToContents() method for the same.
    • UNSOLVED Looking for the best multithreading patterns for database access
      General and Desktop • signal & slot database multithreading • • abforce  

      9
      0
      Votes
      9
      Posts
      3193
      Views

      @abforce said in Looking for the best multithreading patterns for database access: For this purpose can I employ a callback pattern? You can simply use signals/slots across threads
    • SOLVED Accessing the same Database from different threads
      General and Desktop • database sqlite thread • • davidesalvetti  

      3
      0
      Votes
      3
      Posts
      1125
      Views

      @SGaist Thank you for your answer!
    • SOLVED QSqlDatabasePrivate::addDatabase: duplicate connection name 'MyConnection' error
      General and Desktop • c++ qtcreator database runtime error • • Lasith  

      2
      0
      Votes
      2
      Posts
      1783
      Views

      @Lasith You should open the database only once. Currently you do it each time button is pressed.
    • UNSOLVED Using single global object to access database
      General and Desktop • c++ qtcreator database global • • Kushan  

      3
      0
      Votes
      3
      Posts
      2327
      Views

      Hi, There's no need for any global objects all the more if you only have one active connection for your application but it's also valid if you are managing multiple connections. The QSqlDatabase class already provides everything you need. Like written in the documentation, if you are only using one connection, don't give it a name, it will become the default connection and all the SQL related classes will use it by default. If you have several connections, it's easy to retrieve the one you are interested in by using QSqlDatabase::database. On a side note, you should properly test the outcome of your open call. Right now it could be failing and you don't care about that possibility.
    • UNSOLVED connecting to database when a form loads using signals and slots
      General and Desktop • qtcreator signal & slot database forms • • Lasith  

      4
      0
      Votes
      4
      Posts
      1250
      Views

      @mostefa said in connecting to database when a form loads using signals and slots: I think that this post is duplicate Strictly speaking it isn't, although it's quite similar.
    • SOLVED QSqlQuery::prepare: database not open
      General and Desktop • qtcreator database qoci open • • Lasith  

      7
      0
      Votes
      7
      Posts
      1893
      Views

      @mostefa Thanx mate
    • UNSOLVED Qt Quick database for MySQL or Postgresql
      QML and Qt Quick • qml mysql database sqlite postgresql • • mbnoimi  

      1
      0
      Votes
      1
      Posts
      792
      Views

      No one has replied

    • SOLVED Selecting a database while using QSqlTableModel
      General and Desktop • sql database qsqltablemodel • • spektro37  

      8
      0
      Votes
      8
      Posts
      2918
      Views

      @spektro37 Well its used with all QWidgets so would make sense. Its something to be aware of when creating GUI and also the little note that any QWidget that are not given a owner/parent, will become a window. That can be surprised when coming from other frameworks. Say you make a new label QLabel *lab= new QLabel(); Since its given no parent, it will become a window. That was pretty surprising to me first time as i wanted to insert it into the main window. So its good to know about.
    • UNSOLVED Pireal 2.0.2 - Educational tool for working with RA
      Announcements • qml qt5 python database pyqt • • gabodev  

      1
      0
      Votes
      1
      Posts
      659
      Views

      No one has replied

    • QxOrm 1.4.3 and QxEntityEditor 1.2.1 released : support CMake and new QxEntityEditor documentation
      Announcements • cmake sql database serialization orm • • qxorm  

      1
      0
      Votes
      1
      Posts
      1650
      Views

      No one has replied

    • UNSOLVED Database table transfer over TCP
      General and Desktop • database tcpsocket qt 5.7.0 data transfer • • DoughBoy  

      21
      0
      Votes
      21
      Posts
      7460
      Views

      @DoughBoy The following SQL, with the Chinook test database open will create a new file in the same directory named 'out.sqlite' holding all of the album information for artist 51 with the original table layout. A Qt model is totally unnecessary. Just run the query and it will create your file. From there you can compress it and ship it. ATTACH DATABASE 'out.sqlite' AS outdb; CREATE TABLE outdb.album AS SELECT * from album WHERE ArtistId = 51; DETACH DATABASE outdb; It does use SQLite specific sql. Note especially that the ATTACH DATABASE and DETACH DATABASE are sql to be sent to the database just like the CREATE TABLE.. BTW, I have never done this using Qt, only in batch files, but I see no reason for it not to work both ways. Mike