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. Warning: "implicit copy constructor for 'QListSpecialMethods<QList<int>>' is deprecated"
Forum Updated to NodeBB v4.3 + New Features

Warning: "implicit copy constructor for 'QListSpecialMethods<QList<int>>' is deprecated"

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 343 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.
  • SeDiS Offline
    SeDiS Offline
    SeDi
    wrote on last edited by
    #1

    Hi,

    QVector<int> v;
    QVector<int> w;
    v = w;
    

    leads to the warning:
    Definition of implicit copy constructor for 'QListSpecialMethods<QList<int>>' is deprecated because it has a user-declared destructor

    Am I doing sth wrong?
    If not: how can I suppress the warning? I've tried

    #pragma clang diagnostic push
    #pragma clang diagnostic ignored "-Wdeprecated-copy-with-dtor"
    QVector<int> v;
    QVector<int> w;
    v = w;
    #pragma clang diagnostic pop
    

    But the warning stays.

    I am using Qt6.6.1 MinGW 64 bit on a Windows 10 Pro machine under Qt Creator 10.0.2.
    BR
    Sebastian

    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #2

      Hi, I have Qt 6.6.3 MinGW 81.0 64-bit on a Windows 10 Pro using Qt Creator 13.0.2.
      I started an empty Widgets project and added your 3 lines to the ctor in mainwindow.cpp:

      #include "mainwindow.h"
      #include "./ui_mainwindow.h"
      
      MainWindow::MainWindow(QWidget *parent)
          : QMainWindow(parent)
          , ui(new Ui::MainWindow)
      {
          ui->setupUi(this);
      
          QVector<int> v;
          QVector<int> w;
          v = w;
      }
      
      MainWindow::~MainWindow()
      {
          delete ui;
      }
      

      However it compiles fine, no errors.

      1 Reply Last reply
      1
      • SeDiS Offline
        SeDiS Offline
        SeDi
        wrote on last edited by
        #3

        Thanks! With upgrading to Qt 6.7.2 the warning vanished.

        1 Reply Last reply
        0
        • SeDiS SeDi has marked this topic as solved on

        • Login

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