I import the PyQt5 library under blender and I created a command interface.
My problem is that I found myself with two windows (one of blender of course and one of PyQt)
Is there any way to automatically embed (in the script) the PyQt window inside the Blender 3D scene?
Thanks
I don't believe you will get that to work unless you alter blender's source code and build your own version of blender. While you have access to using a range of widgets that blender uses for it's UI, there aren't any ways to incorporate other GUI toolkits into blender's UI.
Blender uses python to define it's user interface and provide access to it's internal data. You can define your own panels, which are collapsible groups of UI widgets, that will be incorporated into blender's UI with the existing panels. You can define operators to perform custom actions, which are then attached to buttons displayed in your custom panels. You can also create addons so that your additions can be enabled every time blender is run.
To get more control over customising the UI appearance you could use the bgl module, I'm not certain if this can be used outside of a 3DView but you could turn a 3DView into your custom drawing area.
Related
I want to create a application in python using wxpython library with multiple windows which will be inter-related to each other using buttons, i.e. we can go from one window to other and again come back to the previous window using buttons just like an app.
There should be one window on the screen at any time if possible. Is this possible using wxpython library. If so then can you suggest me how.
It is really simple. Normally you create one window (usually a frame or a dialog). If you want more windows, you will just create more frames or dialogs.
I'm writing a tool which has a big custom text area widget and a lot of other text input widgets, etc. I'm currently working with adding copy/paste to my tool and got stuck on how to do this on a global level - i.e. I don't want to implement copy/paste locally in every widget that needs it. For Qt standard widgets it just works to use copy/paste with Ctrl+C/Ctrl+V, but of course I have to implement it manually for my custom widgets.
But what about copy/paste actions in the menu bar? Do I have to connect them to every widget that exists in my program, or is there some better built in way to do this? I would prefer if I could just connect the menu actions to some global copy/paste handler that notifies the widget in focus automatically.
There is no generic copy/paste functionality - for custom widgets, you will have to implement everything yourself. The QClipboard class provides access to the system clipboard. Every application has a single clipboard object, which can be accessed via QApplication.clipboard() or qApp.clipboard().
The standard Qt input widgets all define their own copy() and paste() slots that can be connected to menu actions, toolbar buttons, keyboard shortcuts, etc. So your custom widgets should probably define the same interface.
There are classes such as QActionGroup, QButtonGroup, and QSignalMapper that provide support for centralised signal handling, but it is often much simpler to stick with explicit, one-to-one connections.
Just started working with this awesome external but have a couple of questions.
When the control is evoked, is it always the top layer or can I have a background transparent image on top of it so I can frame the control nicely?
Also, my testing seems to read most Barcodes but when it comes down to reading Barcodes on hard drives, the control does not want to decode those.... Too dense of bar code pattern?
I am very impressed thus far with the ease of use of your externals. Makes we want to code more for mobile devices!
an overlaying transparent image is not possible, as far as i know.
but couldnĀ“t you use
command mergZXingControlSetRect pLeft,pTop,pRight,pBottom
to define the rect of that scanner after creation
or
command mergZXingControlCreate pLeft,pTop,pRight,pBottom
to create the scanner control in the specified rect.
Set the rect smaller than the width and the height of the screen.
You could then use an underlying image, which is displayed outside of the scanner rect, to show the frame around scanner control. Did not test it myself, but i would assume that this should work.
Unfortunately the native controls in externals and the ones the engine provides are added as views on top of the LiveCode view. That means you can't intermingle LiveCode controls with them. One thing that some users have done is add a web view with a transparent background and a load a png image. If you create the barcode view first and the web view second then the web view will be on top.
I'd like to simulate navigation and basic functionality using Balsamiq to simulate an iOS app.
I created a series of Balasmiq layouts and I'd like to connect these into an interactive slide show, wherein the individual buttons within each layout connects to a different screen.
Is this possible or do I have to use another tool like Flash?
Balsamiq will allow you to link elements to each other. When you select an object the properties window has a "Link" dropdown and you can link to any other wireframe file in the same directory as the one you are working on. This then puts an arrow next to the control you are working with so that if you Alt+click that arrow you go to the linked form. If you export the entire directory as a PDF you will have a presentation that will work seamlessly with all links being functional.
Here is the tutorial for linking:
Balsamiq linking tutorial
I've a PyQt4 Installed on Python 2.6. I wish to insert actions or widgets into a toolbar in QtDesigner instead of adding them in code, with addAction or addWidget (as simple as adding actions to a menu in design time).
You can add actions by dragging them to your tool bar from the "Action editor" dock window. You cannot add widgets to the tool bar in Qt Designer, I'm afraid you'll have to do this from your code.
You can create your own widget plugins with new or extended functionalities.
Just follow the definition rules from the documentation .
I use a lot of custom widgets inside the Qt Designer.
Once you have figured out, how it works, it becomes a really power full method for your design work flow inside Qt Designer.