Originally, I posted about a problem I was having, but got no response:
I had a QTreeView and wanted to change the color of one of the entries in the view. I opted to change the QTreeView into a QTreeWidget and called QTreeView::setModel() to set my model to match the view.
While the model-view interface works fine, I seem to get a segmentation fault when I do the following in a member function:
void DatabaseTreeWidget::Update_Tree_From_Flags()
{
X = topLevelItem(0);
X
->setTextColor
(1,
QColor(Qt
::darkGreen));
}
void DatabaseTreeWidget::Update_Tree_From_Flags()
{
QTreeWidgetItem *X;
X = topLevelItem(0);
X->setTextColor(1,QColor(Qt::darkGreen));
}
To copy to clipboard, switch view to plain text mode
Why does this happen? I want to change the color of the top level tree item, but am clearly having difficulty.
Bookmarks