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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user