QLabel{border: 1px solid #ffcccc; background-color: #000000; border-radius: 10px; font: bold 15px; color: #ffffff;
QApplication a(argc, argv); MainWindow w; QGraphicsScene scene(0, 0, 500, 500); QGraphicsView gv(&scene, &w); gv.setGeometry(100, 100, 600, 600); gv.setStyleSheet("QGraphicsView{background: qlineargradient(spread:pad, x1:1, y1:1, x2:0, y2:0,stop:0.403409 rgba(10, 10, 10, 255),stop:1 rgba(155, 155, 155, 255));}"); MyWidget *widget = new MyWidget(); widget->setGeometry(10, 10, 400, 50); widget->setText("Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello "); widget->setAlignment(Qt::AlignTop | Qt::AlignLeft | Qt::AlignVCenter); widget->setWordWrap(true); widget->setStyleSheet("QLabel{border: 1px solid #ffcccc;\ background-color: #000000;\ border-radius: 10px;\ font: bold 15px;\ color: #ffffff;}"); QGraphicsProxyWidget *proxy = scene.addWidget(widget); w.setStyleSheet("QMainWindow{background: qlineargradient(spread:pad, x1:1, y1:1, x2:0, y2:0,stop:0.403409 rgba(10, 10, 10, 255),stop:1 rgba(155, 155, 155, 255));}"); w.show(); return a.exec();