[Kstars-devel] Unable to create additional tool bars to a
KMainWindow
Jasem Mutlaq
mutlaqja at ikarustech.com
Mon Jan 26 01:35:50 CET 2004
Hello,
I can't create additional tool bars in a KMainWindow. Here is the code for the
KMainWindow child
FitsViewer::FitsViewer (const KURL url, QWidget *parent, const char *name)
: KMainWindow (parent, name)
{
new KAction( i18n("Action1"), "launch", KShortcut( "Ctrl+I" ), this,
SLOT( imageReduction()), actionCollection(), "image_reduce");
new KAction( i18n("Action2"), "launch", KShortcut( "Ctrl+B" ), this,
SLOT( imageReduction()), actionCollection(), "image_brightness_contrast");
new KAction( i18n("Action3"), "launch", KShortcut( "Ctrl+M" ), this,
SLOT( imageReduction()), actionCollection(), "image_filters");
createGUI("fitsviewer.rc");
}
here is the fitsviewer.rc file
!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="FitsViewer" version="1">
<ToolBar noMerge="1" name="processToolBar"><text>Process ToolBar</text>
<Action name="image_reduce" />
<Action name="image_brightness_contrast" />
<Action name="image_filters" />
</ToolBar>
</kpartgui>
------------------------------------------------------------------------------------------------------------------------
The main application (KStars) calls FitsViewer but no tool bars are created in
the FitsViewer window. Note that I _can_ add KActions in the _main_ toolbar
of FitsViewer by calling calling action->plug(toolbar()); but this only adds
the action to the main tool bar; and I need additional tool bars in
FitsViewer besides the main toolbar.
Any help greatly appreciated!
cheers,
Jasem Mutlaq
http://edu.kde.org/kstars
More information about the Kstars-devel
mailing list