5 #ifndef CNOID_BASE_TOOL_BAR_H
6 #define CNOID_BASE_TOOL_BAR_H
13 #include "exportdecl.h"
18 class ExtensionManager;
22 class CNOID_EXPORT
ToolBar :
public QWidget
30 ToolButton* addButton(
const QString& text,
const QString& tooltip = QString());
31 ToolButton* addButton(
const QIcon& icon,
const QString& tooltip = QString());
32 ToolButton* addButton(
const char*
const* xpm,
const QString& tooltip = QString());
34 ToolButton* addToggleButton(
const QString& text,
const QString& tooltip = QString());
35 ToolButton* addToggleButton(
const QIcon& icon,
const QString& tooltip = QString());
36 ToolButton* addToggleButton(
const char*
const* xpm,
const QString& tooltip = QString());
38 void requestNewRadioGroup();
39 QButtonGroup* currentRadioGroup();
41 ToolButton* addRadioButton(
const QString& text,
const QString& tooltip = QString());
42 ToolButton* addRadioButton(
const QIcon& icon,
const QString& tooltip = QString());
43 ToolButton* addRadioButton(
const char*
const* xpm,
const QString& tooltip = QString());
45 void addAction(QAction* action);
46 void addWidget(QWidget* widget);
47 QLabel* addLabel(
const QString& text);
48 QLabel* addImage(
const QString& filename);
49 QWidget* addSeparator();
50 void addSpacing(
int spacing = -1);
52 ToolBar& setInsertionPosition(
int index);
60 virtual int stretchableDefaultWidth()
const;
69 return (bar1->layoutPriority < bar2->layoutPriority);
73 virtual bool storeState(
Archive& archive);
74 virtual bool restoreState(
const Archive& archive);
77 void setEnabled(
bool on);
78 void changeIconSize(
const QSize& iconSize);
82 int insertionPosition;
84 QButtonGroup* radioGroup;
85 bool isNewRadioGroupRequested;
88 bool isVisibleByDefault_;
89 bool isPlacedOnNewRowByDefault_;
90 bool isAutoRaiseByDefault_;
98 void changeIconSizeSub(QLayout* layout,
const QSize& iconSize);