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 use qcomboBox current Text with in Qprocess Function
Forum Updated to NodeBB v4.3 + New Features

How to use qcomboBox current Text with in Qprocess Function

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 185 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.
  • Ramkumar MohanR Offline
    Ramkumar MohanR Offline
    Ramkumar Mohan
    wrote on last edited by
    #1

    Hi,
    How to use qcomboBox current Text with in Qprocess Function .

    I have already set specific time zone (Asia / Kolkata),

    QProcess Dateprocess (this);
    Dateprocess.start("sh",QStringList()<<"-c"<<"sudo timedatectl set-timezone Asia / Kolkata");
    if (!Dateprocess.waitForStarted())
    {
    qDebug() << "Error : " << Dateprocess.errorString();
    }
    Dateprocess.waitForFinished(-1);
    int systemHwClockStatus = system("sudo hwclock -w");

    and,

    time.PNG

    I made the timezone list but , i want to set system Time and Date Using TimeZone.
    How to use the current text of the combo Box given above.I don't know how to do it.

    pro.PNG

    QProcess Dateprocess (this);
    Dateprocess.start("sh",QStringList()<<"-c"<<"sudo timedatectl set-timezone ");
    if (!Dateprocess.waitForStarted())
    {
    qDebug() << "Error : " << Dateprocess.errorString();
    }
    Dateprocess.waitForFinished(-1);
    int systemHwClockStatus = system("sudo hwclock -w");

    Thank you,

    JonBJ 1 Reply Last reply
    0
    • Ramkumar MohanR Ramkumar Mohan

      Hi,
      How to use qcomboBox current Text with in Qprocess Function .

      I have already set specific time zone (Asia / Kolkata),

      QProcess Dateprocess (this);
      Dateprocess.start("sh",QStringList()<<"-c"<<"sudo timedatectl set-timezone Asia / Kolkata");
      if (!Dateprocess.waitForStarted())
      {
      qDebug() << "Error : " << Dateprocess.errorString();
      }
      Dateprocess.waitForFinished(-1);
      int systemHwClockStatus = system("sudo hwclock -w");

      and,

      time.PNG

      I made the timezone list but , i want to set system Time and Date Using TimeZone.
      How to use the current text of the combo Box given above.I don't know how to do it.

      pro.PNG

      QProcess Dateprocess (this);
      Dateprocess.start("sh",QStringList()<<"-c"<<"sudo timedatectl set-timezone ");
      if (!Dateprocess.waitForStarted())
      {
      qDebug() << "Error : " << Dateprocess.errorString();
      }
      Dateprocess.waitForFinished(-1);
      int systemHwClockStatus = system("sudo hwclock -w");

      Thank you,

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Ramkumar-Mohan
      Don't know what you mean. Running a QProcess has nothing to do with a QComboBox. As you know, you get the current text of a QComboBox via currentText(). If you are saying you want to use that it in a command-line to pass to QProcess then do so.

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved