ismsraka.blogg.se

Anaconda qt designer mac
Anaconda qt designer mac










You will be presented with a dialog to specify the custom widget class the placeholder widget will become. Promoting a QWidget indicates that it should be replaced with the specified subclass, in our case the PyQtGraph plot widget.Ī promoted widget can be reverted back to its base class by right-clicking and choosing Demote to from the widget's context menu. Right click on the widget and select Promote to from the widget's context menu. This is just a tag to reference the element in code.Īdd a widget to the window. Give the widget a name, "graphWidget" will do. Select the Widget from the left sidebar and place it in the centre of your window. As there is no suitable baseclass for the PyQtGraph plot widget, we'll use the basic QWidget as our placeholder. We next need to add the placeholder widget. Qt Creator - Select MainWindow for widget type

anaconda qt designer mac

First open Qt Designer and create a new QMainWindow as normal. We will be using Qt Designer to create a simple UI design, and adding a placeholder for our PyQtGraph widget.

anaconda qt designer mac

Anaconda qt designer mac install#

If you don't have PyQtGraph installed already, you can install it using: In this tutorial I'll walk you through the process of using these custom widgets in your apps. Whether you're using PyQtGraph or maplotlib for your plotting needs, the plot canvas widgets are not available from within Qt Designer. PyQtGraph is an popular alternative which uses Qt's native QGraphicsScene to provide fast zooming, scaling, drag-drop behaviour that feels a natural part of your application. There are a number of plotting libraries available in Python, with matplotlib being the most popular and offering some basic support for PyQt5. For all of these being able to add plots to your UI is very useful - and being able to do this from Qt Designer even more so. PyQtGraphĭata science is one of the post popular uses of Python, and building dashboards and analysis tools is a common use case of PyQt5. If you don't have an obvious base class to use, then you can use QWidget, the common base class of all Qt widgets. This gives you access to the base class properties, events and actions from within Qt Designer. For example, if you have a custom MyAwesomeButton button widget subclassed from QPushButton use QPushButton as the placeholder and promote it to MyAwesomeButton. If the custom widget you are adding is a subclass of an existing Qt widget, you may want to use the base class as your placeholder to promote from. In Qt this final step is referred to as promoting (as in promoting a base class).

anaconda qt designer mac anaconda qt designer mac

Tell Qt to replace your placeholder with your actual widget when building the UI.Add a placeholder widget to represent the custom widget you're adding.The principle of using placeholders in Qt Designer is quite straightforward. This tutorial will walk you through the process of using placeholders to include a PyQtGraph plot in your app from within Qt Designer. Helpfully, Qt Designer supports a mechanism for using placeholder widgets to represent your custom or external widgets in your design. As your applications get more complex however you may find yourself creating custom widgets, or using PyQt5 libraries such as PyQtGraph, who's widgets are not available within Designer. Qt Designer is a great tool for designing PyQt5 GUIs, allowing you to use the entire range of Qt5 widgets and layouts to construct your apps.










Anaconda qt designer mac