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
93c60417
Commit
93c60417
authored
Dec 19, 2008
by
hjk
Browse files
use QTextEdit's "overwriteMode" instead of playing around with the
cursor width manually.
parent
00a3b537
Changes
2
Show whitespace changes
Inline
Side-by-side
src/plugins/fakevim/fakevimplugin.cpp
View file @
93c60417
...
@@ -157,10 +157,7 @@ void FakeVimPlugin::installHandler()
...
@@ -157,10 +157,7 @@ void FakeVimPlugin::installHandler()
return
;
return
;
plainTextEdit
->
removeEventFilter
(
m_handler
);
plainTextEdit
->
removeEventFilter
(
m_handler
);
plainTextEdit
->
installEventFilter
(
m_handler
);
plainTextEdit
->
installEventFilter
(
m_handler
);
QFont
font
=
plainTextEdit
->
font
();
plainTextEdit
->
setOverwriteMode
(
true
);
//font.setFamily("Monospace");
m_savedCursorWidth
=
plainTextEdit
->
cursorWidth
();
plainTextEdit
->
setCursorWidth
(
QFontMetrics
(
font
).
width
(
QChar
(
'x'
)));
//QMainWindow mw;
//QMainWindow mw;
connect
(
m_handler
,
SIGNAL
(
commandBufferChanged
(
QString
)),
connect
(
m_handler
,
SIGNAL
(
commandBufferChanged
(
QString
)),
...
@@ -175,7 +172,7 @@ void FakeVimPlugin::removeHandler(QObject *ob)
...
@@ -175,7 +172,7 @@ void FakeVimPlugin::removeHandler(QObject *ob)
QPlainTextEdit
*
plainTextEdit
=
qobject_cast
<
QPlainTextEdit
*>
(
ob
);
QPlainTextEdit
*
plainTextEdit
=
qobject_cast
<
QPlainTextEdit
*>
(
ob
);
if
(
!
plainTextEdit
)
if
(
!
plainTextEdit
)
return
;
return
;
plainTextEdit
->
set
CursorWidth
(
m_savedCursorWidth
);
plainTextEdit
->
set
OverwriteMode
(
false
);
}
}
void
FakeVimPlugin
::
showCommandBuffer
(
const
QString
&
contents
)
void
FakeVimPlugin
::
showCommandBuffer
(
const
QString
&
contents
)
...
...
src/plugins/fakevim/fakevimplugin.h
View file @
93c60417
...
@@ -74,7 +74,6 @@ private:
...
@@ -74,7 +74,6 @@ private:
FakeVimHandler
*
m_handler
;
FakeVimHandler
*
m_handler
;
ExtensionSystem
::
PluginManager
*
m_pm
;
ExtensionSystem
::
PluginManager
*
m_pm
;
QAction
*
m_installHandlerAction
;
QAction
*
m_installHandlerAction
;
int
m_savedCursorWidth
;
};
};
}
// namespace Internal
}
// namespace Internal
...
...
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