Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTableView add Rows renders wrong
Qt 6.12 LTS is out! See what's new in the release blog

QTableView add Rows renders wrong

Scheduled Pinned Locked Moved Solved General and Desktop
27 Posts 3 Posters 24.8k Views 2 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #14

    First, I'd check with a delegate like the Star Delegate sample to see if everything goes well with custom painting. Then I'd check with just a rendering a combo box without any modification to the painter.

    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
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by A Former User
      #15

      I tested it now with another Widgets and the Problem is still existing. So its not a Problem with only QComboBox. So it seems its a generally Problem with rendering. I have a similar Widget like in the StarDelegate Example and the Problem occurs. I tried not to modiy the QPainter but the Problem still exists. I also deleted the QTableView and created a new One.

      Any other Ideas?

      1 Reply Last reply
      0
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #16

        Hi
        I newer say such issue with
        https://wiki.qt.io/Combo_Boxes_in_Item_Views

        I think you ask it to draw in wrong position with
        painter->deviceTransform().map(option.rect.topLeft()))

        You should check the y pos when its drawing wrongly.

        Else it look ok from fast glance.

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by A Former User
          #17

          @mrjj said in QTableView add Rows renders wrong:

          painter->deviceTransform().map(option.rect.topLeft()))

          If i delete this part the Problem still exists. I took a look at your Link. In this Example there is no paint Event and im wondering. How does the Delegate know how to paint the Element?

          If i remove the render Part the ComboBox isnt shown.

          I think its a Problem with the Painter or the Renderfunction. Or perhaps something in my Layout.

          Update:

          It looks like its a Layout Problem. When i switch the Buttons to the Upper i dont have that Problem.
          0_1503921395908_Unbenannt.png

          But why? Its a normal Gridlayout with a normal Row under the QTableView.

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

            Can you show the code that setup everything including the buttons ?

            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
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #19

              I use the Designer. Cant show any Code, but only the XML Part which is not editable.

              0_1503991011571_Unbenannt.png

              1 Reply Last reply
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #20

                still have the problem. the rows renders outside of the tableview.

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

                  Then can you provide a minimal compilable example so people can test that locally to help find the problem ?

                  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
                  • ? Offline
                    ? Offline
                    A Former User
                    wrote on last edited by A Former User
                    #22

                    I have made the Project Public in my Repository for some Days.

                    https://git.kubitox.com/Ben/KT

                    The Problem is in "Medikamentenplan" the below part. The Problem occurs in DoctorContact

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

                      I can't reproduce the defect you have on macOS.

                      On a side note, you should review that code base, I had to fix several errors before being able to run 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

                      1 Reply Last reply
                      0
                      • ? Offline
                        ? Offline
                        A Former User
                        wrote on last edited by
                        #24

                        I installed a Virtual Machine with Linux and tested it. You are right, on other OS it isnt there. Maybe a Problem with Windows. But i dont know how to fix that now. Im using QT 5.9.1 and MSVC 2015 with 64-bit.

                        Could it be that the Problem is a Driver Problem?

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

                          Maybe a glitch in the Windows style.

                          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
                          • ? Offline
                            ? Offline
                            A Former User
                            wrote on last edited by
                            #26

                            I have totally no Answer for that. Anyone has the Time to Check my Project over Teamviewer? If yes please write me a Message. We can do that with Teamspeak or Discord. Would be nice if you speak German.

                            1 Reply Last reply
                            0
                            • ? Offline
                              ? Offline
                              A Former User
                              wrote on last edited by
                              #27

                              I updated now to Qt 5.9.2 and the Problem is gone. Thx for everyone that tried to help.

                              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
                              • Unsolved