QT发送命令到已经运行的“ adb shell”

时间:2018-08-08 21:38:19

标签: qt shell adb

作为标题,我正在尝试编写一个程序以将命令发送给已执行的 Sub color_labels() Dim chartIterator As Integer, pointIterator As Integer, _seriesArray() As Variant For chartIterator = 1 To ActiveSheet.ChartObjects.Count seriesArray=ActiveWorkbook.Sheets("Sheet1").ChartObjects(chartIterator). _Chart.SeriesCollection(1).Values For pointIterator = 1 To UBound(seriesArray) If seriesArray(pointIterator) >= 0 Then ActiveWorkbook.Sheets("Sheet1").ChartObjects(chartIterator). _ Chart.SeriesCollection(1).Points(pointIterator).Interior.Color = _RGB(146, 208, 80) Else ActiveWorkbook.Sheets("Sheet1").ChartObjects(chartIterator). _Chart.SeriesCollection(1).Points(pointIterator).Interior.Color = _RGB(255, 0, 0) End If Next pointIterator Next chartIterator End Sub Sub ArrowColour() Dim ncars As Integer ncars = Range("A1").Value With ActiveSheet.Shapes.Range(Array("Down Arrow 1")).Fill If ncars > 0 Then .ForeColor.RGB = RGB(0, 176, 80) Else .ForeColor.RGB = RGB(255, 0, 0) End If End With End Sub Option Explicit Sub ApplyCustomLabels() Dim rLabels As Range Dim rCell As Range Dim oSeries As Series Dim Cnt As Integer Set rLabels = Range("C2:C" & Cells(Rows.Count, "C").End(xlUp).Row) Set oSeries = ActiveSheet.ChartObjects(1).Chart.SeriesCollection(1) oSeries.HasDataLabels = True Cnt = 1 For Each rCell In rLabels With oSeries.Points(Cnt).DataLabel.Text = rCell.Value.Font.Color =rCell.Font.Color End With Cnt = Cnt + 1 Next rCell End Sub

就像adb shell,所以我写了这段代码:

ls

问题是QProcess direct_shell; direct_shell.start("adb.exe shell"); direct_shell.waitForStarted(-1); QString output; direct_shell.write("ls\n"); direct_shell.waitForBytesWritten(-1); direct_shell.waitForStarted(-1); direct_shell.waitForReadyRead(-1); output = direct_shell.readAllStandardOutput(); output += direct_shell.readAllStandardError(); qDebut() << output 为空!

为什么?

0 个答案:

没有答案