[mythtv] mythmusic patch - trivial

Brent Hills bhills at openshores.com
Sun Apr 6 20:09:11 EDT 2003


On Sun, 2003-04-06 at 17:12, Matt Zimmerman wrote:
> On Sun, Apr 06, 2003 at 04:55:08PM -0700, Bruce Markey wrote:
> 
> > Well, since the width is the string length, you're right,
> > it wouldn't work for proportionally spaced fonts. However,
> > sprintf would have the same problem. So, I guess I don't
> > understand the issue and this may be of no use either but
> > there is a QListView::setColumnAlignment
> > 
> > http://doc.trolltech.com/3.1/qlistview.html#setColumnAlignment
> 
> Now that looks like exactly the right thing (I expected it to be in
> qlistviewitem).

Yeah, my QT coding is pretty much limited to the lines in the patch. ;-)

In addition, I have a long C background and less so C++.  

The idea was to zero left pad the string so that I could sort the table
by the song # column using the default sort routine.  Everytime the
playlist is shuffled the songs are renumbered and sorted by the column
number.  

To use the default sort routine I needed the column left zero padded or
I would have to introduce a comparison routine for the sort (QT doesn't
sort numerically by default).  

The sorting is triggered by an option but this zero padding code I left
in irregardless.  

I liked the sprintf idiom you posted earlier the best.

Brent Hills.





More information about the mythtv-dev mailing list