aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-13 15:28:17 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-13 15:28:17 -0300
commit61373eaccf506d022e3c31715b31c2b9432b6f49 (patch)
treee469dd9a96108129c38151d5893176560688c10f /qt-ui
parent605f42daa41d74ebacca686b35f03240467f661a (diff)
downloadsubsurface-61373eaccf506d022e3c31715b31c2b9432b6f49.tar.gz
Fix segfault on mouseOver at the Profile with an invalid dive selected ( trip )
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/maintab.cpp4
-rw-r--r--qt-ui/mainwindow.cpp5
-rw-r--r--qt-ui/mainwindow.h2
-rw-r--r--qt-ui/profilegraphics.cpp12
4 files changed, 16 insertions, 7 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index edacf45a4..a43ae563d 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -140,8 +140,8 @@ void MainTab::updateDiveInfo(int dive)
* if we don't use the gtk widget to drive this?
* Maybe call process_selected_dives? Or re-write to query our Qt list view.
*/
- qDebug("max temp %u",stats_selection.max_temp);
- qDebug("min temp %u",stats_selection.min_temp);
+// qDebug("max temp %u",stats_selection.max_temp);
+// qDebug("min temp %u",stats_selection.min_temp);
}
void MainTab::on_addCylinder_clicked()
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 3ba4e6881..3766e2187 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -43,6 +43,8 @@ MainWindow::MainWindow() : ui(new Ui::MainWindow()),
ui->ListWidget->setCurrentIndex(sortModel->index(0,0, firstDiveOrTrip));
else
ui->ListWidget->setCurrentIndex(firstDiveOrTrip);
+
+#if 0
QAction *actionNextDive = new QAction(this);
addAction(actionNextDive);
actionNextDive->setShortcut(Qt::Key_Down);
@@ -51,6 +53,7 @@ MainWindow::MainWindow() : ui(new Ui::MainWindow()),
addAction(actionPreviousDive);
actionPreviousDive->setShortcut(Qt::Key_Up);
connect(actionPreviousDive, SIGNAL(triggered()), this, SLOT(previousDive_triggered()));
+#endif
}
void MainWindow::redrawProfile()
@@ -58,6 +61,7 @@ void MainWindow::redrawProfile()
ui->ProfileWidget->plot(get_dive(selected_dive));
}
+#if 0
void MainWindow::nextDive_triggered()
{
// Get the current Selection:
@@ -147,6 +151,7 @@ void MainWindow::previousDive_triggered()
}
}
}
+#endif
void MainWindow::on_actionNew_triggered()
{
diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h
index 8c07d048c..124f70f33 100644
--- a/qt-ui/mainwindow.h
+++ b/qt-ui/mainwindow.h
@@ -69,9 +69,11 @@ private Q_SLOTS:
void on_actionAboutSubsurface_triggered();
void on_actionUserManual_triggered();
+#if 0
/* keyboard actions */
void nextDive_triggered();
void previousDive_triggered();
+#endif
void dive_selection_changed(const QItemSelection& newSelection,
const QItemSelection& oldSelection);
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp
index 751d685e5..571214f6f 100644
--- a/qt-ui/profilegraphics.cpp
+++ b/qt-ui/profilegraphics.cpp
@@ -214,15 +214,13 @@ void ProfileGraphicsView::plot(struct dive *d)
resetTransform();
zoomLevel = 0;
dive = d;
+ toolTip = 0;
}
- if(!isVisible()){
+ if(!isVisible() || !dive){
return;
}
- if(!dive)
- return;
-
scene()->setSceneRect(0,0, viewport()->width()-50, viewport()->height()-50);
QSettings s;
@@ -1278,8 +1276,12 @@ void ToolTipItem::collapse()
void ToolTipItem::expand()
{
- QRectF nextRectangle;
+ if (!title){
+ return;
+ }
+
+ QRectF nextRectangle;
double width = 0, height = title->boundingRect().height() + SPACING;
Q_FOREACH(ToolTip t, toolTips) {
if (t.second->boundingRect().width() > width)