Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Issue creating widget plugin
Qt 6.11 is out! See what's new in the release blog

Issue creating widget plugin

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 2 Posters 581 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • DragoonD Offline
    DragoonD Offline
    Dragoon
    wrote on last edited by Dragoon
    #1

    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 QGraphicsOpacityEffect class (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

    Christian EhrlicherC 1 Reply Last reply
    0
    • DragoonD Offline
      DragoonD Offline
      Dragoon
      wrote on last edited by Dragoon
      #2

      I fixed it moving the initialization of mOpacityEffect in class constructor initalizer list ... but maybe the problem is different may it depends from CONFIG = C++ project directive?

      1 Reply Last reply
      0
      • DragoonD Dragoon

        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 QGraphicsOpacityEffect class (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

        Christian EhrlicherC Online
        Christian EhrlicherC Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @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.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        DragoonD 1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          @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.

          DragoonD Offline
          DragoonD Offline
          Dragoon
          wrote on last edited by
          #4

          @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 EhrlicherC 1 Reply Last reply
          0
          • DragoonD Dragoon

            @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 EhrlicherC Online
            Christian EhrlicherC Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @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?

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            DragoonD 1 Reply Last reply
            0
            • Christian EhrlicherC Christian Ehrlicher

              @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?

              DragoonD Offline
              DragoonD Offline
              Dragoon
              wrote on last edited by Dragoon
              #6
              This post is deleted!
              Christian EhrlicherC 1 Reply Last reply
              0
              • DragoonD Dragoon

                This post is deleted!

                Christian EhrlicherC Online
                Christian EhrlicherC Online
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @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.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                DragoonD 1 Reply Last reply
                0
                • Christian EhrlicherC Christian Ehrlicher

                  @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.

                  DragoonD Offline
                  DragoonD Offline
                  Dragoon
                  wrote on last edited by Dragoon
                  #8

                  @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.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved