qt6 build

This commit is contained in:
Blue 2024-12-14 01:53:04 +02:00
parent a04693e39d
commit d4cec645b5
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
35 changed files with 279 additions and 632 deletions

View file

@ -21,36 +21,39 @@
SettingsList::SettingsList(QWidget* parent):
QListWidget(parent),
lastWidth(0)
{
{}
SettingsList::~SettingsList() {}
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
void SettingsList::initViewItemOption(QStyleOptionViewItem* option) const {
QListWidget::initViewItemOption(option);
if (!iconSize().isValid())
option->decorationSize.setWidth(lastWidth);
option->rect.setWidth(lastWidth);
}
SettingsList::~SettingsList()
{
}
QStyleOptionViewItem SettingsList::viewOptions() const
{
#else
QStyleOptionViewItem SettingsList::viewOptions() const {
QStyleOptionViewItem option = QListWidget::viewOptions();
if (!iconSize().isValid()) {
if (!iconSize().isValid())
option.decorationSize.setWidth(lastWidth);
}
option.rect.setWidth(lastWidth);
return option;
}
#endif
void SettingsList::resizeEvent(QResizeEvent* event)
{
void SettingsList::resizeEvent(QResizeEvent* event) {
lastWidth = event->size().width();
QListWidget::resizeEvent(event);
}
QRect SettingsList::visualRect(const QModelIndex& index) const
{
QRect SettingsList::visualRect(const QModelIndex& index) const {
QRect res = QListWidget::visualRect(index);
if (index.isValid()) {
if (index.isValid())
res.setWidth(lastWidth);
}
return res;
}