Skip to content

Commit

Permalink
fix: incorrect registering way for qt6
Browse files Browse the repository at this point in the history
Removing warning.

pms: BUG-368399
  • Loading branch information
18202781743 committed Jan 3, 2025
1 parent 0e0e63d commit ee6314e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 9 additions & 0 deletions qt6/src/dquickextendregister_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <dtkdeclarative_global.h>

#include "dqmlglobalobject_p.h"
#include <DWindowManagerHelper>
#include <DGuiApplicationHelper>
#include <DFontManager>
Expand All @@ -15,6 +16,13 @@
DQUICK_BEGIN_NAMESPACE
DGUI_USE_NAMESPACE

namespace DColorForeign
{
Q_NAMESPACE
QML_NAMED_ELEMENT(Color)
QML_FOREIGN_NAMESPACE(DTK_QUICK_NAMESPACE::DColor)
};

struct WindowManagerHelperForeign
{
Q_GADGET
Expand Down Expand Up @@ -57,6 +65,7 @@ struct DPlatformHandleForeign
Q_GADGET
QML_FOREIGN(DPlatformHandle)
QML_NAMED_ELEMENT(PlatformHandle)
QML_UNCREATABLE("PlatformHandle")
};

DQUICK_END_NAMESPACE
6 changes: 1 addition & 5 deletions src/private/dqmlglobalobject_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ DQUICK_BEGIN_NAMESPACE
class DColor
{
Q_GADGET
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QML_ANONYMOUS
QML_NAMED_ELEMENT(Color)
QML_UNCREATABLE("Color is only available as enums.")
#endif
QML_VALUE_TYPE(color)
public:
enum Type : quint8 {
Invalid = 0,
Expand Down

0 comments on commit ee6314e

Please sign in to comment.