summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/customwidget.cpp7
-rw-r--r--plugins/customwidget.h2
2 files changed, 3 insertions, 6 deletions
diff --git a/plugins/customwidget.cpp b/plugins/customwidget.cpp
index 74b07dc..9a3e6f2 100644
--- a/plugins/customwidget.cpp
+++ b/plugins/customwidget.cpp
@@ -35,6 +35,7 @@ PyCustomWidget::PyCustomWidget(PyObject* objectType)
: m_data(new PyCustomWidgetPrivate())
{
m_data->pyObject = objectType;
+ m_name = QString(reinterpret_cast<PyTypeObject*>(objectType)->tp_name);
}
PyCustomWidget::~PyCustomWidget()
@@ -73,11 +74,7 @@ QString PyCustomWidget::includeFile() const
QString PyCustomWidget::name() const
{
- static QString objectName;
- if (objectName.isEmpty()) {
- objectName = QString(reinterpret_cast<PyTypeObject*>(m_data->pyObject)->tp_name);
- }
- return objectName;
+ return m_name;
}
QString PyCustomWidget::toolTip() const
diff --git a/plugins/customwidget.h b/plugins/customwidget.h
index e4eb76d..00393a1 100644
--- a/plugins/customwidget.h
+++ b/plugins/customwidget.h
@@ -52,7 +52,7 @@ public:
private:
QScopedPointer<PyCustomWidgetPrivate> m_data;
-
+ QString m_name;
};
#endif