Changeset cf8d6c9 in sasview for src/sas/qtgui/Perspectives/Fitting/ViewDelegate.py
- Timestamp:
- Jul 31, 2018 9:27:44 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 516ee4b, 18d5c94a, 8e2cd79
- Parents:
- 4453043
- git-author:
- Piotr Rozyczko <rozyczko@…> (07/31/18 09:25:32)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (07/31/18 09:27:44)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/ViewDelegate.py
ree7e423 rcf8d6c9 65 65 66 66 painter.save() 67 painter.translate(textRect.topLeft()) 68 painter.setClipRect(textRect.translated(-textRect.topLeft())) 67 rect = textRect.topLeft() 68 x = rect.x() 69 y = rect.y() 70 x += 3.0 # magic value for rendering nice display in the table 71 y += 2.0 # magic value for rendering nice display in the table 72 rect.setX(x) 73 rect.setY(y) 74 painter.translate(rect) 75 painter.setClipRect(textRect.translated(-rect)) 69 76 # Draw the QTextDocument in the cell 70 77 doc.documentLayout().draw(painter, context) … … 182 189 # Prepare document for inserting into cell 183 190 doc = QtGui.QTextDocument() 184 191 current_font = painter.font() 192 doc.setDefaultFont(current_font) 185 193 # Convert the unit description into HTML 186 194 text_html = GuiUtils.convertUnitToHTML(str(options.text)) … … 193 201 context = QtGui.QAbstractTextDocumentLayout.PaintContext() 194 202 textRect = style.subElementRect(QtWidgets.QStyle.SE_ItemViewItemText, options) 195 196 203 painter.save() 197 painter.translate(textRect.topLeft()) 198 painter.setClipRect(textRect.translated(-textRect.topLeft())) 204 205 rect = textRect.topLeft() 206 y = rect.y() 207 y += 5.0 # magic value for rendering nice display in the table 208 rect.setY(y) 209 painter.translate(rect) 210 painter.setClipRect(textRect.translated(-rect)) 199 211 # Draw the QTextDocument in the cell 200 212 doc.documentLayout().draw(painter, context) … … 260 272 # Prepare document for inserting into cell 261 273 doc = QtGui.QTextDocument() 262 274 current_font = painter.font() 275 doc.setDefaultFont(current_font) 263 276 # Convert the unit description into HTML 264 277 text_html = GuiUtils.convertUnitToHTML(str(options.text)) … … 273 286 274 287 painter.save() 275 painter.translate(textRect.topLeft()) 276 painter.setClipRect(textRect.translated(-textRect.topLeft())) 288 rect = textRect.topLeft() 289 y = rect.y() 290 y += 5.0 # magic value for rendering nice display in the table 291 rect.setY(y) 292 painter.translate(rect) 293 painter.setClipRect(textRect.translated(-rect)) 277 294 # Draw the QTextDocument in the cell 278 295 doc.documentLayout().draw(painter, context)
Note: See TracChangeset
for help on using the changeset viewer.