Don't use static_cast for downcast.

This commit is contained in:
Roman Telezhynskyi 2020-12-19 17:15:28 +02:00
parent c3142b8b07
commit 4b2e8c0c82
3 changed files with 3 additions and 3 deletions

View File

@ -41,7 +41,7 @@ class VApplication;// use in define
#if defined(qApp)
#undef qApp
#endif
#define qApp (static_cast<VApplication*>(VAbstractApplication::instance()))
#define qApp (qobject_cast<VApplication*>(VAbstractApplication::instance()))
/**
* @brief The VApplication class reimplamentation QApplication class.

View File

@ -52,7 +52,7 @@ class VCommonSettings;
#if defined(qApp)
#undef qApp
#endif
#define qApp (static_cast<VAbstractApplication*>(QCoreApplication::instance()))
#define qApp (qobject_cast<VAbstractApplication*>(QCoreApplication::instance()))
class VAbstractApplication : public QApplication
{

View File

@ -40,7 +40,7 @@ class QGraphicsScene;
#if defined(qApp)
#undef qApp
#endif
#define qApp (static_cast<VAbstractValApplication*>(QCoreApplication::instance()))
#define qApp (qobject_cast<VAbstractValApplication*>(QCoreApplication::instance()))
class VAbstractValApplication : public VAbstractApplication
{