Qt Style Sheets ExamplesWe will now see a few examples to get started with using Qt Style Sheets.Style Sheet UsageCustomizing the Foreground and Background ColorsLet's start by setting yellow as the background color of allQLineEdits in an application. This could be achieved like this: qApp->s Read More
1.在创建QGraphicsItem子类的时候,想要实现自己绘图,一般是重新实现boundingRect()和paint()函数,如果不重新实现shape(),基类的实现将会退而使用boundingRect()。2.boundingRect()这个函数的返回值是一个QRectF(一个正方形的区域),当我们需要处理我们所写的MyItem接受到的某些事件(比如鼠标按下、拖动等)时,这些事件就被规定只能发生在这个返回的矩形区域 当中时才会起被接收到。3.函数paint(QPainter*painter,constQStyleOptionGraphicsItem*option,QWidget*/*w. Read More