Replies: 5 comments 4 replies
-
I think it's not necessary convert the whole Qt c++ code to Mojo in order to we have quickly available a MojoQt version. It's just create a kind of (mojo) bindings project using pythonic name convention and inside them call the c++ function which is in the linked QT library to make the magic. In other words, it's "just" convert the PyQt code to mojo code, as PyQt already is a python binding to Qt c++ library. |
Beta Was this translation helpful? Give feedback.
-
I know very little about Mojo at this point but it has piqued my interest as I'm looking to attempt to speed up a trading application I wrote (Fu510nTrader) using vanilla Python 3.x/PyQt6 and have hit some performance bottlenecks. This has sent me down the Rust path which sadly doesn't have very good Qt support so I'm stuck trying port the GUI to GTK4 which has it's own set of challenges combined with Rust's learning curve :(. That being said:
Looking at the PyQt6 package, I see a lot of references to SIP and MetaSIP so that definitely sounds like the best approach here as well. |
Beta Was this translation helpful? Give feedback.
-
Instead of PyQt6 I would suggest PySide6 since it's the official way to support Qt6 in Python. It almost works today with mojo - e.g. see https://github.com/rectalogic/mojo-qt/blob/main/qt.mojo However on macos (at least) the window is not displayed when using mojo. Possibly due to issues transforming the console app to GUI? Even a simple empty window fails to display https://github.com/rectalogic/mojo-qt/blob/main/window.mojo $ mojo window.mojo
size PySide6.QtCore.QSize(100, 100) active False |
Beta Was this translation helpful? Give feedback.
-
OK, I figured it out. mojo is aggressive in destroying objects, so it destroys the See discussion here: https://docs.modular.com/mojo/manual/lifecycle/death#explicit-lifetimes |
Beta Was this translation helpful? Give feedback.
-
There seem to be 3 different understandings here:
let me summarize:
Personally I would suggest to go with |
Beta Was this translation helpful? Give feedback.
-
Introducing the Future: Porting Qt to Mojo - A Call to Action
Hello Mojo Community,
We're on the brink of something revolutionary in the software development world, and it's called Mojo. Imagine a language that combines Python's simplicity with C's execution speed. That's what Mojo promises, and preliminary benchmarks suggest we're achieving that goal.
Why Qt?
Qt is a free and open-source widget toolkit for creating graphical user interfaces. The Qt library is widely used, known for its performance, and has bindings in several languages, including Python through PyQt. But what if we could make it even better by leveraging Mojo's efficiency?
The Vision: PyQt in Mojo
By porting Qt to Mojo, we could create ultra-fast, efficient, and responsive UIs. This will be particularly useful for resource-intensive applications where every millisecond counts. Imagine medical applications that need to process EEG data in real-time or high-frequency trading systems where the slightest delay can cost millions.
The Road Ahead
Benchmarking: Prove Mojo's speed advantages with real-world examples.
Prototype: Develop a prototype of Mojo-Qt to showcase its capabilities.
Community Involvement: Establish a developer community committed to bringing this vision to life.
Call to Action
We're looking for:
C/C++ experts familiar with the inner workings of Qt.
Software engineers experienced in compiler design.
Developers interested in creating the next big thing in UI/UX.
If you're excited about the idea and want to contribute, in making this vision a reality.
Let's build the future, today.
Beta Was this translation helpful? Give feedback.
All reactions