mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Add stub for a widget to show the dive pictures.
This has a few classes: the model is the list of pictures for the current dive, the delegate is how this pictures will be displayed on screen, the widget is the collection of delegates, and the DivePictureThumbnailThread is a worker-thread to generate the thumbnails so the UI will not freeze. [Dirk Hohndel: added the new files to subsurface.pro] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									1556b723a2
								
							
						
					
					
						commit
						1c34c831a4
					
				
					 4 changed files with 58 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -138,6 +138,7 @@ SET(SUBSURFACE_INTERFACE
 | 
			
		|||
	qt-ui/groupedlineedit.cpp
 | 
			
		||||
	qt-ui/usermanual.cpp
 | 
			
		||||
	qt-ui/divelogexportdialog.cpp
 | 
			
		||||
	qt-ui/divepicturewidget.cpp
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
#the profile widget
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										26
									
								
								qt-ui/divepicturewidget.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								qt-ui/divepicturewidget.cpp
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,26 @@
 | 
			
		|||
#include "divepicturewidget.h"
 | 
			
		||||
 | 
			
		||||
void DivePictureDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
 | 
			
		||||
{
 | 
			
		||||
	QStyledItemDelegate::paint(painter, option, index);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int DivePictureModel::columnCount(const QModelIndex &parent) const
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QVariant DivePictureModel::data(const QModelIndex &index, int role) const
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int DivePictureModel::rowCount(const QModelIndex &parent) const
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
DivePictureView::DivePictureView(QWidget *parent): QListView(parent)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										29
									
								
								qt-ui/divepicturewidget.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								qt-ui/divepicturewidget.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,29 @@
 | 
			
		|||
#ifndef DIVEPICTUREWIDGET_H
 | 
			
		||||
#define DIVEPICTUREWIDGET_H
 | 
			
		||||
 | 
			
		||||
#include <QAbstractTableModel>
 | 
			
		||||
#include <QStyledItemDelegate>
 | 
			
		||||
#include <QListView>
 | 
			
		||||
#include <QThread>
 | 
			
		||||
 | 
			
		||||
class DivePictureModel : QAbstractTableModel {
 | 
			
		||||
	virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
 | 
			
		||||
	virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
 | 
			
		||||
	virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class DivePictureDelegate : QStyledItemDelegate {
 | 
			
		||||
	virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class DivePictureView : public QListView{
 | 
			
		||||
	Q_OBJECT
 | 
			
		||||
public:
 | 
			
		||||
	DivePictureView(QWidget *parent);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class DivePictureThumbnailThread : public QThread {
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			@ -40,6 +40,7 @@ HEADERS = \
 | 
			
		|||
	qt-ui/completionmodels.h \
 | 
			
		||||
	qt-ui/divecomputermanagementdialog.h \
 | 
			
		||||
	qt-ui/divelistview.h \
 | 
			
		||||
	qt-ui/divepicturewidget.h \
 | 
			
		||||
	qt-ui/diveplanner.h \
 | 
			
		||||
	qt-ui/downloadfromdivecomputer.h \
 | 
			
		||||
	qt-ui/globe.h \
 | 
			
		||||
| 
						 | 
				
			
			@ -112,6 +113,7 @@ SOURCES =  \
 | 
			
		|||
	qt-ui/completionmodels.cpp \
 | 
			
		||||
	qt-ui/divecomputermanagementdialog.cpp \
 | 
			
		||||
	qt-ui/divelistview.cpp \
 | 
			
		||||
	qt-ui/divepicturewidget.cpp \
 | 
			
		||||
	qt-ui/diveplanner.cpp \
 | 
			
		||||
	qt-ui/downloadfromdivecomputer.cpp \
 | 
			
		||||
	qt-ui/globe.cpp \
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue