OpenCv ImShow() function flashing/flickering - xcode

After running a mac port self update and installing gnomeui library on osx 10.7, I compiled
OpenCV program with Xcode and the ImShow() function created a window that behaves unexpectedly with flashing and flickering.
In the application output message of Xcode the following is displayed:
opengl support available.
Does somebody know where could be the problem?
Do I need to recompile OpenCV with OpenGL?
Is there anything else I can try to rectify this?
Edit:
i attached a screenshot of the windows Xcode generates, normally this kind of UiWindow with the buttons toolbar is generated by QtCreator. I start thinking the problem derives from Qt being updated consequently to mac port self update.

Probably you don't use waitKey after calling imShow, then the window is created and quickly destroyed. If that's the case simply call waitKey after imShow, then the window is created and waits until you press a key then the window is destroyed.

Related

Swift UI Canvas not showing with macOS 10.15 and Xcode 11.1

Canvas does not appear in my 2-year old project even though I recently upgraded to macOS 10.15 (19A547) and Xcode 11.1 (15405). I have selected Editor menu/Canvas to show it. Simulator works fine, and building a new project shows Canvas working properly. Must I enable/select/configure other parts of my project?
Read before looking at image
Canvas is actually for SwiftUI, Also you can use the benefits of it by porting your UIKit elements into the SwiftUI preview. But sometimes for some un/known reason, canvas can not reload the view in time and it's not working.
For example:
When you work on a catalyst project and select mac as a target.
When you use a custom run script that cause a change on the xcworkspace during the build process (like auto build number increment script or etc.)
When you have a long task that triggers the watch dog event. (like recursion or massive loop)
Syntax error
Complex swift code
etc.
These are just a few of them that I faced and conformed. For more information about the issue, most of the time the canvas itself reports the issue and you can read about it with clicking on Diagnostics button above the canvas window:
But some times you can't even see this pan. Sometimes disable and enable the canvas works for that situation and sometimes restarting Xcode (or even mac) works, but some times not!
Hope it helps you save some time.

Mac OS Siera PyQt5 QTabWidget Issue

I usually program on windows (at work) or linux (free time).
Now im doing a project for my wife, and she uses a mac.
In this project there is a QTabWidget with closeable tabs.
On windows the close icon appears properly, and as excepted, however on MAC there is no close icon.
When you click far left on the tab title it just closes unexpectedly, because you cant see a close icon, and im not 100% sure why that is.
Anyone seen this before and know of a fix?
Mac is latest Siera os (just updated)
Python 3
PyQt5 (installed with pip3)
Thanks very much in advance
This is caused by a bug which has been fixed in Qt-5.9.2 (see QTBUG-61092).
In the meantime, it should be possible to work around the issue by setting your own icon using a stylesheet. To do this, you would need to use the QTabBar::close-button selector, which is documented in the Qt Style Sheets Reference.

Xcode 7.1.1 Crashing When Changing Attributes in Interface Builder

I am using Xcode 7.1.1 on OS 10.11.1. When I make changes to fonts, background colors, etc. in interface builder it crashes. I can make one change then when I make another one it will crash so I've been having to save after each change then open the project again after the crash and make another change then repeat the process. Does anyone know of a fix or workaround for this?

NSPopover sample code does not detach window

I have not been able to get my NSPopover to detach to a window in my own projects, so to simplify I tried the Apple sample.
I downloaded a fresh copy of the Apple sample project: http://developer.apple.com/library/mac/samplecode/Popover/Introduction/Intro.html
It behaves the same, which is to say I can't drag the window to detach it either.
The project seems to provide all the correct windows and controllers and implements the detachableWindowForPopover: delegate method. However the method is never called.
Does anyone know the secret to detachable NSPopovers?
Found the answer while typing the question…
Mac OS X 10.10 Yosemite has a new delegate method:
(BOOL)popoverShouldDetach:(NSPopover *)popover
The default behavior on Yosemite is NO (should not detach). So delegates must implement this method in order for windows to be detachable. The sample project does not implement this method, so when compiled on Yosemite it will not detach (and also produces several deprecation warnings -- maybe I should have taken that hint that it needs an update).
Adding:
- (BOOL)popoverShouldDetach:(NSPopover *)popover {
return YES;
}
To MyWindowController.m fixes the problem.

Xcode screensaver with openGL

I am currently simply trying to build a simple screen saver in xcode 3.2 on osx 10.6.3 using an openGL view as described in this article: http://cocoadevcentral.com/articles/000089.php anyways even if I use the exact same code from the example all I see when testing the screen saver is a black screen. I looked in OSX Console if it tells me anything useful. the only thing I get is something like this:
[0x0-0x1e01e].com.apple.systempreferences[629] System
Preferences(629,0x7fff71071be0)
malloc: reference count underflow for
0x20057be80, break on
auto_refcount_underflow_error to
debug. System Preferences[629] invalid
context
I have no idea what is wrong, so I would be glad if someone could tell me how to use openGL together with the screensaver template in xCode 3.2. Also, is there a way to make another target so I can preview the screensaver from within xCode?
Thanks!
The example on Cocoa Dev Central works just fine. The same error comes up for me, but as far as I can tell, that is not the reason why you're getting a black screen.
I had a similar problem because I wasn't correctly reinstalling the screen saver.
Make sure you quit System Preferences before reinstalling the screen saver. If you don't, the old screen saver will still be used, even when it asks you about overwriting it.

Resources