~bitfehler/rust_qt_example

A simple example app using the Rust Qt bindings
Initial commit

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~bitfehler/rust_qt_example
read/write
git@git.sr.ht:~bitfehler/rust_qt_example

You can also use your local clone with git send-email.

#Rust Qt example

This is just an example application for how to use the Rust Qt bindings.

It's main intention is to demonstrate three things:

#Custom resources

A custom resource (in this case, a font) is embedded in the executable. Check out the fonts/ folder and build.rs for details.

#Custom event filter

Usually, one would sub-class a widget to have access to e.g. key events and such. But sub-classing is not yet supported by ritual, the Rust bindings generator. Hence, the event filter technique can be used as a workaround.

#Layout

The app uses a common layout, where a text (in this case, an editor, so you have to type it yourself) is displayed full screen for smaller windows. Above a certain window width, the text will stay at its maximum width, to maintain readability. Type (or paste) some text and resize the window to see it in action.

I'd be interested to see how such a layout would be implemented in GTK. Any pointers to my public inbox would be much appreciated!