[Qt-interest] How best to display arrows in a list?

phil prentice philp.cheer at talktalk.net
Thu Mar 12 18:28:50 CET 2009


Hi Justin
  Thank You very much for your help.  I will have a read and a play.  AT least 
I now know a bit more about whats involved.  Up to know I have been doing 
very simply QT Gui's.  If the circumstances allow I would love to go to a 
training class at ICS...depends on a number of things.  I really enjoy using 
QT.

Thanks again

Phil

On Thursday 12 March 2009 13:58, Justin Noel wrote:
> phil prentice wrote:
> > HI friends
> >   I'm a very stuck as to how go about using QT to display arrows as part
> > of a list.  I have attached a screen shot (.jpg)
> > which displays an old X11 GUI which I would very much like to move over
> > to QT.  What it displays is a list of arrows on the left and a list of
> > arrows at the bottom.  Does QT offer anything that might make its porting
> > to QT easier..I was hoping to use something like QListWidget to help me
> > but I dont think that it is capable?  I am really stuck here as to how I
> > might proceed. Can anybody help me?
> >
> > I would much appreciate any response even if its to say its back to
> > basics i.e. I cant use classes like QListWidget to help me out.
>
> I'll give you a couple of things you can try, but I think you need to
> study up on Qt. Here are a few weblinks that can help you out:
>
> ICS Webinars (Especially "Introduction to Qt"):
> http://www.ics.com/learning/icsnetwork/
>
> Qt Tutorials:
> http://doc.trolltech.com/4.5/tutorials.html
> http://sector.ynet.sk/qt4-tutorial/
>
> ICS Whitepaper on porting Motif to Qt:
> http://www.ics.com/learning/learning_center_downloads/
>
> Popular book on Qt:
> http://www.amazon.com/Programming-Prentice-Source-Software-Development/dp/0
>132354160/ref=sr_1_1?ie=UTF8&s=books&qid=1236865403&sr=8-1
>
> You might also consider going to a training class hosted by ICS or KDAB.
> For disclaimer purposes, I work for ICS. ;)
>
> As for your problem. I suggest the following to recreate your screen:
>
> Use a QScrollArea, a QVBoxLayout and regular widgets like push buttons
> and labels.  If you require it to look more "list" like with selections
> and such you could subclass QPushButton or QAbstractButton and re-impl
> paintEvent() to draw your arrow pixmap, text and a selected background
> color if your state happens to be "checked". You can then use a
> QButtonGroup to make the buttons mutually exclusive.
>
> If you need to scale the area to have lots of buttons or you need to
> insert/remove buttons dynamically then, you might want to use
> QList[View|Widget] with a custom delegate to do the fancy drawing. Check
> out the Qt example under examples/itemviews/pixelator or ICS's
> whitepaper on Qt Delegates.  It's a lot of work, but very scalable.
>
> Good Luck!
> --Justin



More information about the Qt-interest-old mailing list