Skip to content
QtWS25 Last Chance
  • 0 Votes
    6 Posts
    5k Views
    B
    @Sphinkie Wow, I had not noticed there is such a namespace since I'm still mainly using 5.12. If the constants are QColor objects as the doc says, then you should be able to use them directly like w->setForeground(QColorConstants::Red); w->setBackground(QColorConstants::Yellow);
  • 0 Votes
    6 Posts
    2k Views
    sierdzioS
    @TheTrueGoofy said in Read and write QBrush (QPen, QFont) as XML: Certainly this is also quite simple to implement, but I was hoping that there is a more elegant solution. I think the only other way is to create feature request for QtGui, or implement a Qt patch yourself - to add a QBrush::toString() method (or QTextStream overload), with a corresponding QBrush::fromString().
  • 0 Votes
    2 Posts
    3k Views
    H
    The solution was pretty easy, but I overlooked it: QBrush bgBrush,fgBrush; bgBrush = QBrush(color); fgBrush = QBrush(pixMap); painter->setPen(borderpen); painter->fillRect(rec, bgBrush); painter->fillRect(rec, fgBrush); painter->drawRect(rec); Just a brainfart from my side, nothing to see here. Move on!