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. C2664 'QMetaObject::Connection'
Forum Updated to NodeBB v4.3 + New Features

C2664 'QMetaObject::Connection'

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

    I have:

    QObject::connect(mpSpinMax, &QSpinBox::valueChanged,
        [this](int intValue) {
        int intMinValue(mpSpinMin->value());
        if ( intValue < intMinValue) {
    //Prevent value from going less than minimum
        mpSpinMax->setValue(intMinValue);
      }
    });
    QObject::connect(mpSpinMin, &QSpinBox::valueChanged,
        [this](int intValue) {
        int intMaxValue(mpSpinMax->value());
        if ( intValue > intMaxValue) {
    //Prevent value from going over maximum
        mpSpinMin->setValue(intMaxValue);
      }
    });
    

    When I compile I get:

    C2664: 'QMetaObject::Connection QObject::connect(const QObject*,const char*, const char*,Qt::ConnectionType) const': cannot convert argument 2 from 'overloaded-function' to 'const char*'
    

    This happens for each instance. Also tried:

    QObject::connect(mpSpinMax, SIGNAL(valueChanged(int)),
        [this](int intValue) {
        int intMinValue(mpSpinMin->value());
        if ( intValue < intMinValue) {
    //Prevent value from going less than minimum
        mpSpinMax->setValue(intMinValue);
      }
    });
    QObject::connect(mpSpinMin, SIGNAL(valueChanged(int)),
        [this](int intValue) {
        int intMaxValue(mpSpinMax->value());
        if ( intValue > intMaxValue) {
    //Prevent value from going over maximum
        mpSpinMin->setValue(intMaxValue);
      }
    });
    

    Same result.

    Kind Regards,
    Sy

    SPlattenS 1 Reply Last reply
    0
    • SPlattenS SPlatten

      I have:

      QObject::connect(mpSpinMax, &QSpinBox::valueChanged,
          [this](int intValue) {
          int intMinValue(mpSpinMin->value());
          if ( intValue < intMinValue) {
      //Prevent value from going less than minimum
          mpSpinMax->setValue(intMinValue);
        }
      });
      QObject::connect(mpSpinMin, &QSpinBox::valueChanged,
          [this](int intValue) {
          int intMaxValue(mpSpinMax->value());
          if ( intValue > intMaxValue) {
      //Prevent value from going over maximum
          mpSpinMin->setValue(intMaxValue);
        }
      });
      

      When I compile I get:

      C2664: 'QMetaObject::Connection QObject::connect(const QObject*,const char*, const char*,Qt::ConnectionType) const': cannot convert argument 2 from 'overloaded-function' to 'const char*'
      

      This happens for each instance. Also tried:

      QObject::connect(mpSpinMax, SIGNAL(valueChanged(int)),
          [this](int intValue) {
          int intMinValue(mpSpinMin->value());
          if ( intValue < intMinValue) {
      //Prevent value from going less than minimum
          mpSpinMax->setValue(intMinValue);
        }
      });
      QObject::connect(mpSpinMin, SIGNAL(valueChanged(int)),
          [this](int intValue) {
          int intMaxValue(mpSpinMax->value());
          if ( intValue > intMaxValue) {
      //Prevent value from going over maximum
          mpSpinMin->setValue(intMaxValue);
        }
      });
      

      Same result.

      SPlattenS Offline
      SPlattenS Offline
      SPlatten
      wrote on last edited by
      #2

      @SPlatten , fixed, changed parameter 2 to:

      QOverload<int>::of(&QSpinBox::valueChanged)
      

      Kind Regards,
      Sy

      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