QT5 Application Screen not refreshing after resolution change through Linux framebuffer - qt

Having issue at runtime after changing framebuffer resolution,
I have Qt 5.14.2 running on top of linuxfb platform plugin. My QApplication come up in 1024X768 resolution, then change to 1280x1024 resolution using ioctl call to fbdev.
The resolution changed and I can confirm looking at fbset output. The problem I am seeing is that after changing the resolution to 1280x1024 Qt still reports it as 1024X768.
Using code I could resolved that issue and after Qt reported correct resolution also.
QWindowSystemInterface::handleScreenGeometryChange(qApp->screens().first(),
QRect(0,0,xNewWidth,yNewHeight), QRect(0,0,cur_xres,cur_yres));
QWindowSystemInterface::setSynchronousWindowSystemEvents(true);
// Print out resolution from Qt
QRect res = QApplication::desktop()->screenGeometry();
qDebug << "QApplication resolution is now "<< res.width() << "x"<< res.height();
But still screen striding have seen as you can see below screenshot,
here
In QT4 code here was handling screen refreshment after framebuffer resolution changes, it was working fine. however in QT5 QWSServer is gone, QPA abstraction layer introduced.
Application works normal after restarting Qt Application.
Done anyone know how to force Qt to refresh/recheck/update the resolution it is reporting ? or what might be missing from Linuxfb plugin to notify Qt that something has changed under the hood?

Related

To switch between two video files in Qt or opencv python -seamlessly

Currently i'm using opencv (have an option to use QT as well) to play a video file (player) in full screen mode. My requirement is when i'm playing videofile-1 there could a request to play video file-2 and i need to switch to video file-2 seamlessly. Is it possible to do this in opencv or QT ? I know we can do this using RTSP or HTTP streaming.
OpenCV uses cv2.VideoCapture() to read from videofile and cv2.imshow() to project image/video to display. What are you doing between those you it is your choice, so answering your question I guess it's possible.

Increase font size on target board using Qt for Embedded Linux

I'm developing with Qt for Embedded Linux and Qt 4.7.1 on Linux and I'm cross compiling for an ARM board with Digi som. On the Qt application that runs on the ARM board using Digi ESP for embedded Linux, I need some QLabels with large fonts (I set to 48pt on the QtDesigner).
However when I load the executable on the ARM board those fonts are not as large as I see them on the QtDesigner interface (and on my Linux PC), and even if I set a bigger font size, when I run the application on the board, the fonts have always the same size (as if it were reached a maximum font size or as if the font does not support that size).
I have tried everything from makeqpf (which does not compile) to build qt with freetype but nothing seems to work.
I set an environment variable called QWS_DISPLAY with it's dimensions on the target and that solved the problem. Thank you for the hint user12345

Cannot open Qt windows in other screens than primary with Qt5 on Ubuntu Linux

I'm porting a Qt 4.8.x program to Qt 5.3. It works fine under Qt 4.8 when my Ubuntu 12.04 X11 server is running Xinerama mode with Nvidia hardware.
I previously used QtDesktopWidget to retrieve multiple screens and their geometry (I have five connected displays). Under Qt 5.3 in Xinerama mode, QDesktopWidget::screenCount() only returns 1 screen, which is the union of all five. Under Qt 4.8, it would properly return the 5 screens with their correct geometry.
I next tried running my X server with Xinerama disabled with Qt 5.3. Now, I can correctly get the right screenCount with QDesktopWidget and QApplication:screens() returns a proper list of Screen * I can access.
However, whenever I try to open a window in one of these screens, using QWindow::setScreen, the window always opens up in the primary screen, no matter which screen I set in the constructor of QWindow or using QWindow::setScreen.
When I try open my Qt application in the other screen using X11 arguments like:
myapp --display :0.2, this works fine.
However, I need to do this programmatically as I have different content for each display.
Has anyone succeed in opening windows in other screens with Qt5 either with or without Xinerama mode turned on? I would prefer not to use Xinerama at QDesktopWidget seems to be built on libxcb only.
Regards,
Victor

USB mouse hotplugging in DirectFB/QT Embedded

Is there any way to achieve hot-plugging of USB mouse in DirectFB 1.2.9 or Qt Embedded 4.7.3?
Currently my application stack is thus..
-----------------
GUI
-----------------
Qt Embedded 4.7.3
-----------------
DirectFB 1.2.9
-----------------
/dev/input/eventX
-----------------
DirectFB opens the Linux input device node. Qt uses a QSocketNotifier to wait on the DirectFB event buffer and sets up a slot to read the mouse data. But on hot-plugging, DirectFB does not open the device node and no mouse events are generated.
As far as I understand so far, hot-plugging is not supported by DirectFb..
I tried disabling DirectFB's handling of the Linux input device (removing the dev node from linux-input-devices= option in directfbrc), and set QWS_MOUSE_PROTO="linuxinput:.." but this did not work for some reason. Seems no mouse events were generated. Even if I manage to get it to work, I don't think QT provides any support for hot-plugging either.
So is my only alternative to sub-class QMouseDriverPlugin and QWSMouseHandle classes?. For this, I am yet to figure out how to make QT use the sub-classes I implement. i.e, Once I implement these classes how do I link them into the QT input device handling frame-work, so that I can set something like QWS_MOUSE_PROTO="mylinuxinput:.."?
As far as I can remember, I encountered no issue with mouse or keyboard hotplugging in Qt Embedded 4.7.2 (without DirectFB). If you want to subclass yourself, modify the plugin starting from the linuxinput plugin. You'll find that in Qt sources: this is the directory where the plugins are placed, but some classes are included in other directories.
Also, are you getting data in your linux device after pluggin in? Did you try to cat the device?

Qt exposes a QWidget's handle with getDC - how do I get a QWidget's handle on the Mac?

I can make native win32 calls (GetPixel/SetPixel) on a QWidget by using QWidget::getDC .. How do I do this for Mac builds?
Using QImage/QPixmap for retrieving pixel information is not an option because I need very fast access to what's already been drawn onto a QWidget via QPainter on both Windows and Mac.
The reason I am using GetPixel on windows is to implement 2d mouse picking.
I am not sure what you are trying to do but if you want the underlying window system handle/ID, you can use QWidget::winId() which returns HIViewRef or NSView on Mac depending on if it's Carbon or Cocoa version of Qt library.

Resources