pyside2

Breadcrumbs navigation using QToolBar and QListView

久未见 提交于 2020-01-15 09:48:27
问题 I have JSON data something like this {"books":{ "web":{ "front-end":{ "html":["the missing manual", "core html5 canvas"], "css":["css pocket reference", "css in depth"], "js":["you don't know js", "eloquent javascript"] }, "back-end":{ "php":["modern php", "php web services"], "python":["dive into python", "python for everybody", "Think Python", "Effective Python", "Fluent Python"] } }, "database":{ "sql":{ "mysql":["mysql in a nutshell", "mysql cookbook"], "postgresql":["postgresql up and

How to draw a circle on a FigureCanvasQTAgg on mouse click

╄→гoц情女王★ 提交于 2020-01-14 03:21:30
问题 I am new to Qt and I am trying to do a program, that I've previously done in tkinter, to learn how to use it. I have embedded a FigureCanvasQtAgg in a Qt window. I have ploted thing on it. Now I want to plot on this canvas a circle on user's mouse click. What I have done to do it on Tkinter is to use : self.canvas.get_tk_widget().create_oval() Is there a simple way to have the same results in PySide2? Here is a simpler code with what I've tried : from PySide2.QtWidgets import * from PySide2

Why does editingFinished signal generates two times when QMessageBox is being shown by connected slot?

冷暖自知 提交于 2020-01-11 11:50:10
问题 from PySide2 import QtWidgets class Widget(QtWidgets.QWidget): def __init__(self, parent=None): super().__init__(parent) self.lineEdit = QtWidgets.QLineEdit() self.lineEdit.setText("1") self.lineEdit.editingFinished.connect(self.check) self.lineEdit2 = QtWidgets.QLineEdit() vlay = QtWidgets.QVBoxLayout(self) vlay.addWidget(self.lineEdit) vlay.addWidget(self.lineEdit2) def check(self): if self.lineEdit.text() == "1": popup = QtWidgets.QMessageBox(self) popup.setWindowTitle("why") popup.show()

Enable native MacOS Mojave Dark Theme PySide2/Python apps on QT 5.12

时间秒杀一切 提交于 2020-01-06 08:31:55
问题 I would like to know to enable the native MacOS Mojave Dark Theme (and if could be multiplatform win/linux, the better) which is supposed to be available from QT 5.12 (which I guess, it should be available in PySide2). By default, the apps are still the same way, I don't know what to do to enable it. Thanks!! P.S.: using python 2.7.10 (and the solution of pyinstaler works!!, but not running python directly) 回答1: It's not clear how are you running your application. As a module python -m

How to load an image with QLabel in PySide2

大城市里の小女人 提交于 2020-01-03 00:38:20
问题 I'm a beginner in coding and python. I read that tkinter is a bit to "basic" if you want to develop an application which is a a bit more complicated and PyQt is problematic for licencing. This is why I chose PySide2 in order to develop this kind of project, but found so far the documentation relatively scarce. Is this the right choice? My present coding problem is the following: I'm Trying to load an image with PySide2 without success. Here is the code of my 2 attempts: Attempt N°1: import

PySide2 paint on widget created by designer

纵饮孤独 提交于 2019-12-31 05:12:14
问题 This issue is with VS Code on Win10 and Python 3.6.6. I'm new both to Python and PySide2. I've read a lot of topics on this here at StackOverflow and possibly this is a duplicate of another topic, but I'm not able to get my widget painted. I understand that the paintEvent() of the widget object have to be overridden somehow. Most of the examples out there does some painting on the main window but I'm not able to transfer this on widgets from an ui.file. I've created two classes in my .py-file

When i compile my python code i get: RecursionError: maximum recursion depth exceeded while calling a Python object

时光怂恿深爱的人放手 提交于 2019-12-25 18:43:11
问题 edit: Tried the equivalent code with pyqt5 compiled with cython. It works swimmingly so this seems to be a pyside2 bug. Latest version of cython. My app works fine when i run it with python but when i make it into a module and import the module from a simple launcher script suddenly it doesn't seem to see any data from the internet and it also gives me these: RecursionError: maximum recursion depth exceeded while calling a Python object. Nuitka has the same problem but doesn't give me these

QPlainTextEdit text and increase filename in new line in the window

走远了吗. 提交于 2019-12-24 19:13:40
问题 In my script I have a QPlainTextEdit window , when I run my pushbutton script printing a line in my window with ---projectname-seg(Segment)-group_name---, My problem is: when I run my script line is added, when I run it again is added to but I would like to increase my "Seg" in my second -def Rev_Text, each time when I run my function, like new_name change+1 each time when I run my function. I add a new line to my line_list but I can't extract last line and get only "seg element. I would like

QAbstratctTableModel - removeRows

安稳与你 提交于 2019-12-24 18:27:59
问题 Code is almost complete. Here's the deal: It is python and PySide. I have a QAbstractTableModel and a QTableView. I cant get deleting rows correctly. I think the problem is somewhere in the indexes of the rows onde I delete one of them... here is the button delegate I use: class ButtonDelegate(QItemDelegate): def __init__(self, parent): QItemDelegate.__init__(self, parent) def paint(self, painter, option, index): widget = QWidget() layout = QHBoxLayout() widget.setLayout(layout) btn =

Using PyQt5/Pyside2 to set a repeating SVG pattern as main window/Qwidget background

倖福魔咒の 提交于 2019-12-24 12:03:30
问题 I've generated the SVG css code through http://www.heropatterns.com/ and I'm trying to use it as the background for my main window/Qwidget. I want the background to resize as the window grows bigger or shrinks. I tried calling Form.setStyleSheet() with the generated css being passed in as an argument, but I only get the one of the two colors(the backround color) in the pattern. What's the proper way to display a SVG as the backround of the main QWidget window and see the complete pattern? I