Remove weird non-virtual override in ImageLabel
This commit is contained in:
parent
e5288d145a
commit
aec3ffa4b3
3 changed files with 4 additions and 4 deletions
|
@ -48,7 +48,7 @@ ArtDetailWindow::ArtDetailWindow(const QString &filename, const QDir &assetDirec
|
|||
previewBox->setLayout(previewLayout);
|
||||
|
||||
auto imageView = new ImageLabel();
|
||||
imageView->setPixmap(QPixmap::fromImage(image));
|
||||
imageView->setQPixmap(QPixmap::fromImage(image));
|
||||
previewLayout->addWidget(imageView);
|
||||
|
||||
m_titleEdit = new QLineEdit();
|
||||
|
|
|
@ -11,7 +11,7 @@ ImageLabel::ImageLabel(QWidget *parent)
|
|||
setScaledContents(false);
|
||||
}
|
||||
|
||||
void ImageLabel::setPixmap(const QPixmap &p)
|
||||
void ImageLabel::setQPixmap(const QPixmap &p)
|
||||
{
|
||||
pix = p;
|
||||
QLabel::setPixmap(scaledPixmap());
|
||||
|
@ -19,7 +19,7 @@ void ImageLabel::setPixmap(const QPixmap &p)
|
|||
|
||||
int ImageLabel::heightForWidth(int width) const
|
||||
{
|
||||
return pix.isNull() ? this->height() : ((qreal)pix.height() * width) / pix.width();
|
||||
return pix.isNull() ? height() : (pix.height() * width) / pix.width();
|
||||
}
|
||||
|
||||
QSize ImageLabel::sizeHint() const
|
||||
|
|
|
@ -17,7 +17,7 @@ public:
|
|||
[[nodiscard]] QPixmap scaledPixmap() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
void setPixmap(const QPixmap &);
|
||||
void setQPixmap(const QPixmap &);
|
||||
void resizeEvent(QResizeEvent *) override;
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Reference in a new issue