Incomplete display of pyqt5 interface - pyqt5

An interface written in pyqt5 will always show incomplete controls after running from my computer. How can I solve this problem?

Related

Read buttons from joystick with pygame

I'm new to PsychoPy and am testing a few tasks. As a response mechanism I use the buttons on a joystick (logitech G27). I import pygame, and can detect button presses in (the Sternberg example of) PsychoPy, so that's okay. However, after a visual.TextSim command the application hangs and can only be aborted via the windows taskmanager. This occurs only if I have used:
pygame.init() somewhere earlier in the program.
I use windows 7 Pro.
Does anyone know how to solve that ?

Why does OSX/Cocoa dock icon revert to default before going away?

I'm working on wrapping some Cocoa functionality in an Objective-C library that will be called from a cross-platform C library. One of my goals is to provide someone who does development in C on Linux with the ability to deploy to OSX without having to get into XCode, nib files, etc. I want them to be able to compile and link their code on OSX using the command line tools, and end up with a regular resizeable main window with the usual buttons and so on, an application menu and a dock icon that looks and behaves as expected, etc.
I'm working on OSX 10.8.5. I have XCode 5.0 installed. Here's my gcc --version output:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
I've figured out how to present a main window, how to set up the application menu, and various other things, programmatically, without using XCode or any nib or plist, but I've run into a problem with the dock icon.
I set a custom dock icon image by calling:
[NSApp setApplicationIconImage:dockImage];
When the user quits the app, the dock icon image reverts to something else (some kind of default application icon or view), briefly, before going away. How can I prevent that from happening without using XCode to create a nib or a plist?
I've tried setting the activation policy of NSApp to prohibitted in the app delegate's applicationShouldTerminate method, to try to hide the dock icon before this switch back occurs. That didn't help, it does hide the window and the dock icon, but the dock icon still switches back to the default icon, briefly, as part of the process of hiding. I confirmed this by returning NSTerminateLator, and confirming that setting the activation policy to prohibited does cause the dock and the icon to hide even though the app is not terminating, and not setting it leaves it unhidden.
I've tried subclassing NSApplication and overriding the setApplicationIconImage call. I have confirmed that it is being called a second time, by something other than my code (well, or not directly by my code, anyway), just before the program exits. I've tried preventing the second call to it from working by calling the super function the first time, but not the second time, and I've confirmed that code in that function can prevent my code from changing the application icon, but that didn't fix the problem. It still happens anyway, somehow.
I've also tried removing the application badge, like this:
[[window dockTile] setShowsApplicationBadge: NO];
just in case it was something to do with that, but that didn't work. The docs say that app badges are no longer relevant as of 10.6, but I was grasping at straws.
Being stumped on the programmatic front, I'm now trying to find out how to package an .app from scratch,without using XCode, and see if maybe I can create a plist from scratch that has a reference to application image in it. But a programmatic solution would be preferable, as I'd really like to minimize what goes into the OSX-specific packaging of a deployment.
Another possibility might be to use XCode once, to produce a very generic, bare-bones .app that my deployment scripts copy and alter.
Please don't shoot my question down as being "too broad" or "not constructive" or something like that. I realize I'm reinventing wheels that already exist in various forms, but there's no law against trying to build a better mouse trap, or just a different or even a worse one, for that matter. I realize I'm trying to fix a problem that a lot of people would consider inconsequential, but XCode-produced apps don't have this problem, and I really don't want the tools I'm creating to produce any user-visible artifacts like that. I'm not intending to diss Apple's tool chain or invite debate about whether or not what I'm pursuing should be pursued. I have a specific, technical problem that I'm looking for solution to that is within the constraints of my goals.

PythonXY, IPython Qt Console, matplotlib, draw something not in inline mode

I'm new to PythonXY and Matplotlib. I installed PythonXY (v2.7.3.1) in default full mode.
I use the "IPython Qt Console" application.
I draw something using matplotlib.pyplot (imported as plt).
For example. When plt.plot([1,3,2,4]), the figure display in the same IPython console immediately.
If this, I cannot add some other properties, plt.title, plt.xlabel, plt.ylabel, or more. Why? And how can I draw figures in another window, adding more properties, and making the figure not display until plt.show()?
If you select from the Interactive Consoles dropdown on the Python(x,y) Home launcher, "IPython (Qt)" and then click either the Console 2 or cmd.exe button, it should then run IPython (Qt) with the Qt4Agg backend which will allow you to plot in a separate window and apply titles and so on. For more info see What is a backend.
What Python(x,y) in your example above is doing is launching IPython with the pylab inline backend which is different from the standard backends so your commands aren't having any affect, similar behaviour is noted in this issue on github. It doesn't seem possible to change the backend once IPython has been launched with inline. I'm not sure where the Python(x,y) options are set or which script is called to launch the item in the Applications dropdown.
Worth taking a look at Anaconda as a free Python distribution with a scientific focus and regular updates. Anaconda doesn't by default load pylab into IPython so you can choose the backend after launching IPython.
In the IPython command-line interface, the figure is shown and updated at each plot function.
With the inline option, Matplotlib generates an image that automatically inserted in the output line.

UI Designer not in Solution Explorer and unable to get the tool

First of all, I am developing an application in VB.NET, till yesterday it was all good. I saved the project and closed it, now when i started working on that application, i found that there was no way to open the UI area for the application. I am able to see the code behind it i.e. on dashboard.Designer.vb but not the UI. I am able to see the the application after running it using F5. What would be the possible reason for it, and how i can solve it.
Secondly, i tried to find search a lot for this tool but unable to get any, if somebody can tell me what tool is this or any similar tool, it would be of great help.
I was searching for long and found the answer:-
What we need to do is just add the following code in the blank dashboard.vb file
Public Class dashboard
End Class
And this will get the form back.
The second question was answered by #Code Gray
1. Outlook like sidebar and display in Outlook
2. Outlook navigation bar control for .NET application

The type 'Microsoft.CompactFramework.Design.UnsafeControl' has no property named

I get this error when opening the design view of a form that has a Honeywell DecodeControl on it (for a Honeywell barcode scanner - Dolphin 6100 if anyone is interested).
I've googled this to death and done the following:
added an XMTA file with this in it:
<?xml version="1.0" encoding="utf-16"?>
<Classes xmlns="http://schemas.microsoft.com/VisualStudio/2004/03/SmartDevices/XMTA.xsd">
<Class Name="Honeywell.DataCollection.WinCE.Decoding.DecodeControl">
<Description></Description>
<DesktopCompatible>true</DesktopCompatible>
<DesignTimeVisible>true</DesignTimeVisible>
</Class>
</Classes>
Set said XMTA's Build Action to 'none'
Ignoring the first error still gives me an 'Object reference not set to an instance of an object'.
This didn't help at all.
After some lengthy googling, this appears to be to do with controls that are device-specific, and this error is supposedly to stop anything that might cause instability in the designer...except that this control has been working quite happily in the designer all day at work, then when I get home it throws this at me. Nothing has changed - same dev machine, same device, same project, same code as when I last saved it at work.
I'm not even trying to debug the device on the desktop or an emulator - I have the device plumbed in via USB cradle.
Literally the only thing that's changed is that the dev machine is connected to my home network by wireless instead of the CAT5 to work's network. And I can't see that being even remotely related to this.
On a more related note, the control in question never showed up in the toolbox after I did Choose Items -> check the control. Not sure if this is related.
Can anyone shed any light?
I can post the designer code if necessary.
Thanks
Turns out I was targeting the wrong framework for the device - VS decided of it's own volition that I needed to target 3.5 instead of 2.0. Switched it back and all is well.
I ran into this error but it was caused by my playing around with the MessageBeep API in a form. Even though this form was not related in any way to my user controls or components, just having that reference to the Interop namespace in a form corrupted every control in my application and made it impossible to view them in the designer.
The moral of the story is DON'T USE Interop IN CE (PInvoke).
That was scary. Just a heads up for any other unfortunate soul trying to make a Beep sound.
I've the same problem in VS2102 with WEC2013.
And without P/Invoke but with a custom control, entirely managed .net code.
The problem is the Enum properties of my custom control.
And NO solution yet.