philroberts / FPDB-for-OSX

Free Poker DataBase development, with a focus on OSX.
http://fpdb.sf.net
56 stars 21 forks source link

QtDesigner: UI components as separate .ui files #26

Closed astephane closed 7 years ago

astephane commented 7 years ago

Some UI components (main-window, menu etc.) are hardcoded and, I think, they could be designed as separate .ui files using QtDesigner and loaded by the software (adds flexibility and simplifies code) [1]

[1] http://stackoverflow.com/questions/2398800/linking-a-qtdesigner-ui-file-to-python-pyqt#2500905

philroberts commented 7 years ago

I have a (possibly irrational) aversion to that kind of thing. If you can convince me that it 'adds flexibility and simplifies code' in a meaningful way then maybe we can look into it. But IMO there are bigger fish to fry right now in FPDB anyway.

astephane commented 7 years ago

In professional environment, It's easier & faster to design at first, enhance, connect some trivial signal slot without any code etc. etc. Code maintenance is also a lot easier and versatile (e.g. adding a menu-item in contextual menus or main-menu, icons in a toolbar, adding new widgets to the app) because you have the design in the UI file and the behavior in the application code. Managing widgets layout is also easier and nicer to the user.

Not using separate .ui files is the old-fashioned way of doing it i.e. before Rapide Application Development tools such as QtDesigner or Glade have been developed.

Now, in python, it seems that it's not needed to precompile .UI files as python code before runtime. The software just loads the UI files.

At some point, not using UI files makes the program more difficult to maintain and improve.

Internationalization is managed directly by Qt.

Finally, I think this is kind of re-design of the current code base and, as it, not a high priority task.

I might eventually do it in a sub-branch of the qtfork branch to lighten the code.

Maybe, we could just let this issue open and stay as is as a re-design discussion.