> I'm trying to understand how does save state works using QT...
> ... I only found C++ examples which I cant read,
Being able to mentally translate the C++ code in
the Qt doc into Python is a very useful skill!
It really isn't too hard. Turn :: into dot and add
"self." everywhere.
The first thin
# python 2.7
from future import unicode_literals
uu = u'\u2019' # no problem here but...
qcCurlyApostrophe = QChar(uu)
Traceback (most recent call last):
File "", line 1, in
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in
position 0: ordinal not in range(128)
qcCurlyApost
In a Linux system my PyQt4 app fails because it relies on a feature that
dates to Qt 4.7. This Linux system has 4.6 installed. Also the PyQt4 was at
4.6.x. So I did the following:
Downloaded the Linux source of SIP, configure, make, make-install
Downloaded the Linux source of PyQt4, configure, m
The original request was,
> I can write some small and urgly GUI using PyQt,
> but I want to write some bigger and beautiful
> So, is there some good PyQt source code for learning?
I think Genban Tade was looking for design help, not code help. Making the
UI after you design it on paper, is a me
How about defining some "extra" rows and columns?
Then, in your data() method, if the column (or row) index is beyond the
"real" data, you return a string of blanks for the display role, and a 50%
gray brush for the Background role.
___
PyQt mailing lis
I had the problem that this sequence crashed Python:
from PyQt4.QtCore import (Qt, QString, QTextStream)
> ts = QTextStream(QString())
> ts << u'x'
> > Segmentation fault
>
Phil properly reminded me that,
> You need to keep a reference to the QString.
>
And I thought, oh crap,
I was experimenting to see if I could make an in-memory QTextStream and
discovered instead an easy way to make Python 2.7.3 segfault:
[08:23] python
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" o
> From: Christopher Evans
>
> anyone know a way to select multiple cells and edit them, a la excel and
> other packages? Do i need to write custom code, or is this supported?
>
You need to set the Selection Mode. In the Qt Assistant page for
QTableWidget, click "List of all members, including in
>
> Which is why you wouldn't do it, even in C++. You would use QTextDocument,
> QSyntaxHighlighter etc.
>
Sorry, that was a stupid example, as a I realized
not long after hitting "send." My fault.
___
PyQt mailing listPyQt@riverbankcomputing.com
htt
Thanks to you and Mathias for the prompt replies.
> docstring = unicode( myEditor.toPlainText() )
> In PyQt5 toPlainText() will return a str object for Python3 and a unicode
> object for Python2.
>
And, as Mathias says, it is a copy?...
That is not IMO a good design choice. At least if toPla
For an app to be built with PyQt5/Qt5, I will have a
QPlainTextEdit in which the document may be quite
sizable, 500K characters or more.
I will want at times to inspect the document character
by character, or possibly apply Python relib REs to it.
I am somewhat at sea regarding the relationship b
>
> From: Phil Thompson
> > * How to handle co-installing qt4 & qt5 variants of pyqt?
> > Given that currently pyqt4 uses PyQt4 name-space regardless if it's
> > compiled against qt4 or qt5.
>
> A good question that doesn't have a good answer.
>
> The Qt4 and Qt5 variants of PyQt4 are incompatible
The following is the top bit of an apple crash report.
Latest mac binary PyQt4, plus Qt 4.8.4. Only happens in the
version bundled by pyinstaller - never running from source
in the IDE.
The crash follows cmd-q quit after a normal work session.
The main window closeEvent does a number of settings w
>> Everything seems to work correctly except this small thing: it used to
>> be that I could get version strings from Qt.PYQT_VERSION_STR and
>> Qt.qVersion() but now those attributes of Qt are undefined.
>>
>> Does this indicate that I've done something wrong in the installation?
> Works fine for
I had been running fine (Mac OS 10.6, PyQt 4.6 and Qt 4.6 I think).
Today, in order to hopefully fix a QWebKit problem, I installed Qt
4.8.4 for Mac OS,
followed immediately by installing the latest stable SIP and PyQt4 from source.
(From source because I'm still on the mac default python 2.6 and t
The doc for QThread.terminate() says its use "is discouraged".
I have a thread that calls urllib2 to read an http page. I am having a
problem where this thread gets hung somewhere in the urllib2 -- remains to
be determined whether in urllib2.urlopen() or in a read() on the resulting
object.
Anywa
Sorry, googling some of the messages shows they come from the OSX Core
Graphics. So it's an issue between Qt and OSX. Sorry for the noise.
On Thu, Dec 20, 2012 at 4:00 AM, wrote:
> CGErrorBreakpoint
___
PyQt mailing listPyQt@riverbankcomputing.com
h
Hello, I'm working on a little browser app using a QWebView. Today it
went into a loop throwing hundreds of messages like the following.
Revisiting the same URL did not reproduce it.
Do these look familiar to anyone? What component might be in trouble here?
The first messages were:
Wed Dec 19 08
On Mon, Dec 10, 2012 at 4:00 AM, wrote:
> is there any other method I can follow to shorten the
> tortuous list of repetitive commands for initializing multiple widgets?
If you don't mind referring to the objects by index number rather
than individual names, you can do this:
self.myListOfE
qv.toPyObject() gives the same as qv.toMap, a python dict in which the
keys have been changed to QStrings (these keys were all python strings
originally, don't know what it would do with numeric keys) and the
values to QVariants.
This is ok in the sense that no data is lost, but adds some code in
OK, I implement QListView.itemData() returning a python dict,
which then arrives at QListView.setItemData() as a QVariant
of length 1. The problem is, how to cast that qv back to a dict?
I have read
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qvariant.html
and noted especially the
This type of question is better addressed to the Qt fora,
see qt-project.org/forums. That said...
You definitely can monitor all keystrokes using keyPressEvent.
You will likely find other reasons for doing so besides shift-enter,
for example you might trap ^f to implement find.
A whole lot of stu
On Fri, Nov 16, 2012 at 2:20 PM, Phil Thompson
wrote:
> On Fri, 16 Nov 2012 10:34:12 -0800, David Cortesi
> wrote:
>> Working on implementing a List model using QAbstractListModel and
>> would like to implement (set)itemData which returns a QMap.
> Have you tried...
>
Working on implementing a List model using QAbstractListModel and
would like to implement (set)itemData which returns a QMap.
QMap seems to be Qt's version of a dict, a list of key:value pairs.
(QHash is apparently similar.) The point of itemData/setItemData is to
return or set the data for every
In the Digia docs (http://doc.qt.digia.com/qt/qimage.html) QImage is
said to have both a .bits() method and a .constBits() one, the latter
differing in that it does not perform a "deep" copy of the image data.
This might be useful if one wants to sample or process the contents of
large images.
Sim
>> When I try assignment,
>> vptr[1] = 0x00
>> I get the message,
>> TypeError: 'int' does not have the buffer interface
> I can't reproduce this - can you send a short, complete test that
> demonstrates the problem.
Here you go: Ubuntu 12.10, PyQt4 4.9.3-4
$ python
Python 2.7.3 (default
Following up on a stackoverflow answer re manipulating
a QImage, I access the contents of an image by:
vptr = myQi.bytes()
vptr.setsize(myQi.byteCount())
Per the Riverbank docs,
> A sip.voidptr may also be given a size... If it has a size then it is
> also able to support Python’s buffer
>
> The API is different for different versions of the QString API.
> Phil
>
Sorry, I'm using Python 2.7 and PyQt4 (4.8.3).
Looking around the Riverbank docs starting at the top level I find this
link:
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/python_v3.html#qvalidator
which s
I have set up a QValidator whose validate method consists of:
def validate(self, qs, pos) :
return (QValidator.Acceptable, qs, pos)
and this still gets TypeError: invalid result type from
findRepValidator.validate()
Very puzzling.
___
PyQt
Sorry, should have checked the docs on the riverbank first.
QValidator.validate has to return a triple (State, string, pos).
Apparently because the string and pos input args are mutable (non-"const")
in the C++, and this how argument altering is done?
Anyway, excuse the noise on the channel.
DC
Hello, I am trying to set up a QValidator on a QLineEdit. The Assistant
says that the validate() member should return something from the Enum
QValidator::State. My validator's validate() member currently has only the
one statement,
return QValidator.Acceptable
Whenever an edit is made in the L
>
> I have a C-library creating an image supposedly in in BI24 format (video
> application)
>
> Now I'd like to display the image.
>
> I tried to set the pixel format to QImage.Format_RGB888
>
> and I can see the image.
> However the red and blue colors are inversed.
>
I don't know if this will he
To get a python string copy of the contents of a QString object, I have
been using unicode(some_qstring) .
>>> qs = QString(u'BAZ')
>>> len(unicode(qs))
3
So I was surprised when I did the analogous thing to get a
python string copy of the contents of a QChar.
>>> qc = QChar(u'Z')
>>> len(unicod
Folks,
Per the Qt Project roadmap (http://qt-project.org/wiki/Qt_5.0) Qt 5 is
supposed to be in beta now (the alpha is available at
http://qt-project.org/prereleases), with final release "by the end of June".
I look in vain for a pyqt roadmap at riverbank.co.uk, although I do see
roadmaps for sip
On Tue, Jun 12, 2012 at 4:00 AM, wrote:
>
> 1. QTabWidget tab width change (Ganesh Kumar)
>
> I have try with pyqt, with QTabWidget I want increase tab width my
> application. How to achieve tab width. please guide me.
>
> -Ganesh
>
The idea is that the tab bar will resize the tabs in an approp
>
> * But if you navigate around in the cell using arrow keys and then press
> space, the cell is opened, but no signal is triggered.
>* If you then write something in the cell and press TAB to leave the
> cell - no signal is triggered.
These actions relate to editing the cell contents. Sugg
Per both the Qt Assistant and the PyQt4 class reference, QStringList
inherits all methods of QList, but the following code produces the
error message, AttributeError: 'QStringList' object has no attribute
'at'. If I convert the .at(0) to simple [0] indexing, the error moves
on to say "no attribute
I wrote previously about (Py)Qt widgets ignoring generated keystrokes from
third-party apps like Typinator, but now I have verified that they also
ignore input from the official Mac OS built-in keystroke generator, the
Apple Keyboard Viewer. To test this,
- open System Preferences
- select t
I've posted this at the Qt developer forum with no response,
(http://developer.qt.nokia.com/forums/viewthread/11749/),
hopefully someone here has a thought: my PyQt4 app under
OS X 10.6 does not respond properly to keystroke input
generated by the popular apps PopChar and Typinator.
(PopChar is an
I've a working program that loads grayscale PNG images with QPixmap.
The call is the simplest possible,
pxmap = QPixmap(pngPathString)
This worked great, but recently I got a set of png images that look
fine in Mac OS Preview, in Photoshop, etc. but when loaded with the
above, the colors are
To a function I want to pass a parameter to be used with
QTextDocument.find, either QTextDocument.FindCaseSensitively
or zero.
When I literally pass QTextDocument.FindCaseSensitively
the function receives an object of type PyQt4.QtGui FindFlags.
When I pass zero, it gets, no surprise, an int 0.
I
I had previously installed PyQt4 (4.7.2) without difficulty but trying to
update to 4.8.5 a make error occurs, specifically while making the
subdirectory "designer" - the error is around a bunch of missing names at ld
time. Any suggestions appreciated..
Here is an edited display of the error:
ld:
I am experimenting with trying to implement a custom signal and having a lot
of trouble with the syntax of connect, etc, and while making various changes
I am getting frequent SEGV crashes in the QtCore plugin. Below is the
abbreviated head of a crash report.
Does anybody want to know about these?
The following code will reliably produce a crash on my Mac OS 10.6.8 (snow
leopard) system. Python 2.6.1.
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future_builtins import *
from PyQt4.QtCore import (QFile, QTextStream, QStri
OK, David Boddie helped clear up my confusion (as did rereading
chapter 1 of "Rapid GUI Programming") -- to get from a QString to
something I can work on in Python it is only necessary to apply
unicode(). Doh! (Facepalm).
BLEEP represents any transformation that the user requires, which is
not in
I present a document to a user in a QPlainTextEdit widget. The widget
nicely handles most editing functions, but there is a unique operation
I want to provide. When the user selects Edit > BLEEP, the app is
supposed to BLEEP the document.
BLEEPing is not something Qt does, I have to implement BLEE
This is a high-level design question. I'm looking at writing a PyQt-based
replacement for an old app written in Perl/TCL. It is basically a
specialized text editor and QPlainTextEdit would be a nifty basis with one
exception: regex find/replace.
The old app fully exposed Perl regex syntax in its F
On Sun, May 1, 2011 at 12:40 AM, Sateesh Kumar wrote:
> I faced the same error while installing PyQt on Mac. Following the steps
> mentioned here :
> https://bugs.launchpad.net/bzr-mac-installers/+bug/529987/comments/9
> helped me to do a successful install of PyQt Mac.
This does eliminate the e
I'm trying to install on Mac OS X 10.6.7 with the default python 2.6.
I installed SIP, its make and make-install seemed to run correctly.
I installed Qt 4.7.2 and ran its demos.
I downloaded PyQt-mac-gpl-4.8.3 and ran its make, which did a whole
bunch of compiles with no obvious errors. It got righ
49 matches
Mail list logo