Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
65b3830b
Commit
65b3830b
authored
Dec 08, 2009
by
Erik Verbruggen
Browse files
Renamed the QmlEditor::ScriptEditor class to QmlEditor::QmlTextEditor.
parent
a84ebd12
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmleditor/qmlcodecompletion.cpp
View file @
65b3830b
...
...
@@ -65,7 +65,7 @@ void QmlCodeCompletion::setCaseSensitivity(Qt::CaseSensitivity caseSensitivity)
bool
QmlCodeCompletion
::
supportsEditor
(
TextEditor
::
ITextEditable
*
editor
)
{
if
(
qobject_cast
<
Scrip
tEditor
*>
(
editor
->
widget
()))
if
(
qobject_cast
<
QmlTex
tEditor
*>
(
editor
->
widget
()))
return
true
;
return
false
;
...
...
@@ -78,7 +78,7 @@ int QmlCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
{
m_editor
=
editor
;
Scrip
tEditor
*
edit
=
qobject_cast
<
Scrip
tEditor
*>
(
m_editor
->
widget
());
QmlTex
tEditor
*
edit
=
qobject_cast
<
QmlTex
tEditor
*>
(
m_editor
->
widget
());
if
(
!
edit
)
return
-
1
;
...
...
src/plugins/qmleditor/qmleditor.cpp
View file @
65b3830b
...
...
@@ -273,7 +273,7 @@ protected:
#endif
};
ScriptEditorEditable
::
ScriptEditorEditable
(
Scrip
tEditor
*
editor
)
ScriptEditorEditable
::
ScriptEditorEditable
(
QmlTex
tEditor
*
editor
)
:
BaseTextEditorEditable
(
editor
)
{
...
...
@@ -282,7 +282,7 @@ ScriptEditorEditable::ScriptEditorEditable(ScriptEditor *editor)
m_context
<<
uidm
->
uniqueIdentifier
(
TextEditor
::
Constants
::
C_TEXTEDITOR
);
}
Scrip
tEditor
::
Scrip
tEditor
(
QWidget
*
parent
)
:
QmlTex
tEditor
::
QmlTex
tEditor
(
QWidget
*
parent
)
:
TextEditor
::
BaseTextEditor
(
parent
),
m_methodCombo
(
0
),
m_modelManager
(
0
),
...
...
@@ -313,16 +313,16 @@ ScriptEditor::ScriptEditor(QWidget *parent) :
}
}
Scrip
tEditor
::~
Scrip
tEditor
()
QmlTex
tEditor
::~
QmlTex
tEditor
()
{
}
QList
<
Declaration
>
Scrip
tEditor
::
declarations
()
const
QList
<
Declaration
>
QmlTex
tEditor
::
declarations
()
const
{
return
m_declarations
;
}
Core
::
IEditor
*
ScriptEditorEditable
::
duplicate
(
QWidget
*
parent
)
{
Scrip
tEditor
*
newEditor
=
new
Scrip
tEditor
(
parent
);
QmlTex
tEditor
*
newEditor
=
new
QmlTex
tEditor
(
parent
);
newEditor
->
duplicateFrom
(
editor
());
QmlEditorPlugin
::
instance
()
->
initializeEditor
(
newEditor
);
return
newEditor
->
editableInterface
();
...
...
@@ -333,17 +333,17 @@ const char *ScriptEditorEditable::kind() const
return
QmlEditor
::
Constants
::
C_QMLEDITOR
;
}
Scrip
tEditor
::
Context
ScriptEditorEditable
::
context
()
const
QmlTex
tEditor
::
Context
ScriptEditorEditable
::
context
()
const
{
return
m_context
;
}
void
Scrip
tEditor
::
updateDocument
()
void
QmlTex
tEditor
::
updateDocument
()
{
m_updateDocumentTimer
->
start
(
UPDATE_DOCUMENT_DEFAULT_INTERVAL
);
}
void
Scrip
tEditor
::
updateDocumentNow
()
void
QmlTex
tEditor
::
updateDocumentNow
()
{
// ### move in the parser thread.
...
...
@@ -354,7 +354,7 @@ void ScriptEditor::updateDocumentNow()
m_modelManager
->
updateSourceFiles
(
QStringList
()
<<
fileName
);
}
void
Scrip
tEditor
::
onDocumentUpdated
(
QmlEditor
::
QmlDocument
::
Ptr
doc
)
void
QmlTex
tEditor
::
onDocumentUpdated
(
QmlEditor
::
QmlDocument
::
Ptr
doc
)
{
if
(
file
()
->
fileName
()
!=
doc
->
fileName
())
return
;
...
...
@@ -413,7 +413,7 @@ void ScriptEditor::onDocumentUpdated(QmlEditor::QmlDocument::Ptr doc)
setExtraSelections
(
CodeWarningsSelection
,
selections
);
}
void
Scrip
tEditor
::
jumpToMethod
(
int
index
)
void
QmlTex
tEditor
::
jumpToMethod
(
int
index
)
{
if
(
index
)
{
Declaration
d
=
m_declarations
.
at
(
index
-
1
);
...
...
@@ -422,7 +422,7 @@ void ScriptEditor::jumpToMethod(int index)
}
}
void
Scrip
tEditor
::
updateMethodBoxIndex
()
void
QmlTex
tEditor
::
updateMethodBoxIndex
()
{
int
line
=
0
,
column
=
0
;
convertPosition
(
position
(),
&
line
,
&
column
);
...
...
@@ -457,15 +457,15 @@ void ScriptEditor::updateMethodBoxIndex()
setExtraSelections
(
CodeSemanticsSelection
,
selections
);
}
void
Scrip
tEditor
::
updateMethodBoxToolTip
()
void
QmlTex
tEditor
::
updateMethodBoxToolTip
()
{
}
void
Scrip
tEditor
::
updateFileName
()
void
QmlTex
tEditor
::
updateFileName
()
{
}
void
Scrip
tEditor
::
renameIdUnderCursor
()
void
QmlTex
tEditor
::
renameIdUnderCursor
()
{
const
QString
id
=
wordUnderCursor
();
bool
ok
=
false
;
...
...
@@ -486,7 +486,7 @@ void ScriptEditor::renameIdUnderCursor()
}
}
QStringList
Scrip
tEditor
::
keywords
()
const
QStringList
QmlTex
tEditor
::
keywords
()
const
{
QStringList
words
;
...
...
@@ -496,7 +496,7 @@ QStringList ScriptEditor::keywords() const
return
words
;
}
void
Scrip
tEditor
::
setFontSettings
(
const
TextEditor
::
FontSettings
&
fs
)
void
QmlTex
tEditor
::
setFontSettings
(
const
TextEditor
::
FontSettings
&
fs
)
{
TextEditor
::
BaseTextEditor
::
setFontSettings
(
fs
);
QmlHighlighter
*
highlighter
=
qobject_cast
<
QmlHighlighter
*>
(
baseTextDocument
()
->
syntaxHighlighter
());
...
...
@@ -519,7 +519,7 @@ void ScriptEditor::setFontSettings(const TextEditor::FontSettings &fs)
highlighter
->
rehighlight
();
}
QString
Scrip
tEditor
::
wordUnderCursor
()
const
QString
QmlTex
tEditor
::
wordUnderCursor
()
const
{
QTextCursor
tc
=
textCursor
();
tc
.
movePosition
(
QTextCursor
::
StartOfWord
);
...
...
@@ -528,7 +528,7 @@ QString ScriptEditor::wordUnderCursor() const
return
word
;
}
bool
Scrip
tEditor
::
isElectricCharacter
(
const
QChar
&
ch
)
const
bool
QmlTex
tEditor
::
isElectricCharacter
(
const
QChar
&
ch
)
const
{
if
(
ch
==
QLatin1Char
(
'}'
)
||
ch
==
QLatin1Char
(
']'
))
...
...
@@ -536,7 +536,7 @@ bool ScriptEditor::isElectricCharacter(const QChar &ch) const
return
false
;
}
bool
Scrip
tEditor
::
isClosingBrace
(
const
QList
<
QScriptIncrementalScanner
::
Token
>
&
tokens
)
const
bool
QmlTex
tEditor
::
isClosingBrace
(
const
QList
<
QScriptIncrementalScanner
::
Token
>
&
tokens
)
const
{
if
(
tokens
.
size
()
==
1
)
{
...
...
@@ -567,7 +567,7 @@ static int blockStartState(const QTextBlock &block)
return
state
&
0xff
;
}
void
Scrip
tEditor
::
indentBlock
(
QTextDocument
*
,
QTextBlock
block
,
QChar
/*typedChar*/
)
void
QmlTex
tEditor
::
indentBlock
(
QTextDocument
*
,
QTextBlock
block
,
QChar
/*typedChar*/
)
{
TextEditor
::
TabSettings
ts
=
tabSettings
();
...
...
@@ -610,14 +610,14 @@ void ScriptEditor::indentBlock(QTextDocument *, QTextBlock block, QChar /*typedC
ts
.
indentLine
(
block
,
indent
);
}
TextEditor
::
BaseTextEditorEditable
*
Scrip
tEditor
::
createEditableInterface
()
TextEditor
::
BaseTextEditorEditable
*
QmlTex
tEditor
::
createEditableInterface
()
{
ScriptEditorEditable
*
editable
=
new
ScriptEditorEditable
(
this
);
createToolBar
(
editable
);
return
editable
;
}
void
Scrip
tEditor
::
createToolBar
(
ScriptEditorEditable
*
editable
)
void
QmlTex
tEditor
::
createToolBar
(
ScriptEditorEditable
*
editable
)
{
m_methodCombo
=
new
QComboBox
;
m_methodCombo
->
setMinimumContentsLength
(
22
);
...
...
@@ -640,7 +640,7 @@ void ScriptEditor::createToolBar(ScriptEditorEditable *editable)
toolBar
->
insertWidget
(
actions
.
first
(),
m_methodCombo
);
}
TextEditor
::
BaseTextEditor
::
Link
Scrip
tEditor
::
findLinkAt
(
const
QTextCursor
&
cursor
,
bool
/*resolveTarget*/
)
TextEditor
::
BaseTextEditor
::
Link
QmlTex
tEditor
::
findLinkAt
(
const
QTextCursor
&
cursor
,
bool
/*resolveTarget*/
)
{
Link
link
;
...
...
@@ -691,7 +691,7 @@ TextEditor::BaseTextEditor::Link ScriptEditor::findLinkAt(const QTextCursor &cur
return
link
;
}
void
Scrip
tEditor
::
contextMenuEvent
(
QContextMenuEvent
*
e
)
void
QmlTex
tEditor
::
contextMenuEvent
(
QContextMenuEvent
*
e
)
{
QMenu
*
menu
=
new
QMenu
();
...
...
@@ -715,7 +715,7 @@ void ScriptEditor::contextMenuEvent(QContextMenuEvent *e)
menu
->
deleteLater
();
}
void
Scrip
tEditor
::
unCommentSelection
()
void
QmlTex
tEditor
::
unCommentSelection
()
{
Utils
::
unCommentSelection
(
this
);
}
...
...
src/plugins/qmleditor/qmleditor.h
View file @
65b3830b
...
...
@@ -54,14 +54,14 @@ class QmlModelManagerInterface;
namespace
Internal
{
class
QmlHighlighter
;
class
Scrip
tEditor
;
class
QmlTex
tEditor
;
class
ScriptEditorEditable
:
public
TextEditor
::
BaseTextEditorEditable
{
Q_OBJECT
public:
ScriptEditorEditable
(
Scrip
tEditor
*
);
ScriptEditorEditable
(
QmlTex
tEditor
*
);
QList
<
int
>
context
()
const
;
bool
duplicateSupported
()
const
{
return
true
;
}
...
...
@@ -90,15 +90,15 @@ struct Declaration
{
}
};
class
Scrip
tEditor
:
public
TextEditor
::
BaseTextEditor
class
QmlTex
tEditor
:
public
TextEditor
::
BaseTextEditor
{
Q_OBJECT
public:
typedef
QList
<
int
>
Context
;
Scrip
tEditor
(
QWidget
*
parent
=
0
);
~
Scrip
tEditor
();
QmlTex
tEditor
(
QWidget
*
parent
=
0
);
~
QmlTex
tEditor
();
QList
<
Declaration
>
declarations
()
const
;
QStringList
keywords
()
const
;
...
...
src/plugins/qmleditor/qmleditorfactory.cpp
View file @
65b3830b
...
...
@@ -69,7 +69,7 @@ Core::IFile *QmlEditorFactory::open(const QString &fileName)
Core
::
IEditor
*
QmlEditorFactory
::
createEditor
(
QWidget
*
parent
)
{
Scrip
tEditor
*
rc
=
new
Scrip
tEditor
(
parent
);
QmlTex
tEditor
*
rc
=
new
QmlTex
tEditor
(
parent
);
QmlEditorPlugin
::
instance
()
->
initializeEditor
(
rc
);
return
rc
->
editableInterface
();
}
...
...
src/plugins/qmleditor/qmleditorplugin.cpp
View file @
65b3830b
...
...
@@ -166,7 +166,7 @@ void QmlEditorPlugin::extensionsInitialized()
helpManager
->
registerDocumentation
(
QStringList
(
qmlHelpFile
));
}
void
QmlEditorPlugin
::
initializeEditor
(
QmlEditor
::
Internal
::
Scrip
tEditor
*
editor
)
void
QmlEditorPlugin
::
initializeEditor
(
QmlEditor
::
Internal
::
QmlTex
tEditor
*
editor
)
{
QTC_ASSERT
(
m_instance
,
/**/
);
...
...
src/plugins/qmleditor/qmleditorplugin.h
View file @
65b3830b
...
...
@@ -45,7 +45,7 @@ namespace Internal {
class
QmlEditorFactory
;
class
QmlCodeCompletion
;
class
Scrip
tEditor
;
class
QmlTex
tEditor
;
class
QmlEditorPlugin
:
public
ExtensionSystem
::
IPlugin
{
...
...
@@ -62,7 +62,7 @@ public:
static
QmlEditorPlugin
*
instance
()
{
return
m_instance
;
}
void
initializeEditor
(
Scrip
tEditor
*
editor
);
void
initializeEditor
(
QmlTex
tEditor
*
editor
);
private:
static
QmlEditorPlugin
*
m_instance
;
...
...
src/plugins/qmleditor/qmlhoverhandler.cpp
View file @
65b3830b
...
...
@@ -146,7 +146,7 @@ void QmlHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
if
(
!
m_modelManager
)
return
;
Scrip
tEditor
*
scriptEditor
=
qobject_cast
<
Scrip
tEditor
*>
(
editor
->
widget
());
QmlTex
tEditor
*
scriptEditor
=
qobject_cast
<
QmlTex
tEditor
*>
(
editor
->
widget
());
if
(
!
scriptEditor
)
return
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment