24 #include <QVBoxLayout>
60 App_->addDockWidget(Qt::BottomDockWidgetArea,
msgDock);
98 QString logContents =
admsOutput->toPlainText();
99 QStringList lines = logContents.split(
"\n");
103 QList<QTextEdit::ExtraSelection> extraSelections;
104 for (
int i = 0; i < lines.size(); ++i) {
105 QString line = lines[i];
107 if (line.contains(
"[fatal..]",Qt::CaseSensitive)) {
109 int pos =
admsOutput->document()->findBlockByLineNumber(i).position();
110 QTextCursor cursor =
admsOutput->textCursor();
111 cursor.setPosition(pos);
114 QTextEdit::ExtraSelection selection;
115 QColor lineColor = QColor(Qt::yellow).lighter(160);
116 selection.format.setBackground(lineColor);
117 selection.format.setProperty(QTextFormat::FullWidthSelection,
true);
118 selection.cursor = cursor;
119 extraSelections.append(selection);
123 else if (line.contains(
"[error..]",Qt::CaseSensitive)) {
127 else if (line.contains(
"*** No rule to make target",Qt::CaseSensitive)) {
134 admsOutput->setExtraSelections(extraSelections);
138 builderTabs->setTabIcon(0,QPixmap(
":/bitmaps/error.png"));
140 builderTabs->setTabIcon(0,QPixmap(
":/bitmaps/tick.png"));
148 QString logContents =
cppOutput->toPlainText();
152 if (logContents.contains(
"*** No rule to make target")) {
155 else if (logContents.contains(
"error",Qt::CaseInsensitive)) {
161 builderTabs->setTabIcon(1,QPixmap(
":/bitmaps/error.png"));
163 builderTabs->setTabIcon(1,QPixmap(
":/bitmaps/tick.png"));
171 qWarning() <<
admsOutput->textCursor().blockNumber();
173 QString line =
admsOutput->textCursor().block().text();
174 if (line.contains(
"[fatal..]",Qt::CaseSensitive)) {
177 if (line.contains(
":",Qt::CaseSensitive)) {
179 a = line.indexOf(
":")+1;
180 b = line.indexOf(
":",a);
181 gotoLine = line.mid(a,b-a).stripWhiteSpace().toInt();
182 qWarning() <<
"goto line " << gotoLine;
186 if (line.contains(
"syntax error ",Qt::CaseSensitive)) {
188 a = line.indexOf(
"at line");
189 b = line.indexOf(
"--",a);
190 gotoLine = line.mid(a+7,b-a-7).stripWhiteSpace().toInt();
191 qWarning() <<
"goto line " << gotoLine;
215 QTextCursor cursor = d->textCursor();
216 int pos = d->document()->findBlockByLineNumber(gotoLine-1).position();
217 cursor.setPosition(pos);
220 QList<QTextEdit::ExtraSelection> extraSelections;
221 QTextEdit::ExtraSelection selection;
222 QColor lineColor = QColor(Qt::yellow).lighter(160);
223 selection.format.setBackground(lineColor);
224 selection.format.setProperty(QTextFormat::FullWidthSelection,
true);
225 selection.cursor = cursor;
228 extraSelections.append(d->extraSelections());
231 extraSelections.append(selection);
234 d->setExtraSelections(extraSelections);
240 d->setTextCursor(cursor);
Definition of the TextDoc class.
void slotAdmsChanged()
MessageDock::slotAdmsChanged monitors the adms log, update tab icon.
void slotCursor()
MessageDock::slotCursor.
MessageDock(QucsApp *)
MessageDock::MessageDock constructor.
The MessageDock class definiion.
QucsDoc * getDoc(int No=-1)
QPlainTextEdit * admsOutput
admsOutput holds the make output of running admsXml
Definitions and declarations for the main application.
void reset()
MessageDock::reset clear the text and tab icons.
QPlainTextEdit * cppOutput
cppOutput holds the make output of running a C++ compiler
The TextDoc class definition.
void slotCppChanged()
MessageDock::slotCppChanged monitors the compiler log, update tab icon.