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. How to save the Text in QML?
Forum Updated to NodeBB v4.3 + New Features

How to save the Text in QML?

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 5 Posters 4.3k Views 1 Watching
  • 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.
  • M Offline
    M Offline
    Maheshwara
    wrote on last edited by
    #1

    Dear Friends,
    I need to get input(like user details) from the user and save it in a local file.txt. I'm using QML for designing and c++ backend. Or is there any way to save the file directly from QML?. can any one please help...

    1 Reply Last reply
    0
    • N Offline
      N Offline
      njeisecke
      wrote on last edited by
      #2

      I would do the "business logic" in the c++ backend and provide a nice interface to Qml.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lgeyer
        wrote on last edited by
        #3

        [quote author="5mahesh" date="1323343775"]Or is there any way to save the file directly from QML?.[/quote]

        No, there's just the "Offline Storage API.":http://doc.qt.nokia.com/latest/qdeclarativeglobalobject.html#offline-storage-api

        1 Reply Last reply
        0
        • S Offline
          S Offline
          strekazoid
          wrote on last edited by
          #4

          I'm using QSettings for this. Check out my thread:
          http://developer.qt.nokia.com/forums/viewthread/11696/

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mhcrnl
            wrote on last edited by
            #5

            QtQuick - How can I save user input if I have this code?
            @import QtQuick 2.0
            import QtQuick.Controls 1.1
            //import "../qtquickapp1/ButtonItem.qml"
            Rectangle {
            id:parent
            objectName: "Agenda Personala"
            color:"lightyellow"
            width: 360
            height: 360
            Row{
            id:meniu
            anchors.top: parent.top
            ColorAnimation { from: "white"; to: "black"; duration: 200 }
            Button{
            text:qsTr("Inchide")
            onClicked: Qt.quit()
            }
            Button{
            id:salveaza
            text: qsTr("Salveaza")
            signal trigger
            MouseArea{
            anchors.fill: salveaza
            onPressed: parent.color="lightgreen"
            onReleased: parent.color="white"
            }
            }
            //onTrigger: console.log("Semnal emis!")
            Button{
            text: qsTr("Deschide", "Open")
            tooltip: "Deschide"
            }
            }
            Row{
            id: intdate
            anchors.top: meniu.bottom
            anchors.verticalCenter: parent.verticalCenter
            //anchors.verticalCenter: parent
            //color:"lightblue"
            Label{
            text: qsTr("Nume/Prenume: ")
            }
            TextInput{
            id:numeTi
            text:qsTr(" Nume ")
            color: focus?"red":"green"
            maximumLength: 15
            focus: true
            KeyNavigation.tab: telefonTi
            }
            Label{
            text:qsTr(" Nr. Telefon: ")
            }
            TextInput{
            id:telefonTi
            text: qsTr("Telefon")
            color: focus ? "red" : "green"
            maximumLength: 20
            KeyNavigation.backtab: numeTi

                }
            
            
            }
            Row{
                anchors.top: intdate.bottom
                anchors.verticalCenter: parent.verticalCenter
            
                Label{
                    text:numeTi.text+"  "+telefonTi.text
                }
            }
            

            }

            @

            Salutare !!!

            1 Reply Last reply
            0

            • Login

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