diff --git a/src/plugins/debugger/debuggertooltip.cpp b/src/plugins/debugger/debuggertooltip.cpp index f51f6d07730..025745c4cd1 100644 --- a/src/plugins/debugger/debuggertooltip.cpp +++ b/src/plugins/debugger/debuggertooltip.cpp @@ -33,15 +33,15 @@ #include #include +#include #include #include #include #include +#include #include #include #include -#include -#include namespace Debugger { @@ -101,9 +101,8 @@ bool ToolTipWidget::eventFilter(QObject *ob, QEvent *ev) return true; break; case QEvent::KeyPress: - if (static_cast(ev)->key() == Qt::Key_Escape) { + if (static_cast(ev)->key() == Qt::Key_Escape) return true; - } break; case QEvent::KeyRelease: if (static_cast(ev)->key() == Qt::Key_Escape) { @@ -129,7 +128,7 @@ int ToolTipWidget::computeHeight(const QModelIndex &index) const return s; } -Q_SLOT void ToolTipWidget::computeSize() +void ToolTipWidget::computeSize() { int columns = 0; for (int i = 0; i < 3; ++i) { @@ -138,8 +137,9 @@ Q_SLOT void ToolTipWidget::computeSize() } int rows = computeHeight(QModelIndex()); - //Fit tooltip to screen, showing/hiding scrollbars as needed - //Add a bit of space to account for tooltip border, and not touch the border of the screen + // Fit tooltip to screen, showing/hiding scrollbars as needed. + // Add a bit of space to account for tooltip border, and not + // touch the border of the screen. QPoint pos(x(), y()); QRect desktopRect = QApplication::desktop()->availableGeometry(pos); const int maxWidth = desktopRect.right() - pos.x() - 5 - 5; @@ -152,16 +152,14 @@ Q_SLOT void ToolTipWidget::computeSize() setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); rows = maxHeight; columns += verticalScrollBar()->width(); - } - else { + } else { setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); } if (columns > maxWidth) { setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); columns = maxWidth; - } - else { + } else { setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); }