[bt-devel] Commentary editor font chooser

Gary Holmlund gary.holmlund at gmail.com
Sun Nov 30 22:39:59 MST 2008


I have been looking at the  Commentary editor font chooser to eliminate 
the KDE classes. Here is the description from the wiki:

-------------
Commentary editor uses KDE classes for choosing font, size and color. 
For example font name is selected with KFontAction which apparently has 
its own quite complex widget. It works automatically by just adding the 
action to the toolbar. Replacing it is not trivial.

    * color: replace KColorButton with button and QColorDialog
    * size: replace KFontSizeAction with QComboBox and QFontDatabase
    * font name: replace KFontAction with QComboBox and QFontDatabase
    * KActionCollection has to be replaced/removed, too
--------------

There are two ways to deal with these widgets.

1. Use QWidgetAction to wrap the widget into a QAction. This is how KDE 
does these and it would allow the continued use of KActionCollection. 
However, this seemed simple but turned into a complicated function. KDE 
uses about 1000 lines in the KFontSizeAction.

2. Just keep the widgets as widgets using the QToolbar::addWidget() 
funtion to put them on the toolbar. This is very simple to do, but it 
does not allow the widgets to be in the KActionCollection.

I know that the KActionCollection is not really being used since the 
configuration of toolbars is disabled. I also understand that we want to 
replace it.

What are your thoughts on these issues?

Gary




More information about the bt-devel mailing list