71 void updateLineNumberAreaWidth();
73 void highlightCurrentLine();
75 void updateLineNumberArea(
const QRect& Rect,
int);
77 void onChanged(
bool Changed);
79 void onInsertRequested(
const QString& Str);
81 void insertCompletion();
83 void onCompletionPopupCurrentRowChanged(
const QModelIndex &Current,
const QModelIndex& Previous);
93 QStringList m_ContentList;
95 QColor Red = QColor(openfluid::ui::config::LINEMARKER_ERRCOLOR);
96 QColor Orange = QColor(openfluid::ui::config::LINEMARKER_WARNCOLOR);
103 m_MajorMarkerType(MsgType)
105 QString Cleared = Content.trimmed();
106 if (!Cleared.isEmpty())
108 m_ContentList.append(Cleared);
117 QColor getColor()
const
119 if (m_MajorMarkerType == WareSrcMsgParser::WareSrcMsg::MessageType::MSG_ERROR)
131 QString getContent()
const
133 if (m_ContentList.isEmpty())
138 if (m_ContentList.size() == 1)
140 return QString(
"<html>%1</html>").arg(m_ContentList[0]);
143 return QString(
"• %1").arg(m_ContentList.join(
"<br/>• "));
153 if (MsgType == WareSrcMsgParser::WareSrcMsg::MessageType::MSG_ERROR)
155 m_MajorMarkerType = MsgType;
158 m_ContentList.append(Content.trimmed());
164#if (QT_VERSION_MAJOR < 6)
165 QRegExp m_SelectionTagsRegExp;
166 QRegExp m_AllTagsRegExp;
167 QRegExp m_WordPartRegExp;
169 QRegularExpression m_SelectionTagsRegExp;
170 QRegularExpression m_AllTagsRegExp;
171 QRegularExpression m_WordPartRegExp;
174 QWidget* mp_LineNumberArea;
177 QColor m_LineNbAreaColor = QColor(
"#F8F8FF");
178 QColor m_LineNbTextColor = QColor(
"#999999");
180 QString m_IndentString;
182 int m_SpaceCharWidth;
186 QSignalMapper* mp_SignalMapper;
188 QMap<QString, QMenu*> m_InsertionMenus;
190 QCompleter* mp_Completer;
192 QMap<QTextBlock, LineMarker> m_LineMarkersByBlock;
194 bool m_ShowLineMarkers =
true;
198 QTextCursor TextCursor;
200 QTextBlock FirstBlock;
209 QString CommentExtraSpaceString =
" ";
211 void writeString(
const QString& Str,
int InitialIndentInSpaceNb);
213 void insertNewLine();
215 bool findString(
const QString& StringToFind, QTextDocument::FindFlags Options);
217 bool replaceString(
const QString& StringToFind,
const QString& StringForReplace, Qt::CaseSensitivity Cs);
219 int getLeadingSpacesCount(
const QString& QStr);
221 bool hasCharInBlockBeforePos(
int Pos);
223 void selectText(
int StartPos,
int EndPos);
225 SelectionData createSelectionData();
227 void addLinePrefix(
const QString& PrefixStr,
const QTextBlock& Block);
236 int removeLinePrefix(
const QString& PrefixStr,
const QTextBlock& Block);
238 void addMultilinePrefix(
const QString& PrefixStr);
240 void removeMultilinePrefix(
const QString& PrefixStr);
242 void handleSelectionCommenting();
283 const QString& StringForReplace, QTextDocument::FindFlags Options, QString& Message);