File: SourceTreeDelegate.cpp

package info (click to toggle)
obs-studio 32.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 49,868 kB
  • sloc: ansic: 191,636; cpp: 110,959; makefile: 877; python: 675; sh: 287; javascript: 19
file content (16 lines) | stat: -rw-r--r-- 501 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "SourceTree.hpp"
#include "SourceTreeDelegate.hpp"
#include "moc_SourceTreeDelegate.cpp"

SourceTreeDelegate::SourceTreeDelegate(QObject *parent) : QStyledItemDelegate(parent) {}

QSize SourceTreeDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
{
	SourceTree *tree = qobject_cast<SourceTree *>(parent());
	QWidget *item = tree->indexWidget(index);

	if (!item)
		return QStyledItemDelegate::sizeHint(option, index);

	return (QSize(item->sizeHint()));
}