remi
remi copied to clipboard
Crazy idea: Supporting QT .ui files (or qml)
It would be super cool (and a giant load of work I'm sure) to support importing from QT's .ui files (format) or QML. (I don't know QML, but I guess it's another option).
Being able to straightaway import a .ui file (a basic one at least) to have your REMI interface configured would be great. Or generate code for it from it, maybe not import from it straight away. It may attract people to use the library, just bring your already existing .ui file.
For example, a little GUI I needed to do a while ago: https://github.com/awesomebytes/etherdream_tools

The format is quite simple: https://github.com/awesomebytes/etherdream_tools/blob/master/laser_geom_tool/laser_borders.ui
Just wanted to share the idea and leave it written :) Great work with your latest updates @dddomodossola !
Hello @awesomebytes , this is a cool idea. I thought about something similar, mainly from tkinter. I would say that the ui file format is really simple, and it could be simple to import. It is that it requires a bit of work to find a parallelism between Qt widgets,properties,signals - REMI widgets,properties,signals. A basic implementation like in your example could be simple. I keep it in mind, and it is something good for the future. I'm happy you likes the last remi updates. ;-)
@awesomebytes , @dddomodossola I need to put my 2 cents on that conversation
I have this case https://gist.github.com/MaxMorais/426dbad64417996e7152d8c3c512c2b9
@dddomodossola, this is part of the app that we have discussed about due the little issue regarding assets.
In that case, I'm getting an html and compiling it to python, after, I have other code that allow-me to generate the UI from that HTML.
The code of the compiler is really complex, and I dont like him for now, but the HTML Parser is more simpler, and I think is an workable solution.
Instead of have an Qt UI, we can use HTML, since it's native to Remi. The major issue that I saw currently is.
My code needs an class with some instance attributes to render properly the Widgets, like inputs, and other controls.
class LoginView(View):
template = './templates/login_view.tmpl'
identifier = 'login'
def __init__(self, app, *args, **kwargs):
self.app = app
self.cookie_interface = CookieInterface(self.app)
self.login_manager = LoginManager(self.cookie_interface)
self.email = gui.Input('email')
self.email.attributes.update({
'aria-describedby': 'emailHelp',
'placeholder': 'Enter email'
})
self.password = gui.Input('password')
self.password.attributes['placeholder'] = 'Password'
self.remember_me = gui.CheckBox()
self.remember_me.add_class('custom-control-input')
self.btn_submit = gui.Button('Sign in', _class='btn btn-primary btn-block')
self._controls = {
'email': self.email,
'password': self.password,
'remember_me': self.remember_me,
'btn_submit': self.btn_submit
}
super(LoginView, self).__init__(app, _class='page', *args, **kwargs)
The major approach of that style, is that users, don't need to declare the layout into the py code
The major issue of that style is about how to anchor widgets, because rightnow, my compiler understand the value received, and when it's an widget, it generate an entry <repl id="125353923032" /> that will be used for the HTMLParser to fetch the elements from the memory.