Core::OutputWindow: Pimpl remaining members

Apparently, these were forgotten when the d-pointer was added.

Change-Id: I508074361ee3fb1d07a49c883669e96649561a51
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2020-04-29 13:57:05 +02:00
parent a6e1894274
commit 6d36db78aa
3 changed files with 14 additions and 13 deletions

View File

@@ -36,11 +36,13 @@
#include <QAction>
#include <QCursor>
#include <QElapsedTimer>
#include <QMimeData>
#include <QPointer>
#include <QRegularExpression>
#include <QScrollBar>
#include <QTextBlock>
#include <QTimer>
#ifdef WITH_TESTS
#include <QtTest>
@@ -89,6 +91,8 @@ public:
int lastFilteredBlockNumber = -1;
QPalette originalPalette;
OutputWindow::FilterModeFlags filterMode = OutputWindow::FilterModeFlag::Default;
QTimer scrollTimer;
QElapsedTimer lastMessage;
};
} // namespace Internal
@@ -161,11 +165,11 @@ OutputWindow::OutputWindow(Context context, const QString &settingsKey, QWidget
cutAction->setEnabled(false);
copyAction->setEnabled(false);
m_scrollTimer.setInterval(10);
m_scrollTimer.setSingleShot(true);
connect(&m_scrollTimer, &QTimer::timeout,
d->scrollTimer.setInterval(10);
d->scrollTimer.setSingleShot(true);
connect(&d->scrollTimer, &QTimer::timeout,
this, &OutputWindow::scrollToBottom);
m_lastMessage.start();
d->lastMessage.start();
d->originalFontSize = font().pointSizeF();
@@ -426,20 +430,20 @@ void OutputWindow::handleOutputChunk(const QString &output, OutputFormat format)
}
}
const bool atBottom = isScrollbarAtBottom() || m_scrollTimer.isActive();
const bool atBottom = isScrollbarAtBottom() || d->scrollTimer.isActive();
d->scrollToBottom = true;
d->formatter.appendMessage(out, format);
if (atBottom) {
if (m_lastMessage.elapsed() < 5) {
m_scrollTimer.start();
if (d->lastMessage.elapsed() < 5) {
d->scrollTimer.start();
} else {
m_scrollTimer.stop();
d->scrollTimer.stop();
scrollToBottom();
}
}
m_lastMessage.start();
d->lastMessage.start();
enableUndoRedo();
}

View File

@@ -30,9 +30,7 @@
#include <utils/outputformat.h>
#include <QElapsedTimer>
#include <QPlainTextEdit>
#include <QTimer>
namespace Utils {
class OutputFormatter;
@@ -106,8 +104,6 @@ private:
void wheelEvent(QWheelEvent *e) override;
using QPlainTextEdit::setFont; // call setBaseFont instead, which respects the zoom factor
QTimer m_scrollTimer;
QElapsedTimer m_lastMessage;
void enableUndoRedo();
void filterNewContent();
void handleNextOutputChunk();

View File

@@ -60,6 +60,7 @@
#include <QSpinBox>
#include <QTabBar>
#include <QTabWidget>
#include <QTimer>
#include <QToolButton>
#include <QVBoxLayout>