qt-designer

How can I add item data to QComboBox from Qt Designer/.ui file

女生的网名这么多〃 提交于 2019-12-08 19:12:04
问题 I'm using Qt Designer (well, Qt Creator actually, but specifically the part derived from Qt Designer), and I've added a few QComboBox items to a dialog with a constant list of items. I need to map the items in the combo box to strings (which are distinct from the displayed strings). The best idea I've come up for it is to use the QComboBox::itemData function to get the needed string from the selected item, but I'm having trouble adding the associated strings to the items. I've looked all over

what is “Process finished with exit code 1” mean?

*爱你&永不变心* 提交于 2019-12-08 18:08:07
问题 I am beginner in Python. I tried to develop simple currency program but i have problem. can someone helps me ? When i click "Çevir" , program should calculate money(like exchange). But i cant do it. PyCharm write "Process finished with exit code 1" when i click "Çevir" from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import qApp class Ui_MainWindow(object): def setupUi(self, MainWindow): ....(qtdesigner codes . i skip this part) self.pushButton

Changing Pixmap image automatically at runtime in PyQt

僤鯓⒐⒋嵵緔 提交于 2019-12-08 06:33:00
问题 I wish to change the image of a pixmap being displayed in a window automatically using a while loop that has a defined delay and uses locations of images stored in a string list. All possibilities I tried led to the first image being displayed but not changing at runtime. Any changes gets reflected only after the program has completed all kinds of execution. from PyQt4 import QtCore, QtGui import time import sys try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s):

Custom QWidgets. How do I build/get the pyqt5 plugin for Qt Designer on Mac?

无人久伴 提交于 2019-12-08 05:08:18
问题 I want to be able to create my own custom widgets in Qt Designer using the pyqt5 plugin on my Mac! On my windows system this is easy. I have/install pyqt5-tools, this contains pyqt5.dll and I copy this into the Qt Designers plugin directory (these packages were all installed via winPython). I set PYQTDESIGNERPATH=. In my current directory I have ledplugin.py and ledwidget.py I start Qt Designer and I have my custom widget to drag and drop ( this tutorial was taken from https://www.ics.com

Qt: How to remove the default main toolbar from the mainwindow?

寵の児 提交于 2019-12-08 00:55:36
问题 I am new to Qt, and I can't figure out why there is a draggable object in my main window. It starts at the top of the screen in its exapanded form. And then I can drag it and it shrinks into a square. 回答1: You need to remove the main toolbar from either QtDesigner as can be seen below or from the code manually: Then, you will need to rerun qmake for the changes to take effect as the ui_mainwindow.h header file needs to be regenerated from the updated mainwindow.ui description file. 来源: https:

How do I add matplotlib plugin to Qt5.4 Designer plugins?

僤鯓⒐⒋嵵緔 提交于 2019-12-07 18:01:28
For a project I have to combine matplotlib with a pyqt5-gui designed with the Qt5.4 Designer . The tutorial for adding PyQtdesignerplugins version 1.1 doesn't work. Install was correctly build with pip3 and the export of the env-variable s were written to the bashrc as followed by a re-log-in. In Tools of Qt Creator 3.3.2 based on Qt5.4.1 built on March, 4th, 2015, I found under "form Editor" -> "About Qt Designer Plugins" . Next I get a dialog which just informs me what plugins were found. I can refresh it, but that didn't change anything. Since the PyQtdesginerplugins which are installable

Accessing GUI elements from outside GUI class in PyQt

ⅰ亾dé卋堺 提交于 2019-12-07 13:35:48
问题 Note : I've already read this post and I didn't understand it unfortunately. I've got a directory settings somewhat like this : Main_Folder |_ Base_Gui_File.py |_ Child_directory (a directory inside Main_Folder) |_ __init__.py |_ some_other.py I've got all the GUI code in the Base_Gui_File.py file, which was generated from designer (PyQt4). There's a Text Input Field QLineEdit , a Push Button QPushButton and a Text Area QTextBrowser . By default QTextBrowser is hidden. But, what I wanted to

Qt GUI doesnt change after compilation

僤鯓⒐⒋嵵緔 提交于 2019-12-06 23:24:09
问题 I created a GUI using the Qt Designer compiled and run. Then I made a few changes in the GUI and recompiled again but the GUI remained the same. Even if I delete the widgets and recompile they appear... I tried Clean All and Clean Project but no success... What might be the problem? 回答1: You can recompile your UI with the following command. It worked for me. uic mainwindow.ui>ui_mainwindow.h 回答2: I know this is an old thread, but I guess it is still active. One reason for this buggy behavior

Custom QWidgets. How do I build/get the pyqt5 plugin for Qt Designer on Mac?

会有一股神秘感。 提交于 2019-12-06 22:09:33
I want to be able to create my own custom widgets in Qt Designer using the pyqt5 plugin on my Mac! On my windows system this is easy. I have/install pyqt5-tools, this contains pyqt5.dll and I copy this into the Qt Designers plugin directory (these packages were all installed via winPython). I set PYQTDESIGNERPATH=. In my current directory I have ledplugin.py and ledwidget.py I start Qt Designer and I have my custom widget to drag and drop ( this tutorial was taken from https://www.ics.com/blog/integrating-python-based-custom-widget-qt-designer ) On my Mac, I can't figure out what the

pyqtgraph.opengl VS OpenGL.GL - how to display axis at PyQt5 OpenGL embedded widget

纵饮孤独 提交于 2019-12-06 20:39:29
How to interact with PyQt5.QtWidgets openGLWidget using pyqtgraph.opengl instead of OpenGL.GL ? I need to make a next graphical output to openGLWidget on the PyQt5 form: def plot_line(line): pl_line = np.array(line) color = (0.0, 0.0, 200.0, 0.5) newline = gl.GLLinePlotItem(pos=pl_line, color=color, width=5, antialias=False) w.addItem(newline) w.show() line1 = [(-33.13, 1004.82, -125.7), (21.38, 1059.32, -162.03)] plot_line(line1) Here I have an example where I have a UI with a button and openGLWidget and I want to make a graphical output to openGLWidget which I defining at plot_line()