[Qt-interest] Alignment in QTableView
Andreas Pakulat
apaku at gmx.de
Wed May 26 18:10:15 CEST 2010
On 26.05.10 10:55:34, Rob Simmermon wrote:
> I had to switch from a QTableView to a QTableWidget (Same for QTreeView) to
> give me more control over columns and how they are laid out. That led me to
> have to implement my own set of utilities for using QSqlQuery's to populate
> the views.
>
> That's really my own complaint, too, about the MVC, is that in Qt, the
> presentation of the data when using QTableView and QTreeView with models is
> really not isolated. It should be in the view and not the model. Just like
> Mr. Harmer said below. Just getting the current properties of a displayed
> view is a nightmare using QTableView and QTreeView.
Note: I've not read the complete thread, but wanted to note this:
Well, its not in the model, unless you put it into the model. The
ultimate control over how the view items look like is in the delegate
and thats neither view nor model. The view mostly just does layouting
job, the model provides data and everything else is done in the
delegate.
The fact that the model has roles for font's, text-alignment and colors
doesn't mean you should/have to use them. You can do this stuff just as
well in the delegate.
Andreas
--
You worry too much about your job. Stop it. You are not paid enough to worry.
More information about the Qt-interest-old
mailing list