On Nov 28, 2007 2:23 PM, Andreas Pakulat <<a href="mailto:apaku@gmx.de">apaku@gmx.de</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On 28.11.07 13:21:37, Alexandre Badez wrote:<br>> On Nov 28, 2007 12:00 PM, Andreas Pakulat <<a href="mailto:apaku@gmx.de">apaku@gmx.de</a>> wrote:<br>><br>> > But you can do this inside your dialog class. Just override the accept
<br>> > and reject methods and do whatever logic you have their.<br>> ><br>> > It doesn't make sense to have a modal dialog without another window<br>> > (i.e. in your __main__ function), as then its not really modal. And
<br>> > making a modal dialog is exactly what the exec_() does.<br>><br></div><div class="Ih2E3d">> Exactly, but in this case, I need a modal dialog, that why I use the exec_.<br><br></div>So you do have a QApplication created and executed already when you
<br>create your dialog?<br><div class="Ih2E3d"></div></blockquote><div><br>Yes I do :)<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><br>> My problem is what can make a "Bus Error" when I just simply want to create<br>> a QDialog (even the simplest one).<br><br></div>I don't know, google turns up a memory-corruption problem as first
<br>hit... Without some small self-contained example its hard to say what<br>could be wrong.<br><br>Andreas<font color="#888888"></font></blockquote><div><br>That is my problem, and why I ask if somebody know anything about this.
<br>Because, normaly it append after a memory leak (in C/C++ and others), but in python we do not manage our memory that's my problem.<br><br><br>Ok, here is a bit more of my code.<br><br>It's in my own model:<br>
<br> def addIndividu(self, index, lIndividu):<br> self.beginRemoveRows(<br> index,<br> self.rowCount(index),<br> self.rowCount(index))<br><br> # We add the data in the node
<br> node = index.internalPointer()<br> dProblem = node.addIndividu(lIndividu)<br> <br> if dProblem is not None and dProblem != {}:<br> wChapterSelection = WindowChapterSelectionDialog.WindowChapterSelectionDialog
() # <- We create an instance of the window<br><br> # First we verify that all item have a valid type<br> if dProblem.get('undefied_type') is not None:<br> dUndef = dProblem.pop
('undefied_type')<br> for typeIndividu in dUndef:<br> lChapter = dUndef[typeIndividu][0]<br> lIndividu = dUndef[typeIndividu][1]<br> <br> for individu in lIndividu:
<br> wChapterSelection.setWindow(typeIndividu, individu, lChapter)<br> <br> wChapterSelection.exec_() # <- HERE IS MY PROBLEM !! : "bus error"
<br> <br> if wChapterSelection.Accepted == wChapterSelection.result():<br> goodChapter = wChapterSelection.getSelection()<br>
goodChapter.addIndividu([individu])<br></div></div><br><br>The problem is steel there if I do something like:<br><br> def addIndividu(self, index, lIndividu):<br>
self.beginRemoveRows(<br>
index,<br>
self.rowCount(index),<br>
self.rowCount(index))<br>
<br>
# We add the data in the node<br>
node = index.internalPointer()<br>
dProblem = node.addIndividu(lIndividu)<br>
<br>
if dProblem is not None and dProblem != {}:<br>
wChapterSelection =
QtgGui.QDialog() # <- We
create an instance of the window<br>
<br>
# First we verify that all item have a valid type<br>
if dProblem.get('undefied_type') is not None:<br>
dUndef = dProblem.pop('undefied_type')<br>
for typeIndividu in dUndef:<br>
lChapter = dUndef[typeIndividu][0]<br>
lIndividu = dUndef[typeIndividu][1]<br>
<br>
for individu in lIndividu: <br> wChapterSelection.exec_() # <- HERE IS MY PROBLEM !! : "bus error"<br>
<br>
if wChapterSelection.Accepted == wChapterSelection.result():<br>
print "ok :)"<br><br><br>Thanks for your help<br><br>-- <br>Alex<br>