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 with connect, singal
Forum Updated to NodeBB v4.3 + New Features

Error with connect, singal

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 1.7k 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.
  • M Offline
    M Offline
    matx132
    wrote on last edited by
    #1

    Welcome,
    i create that connect:

    @connect(u,
    SIGNAL(requestGreen(const QString,const QString)),
    this,
    SLOT(createGreen(const QString, const QString)));@

    in class utilis
    function green

    @void utilis::green(const QString name,const QString p){
    emit requestGreen(name,p);
    }@

    file utilis.h
    @signals:
    void requestGreen(const QString, const QString);@

    main

    @public slots:
    void createGreen(const QString,const QString);@

    When i call function green in class utilis, program exit, when i run wiht debuger program stop in moc file

    @void utilis::requestGreen(const QString _t1, const QString _t2)
    {
    void _a[] = { 0, const_cast<void>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
    QMetaObject::activate(this, &staticMetaObject, 0, _a);
    }@

    on:
    @QMetaObject::activate(this, &staticMetaObject, 0, _a);@

    and now i don't now where is error in my code, somebody help me?

    1 Reply Last reply
    0
    • X Offline
      X Offline
      Xander84
      wrote on last edited by
      #2

      Hi, I don't see any problem in your code, but your can try using references for the QString parameters. that is more usual and might fix your problem, but it should still work without references, maybe worth a try
      @
      const QString&
      // instead of just
      const QString
      @
      also you should add parameter names for signals and slots, again it should work without them but it's better to specify names anyways, in case you use Qt Quick or something it will be hard without any to reference the variables from the script language. :)

      1 Reply Last reply
      0
      • M Offline
        M Offline
        matx132
        wrote on last edited by
        #3

        when i change in connect vars (add reference), and in signal and slot, nothing change, error this same:

        &"warning: GDB: Failed to set controlling terminal: incorrect ioctl for device"
        Could not load shared library symbols for linux-gate.so.1.
        Do you need "set solib-search-path" or "set sysroot"?

        i use qt creator 3.1.8 and qt widget project.
        my system is linux (Debian 7 32bit)

        1 Reply Last reply
        0
        • X Offline
          X Offline
          Xander84
          wrote on last edited by
          #4

          I don't know but those warning seems not to be related to the signal and slot, maybe there are some other errors in your project somewhere and it only crashes in the at that position!? Hard to say you only posted the signal and slot that there is no error.
          There could also be an error in your build system :/

          1 Reply Last reply
          0
          • M Offline
            M Offline
            matx132
            wrote on last edited by
            #5

            without using connect all is ok, i try use in signal empty function and nothing

            i try in new project use only connect to veryfi is problem with connect or not

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

              Hi,

              Can you show the headers of the concerned classes ?

              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
              • M Offline
                M Offline
                matx132
                wrote on last edited by
                #7

                Thanks all for help,
                i found error, problem with connect, when i move to other class all is ok and work great :), (i used connect other class and next connect to update ui)

                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