Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How would I include other files in the executable/installer build process? #32

Closed
willkara opened this issue Oct 1, 2018 · 5 comments
Closed

Comments

@willkara
Copy link

willkara commented Oct 1, 2018

Is there a correct way to include other files/directories when building the installer/executable directory?
I'm asking because I'm loading the .ui files at runtime in my code to load the QT widgets ...etc.

class AppContext(ApplicationContext):  # 1. Subclass ApplicationContext
    def run(self):  # 2. Implement run()
        form = MainForm('forms/mainwindow.ui')
        return self.app.exec_()  # 3. End run() with this line

I know it has the resource/base directory, would this be the best place for my .ui files?

@willkara
Copy link
Author

willkara commented Oct 1, 2018

The only other thing I can think of is to pre-compile the forms with:

pyside2-uic.exe

and then include those python files in the build.

@willkara
Copy link
Author

willkara commented Oct 1, 2018

EDIT

Just realized that wont work because the compilation will overwrite any action functions in the resulting .py file.

@mherrmann
Copy link
Owner

Can you just place the .ui file into src/main/resources/base, then do MainForm(self.get_resource('mainwindow.ui'))?

@willkara
Copy link
Author

willkara commented Oct 3, 2018

I'll have to try it out next time I'm home. Thanks for the tip.

@mherrmann
Copy link
Owner

My pleasure :-) Closing this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants