C++ (Qt) QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect(); effect->setBlurRadius(3); ui->pushButton->setStyleSheet("border: none"); ui->pushButton->setGraphicsEffect(effect);
C++ (Qt)class TextShadowStyle : public QProxyStyle{public: void drawItemText(QPainter *painter, const QRect &rect, int flags, const QPalette &palette, bool enabled, const QString &text, QPalette::ColorRole textRole) const { if (textRole == QPalette::ButtonText) { QPalette shadowPalette(palette); shadowPalette.setColor(QPalette::ButtonText, QColor(0, 0, 0, 40)); QProxyStyle::drawItemText(painter, rect.adjusted(3, 3, 3, 3), flags, shadowPalette, enabled, text, textRole); } QProxyStyle::drawItemText(painter, rect, flags, palette, enabled, text, textRole); }}; ui->pushButton->setStyle(new TextShadowStyle);