2024-12-04 18:22:25 +01:00
|
|
|
#include "SourceTree.hpp"
|
|
|
|
|
#include "SourceTreeDelegate.hpp"
|
|
|
|
|
#include "moc_SourceTreeDelegate.cpp"
|
2022-08-24 12:37:54 -05:00
|
|
|
|
|
|
|
|
SourceTreeDelegate::SourceTreeDelegate(QObject *parent) : QStyledItemDelegate(parent) {}
|
|
|
|
|
|
2022-08-29 23:55:15 +10:00
|
|
|
QSize SourceTreeDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
|
2022-08-24 12:37:54 -05:00
|
|
|
{
|
|
|
|
|
SourceTree *tree = qobject_cast<SourceTree *>(parent());
|
|
|
|
|
QWidget *item = tree->indexWidget(index);
|
|
|
|
|
|
2022-08-27 23:02:31 -05:00
|
|
|
if (!item)
|
|
|
|
|
return (QSize(0, 0));
|
|
|
|
|
|
2022-08-29 23:55:15 +10:00
|
|
|
return (QSize(option.widget->minimumWidth(), item->height()));
|
2022-08-24 12:37:54 -05:00
|
|
|
}
|