Emmanuel Mayssat | 8 Feb 08:25
Picon

C++ Qt widget called in python?

Is it possible to call C++ Qt widget in PyQt?
If so how?
(Do I need to sip the lib?)

simple example? (let's say a subclass of QLabel in C++)

Regards,
--
E

JPolk | 7 Feb 22:10
Picon
Favicon

QDockWidget issue in Linux, but not Windows, OSX

I have a really weird phenomena here, and am hoping somebody can shed some
light on this...

Before posting code, thought I would briefly describe,...

Using a treeWidget, expanding an item presents us a tableWidget whose parent
is a tabWidget,
whose parent in turn is a dockWidget,...

dockWidget
     |
     tabWidget
           |
           tableWidget

In Windows and OSX, undocking the dockWidget, results in normal behaviour,
It is moveable, closeable, and floatable.

However, in Centos5.6 Linux, when doing same, the dockWidget un-docks
normally,
and shows correct data, but it is *un-moveable*  (This is same code as from
Win,OSX)
It is *hard* docked to top of OS window manager, but I can see the titleBar
of the dockWidget.

Using Alt-F7-≥Move, the dockWidget window can be moved, and now acts
normally.

I searched documentation and the internets, but can't resolve...

Anyone have any ideas on this one?

Thanks!
Jim

--
View this message in context: http://python.6.n6.nabble.com/QDockWidget-issue-in-Linux-but-not-Windows-OSX-tp4374122p4374122.html
Sent from the PyQt mailing list archive at Nabble.com.
Jeffrey Spies | 6 Feb 17:04
Picon
Gravatar

Drawing recursive arrows

I'm working on open source software that is basically a graphviz GUI,
where nodes (circles, squares, diamonds; QGraphicsItems) are connected
via arrows. I have that working. However, I'd like an arrow that
points to a single node like in the attached image.  Has anyone (1)
created these recursive sorts of arrows and (2) created them in such a
way as to dynamically adjust to the surface of the QGraphicsItem? If
not, can anyone suggest ways to accomplish this functionality?  For
example, the arrows would "stick" to the surface of any node (circle,
square, or diamond)?  It would be nice, if this arrow could be moved
around the surface of the node (circle, square, diamond, etc.), such
that it wouldn't always sit on top, but could moved to the sides.

Thanks, and I'm looking forward to hearing your implementations or
opinions on ways to do this.

Jeff.
nibbio6000 | 6 Feb 13:47
Picon
Gravatar

Newbie - Form and Mysql

Hi,
I'm very new with python and pyqt. I would like to understand  the steps to
do to build a easy form that list the result of a query from a database
mysql using pyqt.

I learn how to connect python to mysql and how run query....but i've never
find how to put the record in a list of a mask to display to an user.....

--
View this message in context: http://python.6.n6.nabble.com/Newbie-Form-and-Mysql-tp4369226p4369226.html
Sent from the PyQt mailing list archive at Nabble.com.
Jishnu Das | 6 Feb 02:30
Picon
Favicon
Gravatar

Opening a file dialog in PyQt - possible bug

Hello everyone,

I am attaching 2 sample codes - one that doesn't work and another that 
does. There is no apparent reason for the earlier not to work. [The 
third script main.py just defines the interface and is imported in both 
cases.]

core_notworking.py
To illustrate my problem, I have a line-edit (Edt1, has the text 
"Choose") and a pushbutton (Btn1, labelled "Choose"), both of which are 
trying to open a file dialog box. [The other pushbutton is merely to 
quit the application.] In the first case, pressing the return key from 
the line edit does open a file dialog box. The user can then choose the 
file, the name is displayed correctly in the line-edit and the file 
dialog box closes. In the second case, the file dialog box opens and the 
name of the file the user chooses is correctly printed on the 
command-line. However, the file dialog box doesn't close and we seem to 
hit an infinite loop. If we forcibly close the application, the file 
name is lost.

core_working.py
I replicate the situation described above and add @pyqtSlot descriptors 
as described at 
http://www.riverbankcomputing.com/static/Docs/PyQt4/html/new_style_signals_slots.html

I am not sure why omitting the descriptor completely alters the expected 
behavior. It would be great if someone could please help me with this.

Thanks in advance,
Jishnu

Attachment (core_working.py): text/x-python-script, 840 bytes
Attachment (core_notworking.py): text/x-python-script, 795 bytes
Attachment (main.py): text/x-python-script, 1650 bytes
melli79 | 4 Feb 20:13
Picon

installation problems with PyQt4-4.9 under python3.2.2

Hi everyone!

I have downloaded and compiled (after configuration) PyQt4-4.9 with
SIP-4.13.1 (and static libqt-4.7.2) under python-3.2.2 under Mac OSX.6.  The
scripts even installed all that was compiled without complaint, but when I
run any PyQt-program I get error messages such as:

   Traceback (most recent call last):
     File "helloQt.py", line 6, in <module>
       from PyQt4.QtGui import QApplication, QLabel
   ImportError: No module named QtGui

The strange thing is also that <PYTHONLIB>/site-packages/PyQt4/__init__.py
contains only comments no packages to load. Nevertheless the directory
contains libQtGui.a and all the like.

Did I miss an important step during configuration/ installation?

Thanks for suggestions
Melchior

--
View this message in context: http://python.6.n6.nabble.com/installation-problems-with-PyQt4-4-9-under-python3-2-2-tp4365263p4365263.html
Sent from the PyQt mailing list archive at Nabble.com.
detlev | 4 Feb 16:49
Picon
Favicon

ANN: eric 4.5.0 released

Hi,

I just uploaded eric 4.5.0. It is a feature release fixing some bugs. It 
contains these new features.

- Platforms
  -- Mac OS X is now an officially supported platform
- Editor
  -- Improved highlighter styles configuration
  -- Added configurable file filters
  -- Added configuration option for new QScintilla releases
  -- Enhanced template auto-completion
  -- Added capability to change keywords of the highlighters
- Email dialog
  -- Added function to check the login data
- Project
  -- Added forms generation support for PySide and Python3 Qt projects
- Subversion interfaces
  -- Diff context menu entry for the status dialog
  -- Made status dialog more universal (you can add, remove, commit,... from 
it)
  -- Added a filter on status to the status dialog
- Tools
  -- Enhanced source browser and source documentor
- Web-Browser
  -- Improved proxy configuration
  -- Added more default search engines
  -- Improved handling of mouse buttons 3 and 4 (back/forward in history)

It is available via the eric web site.

http://eric-ide.python-projects.org/index.html

Regards,
Detlev
--

-- 
Detlev Offenbach
detlev <at> die-offenbachs.de
Jürgen E. Fischer | 3 Feb 21:19
Picon
Favicon
Gravatar

SIP 4.13.1 crash when using exceptions

Hi there,

we recently started to support exceptions in the sip bindings of Quantum GIS.
Apparently there is a problem in 4.13.1 that causes sip to crash on 32 bit
platform.

The problem seems to be that type_header_code is referenced on a path where
it's not intialized.  The following patch fixes it for me:

--- ../orig/sip4-4.13.1/sipgen/parser.y 2011-12-19 13:29:28.000000000 +0100
+++ sipgen/parser.y     2012-02-03 22:05:25.810230624 +0100
@@ -792,7 +792,8 @@ exception:  TK_EXCEPTION scopedname base

                 /* Complete the definition. */
                 xd->iff->module = currentModule;
-                appendCodeBlock(&xd->iff->hdrcode, $5.type_header_code);
+                if( $5.token == TK_TYPEHEADERCODE )
+                    appendCodeBlock(&xd->iff->hdrcode, $5.type_header_code);
                 xd->pyname = pyname;
                 xd->bibase = $3.bibase;
                 xd->base = $3.base;

See http://hub.qgis.org/issues/4941 for a more detailed description.

Jürgen

-- 
Jürgen E. Fischer         norBIT GmbH               Tel. +49-4931-918175-20
Dipl.-Inf. (FH)           Rheinstraße 13            Fax. +49-4931-918175-50
Software Engineer         D-26506 Norden               http://www.norbit.de

--

-- 
norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH
Rheinstrasse 13, 26506 Norden
GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502

JPolk | 2 Feb 02:37
Picon
Favicon

Can DockWidgets be docked onto anything else except MainWindows?


Can DockWidgets be docked onto anything else except MainWindows ?

Supposed you have either a layout or a widget that's "mid-page" in a window
and want to dock/undock from that layout/widget and not the MainWindow...

Doesn't look to be possible,...Can anyone confirm this?

Thanks!

--
View this message in context: http://python.6.n6.nabble.com/Can-DockWidgets-be-docked-onto-anything-else-except-MainWindows-tp4357906p4357906.html
Sent from the PyQt mailing list archive at Nabble.com.
Hans-Peter Jansen | 1 Feb 01:25

issue with QPainter.drawPolyline and list of QPoints

Hi Phil,

shouldn't this work:

from PyQt4 import QtCore, QtGui
app = QtGui.QApplication([])
pixmap = QtGui.QPixmap(16, 16)
painter = QtGui.QPainter(pixmap)
plist = [QtCore.QPoint(0, 15), QtCore.QPoint(0, 0), QtCore.QPoint(15, 0)]
painter.drawPolyline(plist)

With PyQt 4.9, this results in:

TypeError: arguments did not match any overloaded call:
  QPainter.drawPolyline(QPointF, ...): argument 1 has unexpected type 'list'
  QPainter.drawPolyline(QPolygonF): argument 1 has unexpected type 'list'
  QPainter.drawPolyline(QPoint, ...): argument 1 has unexpected type 'list'
  QPainter.drawPolyline(QPolygon): argument 1 has unexpected type 'list'

QPaintDevice: Cannot destroy paint device that is being painted
Speicherzugriffsfehler

although you provide a %MethodCode handler for the list of QPoints case.
Ref: line 354 in sip/QtGui/qpainter.sip

Hmm,
Pete
Picon
Favicon
Gravatar

Change background color of section in QHeaderView

Hello,

 

I have a QTableView with headers. The headers need a different background-color , depending if the items are set to editable. This can be toggled for the entire column by clicking the header. If the items are editable, the header must have a green background, otherwise red. I try to implement it using stylesheets (using ::section:checked). The header changed color, but when I go to the next column (pressing right arrow) the background of the header in that column changes as well. And that’s not what I want. I used setHeaderData as well, but that doesn’t seem to do anything. What I want is:

Click the header of a certain column once: background of header turns red

Click the header again, background of header turns green.

Other headers must remain the same unless they are clicked too.

 

What’s the best way to solve this problem?

 

Thanks,

 

Peter


Gmane