pyside

PySide数据库类学习QSqlQuery(一)

前提是你 提交于 2020-03-17 02:07:43
某厂面试归来,发现自己落伍了!>>> QSqlQuery 摘要 函数 · def addBindValue (val[, type=QSql.In]) · def at () · def bindValue (placeholder, val[, type=QSql.In]) · def bindValue (pos, val[, type=QSql.In]) · def boundValue (placeholder) · def boundValue (pos) · def boundValues () · def clear () · def driver () · def execBatch ([mode=ValuesAsRows]) · def exec_ () · def exec_ (query) · def executedQuery () · def finish () · def first () · def isActive () · def isForwardOnly () · def isNull (field) · def isSelect () · def isValid () · def last () · def lastError () · def lastInsertId () · def lastQuery () · def next ()

Force Qt/PyQt/PySide QTabWidget to resize to active tab

对着背影说爱祢 提交于 2020-03-03 10:13:10
问题 I have a QTabWidget working correctly except that it doesn't re-size how I would expect it. There are 2 tabs in the widget. Each has a QVBoxLayout with widgets in it. The VBox also works as expected. The issue is that the first tab has more widgets in its layout than the second tab. When viewing the first tab, the tab sizes to appropriately contain the widgets inside of it. However, when viewing the second tab, the tab widget stays the same size of the first, instead of re-sizing to the

Force Qt/PyQt/PySide QTabWidget to resize to active tab

◇◆丶佛笑我妖孽 提交于 2020-03-03 10:13:08
问题 I have a QTabWidget working correctly except that it doesn't re-size how I would expect it. There are 2 tabs in the widget. Each has a QVBoxLayout with widgets in it. The VBox also works as expected. The issue is that the first tab has more widgets in its layout than the second tab. When viewing the first tab, the tab sizes to appropriately contain the widgets inside of it. However, when viewing the second tab, the tab widget stays the same size of the first, instead of re-sizing to the

Fixing Threads in PySide2

那年仲夏 提交于 2020-02-25 23:09:06
问题 I have programmed an application using PySide2 with some 800 lines of code and now when I want to show a variable in the progress bar it crashes after a short while without any warning. Silently. Just now it dawned on me that my whole approach to this GUI building is probably incorrect. Can this code be saved somehow so that it can via signals set this progress bar from inside the thread without the application crashing? EDIT: this minimal code works and crashes but needs a small ui file.

PySide: Drag and drop files into QListWidget

一笑奈何 提交于 2020-02-20 10:39:51
问题 This is my first entry here so apologies for any newbie mistakes. I've searched both here and Google with no luck before posting. I want to be able to add images to a QListWidget, using drag and drop from a file browser. Dropping a valid file on the list widget also needs to trigger a function in the main class of my app, and pass it the image path. I found this code that does exactly that, but for PyQt4. Importing QtCore and QtGui from PySide instead of PyQt4 produces a segmentation fault

PySide: Drag and drop files into QListWidget

风格不统一 提交于 2020-02-20 10:39:24
问题 This is my first entry here so apologies for any newbie mistakes. I've searched both here and Google with no luck before posting. I want to be able to add images to a QListWidget, using drag and drop from a file browser. Dropping a valid file on the list widget also needs to trigger a function in the main class of my app, and pass it the image path. I found this code that does exactly that, but for PyQt4. Importing QtCore and QtGui from PySide instead of PyQt4 produces a segmentation fault

PySide: Drag and drop files into QListWidget

ε祈祈猫儿з 提交于 2020-02-20 10:38:00
问题 This is my first entry here so apologies for any newbie mistakes. I've searched both here and Google with no luck before posting. I want to be able to add images to a QListWidget, using drag and drop from a file browser. Dropping a valid file on the list widget also needs to trigger a function in the main class of my app, and pass it the image path. I found this code that does exactly that, but for PyQt4. Importing QtCore and QtGui from PySide instead of PyQt4 produces a segmentation fault

PySide: Drag and drop files into QListWidget

主宰稳场 提交于 2020-02-20 10:37:46
问题 This is my first entry here so apologies for any newbie mistakes. I've searched both here and Google with no luck before posting. I want to be able to add images to a QListWidget, using drag and drop from a file browser. Dropping a valid file on the list widget also needs to trigger a function in the main class of my app, and pass it the image path. I found this code that does exactly that, but for PyQt4. Importing QtCore and QtGui from PySide instead of PyQt4 produces a segmentation fault

Signal in PySide not emitted when called by a timer

北慕城南 提交于 2020-02-07 23:46:11
问题 I need to emit a signal periodically. A timer executes certain function, which emits the signal that I want. For some reason this function is not being emitted. I was able to reproduce the error on minimal code (see further down). If I do the same without the timer everything works: from threading import Timer import time from PySide import QtCore class testSignals(QtCore.QObject): signal = QtCore.Signal(); def __init__(self): QtCore.QObject.__init__(self) def run(self): self.signal.emit()

Signal in PySide not emitted when called by a timer

陌路散爱 提交于 2020-02-07 23:45:29
问题 I need to emit a signal periodically. A timer executes certain function, which emits the signal that I want. For some reason this function is not being emitted. I was able to reproduce the error on minimal code (see further down). If I do the same without the timer everything works: from threading import Timer import time from PySide import QtCore class testSignals(QtCore.QObject): signal = QtCore.Signal(); def __init__(self): QtCore.QObject.__init__(self) def run(self): self.signal.emit()