#ifndef IDROPSHADOWABLE_H #define IDROPSHADOWABLE_H #include #include #include #include #include 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中通过<运算符来比较两个参数是否相等 * 即通过aa,则说明它们不相等,便会插入,否则相等。 ----------------------------------------------------------------*/ 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) < &shadows, const QSize &size); void ClearDropShadow(); private: QWidget *m_pSelfWidget; QList m_listShadows; public: void PaintShadows(); }; #endif // IDROPSHADOWABLE_H