Search Results

Search found 118 results on 5 pages for 'pyqt4'.

Page 1/5 | 1 2 3 4 5  | Next Page >

  • Py2exe, PyQt4 and Postgre Driver (QPSQL)

    - by Marshall
    Hi, I`m trying to freeze my application using Py2exe. My app uses PyQt4 and it apparently works fine with py2exe. But once I`ve uninstalled PyQt, it shows the following error: QSqlDatabase: QPSQL driver not loaded QSqlDatabase: available driver: QPSQL7 QPSQL Which doesn't make sense at all. If PyQt4 is still installed, it works just fine. This is my py2exe parameters: data_files = [ ('sqldrivers', [ 'C:\Python26\Lib\site-packages\PyQt4\plugins\sqldrivers\qsqlpsql4.dll' ]) ] setup(console=["delivery.py"], options={"py2exe" : {"includes" : ["sip", "PyQt4.QtSql", "PyQt4.QtWebKit", "PyQt4.QtNetwork"]}}, data_files=data_files)

    Read the article

  • PyQt4.QtWebKit.QWebFrame missing findAllElements() method on debian

    - by user249095
    I recompiled PyQt4 from source, but the issue still exists. On another ArchLinux system, it works well. Can someone help me? Thanks! on Debian: import PyQt4.QtWebKit dir(PyQt4.QtWebKit.QWebFrame.findAllElements) Traceback (most recent call last): File "", line 1, in AttributeError: type object 'QWebFrame' has no attribute 'findAllElements' on ArchLinux: import PyQt4.QtWebKit dir(PyQt4.QtWebKit.QWebFrame.findAllElements) ['__call__', '__class__', '__cmp__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__name__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__self__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']

    Read the article

  • PyQt4 Need to move DLLs to package root

    - by Xavier
    Hi Guys, I've used the new installers from http://www.riverbankcomputing.co.uk/software/pyqt/download for Python 2.6 x86_64 and I've a small problem importing PyQt4 in one particular application. Here's the traceback: # ERROR : Traceback (most recent call last): # File "<Script Block >", line 2, in <module> # from PyQt4 import QtCore # ImportError: DLL load failed: The specified procedure could not be found. # - [line 2] This might look familiar. Fun thing is that in a previous version of the 3d software it does work (and from a standard command line), but not in the new software version. I inspected the sys.path (within the app) in order to see if this path was there: C:\Python26\Lib\site-packages\PyQt4\bin In both application this path is present. Finally managed to make it works by copying the DLLs from C:\Python26\Lib\site-packages\PyQt4\bin to C:\Python26\Lib\site-packages\PyQt4 Is there any known reason for this? I've a hard time debugging this thing further (making sure everything is 64 bit, path are correct, etc) Thanks for your help

    Read the article

  • System Error when running PyQt4's loadUi()

    - by user633804
    Hello, I'm pretty new to Qt, Python and their combinations. I'm currently writing a QGIS plugin in python (I used QtCreator 2.1 (Qt Designer 4.7) to generate a .ui-file and am now trying to use it for a Quantum GIS plugin that's written in Python 2.5 (and running in the Quantum GIS Python 2.5 console)). I am running into trouble when loading the ui-file dynamically when the program runs the loadUi() function. What throws me off is that the error occurs outside my script. Does that mean, I'm passing something wrong into it? Where does the error come in? Any hints on what could be wrong? code_dir = os.path.dirname(os.path.abspath(__file__)) self.ui = loadUi(os.path.join(code_dir, "Ui_myfile.ui"), self) This is the Error Code I am getting (minus the first paragraph): File "C:/Dokumente und Einstellungen/name.name/.qgis/python/plugins\myfile\myfile_gui.py", line 42, in __ init __ self.ui = loadUi(os.path.join(code_dir, "Ui_myfile.ui"), self) File "C:\PROGRA~1\QUANTU~1\apps\Python25\lib\site-packages\PyQt4\uic__init__.py", line 112, in loadUi return DynamicUILoader().loadUi(uifile, baseinstance) File "C:\PROGRA~1\QUANTU~1\apps\Python25\lib\site-packages\PyQt4\uic\Loader\loader.py", line 21, in loadUi return self.parse(filename) File "C:\PROGRA~1\QUANTU~1\apps\Python25\lib\site-packages\PyQt4\uic\uiparser.py", line 768, in parse actor(elem) File "C:\PROGRA~1\QUANTU~1\apps\Python25\lib\site-packages\PyQt4\uic\uiparser.py", line 616, in createUserInterface self.traverseWidgetTree(elem) File "C:\PROGRA~1\QUANTU~1\apps\Python25\lib\site-packages\PyQt4\uic\uiparser.py", line 594, in traverseWidgetTree handler(self, child) File "C:\PROGRA~1\QUANTU~1\apps\Python25\lib\site-packages\PyQt4\uic\uiparser.py", line 233, in createWidget topwidget.setCentralWidget(widget) SystemError: error return without exception set

    Read the article

  • Python: Embed Chaco in PyQt4 Mystery

    - by random guy
    How do i go about adding Chaco to an existing PyQt4 application? Hours of searches yielded little (search for yourself). So far i've figured i need the following lines: import os os.environ['ETS_TOOLKIT']='qt4' i could not find PyQt4-Chaco code anywhere on the internets i would be very grateful to anyone filling in the blanks to show me the simplest line plot possible (with 2 points) from PyQt4 import QtCore, QtGui import sys import os os.environ['ETS_TOOLKIT']='qt4' from enthought <blanks> : : app = QtGui.QApplication(sys.argv) main_window = QtGui.QMainWindow() main_window.setCentralWidget(<blanks>) main_window.show() app.exec_() print('bye') what Chaco/Enthought class inherits from QWidget ?

    Read the article

  • Cannot import PyQt4.QtGui

    - by Rock Hymas
    I have a working Python 2.6 install and just installed the PyQt4 built for Python 2.6 (available at http://www.riverbankcomputing.co.uk/software/pyqt/download). When I try to import PyQt4.QtGui I get the following error: ImportError: DLL load failed: The specified procedure could not be found. I'm on Windows 2k8 64-bit, but my Python install is 32-bit.

    Read the article

  • Label in PyQt4 GUI not updating with every loop of FOR loop

    - by user297920
    I'm having a problem, where I wish to run several command line functions from a python program using a GUI. I don't know if my problem is specific to PyQt4 or if it has to do with my bad use of python code. What I wish to do is have a label on my GUI change its text value to inform the user which command is being executed. My problem however, arises when I run several commands using a for loop. I would like the label to update itself with every loop, however, the program is not updating the GUI label with every loop, instead, it only updates itself once the entire loop is completed, and displays only the last command that was executed. I am using PyQt4 for my GUI environment. And I have established that the text variable for the label is indeed being updated with every loop, but, it is not actually showing up visually in the GUI. Is there a way for me to force the label to update itself? I have tried the update() and repaint() methods within the loop, but they don't make any difference. I would really appreciate any help. Thank you. Ronny. Here is the code I am using: # -*- coding: utf-8 -*- import sys, os from PyQt4 import QtGui, QtCore Gui = QtGui Core = QtCore # ================================================== CREATE WINDOW OBJECT CLASS class Win(Gui.QWidget): def __init__(self, parent = None): Gui.QWidget.__init__(self, parent) # --------------------------------------------------- SETUP PLAY BUTTON self.but1 = Gui.QPushButton("Run Commands",self) self.but1.setGeometry(10,10, 200, 100) # -------------------------------------------------------- SETUP LABELS self.label1 = Gui.QLabel("No Commands running", self) self.label1.move(10, 120) # ------------------------------------------------------- SETUP ACTIONS self.connect(self.but1, Core.SIGNAL("clicked()"), runCommands) # ======================================================= RUN COMMAND FUNCTION def runCommands(): for i in commands: win.label1.setText(i) # Make label display the command being run print win.label1.text() # This shows that the value is actually # changing with every loop, but its just not # being reflected in the GUI label os.system(i) # ======================================================================== MAIN # ------------------------------------------------------ THE TERMINAL COMMANDS com1 = "espeak 'senntence 1'" com2 = "espeak 'senntence 2'" com3 = "espeak 'senntence 3'" com4 = "espeak 'senntence 4'" com5 = "espeak 'senntence 5'" commands = (com1, com2, com3, com4, com5) # --------------------------------------------------- SETUP THE GUI ENVIRONMENT app = Gui.QApplication(sys.argv) win = Win() win.show() sys.exit(app.exec_())

    Read the article

  • Garder les traductions avec cx_Freeze et PyQt4, un article de Jean-Paul Vidal

    Bonjour, Comme j'en avais le besoin, j'ai réalisé 2 tutos, que je propose maintenant pour être transportés sur developpez (=> merci d'avance à dourouc05: dis-moi si tu as besoin du texte dokuwiki). Il s'agit de construire des programmes PyQt4 accompagnés de l'interpréteur Python et de toutes les bibliothèques nécessaires (dont PyQt4), afin qu'ils puissent fonctionner sur des PC sans aucune installation ni de Python ni de PyQt4: - Sous Windows (XP, Vista, 7) - Sous Linux (Ubuntu 10.10) Je pense que ce type de tuto...

    Read the article

  • Diffusion de programmes PyQt4 autonomes sous Windows grâce à cx_Freeze, un article de Jean-Paul Vidal

    Bonjour, Comme j'en avais le besoin, j'ai réalisé 2 tutos, que je propose maintenant pour être transportés sur developpez (=> merci d'avance à dourouc05: dis-moi si tu as besoin du texte dokuwiki). Il s'agit de construire des programmes PyQt4 accompagnés de l'interpréteur Python et de toutes les bibliothèques nécessaires (dont PyQt4), afin qu'ils puissent fonctionner sur des PC sans aucune installation ni de Python ni de PyQt4: - Sous Windows (XP, Vista, 7) - Sous Linux (Ubuntu 10.10) Je pense que ce type de tuto...

    Read the article

  • pyQt4: QWidget subclass not responding to new setStyleSheet() background colour

    - by Ronny
    I am having an issue with PyQt4. I want to create a new widget within a window, and I want this widget to have a custom color. When i create a subclass of the QWidget class, and instantiate it, I am not able to change its background color through the setStyleSheet() function. When I instantiate a new QWidget object, I have no problems in changing its background color. But i dont want an ordinary QWidget object.I want to create my own subclass of QWidget. When i create a subclass of a QPushButton, I am also able to change its background color using the setStyleSheet() function. There are no error messages or warnings in the console window, it just refuses to work properly without any indication as to why. So what i would like to know is why is it that i can change the background color of a widget if i simply create a QWidget object, or a subclass of QPushButton, but not when i create a subclass of QWidget. And how can i therefore change the background color of an object that is a subclass of QWidget? Is it maybe something specific to the version of python or PyQt that i am using? Is it a bug in the library? or some flaw in the way that i am writing my code? I am using python 2.6.4 and PyQt4 Below is an example of the code that leads me to trouble. There are three widgets within the window one below the other. The parent widget is set with background color of green. The top widget is set to red, the middle one, is the subclass of QWidget, which should be blue, but it appears invisible because it takes on the color of the parent window for some reason. and the bottom widget is a subclass of QPushButton and is white. import sys from PyQt4 import QtGui, QtCore ################################################################################ #--------------------------------------------------------- CUSTOM WIDGET CLASS 1 class CustomWidget(QtGui.QWidget): def __init__(self, parent): QtGui.QWidget.__init__(self, parent) # some custom properties and functions will follow ################################################################################ #--------------------------------------------------------- CUSTOM WIDGET CLASS 2 class CustomWidget2(QtGui.QPushButton): def __init__(self, parent): QtGui.QPushButton.__init__(self, parent) # some custom properties and functions will follow ################################################################################ #----------------------------------------------------------- PARENT WIDGET CLASS class Parent(QtGui.QWidget): def __init__(self, parent=None): #---------------------------------------------------------- SETUP WINDOW QtGui.QWidget.__init__(self, parent) self.resize(500, 340) self.setStyleSheet("QWidget {background-color: #00FF00}") #-------------------------------------------------- SETUP DEFAULT WIDGET wid1 = QtGui.QWidget(self) wid1.setGeometry(10, 10, 480, 100) wid1.setStyleSheet("QWidget {background-color: #FF0000 }") #------------------------------------------------- SETUP CUSTOM WIDGET 1 wid2 = CustomWidget(self) wid2.setGeometry(10, 120, 480, 100) wid2.setStyleSheet("QWidget {background-color: #0000FF }") for i in dir(wid2): print i #------------------------------------------------- SETUP CUSTOM WIDGET 2 wid3 = CustomWidget2(self) wid3.setGeometry(10, 230, 480, 100) wid3.setStyleSheet("QWidget {background-color: #FFFFFF }") ################################################################################ #-------------------------------------------------------------------------- MAIN app = QtGui.QApplication(sys.argv) win = Parent() win.show() app.exec_()

    Read the article

  • PyQt4 Custom Widgets

    - by Frank E.
    Are there any good PyQt4 custom widgets like at Qt-Apps.org? I would like to start making PyQt custom widgets but online resources that I find don't seem to be clear For example, Trolltech's and Zetcode's don't seem to be related in any way at all. Thanks for any input :)

    Read the article

  • How to allow resizing of QMessageBox in PyQt4

    - by Simeon Fitch
    I'm using the nice feature in QMessageBox to optionally show detailed text to the user. However, the window after expansion is still fairly small, and one immediately tries to resize the window so more of the details are visible. Even after setting what I think are the proper settings it won't allow resizing. Here's the relevant snippet of PyQt4 code: mb = QMessageBox() mb.setText("Results written to '%s'" % filename) mb.setDetailedText(str(myData)) mb.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) mb.setSizeGripEnabled(True) Am I missing a step and/or is this at all possible?

    Read the article

  • Connecting slots and events in PyQt4 in a loop

    - by LukaD
    Im trying to build a calculator with PyQt4 and connecting the 'clicked()' signals from the buttons doesn't as expected. Im creating my buttons for the numbers inside a for loop where i try to connect them afterwards. def __init__(self): for i in range(0,10): self._numberButtons += [QPushButton(str(i), self)] self.connect(self._numberButtons[i], SIGNAL('clicked()'), lambda : self._number(i)) def _number(self, x): print(x) When I click on the buttons all of them print out '9'. Why is that so and how can i fix this?

    Read the article

  • PyQt4: Scrollbar doesn't show in scrollarea when resizing dockWidget

    - by Whospal
    I created a python test program (Test_InfoPanel.py) that has MainWindow with dockWidget, and within it, a tabWidget with scrollArea widget. However, when I resize the MainWindow, the vertical scrollbar doesn't auto-appear when the Similarly, when I undock the dockWidget & resize, the vertical scrollbar doesn't auto-appear. Pls help! Test Program (Test_InfoPanel.py): #!/usr/bin/env python # Filename: Test_InfoPanel.py # Date: 2012-Sep-18 ''' This program test the scrollarea to show scrollbars for the InfoPanel_UI. ''' import sys from PyQt4 import QtCore, QtGui if __name__ == "__main__": import sys app = QtGui.QApplication(sys.argv) # Look and feel changed to 'Cleanlooks'. app.setStyle('Cleanlooks') from InfoPanel_UI import Ui_MainWindow_InfoPanel AppWindow = QtGui.QMainWindow() ui = Ui_MainWindow_InfoPanel() ui.setupUi(AppWindow) ui.tabWidget_Info_Panel.setCurrentWidget(ui.scrollArea_Info_Panel) AppWindow.show() sys.exit(app.exec_()) Generated *.ui script (InfoPanel_UI.py): # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'InfoPanel.ui' # # Created: Wed Sep 19 13:11:06 2012 # by: PyQt4 UI code generator 4.9.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: _fromUtf8 = lambda s: s class Ui_MainWindow_InfoPanel(object): def setupUi(self, MainWindow_InfoPanel): MainWindow_InfoPanel.setObjectName(_fromUtf8("MainWindow_InfoPanel")) MainWindow_InfoPanel.resize(602, 263) MainWindow_InfoPanel.setDocumentMode(False) self.centralwidget = QtGui.QWidget(MainWindow_InfoPanel) self.centralwidget.setObjectName(_fromUtf8("centralwidget")) MainWindow_InfoPanel.setCentralWidget(self.centralwidget) self.statusbar = QtGui.QStatusBar(MainWindow_InfoPanel) self.statusbar.setObjectName(_fromUtf8("statusbar")) MainWindow_InfoPanel.setStatusBar(self.statusbar) self.dockWidget_Info_Panel = QtGui.QDockWidget(MainWindow_InfoPanel) self.dockWidget_Info_Panel.setMinimumSize(QtCore.QSize(300, 140)) font = QtGui.QFont() font.setBold(True) font.setItalic(True) font.setWeight(75) self.dockWidget_Info_Panel.setFont(font) self.dockWidget_Info_Panel.setLayoutDirection(QtCore.Qt.LeftToRight) self.dockWidget_Info_Panel.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea|QtCore.Qt.RightDockWidgetArea) self.dockWidget_Info_Panel.setObjectName(_fromUtf8("dockWidget_Info_Panel")) self.dockWidgetContents_Info_Panel = QtGui.QWidget() self.dockWidgetContents_Info_Panel.setObjectName(_fromUtf8("dockWidgetContents_Info_Panel")) self.tabWidget_Info_Panel = QtGui.QTabWidget(self.dockWidgetContents_Info_Panel) self.tabWidget_Info_Panel.setGeometry(QtCore.QRect(0, 0, 300, 215)) font = QtGui.QFont() font.setBold(False) font.setItalic(False) font.setWeight(50) self.tabWidget_Info_Panel.setFont(font) self.tabWidget_Info_Panel.setObjectName(_fromUtf8("tabWidget_Info_Panel")) self.tab_1 = QtGui.QWidget() self.tab_1.setObjectName(_fromUtf8("tab_1")) self.scrollArea_Info_Panel = QtGui.QScrollArea(self.tab_1) self.scrollArea_Info_Panel.setGeometry(QtCore.QRect(9, 9, 271, 171)) self.scrollArea_Info_Panel.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded) self.scrollArea_Info_Panel.setWidgetResizable(True) self.scrollArea_Info_Panel.setObjectName(_fromUtf8("scrollArea_Info_Panel")) self.scrollAreaWidgetContents = QtGui.QWidget() self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 269, 169)) self.scrollAreaWidgetContents.setObjectName(_fromUtf8("scrollAreaWidgetContents")) self.frame_Info_Panel = QtGui.QFrame(self.scrollAreaWidgetContents) self.frame_Info_Panel.setGeometry(QtCore.QRect(0, 0, 261, 161)) self.frame_Info_Panel.setObjectName(_fromUtf8("frame_Info_Panel")) self.label_Eqpt_Model = QtGui.QLabel(self.frame_Info_Panel) self.label_Eqpt_Model.setGeometry(QtCore.QRect(10, 10, 111, 27)) self.label_Eqpt_Model.setObjectName(_fromUtf8("label_Eqpt_Model")) self.lineEdit_Eqpt_Model = QtGui.QLineEdit(self.frame_Info_Panel) self.lineEdit_Eqpt_Model.setEnabled(False) self.lineEdit_Eqpt_Model.setGeometry(QtCore.QRect(120, 10, 111, 27)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(60, 60, 60)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(60, 60, 60)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) self.lineEdit_Eqpt_Model.setPalette(palette) self.lineEdit_Eqpt_Model.setObjectName(_fromUtf8("lineEdit_Eqpt_Model")) self.label_State = QtGui.QLabel(self.frame_Info_Panel) self.label_State.setGeometry(QtCore.QRect(10, 40, 111, 27)) self.label_State.setObjectName(_fromUtf8("label_State")) self.lineEdit_State = QtGui.QLineEdit(self.frame_Info_Panel) self.lineEdit_State.setEnabled(False) self.lineEdit_State.setGeometry(QtCore.QRect(120, 40, 111, 27)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(60, 60, 60)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(60, 60, 60)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) self.lineEdit_State.setPalette(palette) self.lineEdit_State.setObjectName(_fromUtf8("lineEdit_State")) self.groupBox_Current_Position = QtGui.QGroupBox(self.frame_Info_Panel) self.groupBox_Current_Position.setGeometry(QtCore.QRect(10, 70, 241, 91)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(85, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(170, 255, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(127, 255, 63)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(42, 127, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(56, 170, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(85, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(170, 255, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(85, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(170, 255, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(127, 255, 63)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(42, 127, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(56, 170, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(85, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(170, 255, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(42, 127, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(85, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(170, 255, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(127, 255, 63)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(42, 127, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(56, 170, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(42, 127, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(42, 127, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(85, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(85, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(85, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) self.groupBox_Current_Position.setPalette(palette) self.groupBox_Current_Position.setObjectName(_fromUtf8("groupBox_Current_Position")) self.label_Current_Position_X = QtGui.QLabel(self.groupBox_Current_Position) self.label_Current_Position_X.setGeometry(QtCore.QRect(20, 20, 41, 27)) self.label_Current_Position_X.setObjectName(_fromUtf8("label_Current_Position_X")) self.lineEdit_Current_Position_X = QtGui.QLineEdit(self.groupBox_Current_Position) self.lineEdit_Current_Position_X.setEnabled(False) self.lineEdit_Current_Position_X.setGeometry(QtCore.QRect(60, 20, 161, 27)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(60, 60, 60)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(60, 60, 60)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) self.lineEdit_Current_Position_X.setPalette(palette) self.lineEdit_Current_Position_X.setObjectName(_fromUtf8("lineEdit_Current_Position_X")) self.label_Current_Position_Y = QtGui.QLabel(self.groupBox_Current_Position) self.label_Current_Position_Y.setGeometry(QtCore.QRect(20, 50, 41, 27)) self.label_Current_Position_Y.setObjectName(_fromUtf8("label_Current_Position_Y")) self.lineEdit_Current_Position_Y = QtGui.QLineEdit(self.groupBox_Current_Position) self.lineEdit_Current_Position_Y.setEnabled(False) self.lineEdit_Current_Position_Y.setGeometry(QtCore.QRect(60, 50, 161, 27)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(60, 60, 60)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(60, 60, 60)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) self.lineEdit_Current_Position_Y.setPalette(palette) self.lineEdit_Current_Position_Y.setObjectName(_fromUtf8("lineEdit_Current_Position_Y")) self.scrollArea_Info_Panel.setWidget(self.scrollAreaWidgetContents) self.tabWidget_Info_Panel.addTab(self.tab_1, _fromUtf8("")) self.tab_2 = QtGui.QWidget() self.tab_2.setObjectName(_fromUtf8("tab_2")) self.tabWidget_Info_Panel.addTab(self.tab_2, _fromUtf8("")) self.dockWidget_Info_Panel.setWidget(self.dockWidgetContents_Info_Panel) MainWindow_InfoPanel.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.dockWidget_Info_Panel) self.retranslateUi(MainWindow_InfoPanel) self.tabWidget_Info_Panel.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(MainWindow_InfoPanel) def retranslateUi(self, MainWindow_InfoPanel): MainWindow_InfoPanel.setWindowTitle(QtGui.QApplication.translate("MainWindow_InfoPanel", "MainWindow Info Panel", None, QtGui.QApplication.UnicodeUTF8)) self.dockWidget_Info_Panel.setWindowTitle(QtGui.QApplication.translate("MainWindow_InfoPanel", "Info Panel", None, QtGui.QApplication.UnicodeUTF8)) self.label_Eqpt_Model.setText(QtGui.QApplication.translate("MainWindow_InfoPanel", "Eqpt Model:", None, QtGui.QApplication.UnicodeUTF8)) self.lineEdit_Eqpt_Model.setText(QtGui.QApplication.translate("MainWindow_InfoPanel", "ABC", None, QtGui.QApplication.UnicodeUTF8)) self.label_State.setText(QtGui.QApplication.translate("MainWindow_InfoPanel", "State:", None, QtGui.QApplication.UnicodeUTF8)) self.lineEdit_State.setText(QtGui.QApplication.translate("MainWindow_InfoPanel", "Working", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox_Current_Position.setTitle(QtGui.QApplication.translate("MainWindow_InfoPanel", "Current Position:", None, QtGui.QApplication.UnicodeUTF8)) self.label_Current_Position_X.setText(QtGui.QApplication.translate("MainWindow_InfoPanel", "X =", None, QtGui.QApplication.UnicodeUTF8)) self.lineEdit_Current_Position_X.setText(QtGui.QApplication.translate("MainWindow_InfoPanel", "1000.00 m", None, QtGui.QApplication.UnicodeUTF8)) self.label_Current_Position_Y.setText(QtGui.QApplication.translate("MainWindow_InfoPanel", "Y =", None, QtGui.QApplication.UnicodeUTF8)) self.lineEdit_Current_Position_Y.setText(QtGui.QApplication.translate("MainWindow_InfoPanel", "1000.00 m", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget_Info_Panel.setTabText(self.tabWidget_Info_Panel.indexOf(self.tab_1), QtGui.QApplication.translate("MainWindow_InfoPanel", "Info_Pg 1", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget_Info_Panel.setTabText(self.tabWidget_Info_Panel.indexOf(self.tab_2), QtGui.QApplication.translate("MainWindow_InfoPanel", "Info_Pg 2", None, QtGui.QApplication.UnicodeUTF8)) PS: I initially created the mainWindow as a Dialog, but realized that after undock & redock, the dockWidget doesn't dock properly. Somehow there's an offset. This doesn't seem to be a problem if the mainWindow is a QtGui.QMainWindow instead of a QtGui.QDialog.

    Read the article

  • Problem installing PyQt4 on Windows 7

    - by alfredozn
    I have a problem installing PyQt4. I have Windows 7 with Python 3.1.2 installed. When I execute the PyQt-Py3.1-gpl-4.7.3-2.exe it shows the warning: This copy of PyQt has been built against Python v3.1 which doesn't seem to be installed. Do you wish to continue with the installation? Why the installer can't see my python installtion???, I set the PYTHONHOME env variable and added python to the PATH variable but is always the same warn. I don't know if the last .2 in my python's version is the problem. If I ignore the warning and install the PyQt, when I try to run the Examples and Demos from the All Programs menu it doesn't show anything. Im new to python and Qt, I don't know how to debug or something to solve this problem =S

    Read the article

  • PyQt4 Move QTableWidget row with widgets

    - by Guard
    I have the following method in my PyQt4 app. r2 is the number of row to move, and r1 is the position where it should be moved. To clarify: the table is filled with cellWidgets, not widgetItems. def move_row(self, r1, r2): tt = self.tableWidget tt.insertRow(r1) for c in range(tt.columnCount()): tt.setCellWidget(r1, c, tt.cellWidget(r2 + 1, c)) tt.removeRow(r2 + 1) # <--- ??? If I comment out the last line, it behaves as expected: the new row is inserted at position r1, it is filled with widgets from r2 (now it's r2+1), and the r2+1 row is empty. If I even hide this row, it behaves well, though it is not what I want (I have the rows numbered, and I don't want this hidden row to occupy the number). But if I remove the row, the widgets initially owned by it disappear. Looks like their ownership is taken on first placement, and is not changed after the move. Any ideas?

    Read the article

  • Crossfading audio with PyQT4 and Phonon

    - by dwelch
    I'm trying to get audio files to crossfade with phonon. I'm using PyQT4. I have tracks queuing properly, but I'm stuck with the fade effect. I think I need to be using the KVolumeFader effect. Here's my current code: def music_play(self): self.delayedInit() self.m_media.setCurrentSource(Phonon.MediaSource(self.playlist[self.playlist_pos])) self.m_media.play() def music_stop(self): self.m_media.stop() def delayedInit(self): if not self.m_media: self.m_media = Phonon.MediaObject(self) audioOutput = Phonon.AudioOutput(Phonon.MusicCategory, self) Phonon.createPath(self.m_media, audioOutput) def enqueueNextSource(self): if len(self.playlist) >= self.playlist_pos+1: self.playlist_pos += 1 self.m_media.enqueue(Phonon.MediaSource(self.playlist[self.playlist_pos])) else: self.m_media.stop() Can anyone give me some advice on implementing the effect?

    Read the article

  • pdf viewer for pyqt4 application?

    - by japs
    Hi all, I'm writing a Python+Qt4 application that would ideally need to pop up a window every once in a while, to display pdf documents and allow very basic operations, namely scrolling through the different pages and printing the document. I've found the reportLab to create pdf files, but nothing about pdf viewers. Does anyone knows anything that might help. i was really hoping for the existence of something like the QWebView widget... thanks in advance to all

    Read the article

  • PyQt4: Hide widget and resize window

    - by masterLoki
    Hi everyone: I'm working with several widgets but the solution just won't come out. What I have is a series of buttons in series of QHBoxLayouts. Some buttons are hidden by default, but they will appear when needed. To solve space issues, all buttons have a minimum and maximum size so they always look well packed. Also I have a QTextEdit, visible by default, which is in a QVBoxLayout with the QHBoxLayout that hold the buttons So the problem is this: When I hide the QTextEdit and show the other buttons, the window won't resize. After searching I found that using self.ui.layout().setSizeConstraint(QtGui.QLayout.SetFixedSize) will do the trick, but the problem is that it takes the maximum size from all widgets, therefore I end a huge window. Doing self.ui.layout().setSizeConstraint(QtGui.QLayout.SetMinAndMaxSize) won't resize the window I already tried using self.ui.resize(0,0), and when doing a self.ui.layout().update() I got False (which I find odd, http://doc.trolltech.com/4.6/qlayout.html#activate), and also tried to override sizeHint() but it keeps using the max size for all widgets. Is there a way to resize the window and while taking care of the min and max size of a widget? Thanks in advance

    Read the article

  • Retrieving text from password field [python][pyqt4]

    - by Dr. Johnson
    def welcomeStage (self): self.test = QtGui.QLineEdit (self) self.test.move (50, 150) QtCore.QObject.connect (self.test, QtCore.SIGNAL ('returnPressed()'), self.passwordStage) def passwordStage (self): self.email = self.test.text() self.test.clear() self.test.setEchoMode (QtGui.QLineEdit.Password) QtCore.QObject.connect (self.test, QtCore.SIGNAL ('returnPressed()'), self.loginStage) def loginStage (self): self.pwd = self.test.text() print self.pwd if len (self.pwd) < 0: welcomeStage () return Simply put, I am making a login form. The user enters their email, then the text field is cleared and echo mode is set to Password mode. The text() function returns the email fine, but when I call text() after I have changed the echo mode, it returns 0. I've been pouring over the documentation looking for anything regarding the text() function and how it operates when Password mode is on, however I have not found anything. Does anybody know how this is done?

    Read the article

  • Type-aware rendering (and editing) of tabular data in pyqt4

    - by pihentagy
    I would like to have a very short / minimal example of how to create some tabular widget with different types of item in it. In the first round let's say I'd like to render [["Hello", 12, True], ["World", 13, False]] (Hello as string, 12 as number (right-align), True as a checkbox for eg.), but it would be nice to have Dates, Colors, and other type of info. Next round: editing (integer with spinbox, maybe sometimes a combobox is handy, but that may not work out of the box). There must be a simple solution, but I couldn't find...

    Read the article

1 2 3 4 5  | Next Page >