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. Connect cannot convert arg 1 from 'UI:MainWindow *' to 'const QObject *'
Qt 6.11 is out! See what's new in the release blog

Connect cannot convert arg 1 from 'UI:MainWindow *' to 'const QObject *'

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 2.8k 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.
  • R Offline
    R Offline
    rocklionmba
    wrote on last edited by
    #1

    So in effort to fix my previous problem (link here), I wasn't able to figure out how to get the delegates working, so I instead made interior_paint inherit Mainwindow and changed the ui from private to protected. It's certainly not the prettiest thing, but it'll do until I learn some more. I simply put the connect in the constructor for interior_paint and it should work. However, I get this error:

    error: C2664: 'const': cannot convert argument 1 from 'Ui::MainWindow *' to 'const QObject *'

    and I don't know what's the cause of it. Can someone offer some advice?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Can you you show the code that triggers that error ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rocklionmba
        wrote on last edited by
        #3
         int_DB = new int_paint[size];
            connect(ui,
                    SIGNAL(MainWindow::send_to_int_paint(QString Usubstrate, QString UQuantity, QString UUOM,int UCoats)),
                    &int_DB,
                    SLOT(interior_paint::insert_to_database(QString Usubstrate, QString UQuantity, QString UUOM,int UCoats)));
        
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by SGaist
          #4

          Looks like you are missing an include statement somewhere and you are trying to connect to an array of int_paint ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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