[PyQt] How to exclude the Lineedits in QSpinbox

2012-06-25 Thread mani kandan
I have a function to check if the selected type of children of a widget
have been filled or not. Here is the code:

def fillCompleted(self, parent, combo=True, spin=True, dspin=True,
line=True):
'''Checks if all fields in a parent widget have been filled'''
filledCompletely = True
if combo:
for x in parent.findChildren(QComboBox):
if x.currentIndex() == 0:
filledCompletely = False
print 'combo'
if spin:
for x in parent.findChildren(QSpinBox):
if x.cleanText() == :
filledCompletely = False
print 'spin'
if dspin:
for x in parent.findChildren(QDoubleSpinBox):
if x.cleanText() == :
filledCompletely = False
print 'dspin'
if line:
for x in parent.findChildren(QLineEdit):
if x.text() == :
filledCompletely = False
if not filledCompletely:
QMessageBox.warning(self,
Data Incomplete,
Please fill all the fields!)
return 0
return 1

I called this function with
if self.fillCompleted(self.purItmSel.currentWidget(),
  spin=False,
  dspin=False):
As you can see, I told it to exclude spinboxes and doublespinboxes from
checking.

However, while checking, it considers the lineedits in these spin/double
spin boxes as lineedit, and validate them too.

How do I classify between the acual lineedits, and lineedits of the
spin/double spinboxes?

Thanks!
-- 
by,
Yours Sincerely
The One and Only
Manikandan
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] Compiling PyQt 4.9.1 with SIP 4.13.3

2012-06-25 Thread 拉佛 薩

Hi All,
I'm having a trouble compiling the PyQt 4.9.1 against SIP 4.13.3.I'm getting 
the following error during the compilation:

PyQt-x11-gpl-4.9.1/sip/phonon/abstractaudiooutput.sip:33:33: error: 
abstractaudiooutput.h: No such file or 
directoryPyQt-x11-gpl-4.9.1/sip/phonon/abstractvideooutput.sip:33:33: error: 
abstractvideooutput.h: No such file or 
directoryPyQt-x11-gpl-4.9.1/sip/phonon/audiooutput.sip:33:25: error: 
audiooutput.h: No such file or 
directoryPyQt-x11-gpl-4.9.1/sip/phonon/backendcapabilities.sip:33:33: error: 
backendcapabilities.h: No such file or 
directoryPyQt-x11-gpl-4.9.1/sip/phonon/effect.sip:33:20: error: effect.h: No 
such file or 
directoryPyQt-x11-gpl-4.9.1/sip/phonon/abstractaudiooutput.sip:33:33: error: 
abstractaudiooutput.h: No such file or 
directoryPyQt-x11-gpl-4.9.1/sip/phonon/abstractvideooutput.sip:33:33: error: 
abstractvideooutput.h: No such file or 
directoryPyQt-x11-gpl-4.9.1/sip/phonon/audiooutput.sip:33:25: error: 
audiooutput.h: No such file or directory...
It seems I need to install the Phonon library so I tried Phonon 4.6.0 and add 
an include path in the Makefile in the _qt folder.I managed to successfully 
compile PyQt but I'm getting the following error when importing the module:

ImportError: PyQt4/_qt.so: undefined symbol: _ZNK6Phonon11VideoWidget8snapshotEv
Any idea what I was missing?
My Linux distribution is Scientific Linux 
6.2:https://www.scientificlinux.org/news/sl62

Thanks!
Michael 
  ___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Compiler Flags and PyQt

2012-06-25 Thread Hans-Peter Jansen
On Sunday 24 June 2012, 19:32:44 Phil Thompson wrote:
 On Sun, 24 Jun 2012 12:05:15 -0400, Scott Kitterman
 deb...@kitterman.com

 wrote:
  Passing the CCPFLAGS via CFLAGS/CXXFLAGS as discussed yesterday
  worked great
  for SIP4.  I it mostly working for PyQT, but it doesn't appear that
  QtCore/QtGui and the Designer plugin aren't getting the all flags. 
  I'm passing
  these flags:
 
  CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat
  -Wformat-
  security -Werror=format-security -D_FORTIFY_SOURCE=2
  CXXFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4
  -Wformat -Wformat-
  security -Werror=format-security -D_FORTIFY_SOURCE=2
  LFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro
 
  It looks like QtCore/QtGui aren't getting the CXXFLAGS

 They are as far as I can see.

  and the plugin
  isn't
  getting the LFLAGS.

 The Designer plugin is built using qmake and doesn't use the SIP
 build system.

One way to get around this issue is propagating the the compiler flags 
into all qt project files as QMAKE_CXXFLAGS.

@Scott: here's how I solved this (line 96 ff.):

https://build.opensuse.org/package/view_file?file=python-qt4.specpackage=python-qt4project=home%3Afrispete%3APyQtrev=6161032f9d1629c3293dd3356c02dc49

Be careful: studying sed scripts on an empty stomach may result in 
serious personal injury.

Pete
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] How to exclude the Lineedits in QSpinbox

2012-06-25 Thread Hans-Peter Jansen
On Monday 25 June 2012, 15:08:46 mani kandan wrote:

 How do I classify between the acual lineedits, and lineedits of the
 spin/double spinboxes?

Check the names and avoid the qt ones. While this is dirty as hell, it's 
quite unlikely, that the qt names will change over time..

Pete

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Compiler Flags and PyQt

2012-06-25 Thread Scott Kitterman
On Monday, June 25, 2012 08:55:30 PM Hans-Peter Jansen wrote:
 @Scott: here's how I solved this (line 96 ff.):
 
 https://build.opensuse.org/package/view_file?file=python-qt4.specpackage=py
 thon-qt4project=home%3Afrispete%3APyQtrev=6161032f9d1629c3293dd3356c02dc49

Thank you.  I'll give something like that a shot (until maybe I get the Debian 
Qt maintainers to change it there).

Scott K
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt