mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Instead of holding the index, hold the URL.
Since the idea is to remove the picture in the future, we need to not hold the row on the model, as when we delete one, the other pictures will change the row. but the QUrl is unique. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
75aafdc715
commit
1e6986d870
3 changed files with 12 additions and 14 deletions
|
|
@ -18,17 +18,18 @@ class DivePictureItem : public DivePixmapItem {
|
|||
Q_OBJECT
|
||||
Q_PROPERTY(qreal scale WRITE setScale READ scale)
|
||||
public:
|
||||
DivePictureItem(int row, QObject *parent = 0);
|
||||
DivePictureItem(QObject *parent = 0);
|
||||
void setPixmap(const QPixmap& pix);
|
||||
public slots:
|
||||
void settingsChanged();
|
||||
void removePicture();
|
||||
void setFileUrl(const QString& s);
|
||||
protected:
|
||||
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
||||
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||
private:
|
||||
int rowOnModel;
|
||||
QString fileUrl;
|
||||
};
|
||||
|
||||
class DiveButtonItem : public DivePixmapItem {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue