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. Solved: Subclass QTableWidget
QtWS25 Last Chance

Solved: Subclass QTableWidget

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 937 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.
  • S Offline
    S Offline
    sting
    wrote on last edited by
    #1

    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.

    Edit:

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

    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