org.kde.koala

Class KToolBar

public class KToolBar extends QToolBar

A KDE-style toolbar. KToolBar can be dragged around in and between different docks. A KToolBar can contain all sorts of widgets. KToolBar can be used as a standalone widget, but KMainWindow provides easy factories and management of one or more toolbars. Once you have a KToolBar object, you can insert items into it with the insert... methods, or remove them with the removeItem() method. This can be done at any time; the toolbar will be automatically updated. There are also many methods to set per-child properties like alignment and toggle behavior. KToolBar uses a global config group to load toolbar settings on construction. It will reread this config group on a KApplication.appearanceChanged() signal. See KToolBarSignals for signals emitted by KToolBar

Author: Reginald Stadlbauer , Stephan Kulow , Sven Radej .

UNKNOWN: Floatable toolbar with auto resize.

Field Summary
static intBottom
static intFlat
static intFloating
static intIconOnly
static intIconTextBottom
static intIconTextRight
static intLeft
static intRight
static intTextOnly
static intTop
static intUnmanaged
Possible bar positions.
Constructor Summary
protected KToolBar(Class dummy)
KToolBar(QWidget parent, String name, boolean honorStyle, boolean readConfig)
Normal constructor.
KToolBar(QWidget parent, String name, boolean honorStyle)
KToolBar(QWidget parent, String name)
KToolBar(QWidget parent)
KToolBar(QMainWindow parentWindow, int dock, boolean newLine, String name, boolean honorStyle, boolean readConfig)
Constructor for non-XML-GUI applications.
KToolBar(QMainWindow parentWindow, int dock, boolean newLine, String name, boolean honorStyle)
KToolBar(QMainWindow parentWindow, int dock, boolean newLine, String name)
KToolBar(QMainWindow parentWindow, int dock, boolean newLine)
KToolBar(QMainWindow parentWindow, int dock)
KToolBar(QMainWindow parentWindow, QWidget dock, boolean newLine, String name, boolean honorStyle, boolean readConfig)
Constructor for non-XML-GUI applications.
KToolBar(QMainWindow parentWindow, QWidget dock, boolean newLine, String name, boolean honorStyle)
KToolBar(QMainWindow parentWindow, QWidget dock, boolean newLine, String name)
KToolBar(QMainWindow parentWindow, QWidget dock, boolean newLine)
KToolBar(QMainWindow parentWindow, QWidget dock)
Method Summary
voidaddConnection(int id, String signal, QObject receiver, String slot)
Adds connections to items.
voidalignItemRight(int id, boolean right)
Align item to the right.
voidalignItemRight(int id)
KAnimWidgetanimatedWidget(int id)
This will return a pointer to the animated widget with the given id, if it exists.
protected voidapplyAppearanceSettings(KConfig config, String _configGroup, boolean forceGlobal)
protected voidapplyAppearanceSettings(KConfig config, String _configGroup)
voidapplySettings(KConfig config, String configGroup, boolean force)
Read the toolbar settings from group configGroup in config and apply them.
voidapplySettings(KConfig config, String configGroup)
intbarPos()
Returns the toolbar position.
voidchangeComboItem(int id, String text, int index)
Changes item index in combobox id to text.
voidchangeComboItem(int id, String text)
protected voidchildEvent(QChildEvent e)
StringclassName()
voidclear()
Remove all items.
voidclearCombo(int id)
Clears the combobox id. Does not delete it or hide it.
booleancontextMenuEnabled()
Returns the context menu enabled flag
intcount()
Returns the total number of items in the toolbar
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
booleanevent(QEvent e)
protected voidfinalize()
Deletes the wrapped C++ instance
booleanfullSize()
Returns the full-size mode enabled flag.
KToolBarButtongetButton(int id)
Returns a pointer to KToolBarButton.
KComboBoxgetCombo(int id)
Returns a pointer to the combobox with id. Example:
		 KComboBox combo = toolbar.getCombo(combo_id);
		 
That way you can get access to other public methods that KComboBox provides.
StringgetComboItem(int id, int index)
Returns text of item index from combobox id. index = -1 refers to current item.
StringgetComboItem(int id)
KLineEditgetLined(int id)
Returns a pointer to KToolBarLined with id. Example:
		 KLineEdit  lined = toolbar.getKToolBarLined(lined_id);
		 
That way you can get access to other public methods that KLineEdit provides.
StringgetLinedText(int id)
Returns the line editor text.
QWidgetgetWidget(int id)
Returns a pointer to the widget corresponding to id. Wrong ids are not tested.
voidhide()
voidhideItem(int id)
Hide item id.
booleanhighlight()
static booleanhighlightSetting()
Returns the global setting for "Highlight buttons under mouse"
inticonSize()
Returns the current icon size for buttons.
inticonSizeDefault()
Returns the default size for this type of toolbar.
inticonTextId()
Returns the current text style for buttons.
static inticonTextSetting()
Returns the global setting for "Icon Text"
intidAt(int index)
Returns the id of the item at the given index.
intinsertAnimatedWidget(int id, QObject receiver, String slot, String icons, int index)
Inserts an animated widget.
intinsertAnimatedWidget(int id, QObject receiver, String slot, String icons)
intinsertButton(String icon, int id, boolean enabled, String text, int index, KInstanceInterface _instance)
Insert a button (a KToolBarButton) with a pixmap.
intinsertButton(String icon, int id, boolean enabled, String text, int index)
intinsertButton(String icon, int id, boolean enabled, String text)
intinsertButton(String icon, int id, boolean enabled)
intinsertButton(String icon, int id)
intinsertButton(String icon, int id, String signal, QObject receiver, String slot, boolean enabled, String text, int index, KInstanceInterface _instance)
This is the same as above, but with specified signals and slots to which this button will be connected.
intinsertButton(String icon, int id, String signal, QObject receiver, String slot, boolean enabled, String text, int index)
intinsertButton(String icon, int id, String signal, QObject receiver, String slot, boolean enabled, String text)
intinsertButton(String icon, int id, String signal, QObject receiver, String slot, boolean enabled)
intinsertButton(String icon, int id, String signal, QObject receiver, String slot)
intinsertButton(QPixmap pixmap, int id, boolean enabled, String text, int index)
Inserts a button (a KToolBarButton) with the specified pixmap.
intinsertButton(QPixmap pixmap, int id, boolean enabled, String text)
intinsertButton(QPixmap pixmap, int id, boolean enabled)
intinsertButton(QPixmap pixmap, int id)
intinsertButton(QPixmap pixmap, int id, String signal, QObject receiver, String slot, boolean enabled, String text, int index)
This is the same as above, but with specified signals and slots to which this button will be connected.
intinsertButton(QPixmap pixmap, int id, String signal, QObject receiver, String slot, boolean enabled, String text)
intinsertButton(QPixmap pixmap, int id, String signal, QObject receiver, String slot, boolean enabled)
intinsertButton(QPixmap pixmap, int id, String signal, QObject receiver, String slot)
intinsertButton(String icon, int id, QPopupMenu popup, boolean enabled, String _text, int index)
Inserts a button with popupmenu.
intinsertButton(String icon, int id, QPopupMenu popup, boolean enabled, String _text)
intinsertButton(QPixmap pixmap, int id, QPopupMenu popup, boolean enabled, String _text, int index)
Inserts a button with popupmenu.
intinsertButton(QPixmap pixmap, int id, QPopupMenu popup, boolean enabled, String _text)
intinsertCombo(String[] list, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled, String tooltiptext, int size, int index, int policy)
Inserts a KComboBox with list.
intinsertCombo(String[] list, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled, String tooltiptext, int size, int index)
intinsertCombo(String[] list, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled, String tooltiptext, int size)
intinsertCombo(String[] list, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled, String tooltiptext)
intinsertCombo(String[] list, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled)
intinsertCombo(String[] list, int id, boolean writable, String signal, QObject receiver, String slot)
intinsertCombo(String text, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled, String tooltiptext, int size, int index, int policy)
Insert a KComboBox with text.
intinsertCombo(String text, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled, String tooltiptext, int size, int index)
intinsertCombo(String text, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled, String tooltiptext, int size)
intinsertCombo(String text, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled, String tooltiptext)
intinsertCombo(String text, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled)
intinsertCombo(String text, int id, boolean writable, String signal, QObject receiver, String slot)
voidinsertComboItem(int id, String text, int index)
Inserts text in combobox id at position index.
voidinsertComboList(int id, String[] list, int index)
Inserts list in combobox id at position index.
intinsertLined(String text, int id, String signal, QObject receiver, String slot, boolean enabled, String toolTipText, int size, int index)
Inserts a KLineEdit.
intinsertLined(String text, int id, String signal, QObject receiver, String slot, boolean enabled, String toolTipText, int size)
intinsertLined(String text, int id, String signal, QObject receiver, String slot, boolean enabled, String toolTipText)
intinsertLined(String text, int id, String signal, QObject receiver, String slot, boolean enabled)
intinsertLined(String text, int id, String signal, QObject receiver, String slot)
intinsertLineSeparator(int index, int id)
Inserts a line separator into the toolbar with the given id.
intinsertLineSeparator(int index)
intinsertLineSeparator()
intinsertSeparator(int index, int id)
Inserts a separator into the toolbar with the given id.
intinsertSeparator(int index)
intinsertSeparator()
intinsertWidget(int id, int width, QWidget _widget, int index)
Inserts a user-defined widget.
intinsertWidget(int id, int width, QWidget _widget)
booleanisButtonOn(int id)
Returns true if button is on and is a toggle button
booleanisDisposed()
Has the wrapped C++ instance been deleted?
intitemIndex(int id)
Returns the index of the item id.
voidloadState(QDomElement e)
Load state from an XML element, called by KXMLGUIBuilder
QMetaObjectmetaObject()
QSizeminimumSize()
QSizeminimumSizeHint()
protected voidmousePressEvent(QMouseEvent arg1)
voidpositionYourself(boolean force)
voidpositionYourself()
voidremoveComboItem(int id, int index)
Removes item index from combobox id.
voidremoveItem(int id)
Remove item id. Item is deleted.
voidremoveItemDelayed(int id)
Remove item id. Item is deleted when toolbar is redrawn.
protected voidresizeEvent(QResizeEvent e)
voidsaveSettings(KConfig config, String configGroup)
Save the toolbar settings to group configGroup in config.
voidsaveState()
Instruct the toolbar to save it's current state to either the app config file or to the XML-GUI resource file (whichever has precedence).
voidsaveState(QDomElement e)
voidsetAutoRepeat(int id, boolean flag)
Turns a button into an autorepeat button.
voidsetAutoRepeat(int id)
voidsetBarPos(int bpos)
Set position of toolbar.
voidsetButton(int id, boolean flag)
Sets a toggle button state.
voidsetButtonIcon(int id, String _icon)
Sets the icon for a button.
voidsetButtonIconSet(int id, QIconSet iconset)
Sets a button icon from a QIconSet.
voidsetButtonPixmap(int id, QPixmap _pixmap)
Sets button pixmap.
voidsetCurrentComboItem(int id, int index)
Sets item index to be current item in combobox id.
voidsetDelayedPopup(int id, QPopupMenu _popup, boolean toggle)
Sets a delayed popup for a button.
voidsetDelayedPopup(int id, QPopupMenu _popup)
voidsetEnableContextMenu(boolean enable)
This allows you to enable or disable the context menu.
voidsetEnableContextMenu()
voidsetFlat(boolean flag)
voidsetFullSize(boolean flag)
Set toolbar to full parent size (default).
voidsetFullSize()
voidsetIconSize(int size)
Set the icon size to load.
voidsetIconSize(int size, boolean update)
Same as setIconText(int size) but allows you to disable the toolbar update.
voidsetIconText(int it)
Set the kind of painting for buttons.
voidsetIconText(int it, boolean update)
Similar to setIconText(IconText it) but allows you to disable or enable updating.
voidsetIconText(String txt)
voidsetItemAutoSized(int id, boolean yes)
Set item autosized.
voidsetItemAutoSized(int id)
voidsetItemEnabled(int id, boolean enabled)
Enables/disables item.
voidsetItemNoStyle(int id, boolean no_style)
This will inform a toolbar button to ignore certain style changes.
voidsetItemNoStyle(int id)
voidsetLinedText(int id, String text)
Sets the text of a line editor.
voidsetStretchableWidget(QWidget w)
protected StringsettingsGroup()
voidsetText(String txt)
Assign a (translated) text to this toolbar.
voidsetTitle(String _title)
Set title for toolbar when it floats.
voidsetToggle(int id, boolean flag)
Turns button into a toggle button if flag is true.
voidsetToggle(int id)
voidsetXMLGUIClient(KXMLGUIClientInterface client)
voidshow()
voidshowEvent(QShowEvent e)
voidshowItem(int id)
Show item id.
QSizesizeHint()
QSizePolicysizePolicy()
Stringtext()
Returns the toolbar's text.
voidtoggleButton(int id)
Toggles a togglebutton.
static booleantransparentSetting()
Returns the global setting for "Toolbars transparent when moving"
voidupdateRects(boolean arg1)
voidupdateRects()

Field Detail

Bottom

public static final int Bottom

Flat

public static final int Flat

Floating

public static final int Floating

IconOnly

public static final int IconOnly

IconTextBottom

public static final int IconTextBottom

IconTextRight

public static final int IconTextRight

Left

public static final int Left

Right

public static final int Right

TextOnly

public static final int TextOnly

Top

public static final int Top

Unmanaged

public static final int Unmanaged
Possible bar positions.

UNKNOWN: Possible bar positions.

Constructor Detail

KToolBar

protected KToolBar(Class dummy)

KToolBar

public KToolBar(QWidget parent, String name, boolean honorStyle, boolean readConfig)
Normal constructor. This constructor is used by the XML-GUI. If you use it, you need to call QMainWindow.addToolBar to specify the position of the toolbar. So it's simpler to use the other constructor. The toolbar will read in various global config settings for things like icon size and text position, etc. However, some of the settings will be honored only if honorStyle is set to true. All other toolbars will be IconOnly and use Medium icons.

Parameters: parent The standard toolbar parent (usually a KMainWindow) name The standard internal name honorStyle If true, then global settings for IconSize and IconText will be honored readConfig whether to apply the configuration (global and application-specific)

UNKNOWN: Normal constructor.

KToolBar

public KToolBar(QWidget parent, String name, boolean honorStyle)

KToolBar

public KToolBar(QWidget parent, String name)

KToolBar

public KToolBar(QWidget parent)

KToolBar

public KToolBar(QMainWindow parentWindow, int dock, boolean newLine, String name, boolean honorStyle, boolean readConfig)
Constructor for non-XML-GUI applications. The toolbar will read in various global config settings for things like icon size and text position, etc. However, some of the settings will be honored only if honorStyle is set to true. All other toolbars will be IconOnly and use Medium icons.

Parameters: parentWindow The window that should be the parent of this toolbar dock The position of the toolbar. Usually QMainWindow.Top. newLine If true, start a new line in the dock for this toolbar. name The standard internal name honorStyle If true, then global settings for IconSize and IconText will be honored readConfig whether to apply the configuration (global and application-specific)

UNKNOWN: Constructor for non-XML-GUI applications.

KToolBar

public KToolBar(QMainWindow parentWindow, int dock, boolean newLine, String name, boolean honorStyle)

KToolBar

public KToolBar(QMainWindow parentWindow, int dock, boolean newLine, String name)

KToolBar

public KToolBar(QMainWindow parentWindow, int dock, boolean newLine)

KToolBar

public KToolBar(QMainWindow parentWindow, int dock)

KToolBar

public KToolBar(QMainWindow parentWindow, QWidget dock, boolean newLine, String name, boolean honorStyle, boolean readConfig)
Constructor for non-XML-GUI applications. The toolbar will read in various global config settings for things like icon size and text position, etc. However, some of the settings will be honored only if honorStyle is set to true. All other toolbars will be IconOnly and use Medium icons.

Parameters: parentWindow The window that should be the parent of this toolbar dock Another widget than the mainwindow to dock toolbar to. newLine If true, start a new line in the dock for this toolbar. name The standard internal name honorStyle If true, then global settings for IconSize and IconText will be honored readConfig whether to apply the configuration (global and application-specific)

UNKNOWN: Constructor for non-XML-GUI applications.

KToolBar

public KToolBar(QMainWindow parentWindow, QWidget dock, boolean newLine, String name, boolean honorStyle)

KToolBar

public KToolBar(QMainWindow parentWindow, QWidget dock, boolean newLine, String name)

KToolBar

public KToolBar(QMainWindow parentWindow, QWidget dock, boolean newLine)

KToolBar

public KToolBar(QMainWindow parentWindow, QWidget dock)

Method Detail

addConnection

public void addConnection(int id, String signal, QObject receiver, String slot)
Adds connections to items. It is important that you know the id of particular item. Nothing happens if you forget id.

UNKNOWN: Adds connections to items.

alignItemRight

public void alignItemRight(int id, boolean right)
Align item to the right. This works only if toolbar is set to full width.

See Also: KToolBar

UNKNOWN: Align item to the right.

alignItemRight

public void alignItemRight(int id)

animatedWidget

public KAnimWidget animatedWidget(int id)
This will return a pointer to the animated widget with the given id, if it exists.

Parameters: id The id for the widget you want to get a pointer to

Returns: A pointer to the current animated widget or 0L

See Also: KToolBar

UNKNOWN: This will return a pointer to the animated widget with the given id, if it exists.

applyAppearanceSettings

protected void applyAppearanceSettings(KConfig config, String _configGroup, boolean forceGlobal)

applyAppearanceSettings

protected void applyAppearanceSettings(KConfig config, String _configGroup)

applySettings

public void applySettings(KConfig config, String configGroup, boolean force)
Read the toolbar settings from group configGroup in config and apply them. Even default settings are re-applied if force is set.

UNKNOWN: Read the toolbar settings from group configGroup in config and apply them.

applySettings

public void applySettings(KConfig config, String configGroup)

barPos

public int barPos()
Returns the toolbar position.

Returns: position of toolbar.

UNKNOWN: Returns the toolbar position.

changeComboItem

public void changeComboItem(int id, String text, int index)
Changes item index in combobox id to text. index = -1 refers current item (one displayed in the button).

UNKNOWN: Changes item index in combobox id to text.

changeComboItem

public void changeComboItem(int id, String text)

childEvent

protected void childEvent(QChildEvent e)

className

public String className()

clear

public void clear()
Remove all items. The toolbar is redrawn after it.

UNKNOWN: Remove all items.

clearCombo

public void clearCombo(int id)
Clears the combobox id. Does not delete it or hide it.

UNKNOWN: Clears the combobox id.

contextMenuEnabled

public boolean contextMenuEnabled()
Returns the context menu enabled flag

Returns: true if the context menu is disabled

UNKNOWN: Returns the context menu enabled flag

count

public int count()
Returns the total number of items in the toolbar

Returns: the total number of items in the toolbar

UNKNOWN: Returns the total number of items in the toolbar

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

event

public boolean event(QEvent e)

finalize

protected void finalize()
Deletes the wrapped C++ instance

fullSize

public boolean fullSize()
Returns the full-size mode enabled flag.

Returns: true if the full-size mode is enabled.

UNKNOWN: Returns the full-size mode enabled flag.

getButton

public KToolBarButton getButton(int id)
Returns a pointer to KToolBarButton. Example:
		 KToolBarButton  button = toolbar.getButton(button_id);
		 
That way you can get access to other public methods that KToolBarButton provides. Using this method is not recommended.

UNKNOWN: Returns a pointer to KToolBarButton.

getCombo

public KComboBox getCombo(int id)
Returns a pointer to the combobox with id. Example:
		 KComboBox combo = toolbar.getCombo(combo_id);
		 
That way you can get access to other public methods that KComboBox provides.

Returns: a pointer to the combobox with id.

UNKNOWN: Returns a pointer to the combobox with id.

getComboItem

public String getComboItem(int id, int index)
Returns text of item index from combobox id. index = -1 refers to current item.

Returns: text of item index from combobox id.

UNKNOWN: Returns text of item index from combobox id.

getComboItem

public String getComboItem(int id)

getLined

public KLineEdit getLined(int id)
Returns a pointer to KToolBarLined with id. Example:
		 KLineEdit  lined = toolbar.getKToolBarLined(lined_id);
		 
That way you can get access to other public methods that KLineEdit provides. KLineEdit is the same thing as QLineEdit plus completion signals.

Returns: a pointer to KToolBarLined with id.

UNKNOWN: Returns a pointer to KToolBarLined with id.

getLinedText

public String getLinedText(int id)
Returns the line editor text.

Returns: the line editor text.

UNKNOWN: Returns the line editor text.

getWidget

public QWidget getWidget(int id)
Returns a pointer to the widget corresponding to id. Wrong ids are not tested. You can do with this whatever you want, except change its height (hardcoded). If you change its width you will probably have to call QToolBar.updateRects(true)

Returns: a pointer to the widget corresponding to id.

See Also: org.kde.qt.QWidget KToolBar

UNKNOWN: Returns a pointer to the widget corresponding to id.

hide

public void hide()

hideItem

public void hideItem(int id)
Hide item id.

UNKNOWN: Hide item id.

highlight

public boolean highlight()

highlightSetting

public static boolean highlightSetting()
Returns the global setting for "Highlight buttons under mouse"

Returns: global setting for "Highlight buttons under mouse"

UNKNOWN: Returns the global setting for "Highlight buttons under mouse"

iconSize

public int iconSize()
Returns the current icon size for buttons.

Returns: the current icon size for buttons.

UNKNOWN: Returns the current icon size for buttons.

iconSizeDefault

public int iconSizeDefault()
Returns the default size for this type of toolbar.

Returns: the default size for this type of toolbar.

UNKNOWN: Returns the default size for this type of toolbar.

iconTextId

public int iconTextId()
Returns the current text style for buttons.

Returns: the current text style for buttons.

UNKNOWN: Returns the current text style for buttons.

iconTextSetting

public static int iconTextSetting()
Returns the global setting for "Icon Text"

Returns: global setting for "Icon Text"

UNKNOWN: Returns the global setting for "Icon Text"

idAt

public int idAt(int index)
Returns the id of the item at the given index.

UNKNOWN: Returns the id of the item at the given index.

insertAnimatedWidget

public int insertAnimatedWidget(int id, QObject receiver, String slot, String icons, int index)
Inserts an animated widget. A KAnimWidget will be created internally using the icon name you provide. This will emit a signal (clicked()) whenever the animation widget is clicked.

Parameters: id The id for this toolbar item receiver The parent of your slot slot The slot to receive the clicked() signal icons The name of the animation icon group to use index The item index

Returns: The item index

See Also: KToolBar

UNKNOWN: Inserts an animated widget.

insertAnimatedWidget

public int insertAnimatedWidget(int id, QObject receiver, String slot, String icons)

insertButton

public int insertButton(String icon, int id, boolean enabled, String text, int index, KInstanceInterface _instance)
Insert a button (a KToolBarButton) with a pixmap. The pixmap is loaded by the button itself based on the global icon settings. You should connect to one or more signals in KToolBar: clicked() , pressed() , released() , or highlighted() and if the button is a toggle button ( setToggle() ) toggled() . Those signals have id of a button that caused the signal. If you want to bind a popup to button, see setButton().

Parameters: icon The name of the icon to use as the active pixmap id The id of this button enabled Enable or disable the button at startup text The tooltip or toolbar text (depending on state) index The position of the button. (-1 = at end). _instance instance this button will belong to

Returns: The item index.

UNKNOWN: Insert a button (a KToolBarButton) with a pixmap.

insertButton

public int insertButton(String icon, int id, boolean enabled, String text, int index)

insertButton

public int insertButton(String icon, int id, boolean enabled, String text)

insertButton

public int insertButton(String icon, int id, boolean enabled)

insertButton

public int insertButton(String icon, int id)

insertButton

public int insertButton(String icon, int id, String signal, QObject receiver, String slot, boolean enabled, String text, int index, KInstanceInterface _instance)
This is the same as above, but with specified signals and slots to which this button will be connected. You can add more signals with addConnection().

Parameters: icon The name of the icon to use as the active pixmap id The id of this button signal The signal to connect to receiver The slot's parent slot The slot to receive the signal specified in that argument. enabled Enable or disable the button at startup text The tooltip or toolbar text (depending on state) index The position of the button. (-1 = at end). _instance instance this button will belong to

Returns: The item index.

UNKNOWN: This is the same as above, but with specified signals and slots to which this button will be connected.

insertButton

public int insertButton(String icon, int id, String signal, QObject receiver, String slot, boolean enabled, String text, int index)

insertButton

public int insertButton(String icon, int id, String signal, QObject receiver, String slot, boolean enabled, String text)

insertButton

public int insertButton(String icon, int id, String signal, QObject receiver, String slot, boolean enabled)

insertButton

public int insertButton(String icon, int id, String signal, QObject receiver, String slot)

insertButton

public int insertButton(QPixmap pixmap, int id, boolean enabled, String text, int index)
Inserts a button (a KToolBarButton) with the specified pixmap. This pixmap will be used as the "active" one and the disabled and default ones will be autogenerated. It is recommended that you use the insertButton function that allows you to specify the icon name rather then the pixmap itself. Specifying the icon name is much more flexible. You should connect to one or more signals in KToolBar: clicked() , pressed() , released() , or highlighted() and if the button is a toggle button ( setToggle() ) toggled() . Those signals have id of a button that caused the signal. If you want to bind a popup to button, see setButton().

Parameters: pixmap The active pixmap id The id of this button enabled Enable or disable the button at startup text The tooltip or toolbar text (depending on state) index The position of the button. (-1 = at end).

Returns: The item index.

UNKNOWN: Inserts a button (a KToolBarButton) with the specified pixmap.

insertButton

public int insertButton(QPixmap pixmap, int id, boolean enabled, String text)

insertButton

public int insertButton(QPixmap pixmap, int id, boolean enabled)

insertButton

public int insertButton(QPixmap pixmap, int id)

insertButton

public int insertButton(QPixmap pixmap, int id, String signal, QObject receiver, String slot, boolean enabled, String text, int index)
This is the same as above, but with specified signals and slots to which this button will be connected. You can add more signals with addConnection().

Parameters: pixmap The name of the icon to use as the active pixmap id The id of this button signal The signal to connect to receiver The slot's parent slot The slot to receive the signal specified in that argument. enabled Enable or disable the button at startup text The tooltip or toolbar text (depending on state) index The position of the button. (-1 = at end).

Returns: The item index.

UNKNOWN: This is the same as above, but with specified signals and slots to which this button will be connected.

insertButton

public int insertButton(QPixmap pixmap, int id, String signal, QObject receiver, String slot, boolean enabled, String text)

insertButton

public int insertButton(QPixmap pixmap, int id, String signal, QObject receiver, String slot, boolean enabled)

insertButton

public int insertButton(QPixmap pixmap, int id, String signal, QObject receiver, String slot)

insertButton

public int insertButton(String icon, int id, QPopupMenu popup, boolean enabled, String _text, int index)
Inserts a button with popupmenu. Button will have small triangle. You have to connect to popup's signals. The signals KButton.pressed(), KButton.released(), KButton.clicked() or KButton.doubleClicked() are not emmited by this button (see setDelayedPopup() for that). You can add custom popups which inherit QPopupMenu to get popups with tables, drawings etc. Just don't fiddle with events there.

UNKNOWN: Inserts a button with popupmenu.

insertButton

public int insertButton(String icon, int id, QPopupMenu popup, boolean enabled, String _text)

insertButton

public int insertButton(QPixmap pixmap, int id, QPopupMenu popup, boolean enabled, String _text, int index)
Inserts a button with popupmenu. Button will have small triangle. You have to connect to popup's signals. The signals KButton.pressed(), KButton.released(), KButton.clicked() or KButton.doubleClicked() are not emmited by this button (see setDelayedPopup() for that). You can add custom popups which inherit QPopupMenu to get popups with tables, drawings etc. Just don't fiddle with events there.

UNKNOWN: Inserts a button with popupmenu.

insertButton

public int insertButton(QPixmap pixmap, int id, QPopupMenu popup, boolean enabled, String _text)

insertCombo

public int insertCombo(String[] list, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled, String tooltiptext, int size, int index, int policy)
Inserts a KComboBox with list. Can be writable, but cannot contain pixmaps. By default inserting policy is AtBottom, i.e. typed items are placed at the bottom of the list. Can be autosized. If the size argument is specified as -1, the width of the combobox is automatically computed.

Returns: Item index.

See Also: KToolBar KToolBar KComboBox

UNKNOWN: Inserts a KComboBox with list.

insertCombo

public int insertCombo(String[] list, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled, String tooltiptext, int size, int index)

insertCombo

public int insertCombo(String[] list, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled, String tooltiptext, int size)

insertCombo

public int insertCombo(String[] list, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled, String tooltiptext)

insertCombo

public int insertCombo(String[] list, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled)

insertCombo

public int insertCombo(String[] list, int id, boolean writable, String signal, QObject receiver, String slot)

insertCombo

public int insertCombo(String text, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled, String tooltiptext, int size, int index, int policy)
Insert a KComboBox with text. The rest is the same as above.

Returns: Item index.

See Also: KToolBar KComboBox

UNKNOWN: Insert a KComboBox with text.

insertCombo

public int insertCombo(String text, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled, String tooltiptext, int size, int index)

insertCombo

public int insertCombo(String text, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled, String tooltiptext, int size)

insertCombo

public int insertCombo(String text, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled, String tooltiptext)

insertCombo

public int insertCombo(String text, int id, boolean writable, String signal, QObject receiver, String slot, boolean enabled)

insertCombo

public int insertCombo(String text, int id, boolean writable, String signal, QObject receiver, String slot)

insertComboItem

public void insertComboItem(int id, String text, int index)
Inserts text in combobox id at position index.

UNKNOWN: Inserts text in combobox id at position index.

insertComboList

public void insertComboList(int id, String[] list, int index)
Inserts list in combobox id at position index.

UNKNOWN: Inserts list in combobox id at position index.

insertLined

public int insertLined(String text, int id, String signal, QObject receiver, String slot, boolean enabled, String toolTipText, int size, int index)
Inserts a KLineEdit. You have to specify signals and slots to which KLineEdit will be connected. KLineEdit has all slots QLineEdit has, plus signals KLineEdit.completion and KLineEdit.textRotation KLineEdit can be set to autoresize itself to full free width in toolbar, that is to last right aligned item. For that, toolbar must be set to full width (which it is by default).

Returns: Item index.

See Also: KToolBar KToolBar KLineEdit

UNKNOWN: Inserts a KLineEdit.

insertLined

public int insertLined(String text, int id, String signal, QObject receiver, String slot, boolean enabled, String toolTipText, int size)

insertLined

public int insertLined(String text, int id, String signal, QObject receiver, String slot, boolean enabled, String toolTipText)

insertLined

public int insertLined(String text, int id, String signal, QObject receiver, String slot, boolean enabled)

insertLined

public int insertLined(String text, int id, String signal, QObject receiver, String slot)

insertLineSeparator

public int insertLineSeparator(int index, int id)
Inserts a line separator into the toolbar with the given id.

Returns: the separator's index

UNKNOWN: Inserts a line separator into the toolbar with the given id.

insertLineSeparator

public int insertLineSeparator(int index)

insertLineSeparator

public int insertLineSeparator()

insertSeparator

public int insertSeparator(int index, int id)
Inserts a separator into the toolbar with the given id.

Returns: the separator's index

UNKNOWN: Inserts a separator into the toolbar with the given id.

insertSeparator

public int insertSeparator(int index)

insertSeparator

public int insertSeparator()

insertWidget

public int insertWidget(int id, int width, QWidget _widget, int index)
Inserts a user-defined widget. The widget must have this toolbar as its parent. Widget must have a QWidget for base class. Widget can be autosized to full width. If you forget about it, you can get a pointer to this widget with getWidget().

Returns: Item index.

See Also: KToolBar

UNKNOWN: Inserts a user-defined widget.

insertWidget

public int insertWidget(int id, int width, QWidget _widget)

isButtonOn

public boolean isButtonOn(int id)
Returns true if button is on and is a toggle button

Returns: true if button is on and is a toggle button

See Also: KToolBar

UNKNOWN: Returns true if button is on and is a toggle button

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

itemIndex

public int itemIndex(int id)
Returns the index of the item id.

Returns: the index of the item id.

UNKNOWN: Returns the index of the item id.

loadState

public void loadState(QDomElement e)
Load state from an XML element, called by KXMLGUIBuilder

UNKNOWN: Load state from an XML element, called by KXMLGUIBuilder

metaObject

public QMetaObject metaObject()

minimumSize

public QSize minimumSize()

minimumSizeHint

public QSize minimumSizeHint()

mousePressEvent

protected void mousePressEvent(QMouseEvent arg1)

positionYourself

public void positionYourself(boolean force)

UNKNOWN:

positionYourself

public void positionYourself()

removeComboItem

public void removeComboItem(int id, int index)
Removes item index from combobox id.

UNKNOWN: Removes item index from combobox id.

removeItem

public void removeItem(int id)
Remove item id. Item is deleted. Toolbar is redrawn after it.

UNKNOWN: Remove item id.

removeItemDelayed

public void removeItemDelayed(int id)
Remove item id. Item is deleted when toolbar is redrawn.

UNKNOWN: Remove item id.

resizeEvent

protected void resizeEvent(QResizeEvent e)

saveSettings

public void saveSettings(KConfig config, String configGroup)
Save the toolbar settings to group configGroup in config.

UNKNOWN: Save the toolbar settings to group configGroup in config.

saveState

public void saveState()
Instruct the toolbar to save it's current state to either the app config file or to the XML-GUI resource file (whichever has precedence).

UNKNOWN: Instruct the toolbar to save it's current state to either the app config file or to the XML-GUI resource file (whichever has precedence).

saveState

public void saveState(QDomElement e)

setAutoRepeat

public void setAutoRepeat(int id, boolean flag)
Turns a button into an autorepeat button. Toggle buttons, buttons with menus, or buttons with delayed menus cannot be made into autorepeat buttons. Moreover, you can and will receive only the signal clicked(), but not pressed() or released(). When the user presses this button, you will receive the signal clicked(), and if the button is still pressed after some time, you will receive more clicked() signals separated by regular intervals. Since this uses QButton.setAutoRepeat() , I can't quantify 'some'.

UNKNOWN: Turns a button into an autorepeat button.

setAutoRepeat

public void setAutoRepeat(int id)

setBarPos

public void setBarPos(int bpos)
Set position of toolbar.

See Also: BarPosition

UNKNOWN: Set position of toolbar.

setButton

public void setButton(int id, boolean flag)
Sets a toggle button state. If the button is a toggle button (see setToggle()) this will set its state flag. This will also emit the signal KButton.toggled().

See Also: KToolBar

UNKNOWN: Sets a toggle button state.

setButtonIcon

public void setButtonIcon(int id, String _icon)
Sets the icon for a button. Can be used while button is visible.

UNKNOWN: Sets the icon for a button.

setButtonIconSet

public void setButtonIconSet(int id, QIconSet iconset)
Sets a button icon from a QIconSet. Can be used while button is visible.

UNKNOWN: Sets a button icon from a QIconSet.

setButtonPixmap

public void setButtonPixmap(int id, QPixmap _pixmap)
Sets button pixmap. Can be used while button is visible.

UNKNOWN: Sets button pixmap.

setCurrentComboItem

public void setCurrentComboItem(int id, int index)
Sets item index to be current item in combobox id.

UNKNOWN: Sets item index to be current item in combobox id.

setDelayedPopup

public void setDelayedPopup(int id, QPopupMenu _popup, boolean toggle)
Sets a delayed popup for a button. Delayed popup is what you see in Netscape Navigator's Previous and Next buttons: If you click them you go back or forth. If you press them long enough, you get a history-menu. This is exactly what we do here. You will insert a normal button with connection (or use signals from toolbar):
		 bar.insertButton(icon, id, SIGNAL("clicked ()"), this,
		                   SLOT (slotClick()), true, "click or wait for popup");
		 
And then add a delayed popup:
		 bar.setDelayedPopup (id, historyPopup);
		 
Don't add delayed popups to buttons which have normal popups. You may add popups which are derived from QPopupMenu. You may add popups that are already in the menu bar or are submenus of other popups.

UNKNOWN: Sets a delayed popup for a button.

setDelayedPopup

public void setDelayedPopup(int id, QPopupMenu _popup)

setEnableContextMenu

public void setEnableContextMenu(boolean enable)
This allows you to enable or disable the context menu.

Parameters: enable If false, then the context menu will be disabled

UNKNOWN: This allows you to enable or disable the context menu.

setEnableContextMenu

public void setEnableContextMenu()

setFlat

public void setFlat(boolean flag)

setFullSize

public void setFullSize(boolean flag)
Set toolbar to full parent size (default). In full size mode the bar extends over the parent's full width or height. If the mode is disabled the toolbar tries to take as much space as it needs without wrapping, but it does not exceed the parent box. You can force a certain width or height with setMaxWidth() or setMaxHeight(). If you want to use right-aligned items or auto-sized items you must use full size mode.

UNKNOWN: Set toolbar to full parent size (default).

setFullSize

public void setFullSize()

setIconSize

public void setIconSize(int size)
Set the icon size to load. Usually you should not call this, the icon size is taken care of by KIconLoader and globally configured. By default, the toolbar will load icons of size 32 for main toolbars and 22 for other toolbars

Parameters: size The size to use

See Also: #

UNKNOWN: Set the icon size to load.

setIconSize

public void setIconSize(int size, boolean update)
Same as setIconText(int size) but allows you to disable the toolbar update.

Parameters: size The size to use update If true, then the toolbar will be updated after this

UNKNOWN: Same as setIconText(int size) but allows you to disable the toolbar update.

setIconText

public void setIconText(int it)
Set the kind of painting for buttons. Choose from:
  • IconOnly (only icons),
  • IconTextRight (icon and text, text is left from icons),
  • TextOnly (only text),
  • IconTextBottom (icons and text, text is under icons).
  • See Also: IconText

    UNKNOWN: Set the kind of painting for buttons.

    setIconText

    public void setIconText(int it, boolean update)
    Similar to setIconText(IconText it) but allows you to disable or enable updating. If update is false, then the buttons will not be updated. This is useful only if you know that you will be forcing an update later.

    UNKNOWN: Similar to setIconText(IconText it) but allows you to disable or enable updating.

    setIconText

    public void setIconText(String txt)

    setItemAutoSized

    public void setItemAutoSized(int id, boolean yes)
    Set item autosized. This works only if the toolbar is set to full width. Only one item can be autosized, and it has to be the last left-aligned item. Items that come after this must be right aligned. Items that can be right aligned are Lineds, Frames, Widgets and Combos. An autosized item will resize itself whenever the toolbar geometry changes to the last right-aligned item (or to end of toolbar if there are no right-aligned items.)

    See Also: KToolBar KToolBar

    UNKNOWN: Set item autosized.

    setItemAutoSized

    public void setItemAutoSized(int id)

    setItemEnabled

    public void setItemEnabled(int id, boolean enabled)
    Enables/disables item.

    UNKNOWN: Enables/disables item.

    setItemNoStyle

    public void setItemNoStyle(int id, boolean no_style)
    This will inform a toolbar button to ignore certain style changes. Specifically, it will ignore IconText (always IconOnly) and will not allow image effects to apply.

    Parameters: id The button to exclude from styles no_style If true, then it is excluded (default: true).

    UNKNOWN: This will inform a toolbar button to ignore certain style changes.

    setItemNoStyle

    public void setItemNoStyle(int id)

    setLinedText

    public void setLinedText(int id, String text)
    Sets the text of a line editor. Cursor is set at end of text.

    UNKNOWN: Sets the text of a line editor.

    setStretchableWidget

    public void setStretchableWidget(QWidget w)

    settingsGroup

    protected String settingsGroup()

    setText

    public void setText(String txt)
    Assign a (translated) text to this toolbar. This is used for the tooltip on the handle, and when listing the toolbars.

    UNKNOWN: Assign a (translated) text to this toolbar.

    setTitle

    public void setTitle(String _title)
    Set title for toolbar when it floats. Titles are however not (yet) visible. You can't change toolbar's title while it's floating.

    UNKNOWN: Set title for toolbar when it floats.

    setToggle

    public void setToggle(int id, boolean flag)
    Turns button into a toggle button if flag is true.

    UNKNOWN: Turns button into a toggle button if flag is true.

    setToggle

    public void setToggle(int id)

    setXMLGUIClient

    public void setXMLGUIClient(KXMLGUIClientInterface client)

    show

    public void show()

    showEvent

    public void showEvent(QShowEvent e)

    showItem

    public void showItem(int id)
    Show item id.

    UNKNOWN: Show item id.

    sizeHint

    public QSize sizeHint()

    sizePolicy

    public QSizePolicy sizePolicy()

    text

    public String text()
    Returns the toolbar's text.

    Returns: the toolbar's text.

    UNKNOWN: Returns the toolbar's text.

    toggleButton

    public void toggleButton(int id)
    Toggles a togglebutton. If the button is a toggle button (see setToggle()) the button state will be toggled. This will also cause the toolbar to emit the signal KButton.toggled() with parameter id. You must connect to this signal, or use addConnection() to connect directly to the button signal KButton.toggled().

    UNKNOWN: Toggles a togglebutton.

    transparentSetting

    public static boolean transparentSetting()
    Returns the global setting for "Toolbars transparent when moving"

    Returns: global setting for "Toolbars transparent when moving"

    UNKNOWN: Returns the global setting for "Toolbars transparent when moving"

    updateRects

    public void updateRects(boolean arg1)

    updateRects

    public void updateRects()