/** * @file PaiWidget.h * @brief 带有边框的widget * @date 2013-1-29 */ #ifndef PAI_FRAME_WIDGET_PAIWIDGET_H #define PAI_FRAME_WIDGET_PAIWIDGET_H #include #include "Turtle.h" namespace pai { namespace gui { /** * @class PaiWidget * @brief 带有边框的widget */ class PAI_WIDGET_EXPORT PaiWidget : public QWidget { Q_OBJECT public: /** * @brief 构造函数 * @param[in] pParent 父窗口句柄 * @param[in] flags Qt::WindowFlags */ PaiWidget(QWidget *pParent = NULL, Qt::WindowFlags flags = 0); /** * @brief 析构函数 */ virtual ~PaiWidget(); /** * @brief 选择需要显示的边框,默认全都显示 * @param[in] top 顶部边框是否显示 * @param[in] bottom 底部边框是否显示 * @param[in] left 左部边框是否显示 * @param[in] right 右部边框是否显示 */ void ShowBorder(bool top, bool bottom, bool left, bool right); /** * @brief 设置背景颜色 * @param[in] color 背景颜色 */ void SetBackgroundColor(const QColor & color); protected: /** * @brief 用来绘制边框 * @param[in] pEvent 事件对象 */ virtual void paintEvent(QPaintEvent *pEvent); private: bool m_ShowTopBorder; ///< 是否显示顶部边框 bool m_ShowBottomBorder; ///< 是否显示底部边框 bool m_ShowLeftBorder; ///< 是否显示左部边框 bool m_ShowRightBorder; ///< 是否显示右部边框 QColor m_BackgroundColor; ///< 背景颜色 }; } } #endif ///< PAI_FRAME_WIDGET_PAIWIDGET_H