473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

PyQt: Can't show PY variable in QT filedialog as initially parameter

Hi,

I use PyQt 3.8 non-commercial version in win32. I get a big question.
I Can't show PY variable in QT filedialog as initially parameter.

Code sample is following:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
fileName="test.avi"

def saveSomething(aString):
dl = QFileDialog.getSaveFileName(aString, "*.*", self, "FileDialog")
or
dl = QFileDialog.getSaveFileName(QString(aString), "*.*",
self, "FileDialog")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
these code can't show corrent string.

If I use string constant.
dl = QFileDialog.getSaveFileName("test.avi", "*.*", self, "FileDialog")

Dialog show it correctly.

Thanks.

Ulysses
Jul 18 '05 #1
4 3107
In article <43**************************@posting.google.com >, ulysses wrote:
Hi,

I use PyQt 3.8 non-commercial version in win32. I get a big question.
I Can't show PY variable in QT filedialog as initially parameter.

Code sample is following:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
fileName="test.avi"

def saveSomething(aString):
dl = QFileDialog.getSaveFileName(aString, "*.*", self, "FileDialog")
or
dl = QFileDialog.getSaveFileName(QString(aString), "*.*",
self, "FileDialog")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
these code can't show corrent string.

If I use string constant.
dl = QFileDialog.getSaveFileName("test.avi", "*.*", self, "FileDialog")

Dialog show it correctly.

Maybe try:

dl = QFileDialog.getSaveFileName(str(aString), "*.*", self, "FileDialog")

Jul 18 '05 #2
> Maybe try:

dl = QFileDialog.getSaveFileName(str(aString), "*.*", self, "FileDialog")


Thank you for you reply. I has try this code. str(aString). But it's still
can't work.

I has kill the question. code is following
strTemp=QString(' '+default)

dl = QFileDialog.getSaveFileName(strTemp, "*.*", self, "FileDialog")

Dialog show correctly. I read it from QT C++ document.
Jul 18 '05 #3
On Thursday 11 September 2003 5:14 pm, ulysses wrote:
Hi,

I use PyQt 3.8 non-commercial version in win32. I get a big question.
I Can't show PY variable in QT filedialog as initially parameter.

Code sample is following:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
fileName="test.avi"

def saveSomething(aString):
dl = QFileDialog.getSaveFileName(aString, "*.*", self, "FileDialog")
or
dl = QFileDialog.getSaveFileName(QString(aString), "*.*",
self, "FileDialog")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
these code can't show corrent string.

If I use string constant.
dl = QFileDialog.getSaveFileName("test.avi", "*.*", self, "FileDialog")

Dialog show it correctly.

Thanks.

Ulysses


Have you got a complete (but small) example that demonstrate's the problem?

Phil
Jul 18 '05 #4
Phil Thompson <ph**@riverbankcomputing.co.uk> wrote in message news:<ma*********************************@python.o rg>...
On Thursday 11 September 2003 5:14 pm, ulysses wrote:
Hi,

I use PyQt 3.8 non-commercial version in win32. I get a big question.
I Can't show PY variable in QT filedialog as initially parameter.

Code sample is following:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
fileName="test.avi"

def saveSomething(aString):
dl = QFileDialog.getSaveFileName(aString, "*.*", self, "FileDialog")
or
dl = QFileDialog.getSaveFileName(QString(aString), "*.*",
self, "FileDialog")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
these code can't show corrent string.

If I use string constant.
dl = QFileDialog.getSaveFileName("test.avi", "*.*", self, "FileDialog")

Dialog show it correctly.

Thanks.

Ulysses


Have you got a complete (but small) example that demonstrate's the problem?

Phil


Above code is a example. I do a little application for free.
main form will arrive 1XXX line. So I can't post it all.

BTW: I can't show getExistingDirectory Dialog in a python thread.
it's will halt whole program.
Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ulysses | last post by:
Hi, I use QT nc,PyQt NC 3.8 in Win32 platform. python 2.3. I need show getExistingDirectory in my program. I catch a question. When I show a Dialog in a python function.it's ok. exp: def...
1
by: Srinath Avadhanula | last post by:
Hello, I wanted to take a look at the qtext module which has been advertised on the PyQT overview page, but am unable to get it. How am I supposed to do this? I installed Python v2.3 from...
2
by: Sibylle Koczian | last post by:
Still trying to learn PyQt from a book about several Python GUI toolkits, I seem to learn first what doesn't work. The following small script seems to work, but after closing the window I get the...
1
by: Chump Wad | last post by:
I will now die. I am too ignorant to make it work. 10.2.setEventCB.py segfaults for me. It is almost there, but it is not there. SoQt.init returns a string, which I can't use as the parent...
3
by: Fabio | last post by:
Hi all, I'm about to write an application, and I'd like to use PyQt, but before choosing this toolkit I would like to clarify some particular licensing issues; if some user has already touched...
3
by: ET | last post by:
I don't know whats the problem, but after I added functions to first verify, then relink linked tables if not found, now I can't convert that database to MDE format. I can split the database, but...
13
by: Andy Baxter | last post by:
Can anyone recommend a good online guide to using objects in javascript? The book I bought (DHTML Utopia) suggests using objects to keep the code clean and stop namespace clashes between different...
4
by: Gabriel - BR | last post by:
Hi,,, Is possible disable the close button in KDE management window? Using python+qt? thanks
9
by: anders | last post by:
I am writing a plugin for a piece of software in python, and I want to start up a PyQt GUI in the plugin, without stalling the main thread while the gui is running (later i will want to pass...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.