some methods to cVard

This commit is contained in:
Blue 2019-10-21 18:02:41 +03:00
parent e7be046e9f
commit c4d22c9c14
5 changed files with 139 additions and 38 deletions

View file

@ -28,34 +28,22 @@
class Image : public QLabel
{
public:
/**
* Default constructor
*/
Image(const QString& path, QWidget* parent = nullptr);
Image(const QString& path, quint16 minWidth = 50, QWidget* parent = nullptr);
/**
* Destructor
*/
~Image();
/**
* @todo write docs
*
* @param TODO
* @return TODO
*/
int heightForWidth(int width) const override;
/**
* @todo write docs
*
* @return TODO
*/
virtual bool hasHeightForWidth() const;
bool hasHeightForWidth() const override;
void setPath(const QString& path);
void setMinWidth(quint16 minWidth);
private:
QPixmap pixmap;
qreal aspectRatio;
quint16 minWidth;
private:
void recalculateAspectRatio();
};
#endif // IMAGE_H