Example #1
0
def open_file_browser():
    ""

    path = QtGui.QFileDialog.getOpenFileName(None,QString.fromLocal8Bit("Select config file:"),"*.ini")
    # if path:
    #     self.database = path # To make possible cancel the FileDialog and continue loading a predefined db
    # self.openDBFile()

    return path
Example #2
0
 def read_output(self, error=False):
     if error:
         self.process.setReadChannel(QProcess.StandardError)
     else:
         self.process.setReadChannel(QProcess.StandardOutput)
     bytes = QByteArray()
     while self.process.bytesAvailable():
         if error:
             bytes += self.process.readAllStandardError()
         else:
             bytes += self.process.readAllStandardOutput()
     text = unicode( QString.fromLocal8Bit(bytes.data()) )
     if error:
         self.error_output += text
     else:
         self.output += text
Example #3
0
 def read_output(self, error=False):
     if error:
         self.process.setReadChannel(QProcess.StandardError)
     else:
         self.process.setReadChannel(QProcess.StandardOutput)
     bytes = QByteArray()
     while self.process.bytesAvailable():
         if error:
             bytes += self.process.readAllStandardError()
         else:
             bytes += self.process.readAllStandardOutput()
     text = unicode(QString.fromLocal8Bit(bytes.data()))
     if error:
         self.error_output += text
     else:
         self.output += text
Example #4
0
    def readErrorR(self):

        res = QString.fromLocal8Bit(self.proc.readAllStandardError())
        self.textBrowser.append(res)
Example #5
0
 def readR(self):
     
     res = QString.fromLocal8Bit(self.proc.readAllStandardOutput())
     #self.textBrowser.clear()
     self.textBrowser.append(res)
Example #6
0
 def read(self):
     res = QString.fromLocal8Bit(self.pro.readAllStandardOutput())
     self.textBrowser.append(res)#添加到text框
Example #7
0
 def transcode(self, bytes):
     return unicode( QString.fromLocal8Bit(bytes.data()) )