Adds initial intermediate qt6 porting state

This commit is contained in:
torsten committed 2026-08-17 17:54:56 +02:00
1 parent 99136e9460
commit d176b5e0d7
11247 files changed
+1891537

No files matched your search

@@ -0,0 +1,48 @@
#include "RatioAwareLabel.h"
RatioAwareLabel::RatioAwareLabel(QWidget *parent)
: QLabel(parent)
{
setScaledContents(false);
}
void RatioAwareLabel::setPixmap(const QPixmap &pixmap)
{
m_pixmap = pixmap;
scale();
}
int RatioAwareLabel::heightRatio(int width) const
{
if (m_pixmap.isNull())
return height();
return (m_pixmap.height() * width / m_pixmap.width());
}
QSize RatioAwareLabel::sizeHint() const
{
int w = width();
return QSize(w, heightRatio(w));
}
void RatioAwareLabel::scale()
{
if (m_pixmap.isNull())
return;
QLabel::setPixmap(m_pixmap.scaled(size(), Qt::KeepAspectRatio, Qt::FastTransformation));
}
void RatioAwareLabel::resizeEvent(QResizeEvent *event)
{
QLabel::resizeEvent(event);
scale();
}