Hi!
I have the following tables structure:
classes (
id integer primary key,
name integer
);
subjects (
id integer primary key,
name varchar,
short_name varchar
);
subjects_relations (
classID integer foreign key,
subjectID integer foreign key
);
students (
id integer primary key,
name varchar,
surname varchar,
class integer foreign key
);
marks (
id integer primary key,
value integer, //in Poland we have digit marks ;)
studentID integer foreign key,
subjectID integer foreign key
);
classes (
id integer primary key,
name integer
);
subjects (
id integer primary key,
name varchar,
short_name varchar
);
subjects_relations (
classID integer foreign key,
subjectID integer foreign key
);
students (
id integer primary key,
name varchar,
surname varchar,
class integer foreign key
);
marks (
id integer primary key,
value integer, //in Poland we have digit marks ;)
studentID integer foreign key,
subjectID integer foreign key
);
To copy to clipboard, switch view to plain text mode
Ps.: Only one mark can be connected with specified subject and student.
Now: I want to make a table (QTableView) like this:
***************| math | eng
-----------------------------
David Smiths | 3 | 5
John Doe | 5 | 4
***************| math | eng
-----------------------------
David Smiths | 3 | 5
John Doe | 5 | 4
To copy to clipboard, switch view to plain text mode
So: columns are subjects connected to a specified class. Rows are students from this class. Cells are marks. Columns labels are subject short_name (this is no problem) and rows labels are name and surname (this is a problem).
How to make that table with one of the Sql Models? I want to mention that I want to edit marks in table and save them with submitAll();.
Cheers,
David
Bookmarks