Qt OSX Incorrect Mouse Behavior - macos

My application uses OpenCV, OpenGL, and Qt to display a webcam feed. It works perfectly on Ubuntu (clicking buttons works properly), but on OSX there seems to be a UI problem. The window displays, but I can't click and I quickly just get the loading spinning pinwheel and it doesn't stop until I force quit the application. Has anyone come across this problem before?

I solved this by adding a timer to the initialization of my gui widget:
m_timer = new QTimer();
connect(m_timer, SIGNAL(timeout()), this, SLOT(gotNewImage()));
m_timer->start(1);
where gotNewImage() is the function I call to grab a new image.

Related

SwiftUI - makes mac unuseable

So not sure if this is just an issue I am having but, has anyone else noticed that the preview seems to slow down you mac? I am now wanting to turn that feature off because I feel its just useless. I have my device connected to the computer and personally I can run it on there.
I am wondering has anyone else had this issue.
Also preview seems to not show images that are using https://github.com/crelies/RemoteImage
So I am basically at a loss.
How do I disable the swiftUI preview.
Click Adjust Editor Option tabbar button and un-check Canvas

Metal app on macOS lags when for example using the menu

I'm playing around with Metal and MetalKit on macOS. It works fine for the most part, but in everything I've built so far the rendering will lag for a brief moment when I do things in the menu bar or hover my mouse over the dock. It's kind of annoying.
The easiest way to reproduce this effect is by trying Apple's own 'Device Selection and Fallback for Graphics Rendering' Sample. I've observed the issue on macOS 10.13 and 10.14.
Does anyone have an idea how to fix this issue?
Core Animation won't lag like that, but it's not suitable for what I would like to do. I believe it's built on top of Metal these days though, making me believe that it should be possible to get rid of the lag.

On MacOS with Qt5.3.1 QToolBar is black when attached

I have a QMainWindow Application that uses several QToolBars. My program works on Linux, Windows and MacOS, however on MacOs the QToolbar behaves a little bit funky. When attached to the MainWindow it is just black as shown here
When I detach it it is grey as you would expect it to be
Also when I maximize to program the toolbar creates artifacts like this
Do I need any MacOS specific things for the QToolBar?
I'm hitting this bug too. I think it is linked to using non-alien widgets inside the toolbar or app wide.
Are you using setAttribute(Qt::AA_NativeWindows);? If so, try removing it.
Would you happen to have a QGLWidget-based UI element in your application? If so, apparently this is a known issue.
https://bugreports.qt.io/browse/QTBUG-41679
I am experiencing the "double-vision" aspect of this on a Qt 5.7.0-based app.

keyboard splitting hangs in opengl app

I have OpenGL application with UITextField in the main menu. When I tap on the text field the keyboard appears and I can edit the text. But if I running under iOS 5 and if I try to split keyboard then the keyboard starts splitting (I mean animation) and then hangs when I release my fingers. I mean it hangs on half splitting - and does not responds more. But my app is still alive - and render is working well - background animation is still working.
I have just made a simple test - have disabled the render at all. And the problem has gone. So the problem is related to OpenGL.
I use OpenGL ES 1.1,
XCode 4.2 and iOS SDK 5.0.
Do somebody have similar problems? Any suggestions?
Please help.
UPDATE:
I have just tested two more games from AppStore - and in one I have found this problem too!
'Roads of Rome HD free' - iPad game.
I've encountered this problem too, but I was able to fix it due to previous experiences. In one application we found that if we keep our GL view active while playing video, the video playback position slider didn't behave smoothly. The same seems to happen with the keyboard split. If your problem is the same as mine, the issue is related to the keyboard split animation not finishing (and, in our case, the point where remained struck varied with each test)
We solved the issue stopping the animation on your GL view (I bet it's called EAGLView) when receiving a UIKeyboardWillChangeFrame notification and starting it again after UIKeyboardDidChangeFrame.
Old post, but I just came across this problem in ios 8 on an iPad3.
Running an OpenGL app at 60fps seems to throttle the keyboard update. Reducing your FPS while the keyboard overlay is active will fix the issue.
I'm using GLKViewController to manage the update and Draw callbacks with a 60fps refresh, but that was causing the keyboard split to lock up half completed.
I found the best solution for me was to set the view's preferredFramesPerSecond to 20 while receiving text input, and then set back to 60 after the textView is closed. As well as fixing the keyboard hang, it also just makes the keyboard generally more responsive.
myViewController.preferredFramesPerSecond = 20;

Animate Windows Wallpaper with QT

i want to make an animated wallpaper for windows. So far i have only expreience with Mac OS X programming and i'm new to windows. So i decided to work with QT because it seems that there is more help out there.
Until now i have created the app in a borderless window in qt. It work quiet fine.
But is there a way in QT to change the level of the window so that its appear above the windows wallpaper but behind the icons?
EDIT:
Ok if found a simple solution.
After some testing with the hints form kusg1 I figured out when there is a transparent window mouse events going still to the desktop.
I actualy want have this website has wallpaper: Ticketack. - So i created a frameless window which stays on bottom and has a transparent background and displays the text. Beside this i can change the windows wallpaper directly to get the background of the clock.
So clock text is not behind the icons but i think this will be ok.
Just some ideas: Use the windows flag as Qt::Window | Qt::FramelessWindowHint + Windows Stay at bottom hint, and set the content of the widget with your animated content (the suitable candidate is to use QGraphicsView).
The widget needs two main tasks:
Upon launching, it grabs the desktop background as pixmap and do overlay with the animated content (this needs to have the desktop to be wallpaper-less for simple scenario).
The widget needs to capture mouse and focus event and channel back to actual window command if the user wants to click the icon on the desktop.
Update:
Some pointers for the implementation:
For managing desktop icon, there is a good article here! (also found from SO).
Qt example and demos has an example on the taking desktop snapshot, the snippet is: QPixmap::grabWindow(QApplication::desktop()->winId());
Answer to your question: no, there isn't.
However, you can try something like this using Windows API: How to draw directly on the Windows desktop, C#?

Resources