Phil Thompson <[EMAIL PROTECTED]> wrote:
>>> James proposed this solution:
>>>
>>> def slotWhatever(self):
>>>dlg = MyModalDialog(self)
>>>sip.transfer(dlg, 0)
>>>if dlg.exec_loop() == QDialog.Accepted:
>>>return dlg.data()
>>>return None
>>>
>>> and then proposed to hardc
On Thursday 07 July 2005 12:27 pm, Giovanni Bajo wrote:
> Phil Thompson <[EMAIL PROTECTED]> wrote:
> >> The problem is that the idiomatic way of using modal dialogs in C++ is
> >> to create local variables, which gets destroyed when their scope
> >> finishes (when
> >> the function exits). Moreover
Phil Thompson <[EMAIL PROTECTED]> wrote:
> This would seem to be an untypical way of doing things - is anybody going
> to shout that their 5 million line application relies on this technique?
It looks like a *very* untypical way of doing things -- at least for modal
dialogs. I believe 99.999% of
> On Thursday 07 July 2005 15:01, Phil Thompson wrote:
>
>> The original proposal would cause problems in the following scenario...
>>
>> 1. One or more modal dialogs that are hidden when not used, rather than
>> being re-created each time they are needed.
>>
>> 2. The dialogs are Python sub-classe
On Thursday 07 July 2005 15:01, Phil Thompson wrote:
> The original proposal would cause problems in the following scenario...
>
> 1. One or more modal dialogs that are hidden when not used, rather than
> being re-created each time they are needed.
>
> 2. The dialogs are Python sub-classes of QD
> Phil Thompson <[EMAIL PROTECTED]> wrote:
>
>> 1. Either add an optional parameter to exec_loop() which does the
>> transfer
>> or have exec_loop_and_transfer() (or something less of a mouthful). At
>> least that way it won't break existing code.
>
> I like this solution. Then I can do:
>
> class
Phil Thompson <[EMAIL PROTECTED]> wrote:
> 1. Either add an optional parameter to exec_loop() which does the transfer
> or have exec_loop_and_transfer() (or something less of a mouthful). At
> least that way it won't break existing code.
I like this solution. Then I can do:
class QDialog(QDialog
> Phil Thompson <[EMAIL PROTECTED]> wrote:
>
>>> The problem is that the idiomatic way of using modal dialogs in C++ is
>>> to
>>> create local variables, which gets destroyed when their scope finishes
>>> (when
>>> the function exits). Moreover, the dialogs have to be children of
> whatever
>>> wi
Phil Thompson <[EMAIL PROTECTED]> wrote:
>> The problem is that the idiomatic way of using modal dialogs in C++ is to
>> create local variables, which gets destroyed when their scope finishes
>> (when
>> the function exits). Moreover, the dialogs have to be children of
whatever
>> widgets they are
> Phil Thompson <[EMAIL PROTECTED]> wrote:
>
>> Does anyone see a potential problem with exec_loop() transferring
>> ownership of the dialog instance back to Python?
>
> Well, which C++ API would you intend to call to achieve this? We
> still
> need the QDialog to keep its p
Phil Thompson <[EMAIL PROTECTED]> wrote:
> Does anyone see a potential problem with exec_loop() transferring
> ownership of the dialog instance back to Python?
Well, which C++ API would you intend to call to achieve this? We still
need the QDialog to keep its parent widget b
On Wednesday 06 July 2005 4:32 pm, Giovanni Bajo wrote:
> James Emerton <[EMAIL PROTECTED]> wrote:
> >>> Does anyone see a potential problem with exec_loop() transferring
> >>> ownership of the dialog instance back to Python?
> >>
> >> Well, which C++ API would you intend to call to achieve this? W
James Emerton <[EMAIL PROTECTED]> wrote:
>>> Does anyone see a potential problem with exec_loop() transferring
>>> ownership of the dialog instance back to Python?
>>
>> Well, which C++ API would you intend to call to achieve this? We still
>> need the QDialog to keep its parent widget because it
On 6/23/05, Giovanni Bajo <[EMAIL PROTECTED]> wrote:
> > Does anyone see a potential problem with exec_loop() transferring
> > ownership of the dialog instance back to Python?
>
> Well, which C++ API would you intend to call to achieve this? We still need
> the
> QDialog to keep its parent widge
James Emerton <[EMAIL PROTECTED]> wrote:
> Sorry to be digging up such an old thread, but my mind keeps coming
> back to this one.
Yeah, me too... I still have not conceived an elegant solution for this
problem. BTW, I also found out that this:
dlg = MyDialog(self):
try:
dlg.exec_loop()
fina
Sorry to be digging up such an old thread, but my mind keeps coming
back to this one.
Does anyone see a potential problem with exec_loop() transferring
ownership of the dialog instance back to Python?
James
On 5/25/05, Giovanni Bajo <[EMAIL PROTECTED]> wrote:
> Hello,
>
> while the QObject obje
Toby Dickenson <[EMAIL PROTECTED]> wrote:
>> Notice that WDestructiveClose does not collect the Python object (of
>> course). So you can easily do something like:
>>
>> class MyDialog(QDialog2):
>> # bla bla
>>
>> def accept(self):
>> self.value = self.lineedit.text()
>>
>> and
On Thursday 26 May 2005 13:16, Giovanni Bajo wrote:
> Toby Dickenson <[EMAIL PROTECTED]> wrote:
>
> >> class QDialog2(QDialog):
> >>def __init__(self, parent=0, name=0, modal=False, flags=0)
> >>QDialog.__init__(self, parent, name, modal, flags |
> >> Qt.WDestructiveClose)
>
> Actuall
Toby Dickenson <[EMAIL PROTECTED]> wrote:
>> class QDialog2(QDialog):
>>def __init__(self, parent=0, name=0, modal=False, flags=0)
>>QDialog.__init__(self, parent, name, modal, flags |
>> Qt.WDestructiveClose)
Actually, for my project, I'm better off with:
class QDialog2(QDialog):
On Thursday 26 May 2005 11:24, Giovanni Bajo wrote:
> class QDialog2(QDialog):
>def __init__(self, parent=0, name=0, modal=False, flags=0)
>QDialog.__init__(self, parent, name, modal, flags |
> Qt.WDestructiveClose)
That works, but Im not sure I would recommend it. It leads to a bigge
Toby Dickenson <[EMAIL PROTECTED]> wrote:
> On Wednesday 25 May 2005 16:13, Giovanni Bajo wrote:
>
>> So, I don't see any easy way to take care of this automatically. One
>> has to remember to manually destroy the dialog calling deleteLater
>
> Yes. My PyQt idiom for running a dialog is:
>
> dl
On Wednesday 25 May 2005 16:13, Giovanni Bajo wrote:
> So, I don't see any easy way to take care of this automatically. One has to
> remember to manually destroy the dialog calling deleteLater
Yes. My PyQt idiom for running a dialog is:
dlg = WhateverDlg(parent)
try:
ok = dlg.ex
--- Giovanni Bajo <[EMAIL PROTECTED]> wrote:
> Hello,
>
> while the QObject object model is pretty clear to me, and I also
> understand
> the way it was translated to Python, today I stumbled upon an issue
> which I
> hadn't realized before:
>
> class MyMainWindow(QMainWindow):
> def about(s
Hello,
while the QObject object model is pretty clear to me, and I also understand
the way it was translated to Python, today I stumbled upon an issue which I
hadn't realized before:
class MyMainWindow(QMainWindow):
def about(self):
dlg = MyAboutDlg(self)
dlg.exec_loop()
Th
24 matches
Mail list logo