Skip to content
GitLab
Menu
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
786e183a
Commit
786e183a
authored
Dec 05, 2008
by
mae
Browse files
markContextMenuRequested signal in ITextEditor
parent
923bfa52
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/texteditor/basetexteditor.cpp
View file @
786e183a
...
...
@@ -488,10 +488,6 @@ ITextEditable *BaseTextEditor::editableInterface() const
d
->
m_editable
,
SIGNAL
(
contentsChanged
()));
connect
(
this
,
SIGNAL
(
changed
()),
d
->
m_editable
,
SIGNAL
(
changed
()));
connect
(
this
,
SIGNAL
(
markRequested
(
TextEditor
::
ITextEditor
*
,
int
)),
d
->
m_editable
,
SIGNAL
(
markRequested
(
TextEditor
::
ITextEditor
*
,
int
)));
}
return
d
->
m_editable
;
}
...
...
@@ -2434,9 +2430,10 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e)
}
}
else
if
(
e
->
button
()
==
Qt
::
RightButton
)
{
QMenu
*
contextMenu
=
new
QMenu
(
this
);
emit
line
ContextMenuRequested
(
editableInterface
(),
cursor
.
blockNumber
(),
contextMenu
);
emit
d
->
m_editable
->
mark
ContextMenuRequested
(
editableInterface
(),
cursor
.
blockNumber
(),
contextMenu
);
if
(
!
contextMenu
->
isEmpty
())
contextMenu
->
exec
(
e
->
globalPos
());
delete
contextMenu
;
}
}
else
if
(
d
->
extraAreaSelectionAnchorBlockNumber
>=
0
)
{
QTextCursor
selection
=
cursor
;
...
...
@@ -2471,7 +2468,7 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e)
d
->
extraAreaToggleMarkBlockNumber
=
-
1
;
if
(
cursor
.
blockNumber
()
==
n
)
{
int
line
=
n
+
1
;
emit
markRequested
(
editableInterface
(),
line
);
emit
d
->
m_editable
->
markRequested
(
editableInterface
(),
line
);
}
}
}
...
...
src/plugins/texteditor/basetexteditor.h
View file @
786e183a
...
...
@@ -431,8 +431,6 @@ protected slots:
signals:
void
markRequested
(
TextEditor
::
ITextEditor
*
editor
,
int
line
);
void
lineContextMenuRequested
(
TextEditor
::
ITextEditor
*
editor
,
int
line
,
QMenu
*
menu
);
void
requestBlockUpdate
(
const
QTextBlock
&
);
void
requestAutoCompletion
(
ITextEditable
*
editor
,
bool
forced
);
...
...
src/plugins/texteditor/itexteditor.h
View file @
786e183a
...
...
@@ -44,6 +44,7 @@
#include <QtGui/QIcon>
QT_BEGIN_NAMESPACE
class
QMenu
;
class
QTextBlock
;
QT_END_NAMESPACE
...
...
@@ -124,6 +125,7 @@ public:
signals:
void
contentsChanged
();
void
markRequested
(
TextEditor
::
ITextEditor
*
editor
,
int
line
);
void
markContextMenuRequested
(
TextEditor
::
ITextEditor
*
editor
,
int
line
,
QMenu
*
menu
);
void
tooltipRequested
(
TextEditor
::
ITextEditor
*
editor
,
const
QPoint
&
globalPos
,
int
position
);
void
contextHelpIdRequested
(
TextEditor
::
ITextEditor
*
editor
,
int
position
);
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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