23#ifndef WORKSPACEWIDGET_H
24#define WORKSPACEWIDGET_H
27 #include "python/pythonWrapper.h"
30#include "../common/sharedStructures.h"
31#include "../common/sharedStructuresQt.h"
34#include "../python/pythonWorkspace.h"
40#include <qtreewidget.h>
58 QTreeWidgetItem(strings, type)
61 explicit WorkspaceTreeItem(QTreeWidget* view,
int type = Type) : QTreeWidgetItem(view, type)
64 WorkspaceTreeItem(QTreeWidget* view,
const QStringList& strings,
int type = Type) :
65 QTreeWidgetItem(strings, type)
69 QTreeWidgetItem(view, after, type)
73 QTreeWidgetItem(parent, type)
76 WorkspaceTreeItem(QTreeWidgetItem* parent,
const QStringList& strings,
int type = Type) :
77 QTreeWidgetItem(parent, strings, type)
80 WorkspaceTreeItem(QTreeWidgetItem* parent, QTreeWidgetItem* after,
int type = Type) :
81 QTreeWidgetItem(parent, after, type)
93 virtual bool operator<(
const QTreeWidgetItem& other)
const
95 int column = treeWidget()->sortColumn();
96 QString thisText = text(column);
97 QString otherText = other.text(column);
100 float a = thisText.toFloat(&ok);
104 float b = otherText.toFloat(&ok);
111 return thisText.localeAwareCompare(otherText) < 0;
123 int numberOfSelectedItems(
bool ableToBeRenamed =
false)
const;
124 int numberOfSelectedMainItems()
const;
127 return m_workspaceContainer;
135 RoleCompatibleTypes = Qt::UserRole + 2,
136 RoleType = Qt::UserRole + 3
139 QString getPythonReadableName(
const QTreeWidgetItem* item)
const;
140 QAction* m_displayItemDetails;
143 QStringList mimeTypes()
const;
144#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
145 QMimeData* mimeData(
const QList<QTreeWidgetItem*> items)
const;
147 QMimeData* mimeData(
const QList<QTreeWidgetItem*>& items)
const;
149 void startDrag(Qt::DropActions supportedActions);
153 const QHash<QString, ito::PyWorkspaceItem*>& items,
154 const QString& baseName,
155 QTreeWidgetItem* parent =
nullptr);
156 void recursivelyDeleteHash(QTreeWidgetItem* item);
157 void recursivelyDeleteHash(
const QString& fullBaseName);
161 bool m_globalNotLocal;
162 QHash<QString, QTreeWidgetItem*> m_itemHash;
165 QPixmap m_dragPixmap;
166 Qt::DropActions supportedDragActions()
const;
171 void workspaceContainerUpdated(
172 PyWorkspaceItem* rootItem, QString fullNameRoot, QStringList recentlyDeletedFullNames);
173 void displayItemDetails();
177 QTreeWidgetItem* item,
int column);
178 void itemExpanded(QTreeWidgetItem* item);
179 void itemCollapsed(QTreeWidgetItem* item);
Definition pythonWorkspace.h:92
every item in the workspace is represented by one PyWorkspaceItem
Definition pythonWorkspace.h:64
tiny derivative of QTreeWidgetItem, that overwrites the comparison operator
Definition workspaceWidget.h:52
virtual bool operator<(const QTreeWidgetItem &other) const
overwritten operator for better number comparison
Definition workspaceWidget.h:93
Definition apiFunctionsGraph.cpp:40