我有一张桌子Thingsies,有列id, data1, otherTableId, otherTableRowId。我需要最后两列而不仅仅是外键列,因为根据Thingy我想要的信息类型而有所不同。
otherTableId引用表中的 an id,该表OtherTables本身具有称为idand的列tableName。这些tableNames是其他表的名称,例如OtherTable1, OtherTable2。中
的列引用了由给出的。他们自己有更多的数据。Thingies 和其中一个中的条目之间存在一对一的对应关系。所以 Thingies 中的行数是所有otherTableRowIdThingiesidOtherTableotherTableIdOtherTablesOtherTablesOtherTables. (这是糟糕的设计吗?)
我想在具有 、 和 的列中显示 Thingies ,其中QTableView以编程方式从和生成。我应该如何进行?iddata1data2data2otherTableIdotherTableRowId
谢谢。