70 enum Symbols { Paren = 0, Square = 2, Brace = 4 };
72 enum CharType { Open = 0, Close = 1};
74 static const QByteArray chars;
79 QBrush matchBackground()
const;
80 void setMatchBackground(
const QBrush &value);
82 QColor matchForeground()
const;
83 void setMatchForeground(
const QColor &value);
85 QBrush unmatchBackground()
const;
86 void setUnmatchBackground(
const QBrush &value);
88 QColor unmatchForeground()
const;
89 void setUnmatchForeground(
const QColor &value);
91 virtual void onStateChanged(
bool state);
93 QPoint
symbolPos(
const QTextCursor &cursor, CharType charType = Open, Symbols symbolType =Paren);
96 void doSymbolsMatching();
99 QTextCursor createDecoration(
int pos,
bool match =
true);
100 void clearDecorations();
101 void match(Symbols symbol, QList<Utils::ParenthesisInfo> &data,
int cursorPos);
102 bool matchLeft(SymbolMatcherMode::Symbols symbol,
const QTextBlock ¤tBlock,
int i,
int cpt);
103 bool matchRight(SymbolMatcherMode::Symbols symbol,
const QTextBlock ¤tBlock,
int i,
int nbRightParen);
104 void refreshDecorations();
106 QBrush m_matchBackground;
107 QColor m_matchForeground;
108 QBrush m_unmatchBackground;
109 QColor m_unmatchForeground;
110 QList<TextDecoration::Ptr> m_decorations;
QPoint symbolPos(const QTextCursor &cursor, CharType charType=Open, Symbols symbolType=Paren)
return value is line (x) and column (y)
Definition symbolMatcherMode.cpp:379