Qt 6.11 is out! See what's new in the release
blog
How we can run Linux command from qt code?
-
@JonB Thanks for your appreciated help!
Your suggestion of QFile is working fine now.QFile f("/sys/bus/iio/devices/iio:device1/out_altvoltage1_TX_LO_frequency"); if (f.open(QIODevice::WriteOnly)) { qint64 count = f.write("2425000000"); Q_ASSERT(count > 0); f.close(); }The value 2425000000 is coming from a variable which can be change any time. I need to pass this value as a variable instead of constant 2425000000.
thanks@Wasee
You must convert your (integer) variable to a string.QIODevice::write()accepts either aconst char *or aconst QByteArray &for the string to write. You can use eitherQString::number()orQByteArray::number()to convert a number to a string/byte array to pass towrite(), as you please.