QGridLayout vs QHBoxLayout & QVBoxLayout for TV Guide?
-
I have recently come back to Qt (tried it for previous projects and opted against it) and am really liking everything about it thus far. I am writing a TV Guide style application that will display Episode Guide Data (EPG) for anywhere from 3-7 days, and this data will be fed in from a Database source.
Right now I am having a hard time determining if I should use a QGridLayout or a combination of QHBoxLayouts (for the episode data) with a single QVBoxLayout on the left side (for the channel name/icons). My main concern with QGridLayout is that I would break it up into "30 minute" blocks, but when programs started at say 3:45, I am not sure it would work correctly. To give a better idea of what I am going for with the GUI, this screenshot can be viewed...
[img]http://www.itvt.com/files/u3/AT&T-u-verse-tv-epg-2009.jpg[/img]
Just on a side note, if I want to only display a segment of this (i.e. 3:00AM - 4:30AM) and say 10 channels, which option would it be easier to implement vertical/horizontal scrolling with? Would I need to stick them in a different widget for that behavior?
Thanks!
-
Hello,
I stumbled upon your post but am not a real expert on the grid layout structure and am sure you probably found a solution by now. Here is my idea of what your should do and a question also for you:
I would go with individual QHBoxLayout for an entire row (channel/station/programming) so it becomes its own objects that can be deleted upon desire without the hassle of the addition linking of objects. I would have each object control the contents of (channel/station/programming) which would be composed of QVBoxLayout's. To hold all created objects (channel/station/programming) I would use a QVBoxLayout. Again, maybe not the best route depending on the functionality you desire, but it is how I would think about doing it.
Now a question: What method did you go about for integrating the U-Verse API?
-
Such information will be powered by a database.
The best one is to reimplement QTableView (for the view) and QStyledItemDelegate (for displaying information)"QStyledItemDelegate":http://qt-project.org/doc/qt-4.8/qstyleditemdelegate.html
"Example - Star":http://qt-project.org/doc/qt-4.8/itemviews-stardelegate.html