started to work on settings

This commit is contained in:
Blue 2022-01-16 22:54:57 +03:00
parent 62a59eb7a1
commit 6bee149e6b
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
10 changed files with 260 additions and 2 deletions

View file

@ -0,0 +1,27 @@
#include "settingslist.h"
SettingsList::SettingsList(QWidget* parent):
QListWidget(parent),
lastWidth(0)
{
}
SettingsList::~SettingsList()
{
}
QStyleOptionViewItem SettingsList::viewOptions() const
{
QStyleOptionViewItem option = QListWidget::viewOptions();
if (!iconSize().isValid()) {
option.decorationSize.setWidth(lastWidth);
}
option.rect.setWidth(lastWidth);
return option;
}
void SettingsList::resizeEvent(QResizeEvent* event)
{
lastWidth = event->size().width();
QListWidget::resizeEvent(event);
}