scrollToEnd() method provided to trigger 'snapping' the terminal to cursor tracked position (typically the extreme value of the scrollbar, or the 'end')

Some signal-fu particular to keyPressEvent(QKeyEvent *) done to make the above usable, no existing dependent implementations should be disturbed by this.
This commit is contained in:
Daniel O'Neill
2011-12-10 21:52:16 -07:00
parent 2be1dbb707
commit c462053b34
4 changed files with 29 additions and 0 deletions
+9
View File
@@ -120,6 +120,8 @@ QTermWidget::QTermWidget(int startnow, QWidget *parent)
this, SIGNAL(termGetFocus()));
connect(m_impl->m_terminalDisplay, SIGNAL(termLostFocus()),
this, SIGNAL(termLostFocus()));
connect(m_impl->m_terminalDisplay, SIGNAL(keyPressedSignal(QKeyEvent *)),
this, SIGNAL(termKeyPressed(QKeyEvent *)));
}
void QTermWidget::selectionChanged(bool textSelected)
@@ -284,6 +286,13 @@ void QTermWidget::setScrollBarPosition(ScrollBarPosition pos)
m_impl->m_terminalDisplay->setScrollBarPosition((TerminalDisplay::ScrollBarPosition)pos);
}
void QTermWidget::scrollToEnd()
{
if (!m_impl->m_terminalDisplay)
return;
m_impl->m_terminalDisplay->scrollToEnd();
}
void QTermWidget::sendText(QString &text)
{
m_impl->m_session->sendText(text);