mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Merge branch 'QtStuff' of git://github.com/tcanabrava/subsurface into Qt
This commit is contained in:
commit
106659774a
3 changed files with 18 additions and 6 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
#include <QSortFilterProxyModel>
|
||||||
|
|
||||||
#include "divelistview.h"
|
#include "divelistview.h"
|
||||||
#include "starwidget.h"
|
#include "starwidget.h"
|
||||||
|
@ -22,13 +23,14 @@
|
||||||
|
|
||||||
|
|
||||||
MainWindow::MainWindow() : ui(new Ui::MainWindow()),
|
MainWindow::MainWindow() : ui(new Ui::MainWindow()),
|
||||||
model(new DiveTripModel(this))
|
model(new DiveTripModel(this)),
|
||||||
|
sortModel(new QSortFilterProxyModel())
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->ListWidget->setModel(model);
|
sortModel->setSourceModel(model);
|
||||||
setWindowIcon(QIcon(":subsurface-icon"));
|
ui->ListWidget->setModel(sortModel);
|
||||||
// Just to test the star widgets, can be safely removed.
|
|
||||||
|
|
||||||
|
setWindowIcon(QIcon(":subsurface-icon"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionNew_triggered()
|
void MainWindow::on_actionNew_triggered()
|
||||||
|
@ -63,6 +65,10 @@ void MainWindow::on_actionOpen_triggered()
|
||||||
report_dives(FALSE, FALSE);
|
report_dives(FALSE, FALSE);
|
||||||
|
|
||||||
ui->InfoWidget->reload();
|
ui->InfoWidget->reload();
|
||||||
|
|
||||||
|
model->deleteLater();
|
||||||
|
model = new DiveTripModel(this);
|
||||||
|
sortModel->setSourceModel(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionSave_triggered()
|
void MainWindow::on_actionSave_triggered()
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
|
|
||||||
|
class QSortFilterProxyModel;
|
||||||
class DiveTripModel;
|
class DiveTripModel;
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
|
@ -68,6 +69,7 @@ private Q_SLOTS:
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
DiveTripModel *model;
|
DiveTripModel *model;
|
||||||
|
QSortFilterProxyModel *sortModel;
|
||||||
QString filter();
|
QString filter();
|
||||||
bool askSaveChanges();
|
bool askSaveChanges();
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,11 @@
|
||||||
<widget class="MainTab" name="InfoWidget" native="true"/>
|
<widget class="MainTab" name="InfoWidget" native="true"/>
|
||||||
<widget class="QGraphicsView" name="ProfileWidget"/>
|
<widget class="QGraphicsView" name="ProfileWidget"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="DiveListView" name="ListWidget"/>
|
<widget class="DiveListView" name="ListWidget">
|
||||||
|
<property name="sortingEnabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
@ -45,7 +49,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>763</width>
|
<width>763</width>
|
||||||
<height>20</height>
|
<height>25</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuFile">
|
<widget class="QMenu" name="menuFile">
|
||||||
|
|
Loading…
Add table
Reference in a new issue