[Kde-games-devel] The status bar and the Difficulty Level widget

Parker Coates parker.coates at gmail.com
Sat Jan 7 02:45:27 UTC 2012


On Fri, Jan 6, 2012 at 19:01, Ian Wadham wrote:
> Libkdegames' standard Difficulty Level widget always appears in the
> status bar, so if you use it you must have a status bar.
>
> Would anyone have any objections if I modified libkdegames to provide
> an option to return a Difficulty Level widget that can be placed anywhere,
> leaving the status bar as the default position?

I'm not sure returning a widget is the cleanest API. I'm guessing
you're talking about some sort of "KComboBox *
KGameDifficulty::comboBox()" method, but that raises a couple issues.
Who owns the widget returned? If the method is called second time, is
a pointer to the same widget returned or a pointer to a new widget?

Personally, I'd recommend to instead create a new
KGameDifficultyComboBox class the inherits KComboBox and automatically
hooks itself up KGameDifficulty. It would probably just be a matter of
make the existing widget public.

Parker


More information about the kde-games-devel mailing list