You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
2.5 KiB
C

#ifndef SARIBBONPANNELITEM_H
#define SARIBBONPANNELITEM_H
#include "SARibbonGlobal.h"
#include <QWidgetItem>
#include <QAction>
class SARibbonToolButton;
/**
* @brief pannelqttoolbar
*
* qttoolbarpannelQActiongalleryQAction
* QActionSARibbonPannelItemSARibbonPannelItemwidgetSARibbonPannel
* SARibbonPannelItem
*
* actionSARibbonToolButton
*/
class SA_RIBBON_EXPORT SARibbonPannelItem : public QWidgetItem
{
public:
/**
* @brief ribbonlargemediasmall
*/
enum RowProportion
{
None, ///< 为定义占比这时候将会依据expandingDirections来判断如果能有Qt::Vertical就等同于Large否则就是Small
Large, ///< 大占比一个widget的高度会充满整个pannel
Medium, ///< 中占比,在@ref SARibbonPannel::pannelLayoutMode 为 @ref SARibbonPannel::ThreeRowMode 时才会起作用且要同一列里两个都是Medium时会在三行中占据两行
Small ///< 小占比占SARibbonPannel的一行Medium在不满足条件时也会变为Small但不会变为Large
};
SARibbonPannelItem(QWidget* widget);
bool isEmpty() const Q_DECL_OVERRIDE;
short rowIndex; ///< 记录当前item属于第几行hide模式下为-1
int columnIndex; ///< 记录当前item属于第几列hide模式下为-1
QRect itemWillSetGeometry; ///< 在调用SARibbonPannelLayout::updateGeomArray会更新这个此处实际设置的时候会QWidgetItem::setGeometry设置Geometry
QAction* action; /// < 记录action参考QToolBarLayoutItem
bool customWidget; ///< 对于没有窗口的action实际也会有一个SARibbonToolButton在销毁时要delete掉
SARibbonPannelItem::RowProportion rowProportion; ///< 行的占比ribbon中有largemedia和small三种占比,见@ref RowProportion
};
#ifndef SA_ActionPropertyName_RowProportion
#define SA_ActionPropertyName_RowProportion "_sa_RowProportion"
#endif
#ifndef SA_ActionPropertyName_ToolButtonPopupMode
#define SA_ActionPropertyName_ToolButtonPopupMode "_sa_ToolButtonPopupMode"
#endif
#ifndef SA_ActionPropertyName_ToolButtonStyle
#define SA_ActionPropertyName_ToolButtonStyle "_sa_ToolButtonStyle"
#endif
#endif // SARIBBONPANNELITEM_H