changing avatar in local vcard, no uploading yet

This commit is contained in:
Blue 2019-10-23 17:49:56 +03:00
parent 2a37f36b83
commit 652381b067
9 changed files with 221 additions and 63 deletions

View file

@ -29,16 +29,6 @@ Image::Image(const QString& path, quint16 p_minWidth, QWidget* parent):
recalculateAspectRatio();
}
Image::Image(const QString& path, quint16 width, quint16 height, quint16 p_minWidth, QWidget* parent):
QLabel(parent),
pixmap(QIcon(path).pixmap(QSize(width, height))),
aspectRatio(0),
minWidth(p_minWidth)
{
setScaledContents(true);
recalculateAspectRatio();
}
Image::~Image()
{
@ -83,9 +73,3 @@ void Image::setPath(const QString& path)
pixmap = QPixmap(path);
recalculateAspectRatio();
}
void Image::setPath(const QString& path, quint16 width, quint16 height)
{
pixmap = QPixmap(QIcon(path).pixmap(QSize(width, height)));
recalculateAspectRatio();
}

View file

@ -21,7 +21,6 @@
#include <QLabel>
#include <QPixmap>
#include <QIcon>
/**
* @todo write docs
@ -30,7 +29,6 @@ class Image : public QLabel
{
public:
Image(const QString& path, quint16 minWidth = 50, QWidget* parent = nullptr);
Image(const QString& path, quint16 width, quint16 height, quint16 minWidth = 50, QWidget* parent = nullptr);
~Image();
@ -38,7 +36,6 @@ public:
int widthForHeight(int height) const;
bool hasHeightForWidth() const override;
void setPath(const QString& path);
void setPath(const QString& path, quint16 width, quint16 height);
void setMinWidth(quint16 minWidth);
private: