How to change scale of JavaFX applications? - javafx

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%

Related

Recommended way for using GStreamer with Qt and QML?

Because of display up to 4 UDP/RTP streams in different modes (single / dual / quad) I first decided to use GStreamer. It works but it is not easy to handle and I can not switch between viewing modes during runtime. To solve that issue I want to use Qt (5.12.4) with QML.
I read a lot about the integration of GStreamer in Qt (QGStreamer, QMediaPlayer), different GStreamer plugins (qmlglsink) and so on. At the end of the day I always end by the QMediaPlayer which integrates since Qt 5.12.x a gst-pipeline element.
I realized a Qt-QML application that show 4 UDP/RTP streams as a kind of preview and when I choose one of this previews it changes to full screen mode. A further tap on the full screen image changes back to preview mode.
BUT the performance is not really satisfied. Either one ore two previews are frozen and when I tap them the full screen is working or the preview is running and the full screen is frozen.
This leads me to the questions:
Is there a performance issue with my embedded device? -> I will check that soon. I can exclude a bandwith problem because only GStreamer works.
Is MediaPlayer with gst-pipeline the right way?
Are there other solutions with more performance using Qt with QML?
Thanks.

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.

How does qt paint its widgets without using native code?

I heard that qt(older versions, at least) do not use windows native API to draw its widgets. I want to know how is this possible ? how does it draw without calling functions from the native API ? is there a way through which creation of non-native widgets is possible ?if yes, then what is it?
I don't know where you heard that, but all drawing operations will at some point need to make platform API calls. Drawing anything on the screen would otherwise be impossible.
Unless by "painting" you mean the way Qt creates the image data for the widgets prior to drawing them on the screen. In that case, yes, Qt rasterizes on its own. It still gets some image data from the native API though, otherwise it wouldn't be able to produce widgets of the currently set theme.

Automated functional testing qt apps in windows

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

Qt+OpenGl+SimpleGl

I have enabled qt+OpenGl+SimpleGl on one of the ARM platform and was able to run opengl example programs.
I also has a qt+Webkit, which is working with a graphic plugin.
I wanted to use simpleGl context for every thing, instead of using the normal graphic screen. So, when I try to run Qt+Webkit with simpleGl, I just get a blank screen.
Does QT support this? If so how can we make it?
Yes, this is correct. OpenGL draws directly to the framebuffer. The simplegl driver doesn't handle what is drawn using the raster paint engine of the QWS, so you may see only black.
Using simplegl for "everything" means you want everything to be drawn using OpenGL in your EGL full-screen window? This is possible under some assumptions. You have to write all your applications to be rendered using the Qt OpenGL paint engine (using the opengl graphics system is not supported under Qt/E). This is possible also for QtWebKit, I'm doing it now. Note that this does not mean that everything is rendered using hardware acceleration. You'll have to write your applications "the right way" to get all actually hardware accelerated. Consider that you'll have to handle the mouse pointer some other way in this case.
The other way is to just modify the simplegl driver to allow for the use of Qt applications using the raster paint engine. This is possible as well with some limitations. Qt can use blit to place its own windows over OpenGL. Look for the framebuffer driver inside the Qt source tree to know how to do this. You can then have common Qt applications and OpenGL Qt applications some way. I'm doing this as well. Not everything can be done anyway.
EDIT: I'm sure you already did, but in case, give this http://doc.qt.io/qt-4.8/qt-embeddedlinux-opengl.html much attention.
Unfortunately I don't know anything about SimpleGL, but I do know that there is a way to render a standard Qt widget in a QGLWidget. Maybe have a look at this Qt Quarterly which I think is somewhat related to your question:
http://doc.qt.nokia.com/qq/qq26-openglcanvas.html

Resources