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. How to execute .hex file on the other device using QT Application
Forum Update on Monday, May 27th 2025

How to execute .hex file on the other device using QT Application

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
9 Posts 4 Posters 733 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.
  • K Offline
    K Offline
    kabdul
    wrote on 4 Jun 2020, 15:06 last edited by
    #1

    Hi,

    I am new to QT. I have created a sample application for selecting the .hex file through FileDialog and I need to execute the selected .hex file on my device. For that I have used the QProcess::startDetached but the file is not executed. Can you please let me know how to execute this file on my android device. Below is the Code which I have tried.

    QFileDialog dialog(this);
    dialog.setFileMode(QFileDialog::AnyFile);
    dialog.setNameFilter(tr("Hex Files (*.hex)"));
    dialog.setViewMode(QFileDialog::Detail);
    QStringList fileNames;
    if (dialog.exec())
    {
    fileNames = dialog.selectedFiles();

        //QString program("cmd /k cd " + fileNames[0]);
        //bool chk=QProcess::startDetached(program);
    
        QProcess::startDetached(fileNames[0]);
        if(chk==true)
        {
        QMessageBox::information(this,"Information","File is Executed");
        }
        else
        {
            QMessageBox::information(this,"Information","File is Not Executed");
        }
    }
    
    J 1 Reply Last reply 4 Jun 2020, 15:48
    0
    • K kabdul
      4 Jun 2020, 15:06

      Hi,

      I am new to QT. I have created a sample application for selecting the .hex file through FileDialog and I need to execute the selected .hex file on my device. For that I have used the QProcess::startDetached but the file is not executed. Can you please let me know how to execute this file on my android device. Below is the Code which I have tried.

      QFileDialog dialog(this);
      dialog.setFileMode(QFileDialog::AnyFile);
      dialog.setNameFilter(tr("Hex Files (*.hex)"));
      dialog.setViewMode(QFileDialog::Detail);
      QStringList fileNames;
      if (dialog.exec())
      {
      fileNames = dialog.selectedFiles();

          //QString program("cmd /k cd " + fileNames[0]);
          //bool chk=QProcess::startDetached(program);
      
          QProcess::startDetached(fileNames[0]);
          if(chk==true)
          {
          QMessageBox::information(this,"Information","File is Executed");
          }
          else
          {
              QMessageBox::information(this,"Information","File is Not Executed");
          }
      }
      
      J Offline
      J Offline
      JonB
      wrote on 4 Jun 2020, 15:48 last edited by
      #2

      @kabdul

      How to execute .hex file on the other device using QT Application

      In what way is a file ending in .hex executable under Android?

      What do you mean about "executing something on the other device"? What two devices are involved, and where are you trying to execute what "on the other device"?

      K 2 Replies Last reply 4 Jun 2020, 15:53
      1
      • J JonB
        4 Jun 2020, 15:48

        @kabdul

        How to execute .hex file on the other device using QT Application

        In what way is a file ending in .hex executable under Android?

        What do you mean about "executing something on the other device"? What two devices are involved, and where are you trying to execute what "on the other device"?

        K Offline
        K Offline
        kabdul
        wrote on 4 Jun 2020, 15:53 last edited by
        #3

        @JonB said in How to execute .hex file on the other device using QT Application:

        ething on the other dev

        Hi,

        Yes I need to execute it in the android device its an embedded device which is running android 8.1.

        Thanks in Advance

        1 Reply Last reply
        0
        • J JonB
          4 Jun 2020, 15:48

          @kabdul

          How to execute .hex file on the other device using QT Application

          In what way is a file ending in .hex executable under Android?

          What do you mean about "executing something on the other device"? What two devices are involved, and where are you trying to execute what "on the other device"?

          K Offline
          K Offline
          kabdul
          wrote on 4 Jun 2020, 15:54 last edited by
          #4

          @JonB I am creating it as a apk file and I am running the application in that device.

          J 1 Reply Last reply 5 Jun 2020, 05:28
          0
          • K kabdul
            4 Jun 2020, 15:54

            @JonB I am creating it as a apk file and I am running the application in that device.

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 5 Jun 2020, 05:28 last edited by
            #5

            @kabdul And what is this .hex?

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

            K 1 Reply Last reply 5 Jun 2020, 09:42
            0
            • J jsulm
              5 Jun 2020, 05:28

              @kabdul And what is this .hex?

              K Offline
              K Offline
              kabdul
              wrote on 5 Jun 2020, 09:42 last edited by
              #6

              @jsulm I don't know about that we are just testing the application how it works. I got a task like I need to execute the hex file on the android device.

              J 1 Reply Last reply 5 Jun 2020, 09:55
              0
              • K kabdul
                5 Jun 2020, 09:42

                @jsulm I don't know about that we are just testing the application how it works. I got a task like I need to execute the hex file on the android device.

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 5 Jun 2020, 09:55 last edited by
                #7

                @kabdul If you don't know what this hex file is and whether it is a valid Android executable, why don't you create a small console app for android and try to start that one?

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

                K 1 Reply Last reply 5 Jun 2020, 14:32
                0
                • J jsulm
                  5 Jun 2020, 09:55

                  @kabdul If you don't know what this hex file is and whether it is a valid Android executable, why don't you create a small console app for android and try to start that one?

                  K Offline
                  K Offline
                  kabdul
                  wrote on 5 Jun 2020, 14:32 last edited by
                  #8

                  @jsulm said in How to execute .hex file on the other device using QT Application:

                  @kabdul If you don't know what this hex file is and whether it is a valid Android executable, why don't you create a small console app for android and try to start that one?

                  How to do that one? can you please give me any sample code.

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    Jadi Nabil
                    wrote on 18 Jun 2020, 16:57 last edited by
                    #9

                    i have the same problem

                    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