Re: [PyQt] binary file viewer with textEdit (PyQt) [correction]

2010-06-24 Thread sandokan
Mark Summerfield-4 wrote: > > [snip] > > Actually I meant: > > file = QFile(self.filename) > if file.open(QIODevice::ReadOnly): > ba = file.readAll() # ba is a QByteArray filled with raw bytes > hexbytes = [] > for i in range(ba.count()): > if QChar(" ") <

Re: [PyQt] binary file viewer with textEdit (PyQt)

2010-06-24 Thread sandokan
Mark Summerfield-4 wrote: > > > One thing that slows QTextEdit down is its sophisticated layout engine. > If you can live without that and use a QPlainTextEdit you should get > some speedup straightaway. > > Wow, this works perfectly fine. However, I still have a problem with binary file rep

[PyQt] binary file viewer with textEdit (PyQt)

2010-06-22 Thread sandokan
Hi, hope you can help me. I am trying to view whole contents of binary file (PE file) in Qt TextEdit widget but still running into some problems (speed is the main problem). I have tried these two ways: 1) converting data using "codecs" s = codecs.open(self.filename,'rb','mbcs').read() self.ui.tex