Mercurial > hg > octave-lyh
changeset 15677:f620ecde2566
Added support for changing the cursor.
author | Jacob Dawid <jacob.dawid@gmail.com> |
---|---|
date | Sat, 21 Jul 2012 01:36:45 -0400 |
parents | aa6cba8ae88b |
children | a1bcffac7fa8 |
files | libqterminal/QTerminalInterface.h libqterminal/unix/QUnixTerminalImpl.cpp libqterminal/unix/QUnixTerminalImpl.h |
diffstat | 3 files changed, 24 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libqterminal/QTerminalInterface.h +++ b/libqterminal/QTerminalInterface.h @@ -49,6 +49,18 @@ virtual void setSize(int h, int v) = 0; virtual void sendText(const QString& text) = 0; + enum CursorType { + UnderlineCursor, + BlockCursor, + IBeamCursor + }; + + virtual void setCursorType(CursorType type, bool blinking) { + // Provide empty default impl in order to avoid conflicts with the win impl. + Q_UNUSED(type); + Q_UNUSED(blinking); + } + public slots: virtual void copyClipboard() = 0; virtual void pasteClipboard() = 0;
--- a/libqterminal/unix/QUnixTerminalImpl.cpp +++ b/libqterminal/unix/QUnixTerminalImpl.cpp @@ -118,6 +118,16 @@ m_terminalModel->sendText(text); } +void QUnixTerminalImpl::setCursorType(CursorType type, bool blinking) +{ + switch(type) { + case UnderlineCursor: m_terminalView->setKeyboardCursorShape(TerminalView::UnderlineCursor); + case BlockCursor: m_terminalView->setKeyboardCursorShape(TerminalView::BlockCursor); + case IBeamCursor: m_terminalView->setKeyboardCursorShape(TerminalView::IBeamCursor); + } + m_terminalView->setBlinkingCursor(blinking); +} + void QUnixTerminalImpl::focusInEvent(QFocusEvent *focusEvent) { Q_UNUSED(focusEvent);