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. Showing Selected Row in a Search Bar or Another Window, Resizing QFormLayout Widgets

Showing Selected Row in a Search Bar or Another Window, Resizing QFormLayout Widgets

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 260 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.
  • C Offline
    C Offline
    CEO.
    wrote on last edited by VRonin
    #1

    tab2.JPG


    tab1.JPG

    Hello great minds,

    Please I need your assistance.
    I am attaching two photos to this post: 1 shows a desktop application window with widgets inside.
    The other is a qTableWidgets that contains every recorded data but outputs only what is searched for.

    From the application first window, you can see a searchbox and a searchbutton.
    Once a word is typed in the searchbox, if the item exists in the database, it will be displayed in the qTableWidget otherwise nothing will be displayed.

    i) Can anyone teach me with codes example on how I can display the content of a selected row of the qtablewidget in the searchbox of the qTablewidget (you can also see a searchbox in the qTablewidget window).

    ii) Can you also teach me how every detail of the selected record can be displayed in the first window as displayed in the photo, with each record showing in the corresponding field of the window showing items details to be captured there.

    iii) I would like someone to tell me how I can increase or decrease the length of the qFormLayout rows (the qLineEdit widgets)

    Please use some codes to illustrate your point as if you're teaching a beginner so I can understand better.

    Thanks

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

      Hi,

      As already suggested in another of your thread, QFormLayout has the fieldGrowthPolicy property to manage the expansion of the fields.

      Since you want to show content of a database, did you already took a look at the QtSql module ?

      The QSqlQueryModel allows you to show data based on a query where you can do the filtering at the database level.

      Or you can use a QSqlTableModel that directly shows all the content of a table.

      All these classes have examples associated with them.

      You should start there and then continue with your application.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      C 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        As already suggested in another of your thread, QFormLayout has the fieldGrowthPolicy property to manage the expansion of the fields.

        Since you want to show content of a database, did you already took a look at the QtSql module ?

        The QSqlQueryModel allows you to show data based on a query where you can do the filtering at the database level.

        Or you can use a QSqlTableModel that directly shows all the content of a table.

        All these classes have examples associated with them.

        You should start there and then continue with your application.

        C Offline
        C Offline
        CEO.
        wrote on last edited by
        #3

        @SGaist I don't understand those things in the documentation. I want where I can study them well and understand

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

          The documentation and the examples that are linked in these pages gives you material to study and test.

          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