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. Issues with Qt Ui Editor
Forum Updated to NodeBB v4.3 + New Features

Issues with Qt Ui Editor

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 266 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.
  • D Offline
    D Offline
    Derker
    wrote on last edited by Derker
    #1

    Have as graphical and logical issues with qt ui editor.

    • At first, when i start Qt and open ui editor, the table with elements not renderign properly. After expanding all in menu, it fixes,but after restarting Qt its happening again. table bug
    • Second and more critical bug, when i trying to connect QSlider with QLabel in ui editor, I get an error
      no matching function for call to 'QObject::connect(QSlider&, void (QAbstractSlider::)(int), QLabel&, <unresolved overloaded function type>)'
      There is the code that was generated by Qt
    QObject::connect(indexSlider, &QSlider::valueChanged, label_2, &QLabel::setNum);
    

    connecting QSlider with QLabel Error

    C 1 Reply Last reply
    0
    • D Derker

      Have as graphical and logical issues with qt ui editor.

      • At first, when i start Qt and open ui editor, the table with elements not renderign properly. After expanding all in menu, it fixes,but after restarting Qt its happening again. table bug
      • Second and more critical bug, when i trying to connect QSlider with QLabel in ui editor, I get an error
        no matching function for call to 'QObject::connect(QSlider&, void (QAbstractSlider::)(int), QLabel&, <unresolved overloaded function type>)'
        There is the code that was generated by Qt
      QObject::connect(indexSlider, &QSlider::valueChanged, label_2, &QLabel::setNum);
      

      connecting QSlider with QLabel Error

      C Offline
      C Offline
      ChrisW67
      wrote on last edited by ChrisW67
      #2

      @Derker There are two overloads of QLabel::setNum(). Both could accept an int argument.

      You need to tell Qt which to choose, something like this:

      connect(
        indexSlider, &QSlider::valueChanged,
        slider, QOverload<int>::of(&QLabel::setNum)
      );
      

      I cannot see a way to do that in Qt Designer (6.5.2) which clearly knows both slots exist, but only offers the setValue(int) variant once you select the valueChanged(int). The UI file results in uic producing the ambiguous code you posted.
      2a4e97a3-4943-41fe-824e-67c6e3b64e7b-image.png

      D 1 Reply Last reply
      1
      • C ChrisW67

        @Derker There are two overloads of QLabel::setNum(). Both could accept an int argument.

        You need to tell Qt which to choose, something like this:

        connect(
          indexSlider, &QSlider::valueChanged,
          slider, QOverload<int>::of(&QLabel::setNum)
        );
        

        I cannot see a way to do that in Qt Designer (6.5.2) which clearly knows both slots exist, but only offers the setValue(int) variant once you select the valueChanged(int). The UI file results in uic producing the ambiguous code you posted.
        2a4e97a3-4943-41fe-824e-67c6e3b64e7b-image.png

        D Offline
        D Offline
        Derker
        wrote on last edited by
        #3

        @ChrisW67 So, its better to connect elements by my self, instead of using ui editor? Because in qt 5.14 everything works fine, and i don’t get any of these bugs…

        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