qt-designer

PySide2 QMainWindow loaded from ui file not triggering window events

僤鯓⒐⒋嵵緔 提交于 2020-06-23 11:47:28
问题 I am loading a QMainWindow from an .ui file - it's working fine but window events like resize won't be triggered. I can't really figure out what I am doing wrong. This is the code: class TestWindow(QMainWindow): def __init__(self, parent=None): super(TestWindow, self).__init__(parent) loader = QUiLoader() file = QFile(abspath("ui/mainwindow.ui")) file.open(QFile.ReadOnly) self.window = loader.load(file, parent) file.close() self.window.show() def resizeEvent(self, event): print "resize" app =

reading UI file and connecting elements such as buttons, text, etc

自作多情 提交于 2020-05-29 09:43:32
问题 I'm looking at using PySide2, but reading UI files, instead of generating Python via pyside2-uic. Strangely, I can't seem to find an example of this simple connectivity. I see the difference between PyQt5 and PySide2: https://www.learnpyqt.com/blog/pyqt5-vs-pyside2/ but am unclear on how a button would hook up in using PySide2. The simplest code which brings up the window is here; what I can't quite figure is the bit that hooks up to the element (btnTest) which was created in the UI. I've

reading UI file and connecting elements such as buttons, text, etc

萝らか妹 提交于 2020-05-29 09:41:45
问题 I'm looking at using PySide2, but reading UI files, instead of generating Python via pyside2-uic. Strangely, I can't seem to find an example of this simple connectivity. I see the difference between PyQt5 and PySide2: https://www.learnpyqt.com/blog/pyqt5-vs-pyside2/ but am unclear on how a button would hook up in using PySide2. The simplest code which brings up the window is here; what I can't quite figure is the bit that hooks up to the element (btnTest) which was created in the UI. I've

How to use matplotlib with PyQt4

☆樱花仙子☆ 提交于 2020-05-23 11:00:09
问题 I want to plot a figure with embedded matplotlib in PyQt. I am using Qt Designer for the main window, and writing python code for the signal and slots connexion part. So my code looks like this : import sys from PyQt4 import QtCore, QtGui, uic from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar import matplotlib.pyplot as plt import pandas as pd import numpy as np

PyInstaller + UI Files - FileNotFoundError: [Errno 2] No such file or directory:

╄→гoц情女王★ 提交于 2020-04-30 11:42:25
问题 I'm trying to export my .py script to .exe using PyInstaller, which has dependencies on .ui files which were created using Qt Designer. I can confirm that my .py script works just fine when running it through PyCharm - I'm able to see the GUI I've created with the .ui files. However, when I export my .py script to .exe and launch it, I recieve the following errors in the command line: C:\Users\giranm>"C:\Users\giranm\PycharmProjects\PyQt Tutorial\dist\secSearch_demo.exe" Traceback (most

How to Output sql data onto a QCalendarWidget

你。 提交于 2020-04-30 09:19:40
问题 I want to be able to highlight a day from my SQL Database on my calendar widget just like how the current day is highlighted when you start the program, in my example it is a red highlight. What i want to happen is when the user presses on the date that is highlighted the text that is alongside the date in the databse is displayed on the label below the calendar. This is my page i made using QT Designer: PYQT Page This is the database that has all the data: SQL Database And this is the code

How to Output sql data onto a QCalendarWidget

谁说胖子不能爱 提交于 2020-04-30 09:16:07
问题 I want to be able to highlight a day from my SQL Database on my calendar widget just like how the current day is highlighted when you start the program, in my example it is a red highlight. What i want to happen is when the user presses on the date that is highlighted the text that is alongside the date in the databse is displayed on the label below the calendar. This is my page i made using QT Designer: PYQT Page This is the database that has all the data: SQL Database And this is the code

where do I write the class for a single promoted QWidget from Qt designer

╄→гoц情女王★ 提交于 2020-04-16 05:51:19
问题 I read, test and understand a lot of examples for usage of QWidgets from Qt designer, which are promoted to PyQt5. Nevertheless I am not able to deal with a simple example for my own. Beneath I show my code, which is not working and try to explain. in Qt desginer i create a simple QMainWindow, named standardized as MainWindow Within I create a single label QLabel. This I promote to class "neuLabel" and name it labelqt. The window with, Add , the header neulabel.h and promote --> everything is

where do I write the class for a single promoted QWidget from Qt designer

末鹿安然 提交于 2020-04-16 05:51:10
问题 I read, test and understand a lot of examples for usage of QWidgets from Qt designer, which are promoted to PyQt5. Nevertheless I am not able to deal with a simple example for my own. Beneath I show my code, which is not working and try to explain. in Qt desginer i create a simple QMainWindow, named standardized as MainWindow Within I create a single label QLabel. This I promote to class "neuLabel" and name it labelqt. The window with, Add , the header neulabel.h and promote --> everything is

QtDesigner changes will be lost after redesign User Interface

筅森魡賤 提交于 2020-03-06 09:49:53
问题 I'm using QtDesinger for design GUI to use in python, after designing my desired UI in QtDesigner, convert it to python code and then I changed generated code to do some action in my python code, but if I changed the UI with QtDesigner and convert it to python code again, I lost my previous changes on my code. how can I solve the problem? can we Spreading a Class Over Multiple Files in python to write code in other files? 回答1: To avoid having these problems it is advisable not to modify this