105 friend class SARibbonCategoryPrivate;
106 friend class SARibbonCustomizeWidgetPrivate;
108 Q_PROPERTY(
bool isCanCustomize READ isCanCustomize WRITE setCanCustomize)
109 Q_PROPERTY(
bool isExpanding READ isExpanding WRITE setExpanding)
110 Q_PROPERTY(QString panelName READ panelName WRITE setPanelName)
139 Q_ENUM(PanelLayoutMode)
147 explicit SARibbonPanel(
const QString& name, QWidget* parent =
nullptr);
150 using QWidget::addAction;
155 void addAction(QAction* act,
156 QToolButton::ToolButtonPopupMode popMode,
159 void addLargeAction(QAction* action);
161 void addMediumAction(QAction* action);
163 void addSmallAction(QAction* action);
166 void addSmallAction(QAction* action, QToolButton::ToolButtonPopupMode popMode);
168 void addLargeAction(QAction* action, QToolButton::ToolButtonPopupMode popMode);
170 void addMediumAction(QAction* action, QToolButton::ToolButtonPopupMode popMode);
172 QAction* addAction(const QString& text,
174 QToolButton::ToolButtonPopupMode popMode,
178 void addMenu(QMenu* menu,
180 QToolButton::ToolButtonPopupMode popMode = QToolButton::InstantPopup);
182 void addLargeMenu(QMenu* menu, QToolButton::ToolButtonPopupMode popMode = QToolButton::InstantPopup);
184 void addMediumMenu(QMenu* menu, QToolButton::ToolButtonPopupMode popMode = QToolButton::InstantPopup);
186 void addSmallMenu(QMenu* menu, QToolButton::ToolButtonPopupMode popMode = QToolButton::InstantPopup);
192 QAction* addSmallWidget(QWidget* w);
195 QAction* addMediumWidget(QWidget* w);
198 QAction* addLargeWidget(QWidget* w);
204 QAction* addSeparator();
211 void setOptionAction(QAction* action);
214 bool isHaveOptionAction() const;
220 PanelLayoutMode panelLayoutMode() const;
222 void setPanelLayoutMode(PanelLayoutMode mode);
225 void resetToolButtonSize();
228 bool isTwoRow() const;
231 void setExpanding(
bool isExpanding = true);
233 bool isExpanding() const;
236 int titleHeight() const;
239 bool isEnableShowTitle() const;
242 int actionIndex(QAction* act) const;
245 void moveAction(
int from,
int to);
248 bool isCanCustomize() const;
250 void setCanCustomize(
bool b);
253 QString panelName() const;
255 void setPanelName(const QString& title);
258 int largeButtonHeight() const;
267 void updateItemGeometry();
279 void setToolButtonIconSize(const QSize& smallSize, const QSize& largeSize);
281 QPair< QSize, QSize > toolButtonIconSize() const;
284 void setLargeIconSize(const QSize& largeSize);
286 QSize largeIconSize() const;
289 void setSmallIconSize(const QSize& smallSize);
291 QSize smallIconSize() const;
300 bool isEnableWordWrap() const;
303 qreal buttonMaximumAspectRatio() const;
307 bool iterateButton(FpRibbonToolButtonIterate fp) const;
311 virtual QSize sizeHint() const Q_DECL_OVERRIDE;
313 virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE;
317 static
int panelHeightHint(const QFontMetrics& fm, PanelLayoutMode layMode,
int panelTitleHeight);
319 static
void setActionRowProportionProperty(QAction* action,
SARibbonPanelItem::RowProportion rp);
321 static
SARibbonPanelItem::RowProportion getActionRowProportionProperty(QAction* action);
323 static
void setActionToolButtonPopupModeProperty(QAction* action, QToolButton::ToolButtonPopupMode popMode);
325 static QToolButton::ToolButtonPopupMode getActionToolButtonPopupModeProperty(QAction* action);
327 static
void setActionToolButtonStyleProperty(QAction* action, Qt::ToolButtonStyle buttonStyle);
329 static Qt::ToolButtonStyle getActionToolButtonStyleProperty(QAction* action);
344 void actionTriggered(QAction* action);
357 void panelNameChanged(const QString& n);
361 virtual
void actionEvent(QActionEvent* e) Q_DECL_OVERRIDE;
363 virtual
void changeEvent(QEvent* e) Q_DECL_OVERRIDE;
372 void setTitleHeight(
int h);
375 void setSpacing(
int n);
378 void setEnableShowTitle(
bool on);
382 void setEnableWordWrap(
bool on);
385 void setButtonMaximumAspectRatio(qreal fac = 1.4);