Adding ./doc from boost
Reviewer: Lauro Moura <lauro.neto@openbossa.org>
Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
685246809d
commit
aaece960d3
1108 changed files with 70655 additions and 0 deletions
23
doc/codesnippets/doc/src/snippets/widgetdelegate.cpp
Normal file
23
doc/codesnippets/doc/src/snippets/widgetdelegate.cpp
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
//![0]
|
||||
class WidgetDelegate (QStyledItemDelegate):
|
||||
# ...
|
||||
|
||||
def paint(painter, option, index):
|
||||
if index.column() == 1:
|
||||
progress = index.data().toInt()
|
||||
|
||||
progressBarOption = QStyleOptionProgressBar()
|
||||
progressBarOption.rect = option.rect
|
||||
progressBarOption.minimum = 0
|
||||
progressBarOption.maximum = 100
|
||||
progressBarOption.progress = progress
|
||||
progressBarOption.text = QString::number(progress) + "%"
|
||||
progressBarOption.textVisible = True
|
||||
|
||||
QApplication.style().drawControl(QStyle.CE_ProgressBar, progressBarOption, painter)
|
||||
else:
|
||||
QStyledItemDelegate.paint(self, painter, option, index)
|
||||
|
||||
//![0]
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue