baoboa / pyqt5

PyQt5 from riverbank
http://www.riverbankcomputing.com/software/pyqt/download5
GNU General Public License v3.0
1.05k stars 586 forks source link

No way to generate relative imports for promoted widgets using `pyuic5` #54

Closed stefanseefeld closed 5 years ago

stefanseefeld commented 5 years ago

I'm using qtcreator to design the UI of a PyQt application. It allows me to bind custom widgets using "widget promotion". While the UI for this seems to be very C++-centric (the dialog asks to specify a "header file"), the pyuic5 tool seems to handle it gracefully, i.e. mapping the header filename to a Python module.

However, the generated import statement uses absolute imports ("from widgets import CustomWidget"), and there is no way to instruct it to use relative imports ("from .widgets import CustomWidget"), even when using the --import-from=. option.

Am I missing something or is this indeed not possible at present ? (It would be great to make this possible !)

baoboa commented 5 years ago

I'm a not able to help you there, please ask this question on the mailing list. good luck

synapticarbors commented 5 years ago

@stefanseefeld -- did you ever determine a solution for this?

stefanseefeld commented 5 years ago

Unfortunately I haven't, no.

stefanseefeld commented 5 years ago

Let me try to answer your questions:

I have no clue about your mailbox, and don't understand what you are proposing, or why. It doesn't seem relevant to this issue.