[Eric] /ui directory and Ui.mainwindow
Detlev Offenbach
detlev at die-offenbachs.de
Thu Sep 28 18:53:12 BST 2017
Hello Phil,
is there a rule somewhere that says, that compiled UI files have to go into a
ui directory? I haven't seen such a rule anywhere, but may have missed it.
Detlev
Am Donnerstag, 28. September 2017, 02:32:18 CEST schrieb Phil:
> 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.
--
Detlev Offenbach
detlev at die-offenbachs.de
More information about the Eric
mailing list