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. Appending Qtablewidget row contents to qLineEdits
Forum Updated to NodeBB v4.3 + New Features

Appending Qtablewidget row contents to qLineEdits

Scheduled Pinned Locked Moved Unsolved General and Desktop
27 Posts 2 Posters 3.7k 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.
  • C CEO.

    @mrjj updateTabbb.JPG

    aim accomplished. ALL THANKS to you. Honestly if you had directed me to QT documentation, I wouldn't have been able to understand it. I appreciate.

    mrjjM Offline
    mrjjM Offline
    mrjj
    Lifetime Qt Champion
    wrote on last edited by
    #21

    @CEO
    Np. Glad you could make it work.

    If you ever need to make something like this again, You can get most of it for free/no code
    if you use a standalone model as then you can also connect the LineEdits to the model with the table and it would auto sync.

    1 Reply Last reply
    0
    • C CEO.

      @mrjj updateTabbb.JPG

      aim accomplished. ALL THANKS to you. Honestly if you had directed me to QT documentation, I wouldn't have been able to understand it. I appreciate.

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

      @CEO alright. I am grateful.

      I have been thinking of ways I can design the table lines. is it possible please? For now, I can only setStylesheet to the table background. Is there anyway I can thicken the table lines and maybe give it another color different from the table background?

      mrjjM 1 Reply Last reply
      0
      • C CEO.

        @CEO alright. I am grateful.

        I have been thinking of ways I can design the table lines. is it possible please? For now, I can only setStylesheet to the table background. Is there anyway I can thicken the table lines and maybe give it another color different from the table background?

        mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #23

        @CEO
        Well there is
        https://doc.qt.io/qt-5/qtableview.html#gridStyle-prop
        that allows you to set pen and color when drawing the grid.

        Its also avialable for TableWidget as it inherits qtableview

        C 3 Replies Last reply
        1
        • mrjjM mrjj

          @CEO
          Well there is
          https://doc.qt.io/qt-5/qtableview.html#gridStyle-prop
          that allows you to set pen and color when drawing the grid.

          Its also avialable for TableWidget as it inherits qtableview

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

          @mrjj alright. thanks.
          Let me check it out.

          1 Reply Last reply
          0
          • mrjjM mrjj

            @CEO
            Well there is
            https://doc.qt.io/qt-5/qtableview.html#gridStyle-prop
            that allows you to set pen and color when drawing the grid.

            Its also avialable for TableWidget as it inherits qtableview

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

            @mrjj I have studied the content. Honestly I hate reading QT documentations because they don't teach an individual how to use them. No illustrative example. Most things I know today, I learned from other links.
            I have practicalized self.tab.setGrid() I don't know options to use. No much work on QT online and learning through the documentation is terrible.

            1 Reply Last reply
            0
            • mrjjM mrjj

              @CEO
              Well there is
              https://doc.qt.io/qt-5/qtableview.html#gridStyle-prop
              that allows you to set pen and color when drawing the grid.

              Its also avialable for TableWidget as it inherits qtableview

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

              @mrjj I found a better site to learn more about Qtablewidget. >>>>> https://topic.alibabacloud.com/a/use-of-qlistwidget-and-qtablewidget-and-style-settings_8_8_10259690.html

              I hate Qt documentation site. They make it difficult for a beginner to understand

              1 Reply Last reply
              0
              • mrjjM mrjj

                Hi
                Ok super. Was afraid I didn't explain good enough.

                Well in my book the
                for j in range(self.itemList.columnCount()):
                should loop all coloums for the selected Row.

                Do notice that code won't do right if you select multiple rows but I assume that was not the plan.

                You are very welcome. Disclaimer. I suck at python as such but programming is programming and
                same tactics works regardless of language used-

                Whoops
                Just saw
                itemList[0].setText(text)
                should be
                itemList[j].setText(text)

                so we take next index when we take next col.

                I assume j will go 0,1,2,3,4 etc ?

                also when you take the text
                itemcodd = self.tab.item(row, 0)
                should that not be itemcodd = self.tab.item(row, j)
                so we take cols one by one and not just 0 (zero)

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

                @mrjj hello Mr. JJ, I am having challenge retrieving data into a qTablewidget. I have been retrieving data into qtablewidget before.

                I used qtable in storing the data into the database and one of the columns in the table used qcombobox. Is it that I will have to retrieve that data into a qcombobox too?

                I am asking this because I'm not seeing any error in my retrieval code.

                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