Skip to content
Snippets Groups Projects
Commit f77d9dc9 authored by hjk's avatar hjk
Browse files

debugger: fix style after previous merge

parent 356130a7
No related branches found
No related tags found
No related merge requests found
...@@ -33,15 +33,15 @@ ...@@ -33,15 +33,15 @@
#include <QtCore/QtDebug> #include <QtCore/QtDebug>
#include <QtGui/QApplication> #include <QtGui/QApplication>
#include <QtGui/QDesktopWidget>
#include <QtGui/QHBoxLayout> #include <QtGui/QHBoxLayout>
#include <QtGui/QHeaderView> #include <QtGui/QHeaderView>
#include <QtGui/QKeyEvent> #include <QtGui/QKeyEvent>
#include <QtGui/QLabel> #include <QtGui/QLabel>
#include <QtGui/QScrollBar>
#include <QtGui/QTreeView> #include <QtGui/QTreeView>
#include <QtGui/QVBoxLayout> #include <QtGui/QVBoxLayout>
#include <QtGui/QWidget> #include <QtGui/QWidget>
#include <QtGui/QScrollBar>
#include <QtGui/QDesktopWidget>
namespace Debugger { namespace Debugger {
...@@ -101,9 +101,8 @@ bool ToolTipWidget::eventFilter(QObject *ob, QEvent *ev) ...@@ -101,9 +101,8 @@ bool ToolTipWidget::eventFilter(QObject *ob, QEvent *ev)
return true; return true;
break; break;
case QEvent::KeyPress: case QEvent::KeyPress:
if (static_cast<QKeyEvent *>(ev)->key() == Qt::Key_Escape) { if (static_cast<QKeyEvent *>(ev)->key() == Qt::Key_Escape)
return true; return true;
}
break; break;
case QEvent::KeyRelease: case QEvent::KeyRelease:
if (static_cast<QKeyEvent *>(ev)->key() == Qt::Key_Escape) { if (static_cast<QKeyEvent *>(ev)->key() == Qt::Key_Escape) {
...@@ -129,7 +128,7 @@ int ToolTipWidget::computeHeight(const QModelIndex &index) const ...@@ -129,7 +128,7 @@ int ToolTipWidget::computeHeight(const QModelIndex &index) const
return s; return s;
} }
Q_SLOT void ToolTipWidget::computeSize() void ToolTipWidget::computeSize()
{ {
int columns = 0; int columns = 0;
for (int i = 0; i < 3; ++i) { for (int i = 0; i < 3; ++i) {
...@@ -138,8 +137,9 @@ Q_SLOT void ToolTipWidget::computeSize() ...@@ -138,8 +137,9 @@ Q_SLOT void ToolTipWidget::computeSize()
} }
int rows = computeHeight(QModelIndex()); int rows = computeHeight(QModelIndex());
//Fit tooltip to screen, showing/hiding scrollbars as needed // 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 // Add a bit of space to account for tooltip border, and not
// touch the border of the screen.
QPoint pos(x(), y()); QPoint pos(x(), y());
QRect desktopRect = QApplication::desktop()->availableGeometry(pos); QRect desktopRect = QApplication::desktop()->availableGeometry(pos);
const int maxWidth = desktopRect.right() - pos.x() - 5 - 5; const int maxWidth = desktopRect.right() - pos.x() - 5 - 5;
...@@ -152,16 +152,14 @@ Q_SLOT void ToolTipWidget::computeSize() ...@@ -152,16 +152,14 @@ Q_SLOT void ToolTipWidget::computeSize()
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
rows = maxHeight; rows = maxHeight;
columns += verticalScrollBar()->width(); columns += verticalScrollBar()->width();
} } else {
else {
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
} }
if (columns > maxWidth) { if (columns > maxWidth) {
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
columns = maxWidth; columns = maxWidth;
} } else {
else {
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment