porymap/include/ui/divingmappixmapitem.h

31 lines
717 B
C
Raw Normal View History

2024-08-09 06:29:28 +01:00
#ifndef DIVINGMAPPIXMAPITEM_H
#define DIVINGMAPPIXMAPITEM_H
#include "mapconnection.h"
#include <QGraphicsPixmapItem>
#include <QPointer>
2024-08-15 03:22:54 +01:00
#include <QComboBox>
2024-08-09 06:29:28 +01:00
class DivingMapPixmapItem : public QObject, public QGraphicsPixmapItem {
Q_OBJECT
public:
2024-08-15 03:22:54 +01:00
DivingMapPixmapItem(MapConnection *connection, QComboBox *combo);
~DivingMapPixmapItem();
2024-08-09 06:29:28 +01:00
MapConnection* connection() const { return m_connection; }
2024-08-15 03:22:54 +01:00
void updatePixmap();
2024-08-09 06:29:28 +01:00
private:
QPointer<MapConnection> m_connection;
2024-08-15 03:22:54 +01:00
QPointer<QComboBox> m_combo;
void setComboText(const QString &text);
static QPixmap getBasePixmap(MapConnection* connection);
2024-08-09 06:29:28 +01:00
2024-08-15 03:22:54 +01:00
private slots:
void onTargetMapChanged();
2024-08-09 06:29:28 +01:00
};
#endif // DIVINGMAPPIXMAPITEM_H