[Eric] /ui directory and Ui.mainwindow

Phil phil_lor at bigpond.com
Thu Sep 28 01:32:18 BST 2017


On 28/09/17 01:52, Detlev Offenbach wrote:
> Hello Phil,
> 
> eric generates a file called Ui_*.py when compiling a form file (*.ui). In your
> example the compiled source would be Ui_mainwindow.py. This file is stored
> alongside the form file. In your module implementing the functionality of the
> form you would include a line like this
> 
> from .Ui_mainwindow import Ui_mainwindow		<- your dialog class here
> class MainWindow(QMainWindow, Ui_mainwindow):
>    def __init__(self, parent=None):
>      QMainWindow.__init__(self, parent=parent)
>      self.setupUi(self)
> 
> That's it. This is the pattern used to implement the eric IDE.

Thank you Detlev,

I was thinking that I wasn't using Eric correctly because I have to 
manually move the created files to the ui directory. Moving them isn't a 
major problem, I just thought that I must have missed a vital step 
somewhere.

Although it's been many years since I've used it, I had become used to 
the way Qt Creator automatically handles the housekeeping duties.

-- 
Regards,
Phil


More information about the Eric mailing list