forked from blue/squawk
some more thoughts about settings widgets
This commit is contained in:
parent
841e526e59
commit
a8a7ce2538
12 changed files with 248 additions and 45 deletions
|
@ -4,6 +4,7 @@ SettingsList::SettingsList(QWidget* parent):
|
|||
QListWidget(parent),
|
||||
lastWidth(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
SettingsList::~SettingsList()
|
||||
|
@ -25,3 +26,13 @@ void SettingsList::resizeEvent(QResizeEvent* event)
|
|||
lastWidth = event->size().width();
|
||||
QListWidget::resizeEvent(event);
|
||||
}
|
||||
|
||||
QRect SettingsList::visualRect(const QModelIndex& index) const
|
||||
{
|
||||
QRect res = QListWidget::visualRect(index);
|
||||
if (index.isValid()) {
|
||||
res.setWidth(lastWidth);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue