forked from blue/squawk
started to work on settings
This commit is contained in:
parent
62a59eb7a1
commit
6bee149e6b
10 changed files with 260 additions and 2 deletions
27
ui/widgets/settings/settingslist.cpp
Normal file
27
ui/widgets/settings/settingslist.cpp
Normal 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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue