Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "mainwindow.h"
- #include "ui_mainwindow.h"
- #include <QProcess>
- #include <QtDebug>
- MainWindow::MainWindow(QWidget *parent) :
- QMainWindow(parent),
- ui(new Ui::MainWindow)
- {
- ui->setupUi(this);
- proc = new QProcess();
- proc->start("acpi -t");
- connect(proc, SIGNAL(readyReadStandardOutput()), this, SLOT(readIn()));
- }
- MainWindow::~MainWindow()
- {
- delete ui;
- }
- void MainWindow::readIn()
- {
- QByteArray data;
- data = proc->readAllStandardOutput();
- ui->textBrowser->setText(data);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement