log_record_delegate
log_record_delegate
¶
Attributes¶
ERROR_SEVERITY_COLOR = QtGui.QColor('#e5484d')
module-attribute
¶
INFORMATION_SEVERITY_COLOR = QtGui.QColor('#3e63dd')
module-attribute
¶
WARNING_SEVERITY_COLOR = QtGui.QColor('#f5a524')
module-attribute
¶
Classes¶
LogRecordItemDelegate
¶
Bases: QStyledItemDelegate
Draws a log record row with a severity bar, level, time and message.
Attributes¶
EXPECTED_LEVEL_NAME_TEXTS = ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL')
class-attribute
instance-attribute
¶
HORIZONTAL_MARGIN_IN_PIXELS = 8
class-attribute
instance-attribute
¶
HORIZONTAL_SPACING_IN_PIXELS = 10
class-attribute
instance-attribute
¶
ROW_VERTICAL_PADDING_IN_PIXELS = 4
class-attribute
instance-attribute
¶
SEVERITY_BAR_WIDTH_IN_PIXELS = 4
class-attribute
instance-attribute
¶
Functions¶
paint(painter, option, index)
¶
Draw the log record row.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
painter
|
QPainter
|
painter. |
required |
option
|
QStyleOptionViewItem
|
style options. |
required |
index
|
QModelIndex | QPersistentModelIndex
|
item index. |
required |
Source code in src/nyx/editor/widgets/output_log/log_record_delegate.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
sizeHint(option, index)
¶
Get the row size.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
option
|
QStyleOptionViewItem
|
style options. |
required |
index
|
QModelIndex | QPersistentModelIndex
|
item index. |
required |
Returns:
| Type | Description |
|---|---|
QSize
|
row size. The width is left to the view. |
Source code in src/nyx/editor/widgets/output_log/log_record_delegate.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
Functions¶
color_for_logging_level(logging_level)
¶
Threshold based, so custom levels (e.g. 25) still get a sensible colour.
Source code in src/nyx/editor/widgets/output_log/log_record_delegate.py
12 13 14 15 16 17 18 | |