PDA

View Full Version : widget for text AND buttons



nongentesimus
15th June 2006, 11:59
Hello

I have a rather simple question (again).
I wuld like to have, or make a widget, that is suitable for two purposes, first to show some long text, and second to have somewhere inside the text some buttons. It would be a simple tutorial for a card-game, the text explains the rules of the game, and by pushing the buttons, the user opens a modal dialog, where he/she can test what hs/she learnt so far.
I tried QTextEdit, but I could not position the buttons indide the text.
Thanks for Your answers

Peter

wysota
15th June 2006, 12:16
QTextBrowser would be a little better here. Create buttons as links and use some kind of styling mechanism (depending on which Qt version you use) to make them look more button-ish. For Qt3 it would be QStyleSheet.

nongentesimus
16th June 2006, 14:43
Thanks, it was a good idea (I did not try QTextBrowser since I did not realise that the setSource() function is virtual). It was really easy this way. :)
Peter