qt-designer

How to set display ratio between widgets in Qt layout?

不羁的心 提交于 2020-08-19 04:20:06
问题 In a tab page I do have one tree view widget and one tab widget inside the vertical layout, I want to set 60% of screen space to tree view and 40% to tab widget, always. How can I do this in Qt Designer ? Platform: Qt Creator 2.4.1 / Win 7. 回答1: If you click the parent widget and scroll down its properties, you will find the properties of its layout at the very bottom. You can set the layoutRowStretch and layoutColumnStretch properties there. In case of a vertical layout, you could for

How to set display ratio between widgets in Qt layout?

让人想犯罪 __ 提交于 2020-08-19 04:20:03
问题 In a tab page I do have one tree view widget and one tab widget inside the vertical layout, I want to set 60% of screen space to tree view and 40% to tab widget, always. How can I do this in Qt Designer ? Platform: Qt Creator 2.4.1 / Win 7. 回答1: If you click the parent widget and scroll down its properties, you will find the properties of its layout at the very bottom. You can set the layoutRowStretch and layoutColumnStretch properties there. In case of a vertical layout, you could for

QtDesigner for Raspberry Pi

≡放荡痞女 提交于 2020-08-09 07:05:48
问题 I am building a UI with QT Designer. I need this UI to run on a Raspberry Pi. What do I need to do to make the UI for the Pi? Does it have to be written in a specific language like python or can I just write it in whatever and launch it on the Pi? I am new to this and would really appreciate the guidance. 回答1: To run qt-creator on Rpi itself. You can install it by "sudo apt-get install qt-creator" It will install qt-creator and qt4-base modules on rpi. After installing, you can run "qt

QtDesigner for Raspberry Pi

杀马特。学长 韩版系。学妹 提交于 2020-08-09 07:05:20
问题 I am building a UI with QT Designer. I need this UI to run on a Raspberry Pi. What do I need to do to make the UI for the Pi? Does it have to be written in a specific language like python or can I just write it in whatever and launch it on the Pi? I am new to this and would really appreciate the guidance. 回答1: To run qt-creator on Rpi itself. You can install it by "sudo apt-get install qt-creator" It will install qt-creator and qt4-base modules on rpi. After installing, you can run "qt

How to properly set parent of a widget in Pyqt?

旧巷老猫 提交于 2020-07-21 04:22:06
问题 I have the following code from PyQt5 import QtCore, QtGui, QtWidgets from mw import Ui_MainWindow as mwin from wd import Ui_Form as wdg class widget(QtWidgets.QWidget): def __init__(self,parent = None): super(widget,self).__init__(parent) self.ui = wdg() self.ui.setupUi(self) self.show() class Main(QtWidgets.QMainWindow): def __init__(self,parent = None): super(Main,self).__init__(parent) self.ui = mwin() self.ui.setupUi(self) self.show() w = widget(self) import sys if __name__ == '__main__':

Im trying to make a app that launches two .exe files but I also want to make it work on any computer and preferably just one big .exe file

╄→гoц情女王★ 提交于 2020-07-16 07:46:23
问题 Im new to all this and all im trying to do is make a little file that looks decent, has a exit button and a launch button that when you hit it, it launches two other .exe files and closes. I also tried to make it launch but I saw that with the current path it would only work on my computer and not anyone elses. Here is my code so far: import tkinter as tk from PyQt5 import QtCore, QtGui, QtWidgets import sys import os from PyQt5.QtWidgets import * from PyQt5.QtGui import * import PyQt5.QtCore

How to insert a Form inside mainWindow

徘徊边缘 提交于 2020-06-28 14:22:07
问题 I'd like to display a Form into a mainWindow tab. The mainWindow is already created and filled with empty tabs, and the Form is also created and filled with empty comboBox, labels and such. The mainWindow is called home and the Form listInvoice. They work well on their own, but when I call listInvoice from the home tab, it opens a new window displaying the listInvoice GUI instead of displaying listInvoice within the tab. Do you know how to call a form from within a mainWindow tab? Thank you

pyQt: How do I update a label?

做~自己de王妃 提交于 2020-06-25 03:11:08
问题 I created this simple UI with qtDesigner and I want to update my label every 10 seconds with the value of a function, but I have no idea how to do this.I've tried different things but nothing worked. def example(): ... return text UI: class Ui_Form(object): def setupUi(self, Form): Form.setObjectName("Form") Form.resize(400, 300) self.label = QtWidgets.QLabel(Form) self.label.setGeometry(QtCore.QRect(165, 125, 61, 16)) self.label.setObjectName("label") self.retranslateUi(Form) QtCore

Change QPushButton Icon on hover and pressed

一世执手 提交于 2020-06-24 09:36:12
问题 I'm trying to change the Icon of a QpushButton on hover and pressed, I'm using QtDesigner with stylesheets. I tried this QpushButton{ qproperty-icon:url(:/images/start.png); } QPushButton:hover { qproperty-icon:url(:/images/start_hov.png); } But it doesn't work. I tried setting it from QtDesigner Menu but it didn't work as well. 回答1: Unfortunately, it is a bug of Qt which is still not fixed. There's a workaround suggestion within the comments to that bug, basically you could use empty

PySide2 QMainWindow loaded from ui file not triggering window events

雨燕双飞 提交于 2020-06-23 11:47:48
问题 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 =