| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 | 
							- #ifndef IDROPSHADOWABLE_H
 
- #define IDROPSHADOWABLE_H
 
- #include <QList>
 
- #include <QSize>
 
- #include <QColor>
 
- #include <QWidget>
 
- #include <QDebug>
 
- /**
 
-  * @brief 这是个数据结构,存储阴影相关的参数
 
-  */
 
- struct BoxShadow
 
- {
 
-     int x;
 
-     int y;
 
-     int radius;                 /* 一边阴影的宽度 */
 
-     int spread;                 /*  */
 
-     QColor color;
 
-     QSize boxSize;
 
-     QImage image;
 
-     //BoxShadow():x(0),y(0),radius(0),spread(0),color(QColor()),boxSize(QSize()){}
 
-     bool operator==(const BoxShadow &rhs) const
 
-     {
 
-         return (this->radius == rhs.radius)
 
-                 &&(this->spread == rhs.spread)
 
-                 &&(this->color == rhs.color)
 
-                 &&(this->boxSize == rhs.boxSize);
 
-     }
 
-     bool operator<(const BoxShadow &rhs) const
 
-     {
 
-         /*----------------------------------------------------------------
 
-          * QMap中通过<运算符来比较两个参数是否相等
 
-          * 即通过a<b来判断是否相等,若小于成立,则说明不相等,便会插入;
 
-          * 若小于不成立,则说明要么大于,要么等于;
 
-          * 然后再反过来比较一次,即b<a,若这次小于成立,则b>a,则说明它们不相等,便会插入,否则相等。
 
-         ----------------------------------------------------------------*/
 
-         if((this->radius == rhs.radius)
 
-             &&(this->spread == rhs.spread)
 
-             &&(this->color == rhs.color)
 
-             &&(this->boxSize == rhs.boxSize))
 
-         {
 
-             return false;
 
-         }
 
-         else 
 
-         {
 
-             return true;    
 
-         }
 
-         //return this->radius < rhs.radius;
 
-     }
 
-     friend QDebug operator<<(QDebug debug, const BoxShadow &boxShadow)
 
-     {
 
- //        QString info = QString("[x: %1][y: %2][radius: %3][spread: %4][size: (%5,%6)]")
 
- //                .arg(boxShadow.x).arg(boxShadow.y).arg(boxShadow.radius).arg(boxShadow.spread)
 
- //                .arg(boxShadow.boxSize.width()).arg(boxShadow.boxSize.height());
 
-         debug << QString("(%1,%2)").arg(boxShadow.x).arg(boxShadow.y)
 
-               <<boxShadow.color<<boxShadow.radius<<boxShadow.spread<<boxShadow.boxSize;
 
-         return debug;
 
-     }
 
- };
 
- Q_DECLARE_METATYPE(BoxShadow);
 
- /**
 
-  * @brief
 
-  */
 
- class IDropShadowable
 
- {
 
- public:
 
-     IDropShadowable(){}
 
-     IDropShadowable(QWidget *selfWidget);
 
- protected:
 
-     void SetDropShadow(const BoxShadow &boxShadow, const QSize &size);
 
-     void SetDropShadows(const QList<BoxShadow> &shadows, const QSize &size);
 
-     void ClearDropShadow();
 
- private:
 
-     QWidget *m_pSelfWidget;
 
-     QList<BoxShadow> m_listShadows;
 
- public:
 
-     void PaintShadows();
 
- };
 
- #endif // IDROPSHADOWABLE_H
 
 
  |