[Kde-games-devel] KGameDifficulty

Mauricio Piacentini mauricio at tabuleiro.com
Tue Jul 24 05:09:51 CEST 2007


Nicolas, regarding KGameDifficulty: is it possible to make the 
appearance of the comboBox in the statusBar optional, maybe controlled 
by a flag in the constructor? Or better yet, not in the constructor, but 
  via another API call, something like

//construct KGameDifficultyObject first...
//then set its propertis
m_gamedifficulty->addToWidget(QWidget * parent)

Dmitry suggested what is probably a better approach: you could expose 
the combo box as a member of KGameDifficulty, so the application code 
could instead do

mainWindow->statusBar()->addWidget(m_difficulty->comboSelector());

or like it is now, using

mainWindow->statusBar()->addPermanentWidget(m_difficulty->comboSelector())

You can use another name instead of comboSelector, maybe 
difficultySelector(), or something like that.

I was talking today in IRC with Dmitry about this and we agreed that 
this process could maybe be more flexible, so different applications 
could still use the selector, even if they do not have a statusBar, or 
if they prefer to gather all user input in the toolbar and use the 
statusBar just for output. With this change the author could easily 
choose to put the window in the statusBar or in the toolbar, depending 
on the game, and maybe adjust the layout if needed. For some games if 
the author prefer we could also let the user configure the toolbar to 
show the selector or not using standard KDE APIs (configure toolbar menu 
item), and this is not working with the current hardcoded approach. I 
think you can see this now with KMines.

Another reason for this in the near future is the rumoured 
widget-on-canvas support that will supposedly be available in QGV for Qt 
4.4. With an API like this we could theoretically also choose to add the 
difficulty selector comboBox widget to the game scene directly, if 
needed, or to another area created inside the scene. It is all about 
making it more flexible.

Any thoughts on this? Maybe this is already possible now, sorry if I 
have not grasped the code completely :) If you are busy I can also try 
to code a patch for it, with your approval.

Regards,
Mauricio Piacentini


More information about the kde-games-devel mailing list