473,397 Members | 2,056 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,397 software developers and data experts.

PyQT: QDialog and QMainWindow interacting with each other

Hello!

I have got a QMainWindow with a QListView, in which the different
entries of a database are shown to the user. Moreover it has got a
QPushButton, so that another QDialog can be opened where the user is
able to add a new entry:

....

self.connect(self.btnNew, SIGNAL('clicked()'), self.openNewDialog)
....

def openNewDialog(self):
dialog = MyDialog(self)
dialog.show()
self.showListViewItems() # this line isn't recognized
MyDialog is closed by calling MyDialog.accept(). What can I do so that
self.showListViewItems() is called after MyDialog has been closed?

Thank you for any input!

Cheers,
Fabian Steiner
Feb 27 '06 #1
2 7414
Fabian Steiner schrieb:
MyDialog is closed by calling MyDialog.accept(). What can I do so that
self.showListViewItems() is called after MyDialog has been closed?

Thank you for any input!

Hi Fabian,

override the accept() method and call self.showListViewItems() there.
But remember to call QDialog.accept() at the end.

def accept( self ):
self.showListViewItems()
QDialog.accept( self )
Kai Teuber
Feb 28 '06 #2
Hi Kai!

Kai Teuber wrote:
Hi Fabian,

override the accept() method and call self.showListViewItems() there.
But remember to call QDialog.accept() at the end.

def accept( self ):
self.showListViewItems()
QDialog.accept( self )

Thank you very much, I got it working :-)

Cheers,
Fabian
Feb 28 '06 #3

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

Similar topics

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...
10
by: Peter | last post by:
I want to draw some lines on a widget. This works ok, but when I want to redraw, the old lines are still there. How do I clear or refresh the widget, so I can draw a new set of lines? Code...
2
by: Erwan Adam | last post by:
Hi all, I try to introduce tooltips in my application written in PyQt (more precisly, in the menubar of my application) but I can't find a way to get the QRect instance associated to a QMenuBar...
2
by: gregarican | last post by:
I have an application I'm writing using PyQt. I'm trying to create the various windows by subclassing Qt objects. I have a subclassed QMainWindow as the parent, and then a series of subclassed...
4
by: gregarican | last post by:
I noticed that when I invoked the setCentralWidget() method using PyQt 3.13 on Python 2.3.5 opening and closing a widget associated with a main window would result in a Win32 access violation crash...
1
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
2
by: dittonamed | last post by:
Code pasted below -----> Can anyone out there suggest a way to access the object "p" thats started in playAudio() from inside the stopAudio()? I need the object reference to use QProcess.kill()...
0
by: pierreroth64 | last post by:
Hi, New with python, I've developped a small cmd line script parsing opts and args with an OptionParser: in myApp.py: ....blablabla... parser.add_option(...) parser.add_option(...)
1
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.