Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. What is the expected behavior of the Sql Widget Mapper Example?

What is the expected behavior of the Sql Widget Mapper Example?

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 1.5k 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.
  • J Offline
    J Offline
    JosephMorgan
    wrote on last edited by
    #1

    Hello, I am new to QT so I am going through the examples and learning but I have a question.

    When I open the Sql Widget Mapper Example and run it, the window pops up with a name, address and type. Tabbing out of the QLineEdit or the QTextEdit saves changes but selecting a different item in the QComboBox never gets saved. In the example, is pressing next or previous supposed to save changes to all the fields in the database? Or is the QComboBox being left out purposely? Thanks in advance..

    1 Reply Last reply
    0
    • J Offline
      J Offline
      JosephMorgan
      wrote on last edited by
      #2

      I'm bumping this in hopes that someone will notice it and knows the answer. :)

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        AFAIK, the combo box should get saved and restored the same way the other widgets do

        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
        0
        • J Offline
          J Offline
          JosephMorgan
          wrote on last edited by
          #4

          Ok. Thank you for your response. That's not whats happening on my computers. The changes made to the combo box do not get saved. This is an unaltered example that I'm using and I was thinking the intention of the example was to show how to save all the widget's changes (as you mentioned). I'm having troubles figuring out why they aren't.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Which version of Qt and OS are you running ?

            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
            0
            • J Offline
              J Offline
              JosephMorgan
              wrote on last edited by
              #6

              I am using the following:

              Qt 5.3.2

              Mac - Yosemite (10.10.1)
              Windows - 8

              Mac / Windows yield the same result.

              I thought maybe it had something to do with not submitting:
              @model->setEditStrategy(QSqlTableModel::OnManualSubmit);
              @

              But I am not sure because it also doesn't work with OnFieldChange & OnRowChange

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Indeed, it does, I've mixed it with another example. That one just enables you to "browse" the database content.

                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
                0

                • Login

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