Automated functional testing qt apps in windows - qt

I'm trying to create scripts that test if some GUI components exist inside a window (combo boxes, check boxes, the state of check boxes, etc.) The app I want to tests is written in QT and running on Windows 7. Its content is created dynamically.
I've tried with swapy/pywinauto, AutoHotkey and AutoIt. But as they rely on standard Windows API calls they are useless for this (need a solution that involves QT).
Any recommendation will be appreciated.

You can try QtTestLib for integrated solution, or, if you want (and can afford) commercial solutions, I am aware of squish and kdexecutor.

Are you aware that AutoHotKey Windows Spy allows you to see if certain GUI objects exist inside a window. In the example image you see that I held the mouse over a combo box named ComboBox5. Are you trying to test at this level?
The rest can be found here already:Check if a certain button is existing or not using autohotkey

Related

How to change scale of JavaFX applications?

I am trying to use the AsciidocFX editor on a 4K monitor and the user interface is too tiny.
I tried to play around with the settings, but it seems that it is not possible to change the scale of the UI from within the application.
Since AsciidocFX is written using the JavaFX framework, I thought that I could change the settings by modifying the vmoptions of the application, or by passing some flags from the command line. Is this possible?
Which Java version do you use? JavaFX 9 and later should upscale on HiDPI automatically.
Also, you can try to control HiDPI scaling with the next VM parameter:
-Dglass.win.uiScale=125%

Define input type for Windows 10 touch keyboard from a JavaFX application

I have a working JavaFX app running on windows 10.
I would like to use the touch-keyboard in a similar to MSDN user input scope to change the touch keyboard
HOWEVER there is no way to interact with it. All textfieeds open the Default keyboard.
I would like to find the closest to JavaFX as possible solution.
Things I have tries so far:
Tried to use the WM_MESSAGE to trick the OS, see Here. This is a messy workaround that does not work on windows 10.
Encapsulating the WM_MESSAGE or InputScope object in an executable, and calling it from JNI only creates a one-way transition from app to keyboard. it will not suffice.
Using a custom keyboard or the JAvaFX touch keyboard (see here is not a valid solution as these keyboards look a bit messy, and they require some twirking we already know exist.
set-numeric-layout-for-windows-onscreen-keyboard-programmatically not working.
activating-touch-enabled-controls-in-javafx is irrelevant.

using RStudio as an pseudo shiny app

This is a rather general, and curious question.
I am working on a moderately complex shiny app, using custom HTML and Javascript code (with menus and independent dialogs), using shiny as a communication protocol with the base R. Everything looks very nice, until I realised that RStudio itself is a web page (or am I wrong?)
The main reason to design a GUI in a shiny app is it's cross-platform, but it still needs to be opened in a web browser. Conversely, RStudio is also a web page but opens just like any other installed software. To me, it looks like a self-contained web browser with different menus.
Now the question: is it possible to use parts of RStudio in a different "app"?
For example, I would love to separate the code editor and the console from RStudio and use them in conjunction with other HTML and Javascript code to produce a GUI similar to RStudio but with different purposes.
To better explain why: RStudio is fantastic, but it has the one big disadvantage (no flame intended, others think this is a feature) that everything must fit in the same page. In order to make the code editor larger, one needs to shrink other parts of the interface. I would like to make them separate dialogs, creating divs when a menu is selected.
Thanks in advance,
Adrian
engineer from RStudio here. You are correct about RStudio itself being "a web page"; the whole UI is effectively done in HTML. There's even a version of RStudio which already runs in a web browser called RStudio Server.
There are unfortunately no extensibility points to do what you want. RStudio internals are largely anonymized and insulated from external access, which make them difficult to separate, re-use, or connect to other services. Here are a few pointers that may be helpful, however:
As a commenter pointed out, it is now possible to pop out the editor window.
You can make an RStudio Add-in which runs in a separate browser window when invoked. Depending on what you want to do in your separate window, you may be able to accomplish it with an add-in.
If you can't use add-ins, the easiest thing to do is actually to just change RStudio itself. It's an open source project, so you're welcome to hack on it and make improvements in reusability or UI flexibility. We welcome pull requests. :-)

How do I generate documentation screenshots for a Qt application?

Without manual intervention I would like to generate screenshots of a Qt desktop application. The screenshots should be generated when the make documentation make target is being issued. So in the source tree there are no PNG files containing screenshots but instead there are automated instructions of how to produce them.
An advantage of generating the screenshots would be that the documentation would always stay accurate. It would cope with the problem that the visual appearance of Qt widgets might change over time. Another advantage would be that screenshots for different Qt styles could be created. A Qt style is chosen by using
QApplication::setStyle() or by starting the app with the -style command line option.
I guess there are be two approaches of how to achieve my goal.
Record all mouse events and key strokes that are needed to bring the application
into the state where the screenshot is being taken.
Make the Qt application scriptable, and write a script that brings the application into the state where the screenshot is being taken
Is there any third-party software that could automate the first approach?
Should I use QtScript for the second approach? Are there other ways of how to accomplish my goal? Are there any open source Qt applications that generate their documentation screenshots in their build system?

How to make own input method in Qt application?

I would like to make an input method which is used only for Qt desktop application.
It like Chinese(Pinyin) input method in windows. Include script processing, rendering of words.
As it includes rendering of words, it can't be created with Keyboard Layout.
More over, when built-in with application, it can be use cross over other platform.
But, It not like on-screen keyboard.
Thanks for all
The Qt way to implement this is to provide an input method plugin, see general plugin development docs and the input method specific base class.
With this you should be able to implement your own input method. Stuff like script processing and rendering is then up to your own plugin.

Resources