Hi Everyone.........
Plz can you send me small code just it has to send some command to CLI. I'm working in ARM i.MX31 ARM board. I need to interact CLI by using Qt 4.5.2. So i need just a simple code to execute on CLI (command Line Interface). For example i need to see all list of folders or dir on Root file system(rfs). Plz can you check it out, give solution how to do it. If i click on button it has to display list of folders and dir on CLI first.
Im writing my complete code of my project here and im attaching .ui file as in zip format. Plz check it out, assit me to pass commands for CLI. plz quote an small example also.overall if i click on button on GUI. it has to send command "ls -l" to CLI, Atleast i need to list of folders and directories on CLI after cancelling GUI, later on i can work it out to bring uo data on CLI to textedit box.. Thanking you in advance see all my attached and written code below.
Asking directly my AIM is to just click on button, if i cancel GUI. atleast i want see "ls -l" cmd on terminal and it should have list all the folders and directories.
QPROCESS.PRO
================================================== ============================================
#-------------------------------------------------
#
# Project created by QtCreator 2009-12-10T15:21:05
#
#-------------------------------------------------
TARGET = Qprocess
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
================================================== ================================================== ==========
main.cpp
================================================== ================================================== ==========
#include <QtGui/QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
================================================== ================================================== ===========
mainwindow.cpp
================================================== ================================================== ===========
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow)
{
ui->setupUi(this);
pushbutton =new QPushButton;
pushbutton=ui->pushButton;
connect(pushbutton,SIGNAL(clicked()),this,SLOT(but tonclicked()));
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::buttonclicked()
{
pushbutton->setText("VINAY");
proc=new QProcess(this);
proc->start("VKB -qws");//Actually i want to give commands like ls -l or cd .. which should be passed to CLI and act on that. but im not finding options in proc-> . Plz can you send me a small code to interact with CLI.
}
================================================== ================================================== ===========
mainwindow.h
================================================== ================================================== ===========
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtGui/QMainWindow>
#include <QProcess>
#include <QPushButton>
#include <QTextEdit>
class QProcess;
namespace Ui
{
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
private:
QProcess *proc;
QPushButton *pushbutton;
private slots:
void buttonclicked();
};
#endif // MAINWINDOW_H
================================================== ===================================
Bookmarks