mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Element panel : elements can be searched by their name but also with by all their informations.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5698 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -240,7 +240,20 @@ void FileElementCollectionItem::setUpData()
|
||||
if (isDir())
|
||||
setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsEnabled);
|
||||
else
|
||||
{
|
||||
setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled);
|
||||
|
||||
//Set the local name and all informations of the element
|
||||
//in the data Qt::UserRole+1, these data will be use for search.
|
||||
ElementsLocation location(collectionPath());
|
||||
DiagramContext context = location.elementInformations();
|
||||
QStringList search_list;
|
||||
for (QString key : context.keys()) {
|
||||
search_list.append(context.value(key).toString());
|
||||
}
|
||||
search_list.append(localName());
|
||||
setData(search_list.join(" "));
|
||||
}
|
||||
|
||||
setToolTip(collectionPath());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user