Tools to create HTML-Based Windows UI in C++ - c++

I'm looking for suggestions on technologies to design a windows UI that's powered by HTML. I've run across HTMLayout which seems pretty good if not perhaps a bit limited. Are there any other technologies that would provide a good platform for creating an application UI based on HTML?

You could use chromiumembedded. You get the power of Google's Chrome in your application.
Evernote used CEF (Chromium Embedded Framework) when they moved from C# back to C++.
Unlike HTMLayout, CEF has a permissive license, which allows usage in commercial applications without paying royalties. The drawback would be the huge binary size.

Qt has the ability to use CSS to layout ui and some other cool things. MSHTML namespace and COM interfaces allow for some ui styles as well. That's all I know of off the top of my head for C++
Windows 8 when released will provide some sort of API using HTML5 and JavaScript for tile based applications in the start screen.

Related

It is possible to just use QT and WebAssembly (instead of HTML + CSS + JavaScript) to develop a front-end web?

I am a C++ programmer, but for some reason, I have to develop a website by myself(My own commercial project). I don't want to take a lot of time to study JavaScript and something else. It is possible to just use QT and WebAssembly (instead of HTML + CSS + JavaScript) to develop a front-end web?
Yes, it's absolutely possible and I'm currently doing it for a project but you should do it carefully based on the project requirements, running environment and your own backgrounds.
Here are some problems you may encounter:
The output .wasm file may get too large. Generally, it won't be suitable for public domain applications.
In low-end devices, maybe you find it laggy if you don't do enough code level optimizations.
Threads are not officially supported yet (as of Dec. 2019) by major browsers but tech-preview is available. This is not a real big problem as it would be a standard feature soon.
Native virtual keyboard won't work on mobile devices but the work is in progress.
These were my own major problems with Qt for WebAssembly.
Despite this, I find it much more flexible than HTML+CSS. QML is really a nice language for UI development. Creating animated UIs is quite easy and straight-forward.
You can also use many JavaScript libraries in your QML code like Lodash and Moment or any other js library that does not refer or manipulate window DOM.
Yes, it is possible. But you should do not do it if only reason is reject for learning new technologies.
For now (I'am writing this answer when Qt 5.14 is present) Qt for webassembly is deployed as official platform. Unfortunately it is young platform support with a lot of problems and possible future changes. Qt team do really good job so next version will be better. 5.14 is much better than 5.13 in webassembly context but still need fixes.
You should know Qt for webassembly will support only a few Qt modules, excluding widget. Yes, you can only use QML for GUI.
Qt for webassembly was created for the purpose of port one code base in other platform (it it generally Qt develop way, please see Qt for MCU). With other technologies in this stack like QRemoteObject is very interesting technologies. It was not created for websites in normal network. Main Qt for webassembly target are internal network systems and remote control of devices. Pay attention about this.
Unfortunately, not all browser will support webassembly right. Please see Qt for weassembly support notes.
Additional, in Qt you can't find build-in rest-API handle or other standard web technologies to integrate with your existing backed.

UWP front end with a COM backend

I'm a student working on a diy scientific computing engine. I would really like to develop using the UWP XAML UI. Nothing else. I just want to consume the front end from a standard COM DLL. I need access to things like MySQL/Cluster and dynamic loading. I am quite proficient in COM. UWP and windows runtime component sandboxing is counter productive for me. VS2017 is awesome. XAML is awesome. This is not a store app. I just need to wrap basic event calls that wouldn't need to marshal anything more complicated than a string or a float. I can't seem to nail down an appropriate consice approach. Is there an approach that is supported by the relevant community?
With the recently announced XAML Islands at the //Build 2018 Conference, you will be able to create XAML UserControls and host them on your Win32/.NET framework applications (ie: Winforms or WPF). This technology is currently in preview and supports the XAML WebView control, allowing Win32/.NET apps to have a fully HTML5 rendering engine.
For more information take a look at:
https://blogs.windows.com/buildingapps/2018/05/07/modernizing-applications-for-our-multi-sense-multi-device-world/
https://learn.microsoft.com/en-us/windows/uwp/xaml-platform/xaml-host-controls
To address your WPF longevity question, our focus is on improving the UWP platform, but we do realize many companies have application assets in Winforms and WPF, so our goal is to ensure developers can interop with our new technologies. You might want to investigate the .NETCore3 roadmap to learn more.
https://blogs.msdn.microsoft.com/dotnet/2018/05/07/net-core-3-and-support-for-windows-desktop-applications/
Hope this helps,
Adam Braden [MS]

Most lightweight way to host a html/css/js UI?

I'm writing a pure Win32 application in MSVC 2012 using C++. After lots of struggling with trying to theme native win32 (I don't want to use .NET) I wouldn't mind seeing if I can do it much easier by having the application frontend rendered from HTML/CSS (which is easy to theme).
What lightweight libraries are there available for C++ that would let me have a web styled frontend on my desktop application, while seamlessly giving the user the impression that they aren't looking at a webpage?
Maybe something like http://www.terrainformatica.com/htmlayout/ could help you out.

Is QT the right solution for my cross-platform application?

My App is supposed to run on both Mac and PC. It needs to access the local file system and manipulate it. I also need to be able to resize images and create watermarked images as well as thumbnails. It's important for my user interfaces to look as similar as possible on both platforms.
Therefore I've been looking at QT which seems to be really up to date but I'm not very familiar with C++. I noticed that QT has support for the Webkit engine and wonder if my application UI can be written in HTML and be controlled using C++?
has anyone done this before? Any pros and cons are really appreciated.
Use Qt
Qt has a strong user community and easy-to-use documentation. All of the platform-specific code is packaged up into C++ clases (QImage, QFile, etc.).
Don't Use HTML for a Qt GUI
Caveat: If you plan on using an HTML interface I don't know if Qt is really a good solution. The default UI for Qt is XML-based (at design-time! - at run-time it uses the native platform GUI).
I haven't personally used WebKit to implement any user interfaces with Qt and that is not the intended design. Usually you'll invoke WebKit to display an embedded web page or help file.
Use QML for an HTML-Like Interface in Qt
As pointed out by gvd below, if you want to design your interface using HTML-like technology, then you will want to use QML.
Sources:
http://doc.qt.nokia.com/latest/qimage.html
http://doc.qt.nokia.com/latest/qfile.html
http://doc.qt.nokia.com/latest/qtscript.html
Develop C++ Qt application GUI interfaces in HTML+javascript?
http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeintroduction.html

Test automation tool/libraries/framework for C++ GUI desktop windows apps

unfortunatelly I have a GUI desktop application running on Windows and compiled using Borland C++ compiler. I know it's a very old technology, but that's the life. The company I work for have lots of free licences for QTP. But to be honest I don't like this tool and I want to change it with some open source alternative.
I have an experiance with automation Web services using Selenium, and some java swing applets.
I created my tests based on Java/JUnit. I'm wondering if I can create some tests in Java to test my C++ application - that would be great. If that's not possible if I can use any C/C++ libraries to create my own test framework.
That shouldn't be unit tests. I want to create rather a suite of functional tests.
I want to be able to localize objects like buttons, tables, cells, etc., perform action like clicking, changing focus, etc.
In addition I have access to source. But this is rather an old spaghetti code and I don't have much experiance with C++ apps.
What do you suggest?
We use Sikuli and have been quite happy with it. It works outside of the various automation APIs so it handles non-standard UIs very well.
Open Source Tools
White is a .NET based UI automation tool that can automate win32 applications among others types. As long as the controls used in your app expose their content/behaviour using Windows' standard UIAutomation hooks then you should be able to use it to do what you need.
UIAutomation Verify is another CodePlex project that works with the same APIs to automate UIA compliant UIs.
Visual Studio
Finally if you have access to it then Visual Studio 2010 has scripted UI test functionality built in Premium/Ultimate editions - Coded UI Tests. This supports .NET, native and web applications with record/replay and scripting functionality.
Robert, if your company already has licenses of QTP, I suggest you use that. It's the right tool for the job, and there's no sense reinventing the wheel if your company already owns it. It has its warts - my main objections are to the limited IDE and VBScript scripting language - but it did not become the market-leading tool by accident. There are not a lot of open-source options for testing a Windows C++ GUI app. The main commercial options you should consider are HP QTP, IBM Rational Functional Tester and VS2010 Coded UI Tests.
I agree with Robert that QTP is sometimes not the best tool, especially when you want it to wait for the desktop application to finish its processing. QTP commands are not synchronous, meaning that QTP does not wait until the previous command finishes execution before moving to the next call. We had a lot of issues with this. We are now planning to write a c# dll that can do this for QTP and include that in our QTP programs to make QTP to dynamically wait until the Desktop application finishes its processing. Currently, to my knowledge, no such wait functionality is supported by QTP.
Also, coming back to the object recognition issue, We did have a lot of issue with this and took the alternative route of invoking commands using Mnemonics through keystrokes in QTP. As Simon has already mentioned, this could be due to non-exposure of the GUI elements. We did not have much control in this regard and so we did not investigate further on this.