Using WxWidgets Qt backend? #877
Replies: 15 comments 75 replies
-
To clarify, does the theme come from Qt or wxWdigets? Sharing a Qt theme between Audacity and MuseScore could be an interesting idea. |
Beta Was this translation helpful? Give feedback.
-
Theme is from Qt side. EDIT: An extra note worth considering, is that Qt allows for applying CSS-like stylesheets on top of application widgets. So as long as each widget object name is defined, one can theme things with CSS 🤩 |
Beta Was this translation helpful? Give feedback.
-
The wxQT backend is somewhat minimal currently - and if I recall only one main group was contributing to it for their own app support. There are many places in it that may end up just not working because parts haven't been implemented (one major place that hasn't been implemented is the OpenGL support and |
Beta Was this translation helpful? Give feedback.
-
Also, switching to the wxQT backend is a lot more work for packaging on Linux than just switching to QT, since linux distros don't build anything other than the wxGTK backend normally. |
Beta Was this translation helpful? Give feedback.
-
From what I have tested and saw in the code, a lot of stuff already works. Some drawing issues seem to be due to transparency being used, so perhaps the ghosting is fixed by a simple Qt::WA_OpaquePaintEvent in the right places. On a somewhat related topic... |
Beta Was this translation helpful? Give feedback.
-
There's also the much requested "Audacity for mobile" to consider. Does wxQt support Android or iOS yet? The last time I looked, it didn't. |
Beta Was this translation helpful? Give feedback.
-
Desktop widgets make no sense for mobile, and the current design does not fit well into touch input. |
Beta Was this translation helpful? Give feedback.
-
I am really keen for us to move to Qt. That will make so much difference. @falkTX - Could you say more about the issues? Is this looking like a good stepping stone to full Qt? Is there a sharable GitHub link so that we can see what you've done so far? |
Beta Was this translation helpful? Give feedback.
-
I started a clean experimental branch for wxQt over at https://github.com/KXStudio/audacity/compare/master...KXStudio:wxqt |
Beta Was this translation helpful? Give feedback.
-
Maybe that should change and over time get Audacity ready for a full Qt port. |
Beta Was this translation helpful? Give feedback.
-
Felipe, thank you for the suggestions. I have contributed to Audacity since 2014 and been a team member since 2015. I have learned enough wxWidgets for my purposes but have little familiarity with Qt. Rather than gaining that familiarity, what occupies me instead is enlarging the parts of the program that are TOOLKIT-NEUTRAL. It’s the notion of good “model-view” separation. Great parts of the program, like the mathematics or the persistency or the audio engine, should be independent of the choice of toolkit used for drawing widgets. Having achieved that neutrality, and separated large parts of Audacity into libraries, then perhaps we could contemplate multiple Audacity products implementing different user interfaces. A classic desktop Audacity and a concurrently maintained tiny Audacity for phones, perhaps? Much code has accumulated in twenty years that did not observe this neutrality principle very well, but it has been my labor in recent years to correct that with various restructuring transformations. See commit history. My name occurs a few times. wxWidgets and Qt both are old enough projects that they date from a time when the C++ standard library was not well advanced or well implemented everywhere, and so they both reinvented (or preinvented) many wheels for strings, containers, files, threads, etc. In these times, it would be better to use standard C++ for these things where you can, but the reality is that the use of wx equivalents is pervasive in Audacity. However I don’t see this as an obstacle. Linking to the wxBase subset of the non-monolithic build of the wxWidgets libraries, for such utilities, is consistent, I think, with toolkit neutrality. So we can avoid wasting effort on rewrites of the wrong wxWidgets things. (Still we should be restricted in the library layer only to a subset of wxBase, which includes enough for console applications, and that does not exclude event handling such as for timers. It does contain support for a main event loop.) When it comes to putting new Qt skin on the old toolkit neutral guts, what you did may be a shortcut to a change of look-and-feel. But for enabling QML development — I’m not sure that the retargeting to wxQt really helps. I had thought that, barring painful workarounds, a user interface must be all or nothing wxWidgets or Qt because there can be only one main event loop. But do I misunderstand? Is there a way to do hybrid UI programming, transitioning parts of the interface from wxWidgets incrementally, enabled by wxQt? Educate me. |
Beta Was this translation helpful? Give feedback.
-
I don't know enough to see why you prefer QString to std::string (or std::wstring). A glance at Qt 5 documentation for smart pointer classes makes me think the standard pointers are superior (move semantics). For a fun time, study TranslatableString in Audacity, an invention of my own, allowing (1) static type checking that prevents a mixing-up of strings that are meant for users to read with those used for other purposes, and (2) binding of arguments to positions in a formatted string, before doing the substitution, which may depend on the global setting of preferred locale, which may in turn be changed at some time after the construction of the string object. |
Beta Was this translation helpful? Give feedback.
-
So, is this matter being still being pursued or was Muse Group's quest to drive off contributors successful? |
Beta Was this translation helpful? Give feedback.
-
@falkTX could you kindly make your all-dark build available in some way? The current UI in Windows 🙈 |
Beta Was this translation helpful? Give feedback.
-
Does anyone know if Qt backend of wxWidgets became properly useful by now? |
Beta Was this translation helpful? Give feedback.
-
This is more of a question rather than a feature request.
As Musescore is done in Qt and Muse Group is hiring Qt developers, seems the interest is on Qt things.
Audacity is an old codebase, changing the entire toolkit is not a good decision at this point, too much core elements rely on WxWidgets.
If everyone working in the codebase is familiar with the same toolkit (say Qt) it makes the overall process much smoother.
Now with that said, WxWidgets has a WIP Qt backend.
Find more details in https://wiki.wxwidgets.org/WxQt
So I am opening this ticket to bring a discussion around this topic.
I see a few clear benefits from such move:
I am not just opening a ticket to request things, I actually went ahead and spent some hours to try this out.
There are a few places in Audacity where code needs to be adapted, but it is only a few days work maximum.
I was able to hack around in a few places in Audacity code to make everything build and run.
As a bonus, I threw in my own custom color palette and style that I use in Carla.
Here are a few screenshots to show the result:
native file dialog through qt:
Colors can be changed of course, I just like this style in particular. It is a slightly modified Fusion theme from Qt.
Now the main question is... is there interest on this?
WxWidgets Qt backend is still work-in-progress yes, but on the other hand Audacity does not need the entire thing.
Fixing WxWidgets Qt side (and then submitting patches upstream) could be a way forward here.
Looking forward to comments and/or opinions.
Beta Was this translation helpful? Give feedback.
All reactions