pyqt5

Set CullFace to Front and Back in Qt3D in Python via PySide2

梦想与她 提交于 2021-02-20 05:13:37
问题 I wanted to set QCullFace to FrontAndBack and that is why I wrote this: from PySide2.Qt3DRender import Qt3DRender cull_face = Qt3DRender.QCullFace() cull_face.setMode(Qt3DRender.QCullFace.FrontAndBack) render_pass = Qt3DRender.QRenderPass() render_pass.addRenderState(cull_face) The code above should set CullFace globally. But it does not. What did I do wrong? 回答1: I assume that the python binding does not change how Qt works in C++. So you probably have a Qt3DWindow somewhere (unless you

Set CullFace to Front and Back in Qt3D in Python via PySide2

风流意气都作罢 提交于 2021-02-20 05:13:07
问题 I wanted to set QCullFace to FrontAndBack and that is why I wrote this: from PySide2.Qt3DRender import Qt3DRender cull_face = Qt3DRender.QCullFace() cull_face.setMode(Qt3DRender.QCullFace.FrontAndBack) render_pass = Qt3DRender.QRenderPass() render_pass.addRenderState(cull_face) The code above should set CullFace globally. But it does not. What did I do wrong? 回答1: I assume that the python binding does not change how Qt works in C++. So you probably have a Qt3DWindow somewhere (unless you

Pyqt5: Attempting to add QLayout “ ”Form", which already has a layout (multiple inheritance python) [duplicate]

一笑奈何 提交于 2021-02-20 04:30:07
问题 This question already has answers here : QtDesigner changes will be lost after redesign User Interface (2 answers) Closed 10 months ago . i have created a ui file, window.ui (consist with a tab widget) and a Widget file student (some buttons,functions) using qtDesigner and than convert into py file using pyuic5. and inherit in a separate file like mainWindow.py and mainStudent.py . i added a tabWidget into mainWindow.py and i want to call the page student.py from the tab . so i create a new

Dynamic size of QTreeWidget in PyQt5

我的梦境 提交于 2021-02-20 04:12:36
问题 I got a QTreewidget, which i want to be as small as possible, with probably only one branch. But i want the size to change accordingly to how that expands or collapses. As well as start out with a size that fits the filled part of the widget. I make the QTreewidget by adding QTreeWidgetItems, which got the TreeWidget as parent, and then making QTreeWidgetItems again which got the above QTreeWidgetItem as parent. Right now, it starts like left image, but i want it to start like the right one.

Dynamic size of QTreeWidget in PyQt5

给你一囗甜甜゛ 提交于 2021-02-20 04:12:32
问题 I got a QTreewidget, which i want to be as small as possible, with probably only one branch. But i want the size to change accordingly to how that expands or collapses. As well as start out with a size that fits the filled part of the widget. I make the QTreewidget by adding QTreeWidgetItems, which got the TreeWidget as parent, and then making QTreeWidgetItems again which got the above QTreeWidgetItem as parent. Right now, it starts like left image, but i want it to start like the right one.

How to use a QTextBrowser instead of the console in python?

痴心易碎 提交于 2021-02-19 09:54:29
问题 I've constructed a window in pyqt5, which by clicking on "optimize" button, the program reads the "Gurobi-model.lp" file(click here to get the file), and optimizes it by the help of the Gurobi software. How can I display the logs of the Gurobi on a QTextBrowser? I found some functions in the Gurobi such as OutputFlag, LogFile, LogToConsole. However, I searched a lot, and I didn't understand these functions might be helpful for me or not. Anybody can help me in this regard? For those who are

insert multiple input fields before running scrapy

﹥>﹥吖頭↗ 提交于 2021-02-19 08:30:06
问题 I'm referencing a stackoverflow answer that is similar to my GUI app. My scrappy application is a bit different. When exectuing the app, a user is prompt to enter keywords for scrapy to search for looks like this im trying to put this logic on the GUI, but im unsure how to do it. here is what the gui looks like as of now. I want to be able to input fields where a user can input the information need before processing the scrapy script. here is a bit of the scrapy script my_spider.py import

Prevent ComboBox editing in StyledItemDelegate

对着背影说爱祢 提交于 2021-02-19 08:16:16
问题 I am trying to make everything shown by the current code un-editable. Previous searches all suggest either modifying the flags() function of the model or using the setEditTriggers of the table. I do both in this code, but neither of them work. Looking at a widget-by-widget case, I can find readonly modes for LineEdit and others, but not for ComboBox. So I can not even modify the delegate to force the readonly constraint, not that I would necessarily like to do it this way. EDIT: to clarify,

how to let serial work well background and also foreground?

只谈情不闲聊 提交于 2021-02-19 08:13:05
问题 i have a serial app, The Robot class need to always receive serial message and then to do some thing, the Demo gui need to interactive Robot and get Robot.handle_readData , if no data get, need to get again and again until had data. Now i had no idea how to solve this problem, need someone give me good idea. from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtSerialPort import * class Robot(QObject): def __init__(self): super().__init__() self

AttributeError: 'MyMainWindow' object has no attribute 'pushButton'

江枫思渺然 提交于 2021-02-18 18:17:49
问题 Trying to proceed click button event in my code but got some issue. AttributeError: 'MyMainWindow' object has no attribute 'pushButton' Seems, like clicked event can`t find pushbutton from my subclass. Probably i did some mistakes in syntax, so really waiting for your help guys. Sorry if the question very banal, pyQt5 is simply new for me, trying to figure out in all of this. Here is my files. ui_main.py # -*- coding: utf-8 -*- # Form implementation generated from reading ui file '1.ui' # #