From cafc7e4b1338156c9a3294a8f1037b5a31fffdbb Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 10 Feb 2014 14:41:59 -0200 Subject: Clear the data when the model resets. This patch does a few things: 1 - reset the model when user closes the dive file 2 - connects the 'rowsAboutToBeRemoved' in a way that the graphics can remove their polygons too 3 - adds a 'clear' virtual method so items that don't follow the rules can clean themseves up. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'qt-ui/profile/profilewidget2.cpp') diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 7db90886e..69ec8b9e2 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -432,6 +432,7 @@ void ProfileWidget2::setEmptyState() if (currentState == EMPTY) return; + dataModel->clear(); backgroundFile = QString(":poster%1").arg( rand()%3 +1); currentState = EMPTY; fixBackgroundPos(); -- cgit v1.2.3-70-g09d2