Hi all,
I am trying to avoid a horizontal scrollbar in QTreeWidget by restricting the text of the items to some fixed number of characters (let's say 25). The functionality I need is to restrict the _displayed_ name only, keeping the original name in the case the item text is being edited. Also, the original text can be displayed on mouse hover, but this is simply solvable by QTreeWidgetItem::setToolTip().
Is there any standard way to do something like this?
Thank you.
QStringList sEntryList;
sEntryList << "Some text here which does not need to be displayed fully, making the QTreeWidget horizontally scrollable";
QTreeWidgetItem* const pEntryItem = new QTreeWidgetItem(1, 0, 5, this, sEntryList);
pEntryItem->setFlags(pEntryItem->flags() | Qt::ItemIsDragEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable);
pEntryItem->setToolTip("This text here can be displayed on mouse hover event");
Bookmarks