Solved: Subclass QTableWidget

  • I started working on things I need for my application so I built an application that had a QGroupBox with three QTableWidgets inside to hold my data. I like the idea of having my own classes so I can better manage the object. So I created a subclass for QGroupBox and promoted the instance in my design to to it. Everything worked well.

    So, the next step I wanted my own classes for the QTableWidgets but that wasn't so easy. There is not a subclass generator in the File->New File or Project-> ... dialog. I tried two things,

    1. just build the classes myself. That didn't make the compiler happy at all. It claimed I changed the meaning fo the class,

    2. then I thought I would just copy the GroupBox subclass that worked, change the names, etc. But that didn't work either. Same compiler message.

    I figured I needed to learn mose so I just deleted everything after I removed it. The problem is the debug won't build because it remembers one of the header files and I can't find the file that the compiler claims it is in.

    No rule to make target '../project/xxxtable.h' needed by ui_mainwindow.h.

    The release build works well, there is no file ui_mainwindow.h in any of the files. I ran build qmake and the issue is now fixed.

    How do you subclass either QTableWidget or QTableView, I assume either will meet my needs.


    Not sure what the issue was then, I tried it again and it works as expected.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.