Issue creating widget plugin
-
Hallo, I created a custom Qt widget in Qt Creator (C++).
I tought to create a plugin to share this widget as a lib.
I followed the tutorial verbatim but when I try to build the plugin project I got an error in the line commented below:#include <QGraphicsOpacityEffect> .. #include <QWidget> #include <QtUiPlugin/QDesignerExportWidget> class QDESIGNER_WIDGET_EXPORT QVirtualPad : public QWidget { Q_OBJECT private: explicit QVirtualPad(QWidget *parent = nullptr); ... QGraphicsOpacityEffect mOpacityEffect = QGraphicsOpacityEffect(this); // Deleted costructor error. ... };The error complains about a deleted constructor of
QGraphicsOpacityEffectclass (it doesn't seem to be deleted anyway).
This issue appears only when I try to compile the plugin not when compiling and using the custom widget class inside a form (of course the widget files are the same in both cases).
Why?
Maybe Qt Creator cannot compile Designer plugins?Best regards,
Mike -
Hallo, I created a custom Qt widget in Qt Creator (C++).
I tought to create a plugin to share this widget as a lib.
I followed the tutorial verbatim but when I try to build the plugin project I got an error in the line commented below:#include <QGraphicsOpacityEffect> .. #include <QWidget> #include <QtUiPlugin/QDesignerExportWidget> class QDESIGNER_WIDGET_EXPORT QVirtualPad : public QWidget { Q_OBJECT private: explicit QVirtualPad(QWidget *parent = nullptr); ... QGraphicsOpacityEffect mOpacityEffect = QGraphicsOpacityEffect(this); // Deleted costructor error. ... };The error complains about a deleted constructor of
QGraphicsOpacityEffectclass (it doesn't seem to be deleted anyway).
This issue appears only when I try to compile the plugin not when compiling and using the custom widget class inside a form (of course the widget files are the same in both cases).
Why?
Maybe Qt Creator cannot compile Designer plugins?Best regards,
Mike@Dragoon said in Issue creating widget plugin:
The error complains about a deleted constructor of QGraphicsOpacityEffect class (it doesn't seem to be deleted anyway).
And the error is correct - QObject's are not copyable. Use a pointer instead.
-
@Dragoon said in Issue creating widget plugin:
The error complains about a deleted constructor of QGraphicsOpacityEffect class (it doesn't seem to be deleted anyway).
And the error is correct - QObject's are not copyable. Use a pointer instead.
@Christian-Ehrlicher you're correct for sure but why the error is reported only when compiling the plugin and not when compiling the application project?
-
@Christian-Ehrlicher you're correct for sure but why the error is reported only when compiling the plugin and not when compiling the application project?
@Dragoon said in Issue creating widget plugin:
and not when compiling the application project?
I don't understand correctly but why would you add the designer plugin class into an application?
-
@Dragoon said in Issue creating widget plugin:
and not when compiling the application project?
I don't understand correctly but why would you add the designer plugin class into an application?
-
@Dragoon said in Issue creating widget plugin:
s not reported when the same source code is compiled for being used in a Qt widget form
You will get the error there too but you don't compile this piece of code in your application - it's only needed when you create a designer plugin.
-
@Dragoon said in Issue creating widget plugin:
s not reported when the same source code is compiled for being used in a Qt widget form
You will get the error there too but you don't compile this piece of code in your application - it's only needed when you create a designer plugin.
@Christian-Ehrlicher Nope... the error was a line of code of the widget class that was shared both from plugin and application form .
So it should have repoted in both compliation stages... anyway at this time is fixed.