I am using PyQt4 for GUI apps.
I created a class that contains a function to center any window (Form) whose 
name is passed to this class. I have two questions:
How to modify the below given code to center the window whose name we passed as 
an argument.How to pass window name to this class from another file that 
imports this class?
============= CODE BLOCK STARTS HERE ===========from PyQt4 import QtGui
class PositionWindow:    def __init__(self, xCoord, yCoord, windowName, parent 
= None):      self.x = xCoord      self.y = yCoord      self.wName = 
windowName;            def center(self):        screen = 
QtGui.QDesktopWidget().screenGeometry()        size = self.geometry()        
self.move((screen.width()-size.width())/2, 
(screen.height()-size.height())/2)============= CODE BLOCK ENDS HERE ===========
................Rohit 
K.elementFontfont-familyfont-sizefont-stylefont-variantfont-weightletter-spacingline-heighttext-decorationtext-aligntext-indenttext-transformwhite-spaceword-spacingcolorBackgroundbg-attachmentbg-colorbg-imagebg-positionbg-repeatBoxwidthheightborder-topborder-rightborder-bottomborder-leftmarginpaddingmax-heightmin-heightmax-widthmin-widthoutline-coloroutline-styleoutline-widthPositioningpositiontopbottomrightleftfloatdisplayclearz-indexListlist-style-imagelist-style-typelist-style-positionTablevertical-alignborder-collapseborder-spacingcaption-sideempty-cellstable-layoutEffectstext-shadow-webkit-box-shadowborder-radiusOtheroverflowcursorvisibility
                                      
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to