Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QMl display hexadecimal
Forum Updated to NodeBB v4.3 + New Features

QMl display hexadecimal

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 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.
  • S Offline
    S Offline
    satyanarayana143
    wrote on last edited by
    #1

    Hi friends,

    I am sending int value from c++ to Qml i want to display in hex in QMl how can i do and want pass Whole structure from c++ to Qml any possible solution.

    J.HilkJ 1 Reply Last reply
    0
    • S satyanarayana143

      Hi friends,

      I am sending int value from c++ to Qml i want to display in hex in QMl how can i do and want pass Whole structure from c++ to Qml any possible solution.

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @satyanarayana143 said in QMl display hexadecimal:

      I am sending int value from c++ to Qml i want to display in hex in QMl how can i do

      hexString = yourNumber.toString(16);
      

      and want pass Whole structure from c++ to Qml any possible solution.

      possible, more information is required


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      1
      • S Offline
        S Offline
        satyanarayana143
        wrote on last edited by
        #3

        how to pass structure filled with data fromm c++ and display in QML

        B 1 Reply Last reply
        0
        • S satyanarayana143

          how to pass structure filled with data fromm c++ and display in QML

          B Offline
          B Offline
          Bob64
          wrote on last edited by
          #4

          @satyanarayana143 can you share some code? What is the structure that you mention? What exactly do you want to do with the data on the QML side?

          S 1 Reply Last reply
          0
          • S Offline
            S Offline
            satyanarayana143
            wrote on last edited by
            #5

            In Main.cpp
            qmlRegisterType<PowerQualityMain>("PowerQualityMain",1,0,"PowerQualityMain");

            In PowerQualityMain .h

            typedef struct
            {
            /* Power Quality Statistics */
            uint32_t avrms;
            uint32_t bvrms;
            uint32_t cvrms;
            uint32_t avrmsone;
            uint32_t bvrmsone;
            uint32_t cvrmsone;
            }RegDataBuffer;

            RegDataBuffer m_pRegDataBuffer;
            Updatedat8ksps m_pUpdatedat8ksps;

            In PowerQualityMain .cpp filled data to structure

            m_pRegDataBuffer.birms = m_pUpdatedat8ksps.birms;
            m_pRegDataBuffer.cirms = m_pUpdatedat8ksps.cirms;
            m_pRegDataBuffer.avrms = m_pUpdatedat8ksps.avrms;
            m_pRegDataBuffer.bvrms = m_pUpdatedat8ksps.bvrms;
            m_pRegDataBuffer.cvrms = m_pUpdatedat8ksps.cvrms;

            In Qml i tried to display like this not Working
            PowerQualityMain
            {
            id:m_pPowerQualityMain
            console.log("m_pRegDataBuffer.cvrms",(m_pPowerQualityMain.m_pRegDataBuffer.cvrms)
            }

            how to display in Qml

            1 Reply Last reply
            0
            • B Bob64

              @satyanarayana143 can you share some code? What is the structure that you mention? What exactly do you want to do with the data on the QML side?

              S Offline
              S Offline
              satyanarayana143
              wrote on last edited by
              #6

              satyanarayana143 18 minutes ago
              In Main.cpp
              qmlRegisterType<PowerQualityMain>("PowerQualityMain",1,0,"PowerQualityMain");

              In PowerQualityMain .h

              typedef struct
              {
              /* Power Quality Statistics */
              uint32_t avrms;
              uint32_t bvrms;
              uint32_t cvrms;
              uint32_t avrmsone;
              uint32_t bvrmsone;
              uint32_t cvrmsone;
              }RegDataBuffer;

              RegDataBuffer m_pRegDataBuffer;
              Updatedat8ksps m_pUpdatedat8ksps;

              In PowerQualityMain .cpp filled data to structure

              m_pRegDataBuffer.birms = m_pUpdatedat8ksps.birms;
              m_pRegDataBuffer.cirms = m_pUpdatedat8ksps.cirms;
              m_pRegDataBuffer.avrms = m_pUpdatedat8ksps.avrms;
              m_pRegDataBuffer.bvrms = m_pUpdatedat8ksps.bvrms;
              m_pRegDataBuffer.cvrms = m_pUpdatedat8ksps.cvrms;

              In Qml i tried to display like this not Working
              PowerQualityMain
              {
              id:m_pPowerQualityMain
              console.log("m_pRegDataBuffer.cvrms",(m_pPowerQualityMain.m_pRegDataBuffer.cvrms)
              }

              how to display in Qml

              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