[PyQt] Problem with uic.loadUiType

2012-01-23 Thread Rapczak, Jesse
Hey all,

I'm relatively new to PyQt and am trying to use uic.loadUiType to load
up a .ui file at runtime. However, I'm getting the following error. I
must be doing something wrong... any ideas?

# Error: : invalid syntax (, line
31)
# Traceback (most recent call last):
#   File "", line 1, in 
#   File "c:\Tools\Maya\Common\Utilities\BranchSelector\example1.py",
line 40, in 
# listExample_form, listExample_base =
uic.loadUiType('C:\Tools\Maya\Common\Utilities\BranchSelector\example1.u
i')
#   File "c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\__init__.py",
line 200, in loadUiType
# winfo = compiler.UICompiler().compileUi(uifile, code_string,
from_imports)
#   File
"c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\Compiler\compiler.py",
line 55, in __init__
# CompilerCreatorPolicy())
#   File "c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\uiparser.py",
line 127, in __init__
# self.factory = QObjectCreator(creatorPolicy)
#   File "c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\objcreator.py",
line 91, in __init__
# if load_plugin(open(filename), plugin_globals, plugin_locals):
#   File
"c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\port_v2\load_plugin.py",
line 47, in load_plugin
# raise WidgetPluginError("%s: %s" % (e.__class__, str(e)))
# WidgetPluginError: : invalid syntax
(, line 31) #


Thanks!

--
Jesse Rapczak
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Problem with uic.loadUiType

2012-01-23 Thread Rapczak, Jesse
Sure. I'm trying to use the example here:

 

http://dl.dropbox.com/u/1633130/PyQt%20tuts/example1.py

http://dl.dropbox.com/u/1633130/PyQt%20tuts/example1.ui

 

This is from http://nathanhorne.com/?p=451

 

From: Panupat Chongstitwattana [mailto:panup...@gmail.com] 
Sent: Monday, January 23, 2012 11:11 AM
To: Rapczak, Jesse
Subject: Re: [PyQt] Problem with uic.loadUiType

 

Can we see your code?



On Tue, Jan 24, 2012 at 12:04 AM, Rapczak, Jesse 
wrote:

Hey all,

I'm relatively new to PyQt and am trying to use uic.loadUiType to load
up a .ui file at runtime. However, I'm getting the following error. I
must be doing something wrong... any ideas?

# Error: : invalid syntax (, line
31)
# Traceback (most recent call last):
#   File "", line 1, in 
#   File "c:\Tools\Maya\Common\Utilities\BranchSelector\example1.py",
line 40, in 
# listExample_form, listExample_base =
uic.loadUiType('C:\Tools\Maya\Common\Utilities\BranchSelector\example1.u
i')
#   File "c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\__init__.py",
line 200, in loadUiType
# winfo = compiler.UICompiler().compileUi(uifile, code_string,
from_imports)
#   File
"c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\Compiler\compiler.py",
line 55, in __init__
# CompilerCreatorPolicy())
#   File "c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\uiparser.py",
line 127, in __init__
# self.factory = QObjectCreator(creatorPolicy)
#   File "c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\objcreator.py",
line 91, in __init__
# if load_plugin(open(filename), plugin_globals, plugin_locals):
#   File
"c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\port_v2\load_plugin.py",
line 47, in load_plugin
# raise WidgetPluginError("%s: %s" % (e.__class__, str(e)))
# WidgetPluginError: : invalid syntax
(, line 31) #


Thanks!

--
Jesse Rapczak
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

 

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Function to open window and return user input

2012-01-23 Thread Christopher Evans
Is there a way to make this non modal? I am using Maya and we did not use
exec because it always made the dialog application modal, as in it halts
the main thread and doesn't allow users to interface with the parent app
while the window is open.

CE

On Sun, Jan 22, 2012 at 4:27 PM, Hans-Peter Jansen  wrote:

> On Friday 20 January 2012, 20:38:33 Christopher Evans wrote:
> > QInput is designed to get a single input from a user.
> >
> > In my case, we are making a complex remapping dialog that takes two
> > ordered lists as input, allows the users to change the order, then on
> > dialog close, it should return the two re-ordered lists.
>
> That's called a modal dialog. Create it, exec_ it (look up
> QDialog::exec()), process data after close, and be done.
>
> Pete
> ___
> PyQt mailing listPyQt@riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>



-- 
CE
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] D-Bus support for Windows

2012-01-23 Thread Lukas Hetzenecker
Thanks! I got it working!

Here is a simplified HOWTO for everybody that wants to achieve the same:

To get it working you need to compile the latest dbus library/daemon,
Qt 4.8 (needs to be recompiled, because the official release for
Window doesn't include QtDBus), dbus-python (patches to make it
compile with MSVC can be found in the KDE Windows repository) and
finally PyQt (the windows source doesn't include the dbus
subdirectory, it has to be copied from the X11 release; PyQt 4.9 is
the minimum requirement).

If you have any more questions feel free to ask me,
Lukas

2012/1/23 Lukas Hetzenecker :
> Thanks! I got it working!
>
> Here is a simplified HOWTO for everybody that wants to achieve the same:
> To get it working you need to compile the latest dbus library/daemon,
> Qt 4.8 (needs to be recompiled, because the official release for
> Window doesn't include QtDBus), dbus-python (patches to make it
> compile with MSVC can be found in the KDE Windows repository) and
> finally PyQt (the windows source doesn't include the dbus
> subdirectory, it has to be copied from the X11 release; PyQt 4.9 is
> the minimum requirement).
>
> If you have any more questions feel free to ask me,
> Lukas
>
> 2011/12/28 Phil Thompson :
>> On Wed, 28 Dec 2011 11:30:11 +0100, Lukas Hetzenecker
>>  wrote:
>>> Hello Phil and all interested community members,
>>>
>>> I'd like to ask you if you have any plans to add support for Windows
>>> to your D-Bus mainloop implementation.
>>>
>>> Some time ago there was a discussion on the dbus mailing list:
>>> http://web.archiveorange.com/archive/v/2mxmYng5gCA0MCJamGh9
>>>
>>> The D-Bus server was already ported to Windows and is used
>>> successfully by some applications (e.g. the KDE project).
>>> The only thing that's missing now is any python support (glib also
>>> isn't ported yet). I tried to copy the dbus/ directory from
>>> the Linux source code to the source for Windows and it compiled,
>>> although i couldn't get it to work (more information about
>>> that is in the thread mentioned above).
>>>
>>> Is there any chance that we could get this great IPC framework
>>> supported on all major operating systems?
>>
>> If you can build and run C++ Qt DBus applications under Windows then the
>> new QtDBus module in PyQt v4.9 should work (if you are using Qt v4.7 or
>> later). You will need to change configure.py so that it tries to build
>> QtDBus under Windows - the change needed is obvious if you search for
>> "QtDBus".
>>
>> Phil
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] question about image on browser

2012-01-23 Thread Tony Peña
Hi, sorry by my english...

i´m working over linux, and when i try to execute on windows i get this
image bug on QWebKit

check the image and take a look of the airplane between the 2 green-red
lines

http://i40.tinypic.com/5uldau.jpg

on linux x86 and x64 works fine the icon airplane in the QWebKit browser
and in the browser of system any chromiun, friefox etc.

on windows x86 works fine the icon in the browser but not in QWebkit

and is the same code.

softwares implemented: python 2.7.2 and PyQt 4.9.1-py27
any suggestion?

Kind Regards

-- 
Antonio Peña
Secure email with PGP 0x8B021001 available at http://pgp.mit.edu
Fingerprint: 74E6 2974 B090 366D CE71  7BB2 6476 FA09 8B02 1001
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Function to open window and return user input

2012-01-23 Thread Hans-Peter Jansen
On Monday 23 January 2012, 18:53:46 Christopher Evans wrote:
> Is there a way to make this non modal? I am using Maya and we did not
> use exec because it always made the dialog application modal, as in
> it halts the main thread and doesn't allow users to interface with
> the parent app while the window is open.

Well, I don't have any experience with Maya at all, but what you need 
seems pretty straight forward. I would subclass QDialog, show (or 
exec_) the non modal dialog, and collect the data when closed.

The gory details depend on how Maya runs such extension code (eg. how 
QApplication and the event loop is handled). 

Pete

> CE
>
> On Sun, Jan 22, 2012 at 4:27 PM, Hans-Peter Jansen  
wrote:
> > On Friday 20 January 2012, 20:38:33 Christopher Evans wrote:
> > > QInput is designed to get a single input from a user.
> > >
> > > In my case, we are making a complex remapping dialog that takes
> > > two ordered lists as input, allows the users to change the order,
> > > then on dialog close, it should return the two re-ordered lists.
> >
> > That's called a modal dialog. Create it, exec_ it (look up
> > QDialog::exec()), process data after close, and be done.
> >
> > Pete
> > ___
> > PyQt mailing listPyQt@riverbankcomputing.com
> > http://www.riverbankcomputing.com/mailman/listinfo/pyqt


___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Sqlite3 'database is locked' errors

2012-01-23 Thread Brian Zambrano
I ended up solving this but it's very odd.

I do my own DB work with QSqlQuery, but commit any transaction I open.  I
have two QSqlTableModels which I use.  In one of the QSqlTableModels I was
using setQuery to select a subset of the columns I needed.  That ended up
being the issue.  When I remove the setQuery call and simply ignore the
unneeded columns from the view, everything works.

BZ


On Thu, Jan 19, 2012 at 11:24 PM, Brian Zambrano  wrote:

> In my application I have a Sqlite db which at times needs an updated
> schema.  To work around some issues on Windows, I need to do "drop table"
> for each table.  However, I'm continuously getting:
>
> "database is locked Unable to fetch row"
>
> after each "DROP table table_name" statement.  There are no other queries
> I'm running or uncommitted transactions.  Can some of my QSql* widgets be
> holding on to locks which prevent the tables from being dropped?
>
> BZ
>
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt