mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Another futile attempt to keep whitespace consistent
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
3e46b4862a
commit
1fec6453a2
2 changed files with 28 additions and 22 deletions
|
@ -21,7 +21,8 @@ DivePictureModel::DivePictureModel()
|
|||
typedef QPair<QString, QImage> SPixmap;
|
||||
typedef QList<SPixmap> SPixmapList;
|
||||
|
||||
SPixmap scaleImages(const QString& s) {
|
||||
SPixmap scaleImages(const QString &s)
|
||||
{
|
||||
QImage p = QImage(s).scaled(128, 128, Qt::KeepAspectRatio);
|
||||
SPixmap ret;
|
||||
ret.first = s;
|
||||
|
@ -73,14 +74,19 @@ QVariant DivePictureModel::data(const QModelIndex &index, int role) const
|
|||
QString key = stringPixmapCache.keys().at(index.row());
|
||||
if (index.column() == 0) {
|
||||
switch (role) {
|
||||
case Qt::ToolTipRole : ret = key; break;
|
||||
case Qt::DecorationRole : ret = stringPixmapCache[key].image; break;
|
||||
case Qt::DisplayRole : ret = QFileInfo(key).fileName();
|
||||
case Qt::ToolTipRole:
|
||||
ret = key;
|
||||
break;
|
||||
case Qt::DecorationRole:
|
||||
ret = stringPixmapCache[key].image;
|
||||
break;
|
||||
case Qt::DisplayRole:
|
||||
ret = QFileInfo(key).fileName();
|
||||
}
|
||||
}
|
||||
else if (index.column() == 1){
|
||||
} else if (index.column() == 1) {
|
||||
switch (role) {
|
||||
case Qt::UserRole : ret = QVariant::fromValue( (void*) stringPixmapCache[key].picture);
|
||||
case Qt::UserRole:
|
||||
ret = QVariant::fromValue((void *)stringPixmapCache[key].picture);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
|
|
@ -20,6 +20,7 @@ public:
|
|||
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
void updateDivePictures(int divenr);
|
||||
|
||||
private:
|
||||
DivePictureModel();
|
||||
int numberOfPictures;
|
||||
|
@ -40,7 +41,6 @@ public:
|
|||
};
|
||||
|
||||
class DivePictureThumbnailThread : public QThread {
|
||||
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Reference in a new issue