Problems with PyQt

Phil Thompson phil at riverbankcomputing.co.uk
Fri Jan 28 18:14:24 EST 2005


I suggest that you post your question to the PyKDE mailing list and include a 
complete example that demonstrates your problem as an attachment (so the 
indentation is preserved).

Phil

On Friday 28 January 2005 9:42 pm, Michael McGarry wrote:
> Hi,
>
> I am having a problem making a widget appear. I have 5 widgets which
> are windows with no parents. 3 of the widgets appear without a problem
> the other 2 widgets will not appear when I invoke widget.show() from
> within a handler for another widget. I am completely clueless as to why
> these 2 widgets will not draw. One of them is simply a wait window I
> want to appear while I am performing a time consuming task.
>
> Here is a snippet of code:
>
> def viewSimButton_pressed(self):
> wait_win.waitProgressBar.setPercentageVisible(1)
> wait_win.waitProgressBar.setTotalSteps(5)
> wait_win.waitProgressBar.setProgress(0)
> wait_win.show()
> self.hide()
> self.viewSimButton.setDown(0)
> for loopIdx in range(self.simListBox.count()):
> if self.simListBox.isSelected(loopIdx) == 1:
> simIdx = loopIdx
> simID = self.simListBox.item(simIdx).text().ascii()
> # Clear list box
> sim_view_win.simOutputListBox.clear()
> if os.path.exists(simID) == 1:
> os.chdir(simID)
> wait_win.waitProgressBar.setProgress(1)
> # Check process ID file
> if os.path.exists('pid') == 1:
> time.sleep(1) # wait 1 second, then check again
> pidFile = open('pid','r')
> pidStr = pidFile.readline()
> if pidStr == 'done\n':
> sim_view_win.simStatusLbl.setText('Completed')
> else:
> sim_view_win.simStatusLbl.setText('Running')
> simData = sims[simID]
> sim_view_win.simIDEdit.setText(simID)
> sim_view_win.hostEdit.setText(simData['host'])
> wait_win.waitProgressBar.setProgress(3)
> # Fill list box with output files
> #
> filedir = os.popen('ls','r')
> filename = filedir.readline()
> while filename:
> filename = string.rstrip(filename)
> if ((filename != 'pid') and (filename != 'sim_cfg') and (filename !=
> 'sim_log')
> and (filename != 'sim_core')
> and (string.find(filename,'.fig') == -1)
> and (string.find(filename,'.gp') == -1)):
> sim_view_win.simOutputListBox.insertItem(filename)
> filename = filedir.readline()
> os.chdir('..')
> wait_win.waitProgressBar.setProgress(5)
> wait_win.hide()
> sim_view_win.show()
>
> wait_win will show on the screen but not with it's progress bar. Can
> anyone help?
>
> Thanks,
>
> Michael



More information about the Python-list mailing list