TreeModel: (Partially) separate header data from root item

Full separation does not seem possible as QTreeView assumes
all items to have equal column count.

Change-Id: Ia260924fe13ea62789923af8484f9838295355b6
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2015-01-16 15:24:53 +01:00
parent c0c9a83409
commit ec187241e5
10 changed files with 62 additions and 67 deletions

View File

@@ -56,8 +56,6 @@ namespace Internal {
struct LocationItem : public TreeItem
{
int columnCount() const { return 8; }
QVariant data(int column, int role) const
{
if (role == Qt::DisplayRole) {
@@ -86,7 +84,6 @@ class BreakpointItem : public QObject, public TreeItem
public:
~BreakpointItem();
int columnCount() const { return 8; }
QVariant data(int column, int role) const;
QIcon icon() const;
@@ -251,10 +248,9 @@ BreakHandler::BreakHandler()
#if USE_BREAK_MODEL_TEST
new ModelTest(this, 0);
#endif
auto root = new TreeItem(QStringList()
setHeader(QStringList()
<< tr("Number") << tr("Function") << tr("File") << tr("Line")
<< tr("Address") << tr("Condition") << tr("Ignore") << tr("Threads"));
setRootItem(root);
}
QIcon BreakHandler::breakpointIcon()