pyside

Python PyQt Pyside - setNameFilters in QFileDialog does not work

寵の児 提交于 2020-01-23 02:46:10
问题 (Windows 7 64 Bit, PyCharm 3.4.1 Pro, Python 3.4.0, PySide 1.2.2) I want to make a file dialog with filters and preselect one filter. If i use the static method, it works, i can use filters and preselect one filter. dir = self.sourceDir filters = "Text files (*.txt);;Images (*.png *.xpm *.jpg)" selected_filter = "Images (*.png *.xpm *.jpg)" fileObj = QFileDialog.getOpenFileName(self, " File dialog ", dir, filters, selected_filter) If i use an object it does not work, my filters are not there.

Pyside, webkit basic question

自古美人都是妖i 提交于 2020-01-22 09:44:46
问题 I am currently running this code, and although the web browser appears, the web inspector doesn't seem to display anything, am i doing something incorrectly? import sys from PySide.QtCore import * from PySide.QtGui import * from PySide.QtWebKit import * app = QApplication(sys.argv) web = QWebView() web.load(QUrl("http://www.google.com")) web.show() inspect = QWebInspector() inspect.setPage(web.page()) inspect.show() sys.exit(app.exec_()) 回答1: It is in the Qt Documentation: Note: A

PySide / Qt Import Error

家住魔仙堡 提交于 2020-01-20 18:44:04
问题 I'm trying to import PySide / Qt into Python like so and get the follow error: from PySide import QtCore ImportError: dlopen(/usr/local/lib/python2.7/site-packages/PySide/QtCore.so, 2): Library not loaded: libpyside-python2.7.1.2.dylib Referenced from: /usr/local/lib/python2.7/site-packages/PySide/QtCore.so Reason: image not found I'm running/installed via: Mac OSX 10.9.4 Mavericks Homebrew Python 2.7 Homebrew installed Qt Pip installed PySide The file libpyside-python2.7.1.2.dylib is located

Is there a way to align or manipulate the position of a QIcon inside a QTableWidgetItem?

为君一笑 提交于 2020-01-17 04:24:26
问题 Intro: I am using PySide and the Qt Framework to build a GUI app I am dynamically adding edit and delete icons in a QTableWidgetItem and I am trying to align them in the center of the cell. I have tried setTextAlign and setStyleSheet on various parts of the QTableWidget. If anyone knows a workaround that would be awesome. I am also wanting these to be clickable so that if the user clicks the edit they will be able to edit the corresponding object that row applies to. If someone could help me

Is there a way to align or manipulate the position of a QIcon inside a QTableWidgetItem?

夙愿已清 提交于 2020-01-17 04:24:06
问题 Intro: I am using PySide and the Qt Framework to build a GUI app I am dynamically adding edit and delete icons in a QTableWidgetItem and I am trying to align them in the center of the cell. I have tried setTextAlign and setStyleSheet on various parts of the QTableWidget. If anyone knows a workaround that would be awesome. I am also wanting these to be clickable so that if the user clicks the edit they will be able to edit the corresponding object that row applies to. If someone could help me

How to display image on secondary monitor in full screen?

隐身守侯 提交于 2020-01-16 08:55:12
问题 How can I use PyQt5/PySide or any other Python library to display a desired image on a secondary monitor in full-screen mode? In the past, I used a framebuffer image viewer (Fbi and Fbi improved). However, this approach requires me to use Linux. I prefer to work in Windows and preferably find a solution using Python. Motivation/Context I am working on a DLP projection based 3D printing process. When I connect a DLP projector to my Windows PC using HDMI, it shows up as a second monitor. I want

python/pyside using a custom widget in a qtreewidget

别说谁变了你拦得住时间么 提交于 2020-01-15 11:38:09
问题 Using Python3 and pyside. I have a python dictionary which I want to display as a tree using Qt. I want the values to be editable but not the keys. I have managed to achieve this using setItemWidget as shown in the following example: #!/usr/bin/python3 # -*- coding: utf-8 -*- import sys from PySide import QtGui def data_to_tree(parent, data): if isinstance(data, dict): parent.setFirstColumnSpanned(True) for key,value in data.items(): child = QtGui.QTreeWidgetItem(parent) child.setText(0, key)

PySide/PyQT5: How to emit signals from a QGraphicsItem?

妖精的绣舞 提交于 2020-01-15 09:20:28
问题 I want to emit a signal from a QGraphicsItem when it is doubled-clicked, in order to change a widget in the main window. The graphics-scene/-item does not provide an emit() method, but I was just wondering if there is an alternate way to do this. The code below has a function within a QGraphicsView class that will print to the terminal when an item is double-clicked. How can I make that into a slot/signal instead (if QGraphicsItem does not support signal/slots)? import sys from PySide.QtCore

How to detect any mouse click on PySide Gui?

我们两清 提交于 2020-01-14 13:11:22
问题 I am trying implement a feature such that when a mouse is clicked on the gui, a function is triggered Below is my mouse click detection, it doesn't work when I click on any part of the gui from PySide.QtCore import * from PySide.QtGui import * import sys class Main(QWidget): def __init__(self, parent=None): super(Main, self).__init__(parent) layout = QHBoxLayout(self) layout.addWidget(QLabel("this is the main frame")) layout.gui_clicked.connect(self.anotherSlot) def anotherSlot(self, passed):

How to detect any mouse click on PySide Gui?

大城市里の小女人 提交于 2020-01-14 13:09:49
问题 I am trying implement a feature such that when a mouse is clicked on the gui, a function is triggered Below is my mouse click detection, it doesn't work when I click on any part of the gui from PySide.QtCore import * from PySide.QtGui import * import sys class Main(QWidget): def __init__(self, parent=None): super(Main, self).__init__(parent) layout = QHBoxLayout(self) layout.addWidget(QLabel("this is the main frame")) layout.gui_clicked.connect(self.anotherSlot) def anotherSlot(self, passed):