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. Error in Qt Creator 5.9 ; use of deleted function 'Blob::Blob(const Blob&)'

Error in Qt Creator 5.9 ; use of deleted function 'Blob::Blob(const Blob&)'

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 6 Posters 7.0k Views
  • 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.
  • S Offline
    S Offline
    Syazwany
    wrote on 27 Feb 2018, 18:59 last edited by
    #1

    I am currently dealing with these errors. I am not sure where I did wrong since they are from qobject.h
    I am using Qt Creator 5.9 on Windows.

    The errors :

    1. C:\Qt\Qt5.9.0\Tools\mingw530_32\i686-w64-mingw32\include\c++\ext\new_allocator.h:120: error: use of deleted function 'Blob::Blob(const Blob&)'
      { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
      ^
    2. C:\Qt\Qt5.9.0\5.9\mingw53_32\include\QtCore\qscopedpointer.h:175: error: 'QScopedPointer<T, Cleanup>::QScopedPointer(const QScopedPointer<T, Cleanup>&) [with T = QObjectData; Cleanup = QScopedPointerDeleter<QObjectData>]' is private
      Q_DISABLE_COPY(QScopedPointer)
      ^
    K 1 Reply Last reply 27 Feb 2018, 19:15
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 27 Feb 2018, 19:13 last edited by
      #2

      Hi
      It says use of deleted function
      Blob::Blob(const Blob&)
      In plain english it means "Hey you try to copy an QObject which is not allowed"
      (the copy constructor have been deleted on purpose)

      So if Blob is a QObject, you somehow ask it to make a copy.
      (inserting into list or by other means)

      M 1 Reply Last reply 16 May 2019, 03:49
      6
      • S Syazwany
        27 Feb 2018, 18:59

        I am currently dealing with these errors. I am not sure where I did wrong since they are from qobject.h
        I am using Qt Creator 5.9 on Windows.

        The errors :

        1. C:\Qt\Qt5.9.0\Tools\mingw530_32\i686-w64-mingw32\include\c++\ext\new_allocator.h:120: error: use of deleted function 'Blob::Blob(const Blob&)'
          { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
          ^
        2. C:\Qt\Qt5.9.0\5.9\mingw53_32\include\QtCore\qscopedpointer.h:175: error: 'QScopedPointer<T, Cleanup>::QScopedPointer(const QScopedPointer<T, Cleanup>&) [with T = QObjectData; Cleanup = QScopedPointerDeleter<QObjectData>]' is private
          Q_DISABLE_COPY(QScopedPointer)
          ^
        K Offline
        K Offline
        koahnig
        wrote on 27 Feb 2018, 19:15 last edited by
        #3

        @Syazwany

        To add to @mrjj you are not using Qt creator 5.9. You are using Qt 5.9 libraries probably pre-compiled with MinGW.

        Qt creator is an IDE and may use many different Qt library versions.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        6
        • M mrjj
          27 Feb 2018, 19:13

          Hi
          It says use of deleted function
          Blob::Blob(const Blob&)
          In plain english it means "Hey you try to copy an QObject which is not allowed"
          (the copy constructor have been deleted on purpose)

          So if Blob is a QObject, you somehow ask it to make a copy.
          (inserting into list or by other means)

          M Offline
          M Offline
          m4l490n
          wrote on 16 May 2019, 03:49 last edited by
          #4

          @mrjj said in Error in Qt Creator 5.9 ; use of deleted function 'Blob::Blob(const Blob&)':

          So if Blob is a QObject, you somehow ask it to make a copy.
          (inserting into list or by other means)

          Does that mean that I can't append a class that inherits from QObject into a QVector? I kind of need to do that.

          J 1 Reply Last reply 16 May 2019, 04:16
          0
          • M m4l490n
            16 May 2019, 03:49

            @mrjj said in Error in Qt Creator 5.9 ; use of deleted function 'Blob::Blob(const Blob&)':

            So if Blob is a QObject, you somehow ask it to make a copy.
            (inserting into list or by other means)

            Does that mean that I can't append a class that inherits from QObject into a QVector? I kind of need to do that.

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 16 May 2019, 04:16 last edited by
            #5

            @m4l490n You can store pointers inside the vector

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            A 1 Reply Last reply 16 May 2019, 04:56
            4
            • J jsulm
              16 May 2019, 04:16

              @m4l490n You can store pointers inside the vector

              A Offline
              A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on 16 May 2019, 04:56 last edited by
              #6

              @jsulm said in Error in Qt Creator 5.9 ; use of deleted function 'Blob::Blob(const Blob&)':

              @m4l490n You can store pointers inside the vector

              To slightly improve this answer:

              You can store pointers to the QObject derived class inside the vector

              Qt has to stay free or it will die.

              1 Reply Last reply
              2

              • Login

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