pyside

QDialog: Forbidden Cursor appears when Question Mark (?) Pressed

天大地大妈咪最大 提交于 2019-12-12 02:06:03
问题 I am trying to get the 'WhatsThis' functionality working in a QDialog-based application, so when the user clicks the little question mark in the Title Bar, a little 'about' dialog appears. By default, clicking that button does nothing except change my mouse cursor to the 'Forbidden' cursor: Based on a previous post, I reimplemented event as follows: def event(self, event): if event.type() == QtCore.QEvent.EnterWhatsThisMode: print "Here is a useful message" return True return QtGui.QDialog

QSqlRelationalTableModel with QSqlRelationalDelegate not working behind QAbstractProxyModel

十年热恋 提交于 2019-12-12 01:55:38
问题 I need to swap the rows and columns of a QSqlRelationalTableModel. After a lot of searching, I wrote a little proxymodel to flip the rows and the columns. It is partly working. The relations in the table are resolved and showed but the dropboxes to choose them gets lost. Also, how do I get them to update? Here is a little self-contained script that reproduces the behavior. Where is my error? I have strong suspicion that it has to do with the signals and slots of the models but I haven't found

Installing PySide - Windows 8

蹲街弑〆低调 提交于 2019-12-11 23:53:36
问题 Following these instructions: http://qt-project.org/wiki/Setting_up_PySide Successfully installed these programs: PySide-1.1.2.win-amd64-py2.7.exe - qt-win-opensource-4.8.4-vs2010.exe - Qt libraries 4.8.4 for Windows (VS 2010, 234 MB) Tried the following and got an error: PS C:\Windows\system32> python Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import PySide >>> print(PySide

Qt mouse event propagation with scene items

走远了吗. 提交于 2019-12-11 18:57:40
问题 When QGraphicsScene item is behind it's child Item, I wish for mouse grabber to check item behind, and then grab topmost item if the first is not grabbed. SAMPLE CODE : from PySide.QtCore import * from PySide.QtGui import * class View(QGraphicsView): pass class Scene(QGraphicsScene): pass class ChildCircle(QGraphicsEllipseItem): def __init__(self, parent): super(ChildCircle, self).__init__() self.setRect(QRect(-20,-20,70,70)) self.setParentItem( parent ) def mousePressEvent(self, event):

PySide QFileDialog window size

末鹿安然 提交于 2019-12-11 17:03:55
问题 As far as I understand widget window size could be defined by calling 'setGeometry' function. import_dialog = QtGui.QFileDialog() import_dialog.setWindowTitle('Import File') import_dialog.setDirectory(FILE_DIR) import_dialog.setGeometry(100, 100, 200, 200) import_file, _ = import_dialog.getOpenFileNames() print(import_file) But when I'm executing this part of my gui code, I'm facing pop up window that covers entire screen. I tried to make it smaller by calling 'setGeometry' function but with

QCompleter supporting multiple items like stackoverflow tag field

不羁的心 提交于 2019-12-11 14:34:08
问题 Is there a way to make the QCompleter for pyside work more similar to how the Tag editor here on StackOverflow works? Where a user can type a word and then if there is a space it allows the autocomplete to display matching words? This post seems like it does what i want but it's in C++ How to force QCompleter to check second word in QLineEdit import os import sys import json from PySide import QtCore, QtGui class ExampleWindow(QtGui.QMainWindow): def __init__(self, parent=None): super

Graph (pyqtgraph) is not getting plotted inside QML generated window

守給你的承諾、 提交于 2019-12-11 13:53:32
问题 I am trying to plot a graph inside a qml generated window. Since i need to use QML for GUI ( client requirement). I manage to get the graph window inside QML, but its plotting nothing. I dont know my code is correct or not, please suggest, point me in the right direction. main.py: #! /usr/bin/python import os import sys from PySide import QtGui from PySide import QtCore from PySide import QtDeclarative import numpy as np import pyqtgraph as pg class Graph (QtDeclarative.QDeclarativeItem): def

continuously updating tooltip

偶尔善良 提交于 2019-12-11 13:11:59
问题 is there a way to update the tooltip of a QLabel (or whatever) continuously? e.g. the following code uses a timer that continuously updates a label and its tooltip. while i can see the label change, if i hover over the QLabel i will get a tooltip with the last current value. the tooltip stays "fixed", until i move the mouse, which updates the tooltip to it's new value. !/usr/bin/env python # -*- coding: utf-8 -*- import sys from PySide import QtGui, QtCore class Example(QtGui.QWidget): def _

Strange error using cx-freeze to build a PySide program osx

左心房为你撑大大i 提交于 2019-12-11 12:55:02
问题 I am using cx-freeze4.3.3 on a 64-bit mac running python 2.7.8 installed via the anaconda python distribution. The program is very simple as follows: import sys from PySide.QtGui import QApplication, QDialog app = QApplication(sys.argv) form = QDialog() form.show() app.exec_() The setup.py file is standard, with the following included: options = { 'build_exe': { 'includes': 'atexit' } } executables = [ Executable('test.py', base=base) ] When running python setup.py build , the following error

How do I get PySide QWebView to display all images?

南笙酒味 提交于 2019-12-11 12:46:58
问题 The simplest PySide app shown below with a QWebView is showing webpages which have many but not all images missing. It is not consistent on whether it's gif, pngs or jpgs that are causing the problem. It might be something to do with the size of the image that is being downloaded. from sys import exit from PySide.QtGui import QApplication from PySide.QtWebKit import QWebView, QWebPage app = QApplication([]) webview = QWebView() webview.show() webview.load("http://bbc.co.uk") exit(app.exec_())