Atlas Game Manager
A game manager for f95 and dlsite written in c++
Loading...
Searching...
No Matches
ImageWidget.hpp
Go to the documentation of this file.
1//
2// Created by kj16609 on 6/4/23.
3//
4
5#pragma once
6#ifndef ATLASGAMEMANAGER_IMAGEWIDGET_HPP
7#define ATLASGAMEMANAGER_IMAGEWIDGET_HPP
8
9#include <QLabel>
10
11class ImageWidget final : public QLabel
12{
13 Q_OBJECT
14
15 QString m_path {};
16 QPixmap m_pixmap {};
17
18 QPixmap scaledPixmap();
19
20 public:
21
22 ImageWidget( QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags() );
23
24 void setPath( const QString path );
25
26 QString path() const { return m_path; }
27
28 //Drag n' drop stuff
29 void dragEnterEvent( QDragEnterEvent* event ) override;
30 void dropEvent( QDropEvent* event ) override;
31 void resizeEvent( QResizeEvent* event ) override;
32
33 signals:
34 void pathChanged( const QString& path );
35};
36
37#endif //ATLASGAMEMANAGER_IMAGEWIDGET_HPP
QString m_path
Definition ImageWidget.hpp:15
ImageWidget(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
Definition ImageWidget.cpp:12
QPixmap m_pixmap
Definition ImageWidget.hpp:16
void pathChanged(const QString &path)
void dragEnterEvent(QDragEnterEvent *event) override
Definition ImageWidget.cpp:24
void setPath(const QString path)
Definition ImageWidget.cpp:15
void resizeEvent(QResizeEvent *event) override
Definition ImageWidget.cpp:51
void dropEvent(QDropEvent *event) override
Definition ImageWidget.cpp:35
QString path() const
Definition ImageWidget.hpp:26
QPixmap scaledPixmap()
Definition ImageWidget.cpp:58