473,765 Members | 1,994 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PyQt: Can't show QFileDialog.get ExistingDirecto ry in Python Thread, bug or not?

Hi,

I use QT nc,PyQt NC 3.8 in Win32 platform. python 2.3.
I need show getExistingDire ctory in my program. I catch a question.

When I show a Dialog in a python function.it's ok. exp:

def showDirectory:
dl=QFileDialog. getExistingDire ctory('',None,
'get directory',
'choose directory',1)
print str(dl)

When I call this function in a python thread. the whole program halted
at once. It's seem a infinite loop. exp:
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~
Main function start.....
thread = Thread(target = next, args = [params, frmMain, doneflag])
thread.setDaemo n(false)
thread.start()
def next(params, d, doneflag):
dow = Download ()
d.dow = dow
dow.download(pa rams, d.chooseFile, d.updateStatus, d.finished, d.error,
doneflag, 100, d.newpath)
if not d.fin:
d.failed()

def onChooseFile(se lf, default, bucket, f, size, dir, saveas):
if saveas != '':
dl = saveas
else:
if dir:
dl=QFileDialog. getExistingDire ctory('',None,
'get directory',
'choose directory',1)
else:
dl = QFileDialog.get SaveFileName(te mpShow, "*.*",
self, "FileDialog ")

It's very cute I can use QFileDialog.get SaveFileName. Why I can't use
dl=QFileDialog. getExistingDire ctory.

It's a Qt small bug???

Ulysses
Jul 18 '05 #1
0 2627

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

Similar topics

4
3126
by: ulysses | last post by:
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):
2
3568
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 error message "Fatal Python error: PyEval_RestoreThread: NULL tstate". Without the line "self.app = app" the error goes away. So I suppose the main window can't have a reference to the application class. Right? Using the global variable qApp...
1
1534
by: Christopher Stone | last post by:
Does anyone have an example of how to do this? When I try to make a class that subclasses from a QFilePreview class and a QWidget class, I get the following error: TypeError: Cannot sub-class from more than one wrapped class
16
2136
by: Nanoscalesoft | last post by:
hello all, I am planning to start coding a nanoscale design software in python with QT interface.I have to do this in windows or linux.Intially windows would be fine. I have struggled almost full day today trying to make from import qt * execute...........................I have the basic python core. I went through the sites like riverbankcomputing and trolltech and few online pages and books which talk about PyQT but never say about...
1
3185
by: tim.stoop | last post by:
Hi people, I'm trying my first little app to create a small, simple application in Python (just to see how PyQt works and all) and I seem to get stuck. I want to make a front-end for ImageMagick's convert for my dad. He usually wants to send people pictures he made with his digital camera and he needs those smaller. So I want him to be able to select a directory and click a button to have the python-script automagically call convert to...
9
12317
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 messages between the main thread and the gui thread). I'm new to pyqt, so I'm probably doing something very silly, but for the moment I'm just trying to get the first pyqt tutorial example running in a seperate thread: ----8<--------
1
3419
by: Alexander Eisenhuth | last post by:
Hello alltogether, My System: Python 2.5.1 Boost.Python Qt 4.2.2 SIP 4.6 PyQt 4.2 WinXp
4
2487
by: Markus Dahlbokum | last post by:
Hello, I'm trying to link python statically with qt and pyqt. I've tried this in several ways but never succeeded. At the moment the final make runs without errors but I get import errors when accessing pyqt. How can I solve this problem? Markus # installing zipimport hook
1
2962
by: klia | last post by:
hey folks; i am working on my program using python and PYQT that is suppose to load digital photos into the main interface of my program and perform few action on them. i have here the codes that will prompt me to brows to the system directory and show the system files and any other files. any way the codes here deal only with text files and loads only one file at the time. my question how can i alter the code to deal with digital photos and...
0
10153
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9946
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8830
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7371
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6646
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3530
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2800
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.