Results 1 to 8 of 8

Thread: Qml_database

  1. #1
    Join Date
    Nov 2011
    Location
    coimbatore
    Posts
    80
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Qml_database

    hi,
    i am beginner for qt...i have small doubt in qml ...i want to create simple database save and retrieve from gui...anyone please help me.....

  2. #2
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: Qml_database

    In qml you have to use JavaScript for that as i know.

  3. The following user says thank you to alizadeh91 for this useful post:

    ganeshgladish (14th March 2013)

  4. #3
    Join Date
    Nov 2011
    Location
    coimbatore
    Posts
    80
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qml_database

    thank you for your replay sir,

    can u please tell some examples code then i will understand ...please sir

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qml_database

    Quote Originally Posted by ganeshgladish View Post
    hi,
    i am beginner for qt...i have small doubt in qml ...i want to create simple database save and retrieve from gui...anyone please help me.....
    You can use local storage API (see the docs for details) or expose a full blown database interface from C++.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #5
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: Qml_database

    In qt5 you can use a QObject and expose it into qml for that also in Qt4 the procedure is similar.

  7. #6
    Join Date
    Nov 2011
    Location
    coimbatore
    Posts
    80
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qml_database

    thank you for your reply,
    please give tell example program or sites sir ...

  8. #7
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: Qml_database

    First of all you can write your own c++ class from QObject. Do your work with database in this class. Then for using this class in qml you have to register it:
    Qt Code:
    1. qmlRegisterType<MyObject>("QtQuick", 1, 0, "MyObject");
    To copy to clipboard, switch view to plain text mode 
    then in your qml, just import your custom type and use it.

    see this: http://qt-project.org/doc/qt-5.0/qtq...roperties.html for embedding qobject in qml in Qt5

  9. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qml_database

    Quote Originally Posted by ganeshgladish View Post
    thank you for your reply,
    please give tell example program or sites sir ...
    http://qt-project.org/doc/qt-5.0/qtq...storage-2.html
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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.