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. Mismatch between QtCreator and QtDesigner - implementing "connect"
Forum Updated to NodeBB v4.3 + New Features

Mismatch between QtCreator and QtDesigner - implementing "connect"

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 338 Views 2 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by aha_1980
    #1

    I have successfully implemented "connect" in QtDesigner - passing string from "list" to "plaintextEdit".

    I can implement similar "connect " in code - especially the last parameter with the help of intelisnese - all "legal".

       connect(ui->list,
                    &QListWidget::itemClicked ,
                ui->plainTextEdit,
               &QPlainTextEdit::addItem);
     
    

    But the compiler throws an error:

    /media/f/QT/Qt/QT/qtconnectivity/examples/bluetooth/CAT_BT_18112020/device.cpp:138: error: 'addItem' is not a member of 'QPlainTextEdit'
                &QPlainTextEdit::addItem);
                 ^
    

    connect(ui->list,
    &QListWidget::itemClicked ,
    ui->plainTextEdit,
    &QPlainTextEdit::addItem);

    What am I doing wrong ?

    Pl45m4P 1 Reply Last reply
    0
    • A Anonymous_Banned275

      I have successfully implemented "connect" in QtDesigner - passing string from "list" to "plaintextEdit".

      I can implement similar "connect " in code - especially the last parameter with the help of intelisnese - all "legal".

         connect(ui->list,
                      &QListWidget::itemClicked ,
                  ui->plainTextEdit,
                 &QPlainTextEdit::addItem);
       
      

      But the compiler throws an error:

      /media/f/QT/Qt/QT/qtconnectivity/examples/bluetooth/CAT_BT_18112020/device.cpp:138: error: 'addItem' is not a member of 'QPlainTextEdit'
                  &QPlainTextEdit::addItem);
                   ^
      

      connect(ui->list,
      &QListWidget::itemClicked ,
      ui->plainTextEdit,
      &QPlainTextEdit::addItem);

      What am I doing wrong ?

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @AnneRanch

      QPlainTextEdit does not handle items... So it does not have any addItem function or slot.

      It's
      setPlainText
      or
      appendPlainText


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      3
      • A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #3

        @Pl45m4 said in MIsmatch between QtCreator and QtDesigner - implementing "connect":

        QPlainTextEdit does not handle items... So it does not have any addItem function or slot.
        It's
        setPlainText
        or
        appendPlainText

        I made an error connecting two "lists", however when I connect list and plain text using append I get an error I am unable to decipher. It also looks as my signals are not in correct sequence.

        They should be in
        push button -> initialize and show dialog - that works fine.
        dialog activated -> fill "list" with lines of text - that is done by original "btscan" connect and it is in QtDesigner (singal / slots ) and XML and that works too

        when filling the list , each "new item" should generate a signal and copy the item to "plain text". That works only once, on first "new item" detected . This is my add implemented in QtDesigner. I am not sure why it does not work on all "new / chaged" items. That is a minor issue.

        What is need is to copy "new" items to "parent " dialog.
        Ideally using same slot which is filling the "child" dialog.
        I do no know how to modify / add to XML ( and really cannot since it is system created anyway.)

        I cannot do "cross object" conncet in QtDesigner and my attempts to do this in code failed ( posted elsewhere ).

        After the above long and boring story - here are a simple and stupid question:

        is it correct to implement "connect" in class constructor ?

        to keep signals / slots in proper sequence - how do I verify that QtDesigner connection signals are "passed" to other object?

        AKA how to debug / step thru QtDesigner XML code ?

        Pl45m4P 1 Reply Last reply
        0
        • A Anonymous_Banned275

          @Pl45m4 said in MIsmatch between QtCreator and QtDesigner - implementing "connect":

          QPlainTextEdit does not handle items... So it does not have any addItem function or slot.
          It's
          setPlainText
          or
          appendPlainText

          I made an error connecting two "lists", however when I connect list and plain text using append I get an error I am unable to decipher. It also looks as my signals are not in correct sequence.

          They should be in
          push button -> initialize and show dialog - that works fine.
          dialog activated -> fill "list" with lines of text - that is done by original "btscan" connect and it is in QtDesigner (singal / slots ) and XML and that works too

          when filling the list , each "new item" should generate a signal and copy the item to "plain text". That works only once, on first "new item" detected . This is my add implemented in QtDesigner. I am not sure why it does not work on all "new / chaged" items. That is a minor issue.

          What is need is to copy "new" items to "parent " dialog.
          Ideally using same slot which is filling the "child" dialog.
          I do no know how to modify / add to XML ( and really cannot since it is system created anyway.)

          I cannot do "cross object" conncet in QtDesigner and my attempts to do this in code failed ( posted elsewhere ).

          After the above long and boring story - here are a simple and stupid question:

          is it correct to implement "connect" in class constructor ?

          to keep signals / slots in proper sequence - how do I verify that QtDesigner connection signals are "passed" to other object?

          AKA how to debug / step thru QtDesigner XML code ?

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by Pl45m4
          #4

          @AnneRanch said in MIsmatch between QtCreator and QtDesigner - implementing "connect":

          is it correct to implement "connect" in class constructor ?

          Short and simple answer: It depends.

          In general: Yes, when the connection should be valid the whole life time of the object. Basically connections can be made everywhere (as long as they make sense).

          how to debug / step thru QtDesigner XML code ?

          You can't.
          It's XML and no C++ class.

          ui_CLASSNAME.h is the corresponding C++ header file to your CLASSNAME.ui. And since it's just a header, there is nothing really going on there. It only includes the widgets, you create in QtDesigner.

          I do no know how to modify / add to XML

          Just modify your QtDesigner file.


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          1 Reply Last reply
          2

          • Login

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