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. Modbusmaster

Modbusmaster

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 484 Views
  • 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.
  • Z Offline
    Z Offline
    Zac.Boussaid
    wrote on last edited by
    #1

    Hey guys,
    i'm trying to understand the example of Qt Modbus Master. Everything was comprehensible until the point QTreeview. In design mode the checkboxes are not shown but when I run the Code, the system will probably generate the chexboxes itself. Is it true? if yes i would like to know where in the code are the inputs of these checkboxes stored because I would like to use the inputs of these checkboxes later.Qt community.png Qt community_1.png

    jsulmJ 1 Reply Last reply
    0
    • Z Zac.Boussaid

      Hey guys,
      i'm trying to understand the example of Qt Modbus Master. Everything was comprehensible until the point QTreeview. In design mode the checkboxes are not shown but when I run the Code, the system will probably generate the chexboxes itself. Is it true? if yes i would like to know where in the code are the inputs of these checkboxes stored because I would like to use the inputs of these checkboxes later.Qt community.png Qt community_1.png

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Zac-Boussaid Its done in the model, see writeregistermodel.cpp

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • Z Offline
        Z Offline
        Zac.Boussaid
        wrote on last edited by
        #3

        First of all thank you for your answer.I saw the Data "writeregistermodel.cpp" but i wasn't able to understand in which variable are the Inputs of the Checkboxes stored.

        jsulmJ 1 Reply Last reply
        0
        • Z Zac.Boussaid

          First of all thank you for your answer.I saw the Data "writeregistermodel.cpp" but i wasn't able to understand in which variable are the Inputs of the Checkboxes stored.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Zac-Boussaid The data is stored in m_coils member variable.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          2
          • Z Offline
            Z Offline
            Zac.Boussaid
            wrote on last edited by Zac.Boussaid
            #5

            I’m using the Modbusclient example. The writeregistermodel.cpp uses a function that i cannot call in the Window.cpp.
            For example i want to use the two variables index and s in the Function setData which exists in writeregistermodel.cpp and i want to check their state in the mainwindow.
            the main idea is: let's suppose i have a lamp that i want to turn it on using a switcher. i will send a request to check the state of the switch. IF the switcher is on i would like to automatically turn my lamp on. In this case i would like to be able to automatically send a write request. Could some one give an idea how can i achieve this task.
            Thank you in Advance
            code setData.png

            jsulmJ 1 Reply Last reply
            0
            • Z Zac.Boussaid

              I’m using the Modbusclient example. The writeregistermodel.cpp uses a function that i cannot call in the Window.cpp.
              For example i want to use the two variables index and s in the Function setData which exists in writeregistermodel.cpp and i want to check their state in the mainwindow.
              the main idea is: let's suppose i have a lamp that i want to turn it on using a switcher. i will send a request to check the state of the switch. IF the switcher is on i would like to automatically turn my lamp on. In this case i would like to be able to automatically send a write request. Could some one give an idea how can i achieve this task.
              Thank you in Advance
              code setData.png

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Zac-Boussaid said in Modbusmaster:

              Could some give an idea how can i achieve this task.

              https://doc.qt.io/qt-5/signalsandslots.html

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                Zac.Boussaid
                wrote on last edited by Zac.Boussaid
                #7

                thank you for your help
                the problem is solved

                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