After long time I'm going to write another blog post. This is regarding the Qt and it will detail a solution for the problem of fillData->clip->clipRect.isEmpty(). I got this problem as below cage while trying to create a 'title block' for the engineering drawing.
I created a QPrintPreviewDialog which previews engineering drawings generated by the application. I draw rectangle to represent title block which consists details of the drawing. At some points length of the detail higher than the space of the rectangle. Then I got below run-time error.
The simple answer is you are going to write the text in the rectangle which is not have enough space to show your content.
You can do following things.
1. Increase the size of Rectangle.
2. Decrease the font size.
3. Or use Qt.TextElideMode
Sample title block (copy rights) |
ASSERT: "!fillData->clip->clipRect.isEmpty()" in file painting/qpaintengine_raster.cpp, line 4435
The simple answer is you are going to write the text in the rectangle which is not have enough space to show your content.
You can do following things.
1. Increase the size of Rectangle.
2. Decrease the font size.
3. Or use Qt.TextElideMode
enum Qt::TextElideMode
This enum specifies where the ellipsis should appear when displaying texts that don't fit:Constant | Value | Description |
---|---|---|
Qt::ElideLeft | 0 | The ellipsis should appear at the beginning of the text. |
Qt::ElideRight | 1 | The ellipsis should appear at the end of the text. |
Qt::ElideMiddle | 2 | The ellipsis should appear in the middle of the text. |
Qt::ElideNone | 3 | Ellipsis should NOT appear in the text. |