pyside

How to install PySide on CentOS?

雨燕双飞 提交于 2019-12-07 00:55:38
问题 I want to install ReText on CentOS. Have a problem, [root@localhost scripts-2.6]# python retext.py Traceback (most recent call last): File "retext.py", line 23, in <module> from ReText import QtCore, QtWidgets, QtWebKit, datadirs, globalSettings File "/usr/lib/python2.6/site-packages/ReText/__init__.py", line 21, in <module> from PySide import QtCore, QtGui, QtWebKit ImportError: No module named PySide Then I typed yum install PySide and yum install python-pyside to install PySide, and got

I need help on taking a flash webvideo screenshot on Pyside or PyQt4

我的梦境 提交于 2019-12-06 21:18:29
i have an issue on taking a screenshot of the youtube video page. in Pyside i have enabled flash function using below command to play video on Pyside browser s.setAttribute(QWebSettings.PluginsEnabled, True) s.setAttribute(QWebSettings.JavascriptEnabled, True) now my script can open video embedded website and playing videos but when i tried to capture screenshot it showing Black screen on video embedded place. Script: #!/usr/bin/env python #-*- coding:utf-8 -*- from PySide.QtCore import Qt, QUrl, QTimer, Slot from PySide.QtGui import QApplication, QImage, QPainter from PySide.QtWebKit import

PySide emit signal causes python to crash

送分小仙女□ 提交于 2019-12-06 16:24:00
I am working through the book "Rapid Gui Programming with Python and Qt" and am having a problem on the signals/slots project. I have downloaded the authors code to compare against my own, and it all looks the same, however, when I emit a signal from a derived spin box class, python just crashes. Here is the entire code that I have: import sys from PySide.QtCore import * from PySide.QtGui import * class ZeroSpinBox(QSpinBox): zeros = 0 def __init__(self, parent=None): super(ZeroSpinBox, self).__init__(parent) self.connect(self, SIGNAL("valueChanged(int)"), self.checkzero) def checkzero(self):

how to redirect Wheel events of QWidget to QTextEdit

坚强是说给别人听的谎言 提交于 2019-12-06 14:05:18
when you turn the mouse wheel while the mouse is not on the QTextEdit ,the scroll bars will not move in such case ,but I still want to move the scroll bars by mouse wheel ,so how can I implement this function ? I know some software like Microsoft Word have this feature . I implement this feature like the following ,but when you move the scroll bars to the top or bottom by mouse wheel ,an error would occur : maximum recursion depth exceeded while calling a Python object. anyone can help ? my code here http://codepad.org/1rq06qTk : import sys from PyQt4.QtGui import * from PyQt4.QtCore import *

PySide / wait or sleep

半城伤御伤魂 提交于 2019-12-06 13:44:20
i´m new to python and pyside. I´ll try to run the following code with success. But now i want the programm to wait after showing up the window for a defined time where the user can´t use it and then upgrade the statusbar. i´ll tried sleep() but have no idea where it had to be placed the correct way in the code. Thanks for help. #!/usr/bin/python # -*- coding: utf-8 -*- """ ZetCode PySide tutorial This program creates a statusbar. author: Jan Bodnar website: zetcode.com last edited: August 2011 """ import sys, time from PySide import QtGui class Main(QtGui.QMainWindow): def __init__(self):

How to make QAbstractTableModel 's data checkable

半腔热情 提交于 2019-12-06 13:39:34
How to make QAbstractTableModel 's data checkable I want to make each cell in the following code can be checked or unchecked by the user ,how to modify the code ? according to the Qt documentation :Qt::CheckStateRole and set the Qt::ItemIsUserCheckable might be used ,so anyone can give a little sample ? import sys from PyQt4.QtGui import * from PyQt4.QtCore import * class MyModel(QAbstractTableModel): def __init__(self, parent=None): super(MyModel, self).__init__(parent) def rowCount(self, parent = QModelIndex()): return 2 def columnCount(self,parent = QModelIndex()) : return 3 def data(self

Python PyQT/PySide QThread limiting

此生再无相见时 提交于 2019-12-06 12:54:35
问题 I have problem with thread limiting. I want to do it using QThread. So SpiderThread is QThread object crawling some urls. But I want to limit working threads to X threads at once. I have done it earlier with threadpool and QRunnable but it's buggy in pyside when numbers of urls are big. So I have this simple code: self.threads = [] for url in self.urls: th = SpiderThread(url) th.updateresultsSignal.connect(self.update_results) self.threads.append(th) th.start() Anyone have working example of

QUiLoader.createWidget equivalent in PyQt

孤人 提交于 2019-12-06 11:47:19
I have a PySide application that I'm investigating making compatible with PyQt4. Obviously this shouldn't be too difficult, but I'd like to minimise the number of code changes necessary. The biggest difference I've come across (which affects my program) is the fact that PyQt does not wrap the QUiLoader class. Now I realise that I can still load ui files with the uic module in PyQt, however I'm currently using a subclass of QUiLoader in PySide that implements some custom functionality that I'd like to reserve if possible. The functionality is as follows. I've subclassed QUiLoader and overridden

import classes from pyside inside of a boost python module?

心已入冬 提交于 2019-12-06 10:25:15
问题 I'd like to use PySide to define the basic QT classes and the mapping between C++ and python, but to do so in both standalone python code and from embedded python using boost::python. First, the module definition and class returning QPointF: QPointF X::getY() { return QPointF(); } BOOST_PYTHON_MODULE(myBoostPythonModule) { // is there some magic init/register commands to put here? boost::python::api::object module = import("__main__"); boost::python::api::object name_space = module.attr("_

Qt animating a button

好久不见. 提交于 2019-12-06 08:56:52
问题 Can anyone provide or point to a simple example in Qt, where we can slide a button downwards or upward if another button is clicked. For example, a simple dialog which have three buttons vertically positioned. When we click the upper button, the middle and the lower button should slide down 20-30 pixel leaving a space between the upper and other two buttons. Also if middle button is clicked, the buttons should attain their initial position and a similar animation should occur between the