forked from qt-creator/qt-creator
Snippets: Set indenters.
This commit is contained in:
@@ -50,12 +50,9 @@ QString SnippetEditorEditable::id() const
|
||||
return Constants::SNIPPET_EDITOR_ID;
|
||||
}
|
||||
|
||||
SnippetEditor::SnippetEditor(QWidget *parent) :
|
||||
BaseTextEditor(parent),
|
||||
m_indenter(new NormalIndenter)
|
||||
SnippetEditor::SnippetEditor(QWidget *parent) : BaseTextEditor(parent)
|
||||
{
|
||||
setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
|
||||
|
||||
setHighlightCurrentLine(false);
|
||||
setLineNumbersVisible(false);
|
||||
}
|
||||
@@ -68,11 +65,6 @@ void SnippetEditor::installSyntaxHighlighter(TextEditor::SyntaxHighlighter *high
|
||||
baseTextDocument()->setSyntaxHighlighter(highlighter);
|
||||
}
|
||||
|
||||
void SnippetEditor::installIndenter(Indenter *indenter)
|
||||
{
|
||||
m_indenter.reset(indenter);
|
||||
}
|
||||
|
||||
void SnippetEditor::focusOutEvent(QFocusEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
@@ -84,9 +76,3 @@ BaseTextEditorEditable *SnippetEditor::createEditableInterface()
|
||||
{
|
||||
return new SnippetEditorEditable(this);
|
||||
}
|
||||
|
||||
void SnippetEditor::indentBlock(QTextDocument *doc, QTextBlock block, QChar typedChar)
|
||||
{
|
||||
if (!m_indenter.isNull())
|
||||
m_indenter->indentBlock(doc, block, typedChar, tabSettings());
|
||||
}
|
||||
|
||||
@@ -71,7 +71,6 @@ public:
|
||||
virtual ~SnippetEditor();
|
||||
|
||||
void installSyntaxHighlighter(SyntaxHighlighter *highlighter);
|
||||
void installIndenter(Indenter *indenter);
|
||||
|
||||
signals:
|
||||
void snippetContentChanged();
|
||||
@@ -81,10 +80,6 @@ protected:
|
||||
|
||||
virtual int extraAreaWidth(int * /* markWidthPtr */ = 0) const { return 0; }
|
||||
virtual BaseTextEditorEditable *createEditableInterface();
|
||||
virtual void indentBlock(QTextDocument *doc, QTextBlock block, QChar typedChar);
|
||||
|
||||
private:
|
||||
QScopedPointer<Indenter> m_indenter;
|
||||
};
|
||||
|
||||
} // TextEditor
|
||||
|
||||
Reference in New Issue
Block a user