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. How to get Hardware Info in the Linux using Qt?
Forum Updated to NodeBB v4.3 + New Features

How to get Hardware Info in the Linux using Qt?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 4.2k 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.
  • G Offline
    G Offline
    Gops
    wrote on last edited by
    #1

    Dear All,
    I have developed one application in the Qt Creator. I have one requirment for get hardward information in the Linux system, Then i try dmidecode using and run in Qt.It will occur error message for "dev/mem" permission denied". So i try to terminal to run sudo ./application. it will ask password after enter the password the application running and get hardwareinfo also. So how to do in Qt. Please help me it urgent.

    how to get Hardware without sudo permission in the Linux using Qt?

    Thanks

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jim_kaiser
      wrote on last edited by
      #2

      I would think you should be able to use QProcess to do it. You can access the input and output channels of the process. Start dmidecode with a QProcess. Check the program output for whether it asks the password, and then ask the same from the user in a dialog in Qt.. then send that password back on the input channel.

      From Documentation of QProcess:

      bq. QProcess allows you to treat a process as a sequential I/O device. You can write to and read from the process just as you would access a network connection using QTcpSocket. You can then write to the process's standard input by calling write(), and read the standard output by calling read(), readLine(), and getChar().

      1 Reply Last reply
      0
      • G Offline
        G Offline
        Gops
        wrote on last edited by
        #3

        Thanks i will to update..

        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