That made sense to me and was a good pointer in the right direction, I've come up with this now:
def actionHelpTriggered(self):
helpPanel.setModal(True)
###helpPanel.setSizeGripEnabled(False) #### doesn't work, it doesn't stop dialog panel being stretched bigger.
helpPanel.setWindowTitle('Help')
with open('help.html', 'r') as infile:
result = infile.read()
self.helptext.setHtml(result)
self.helptext.setReadOnly(-1)
self.helptext.resize(800, 500)
helpPanel.show()
helpPanel.helptext.show()
def actionHelpTriggered(self):
helpPanel = QtGui.QDialog()
helpPanel.setModal(True)
###helpPanel.setSizeGripEnabled(False) #### doesn't work, it doesn't stop dialog panel being stretched bigger.
helpPanel.setWindowTitle('Help')
self.helptext = QtGui.QTextEdit(helpPanel)
with open('help.html', 'r') as infile:
result = infile.read()
self.helptext.setHtml(result)
self.helptext.setReadOnly(-1)
self.helptext.resize(800, 500)
helpPanel.show()
helpPanel.helptext.show()
To copy to clipboard, switch view to plain text mode
It does what I want, in that the dialog is modal with a title bar with an 'X' and the textEdit on top of it and a vertical slider. The dialog starts at the same size as the textEdit panel.
...in actionHelpTriggered
helpPanel.helptext.show()
AttributeError: 'QDialog' object has no attribute 'helptext'
I don't know why I get this as the last two lines seem to work, and without them nothing shows.
Bookmarks