| 106 | } |
| 107 | |
| 108 | void OutputPane::handleNextOutput() |
| 109 | { |
| 110 | auto &output = d->outputList.first(); |
| 111 | QTextCharFormat textFormat; |
| 112 | switch (output.format) { |
| 113 | case OutputFormat::StdOut: |
| 114 | textFormat.setFontWeight(QFont::Normal); |
| 115 | break; |
| 116 | case OutputFormat::StdErr: |
| 117 | textFormat.setForeground(kErrorMessageTextColor); |
| 118 | textFormat.setFontWeight(QFont::Normal); |
| 119 | break; |
| 120 | case OutputFormat::NormalMessage: |
| 121 | textFormat.setForeground(kMessageOutput); |
| 122 | break; |
| 123 | case OutputFormat::ErrorMessage: |
| 124 | textFormat.setForeground(kErrorMessageTextColor); |
| 125 | textFormat.setFontWeight(QFont::Bold); |
| 126 | break; |
| 127 | default: |
| 128 | textFormat.setFontWeight(QFont::Normal); |
| 129 | } |
| 130 | |
| 131 | if (output.text.size() <= d->maxCharCount) { |
| 132 | appendCustomText(output.text, output.mode, textFormat); |
| 133 | d->outputList.removeFirst(); |
| 134 | } else { |
| 135 | appendCustomText(output.text.left(d->maxCharCount), output.mode, textFormat); |
| 136 | output.text.remove(0, d->maxCharCount); |
| 137 | } |
| 138 | |
| 139 | if (!d->outputList.isEmpty()) |
| 140 | d->outputTimer.start(); |
| 141 | } |
| 142 | |
| 143 | bool OutputPane::isScrollbarAtBottom() const |
| 144 | { |