On Friday 14 January 2011 15:58:41 Fars- mo wrote:
> Hugo Parente Lima wrote:
> > > On the other hand, due to the dynamic nature of Python's type system,
> > > QApplication.instance() will return the current QApplication. This is
> > > not true in C++ as ::instance() only returns a QCoreApplication*,
> > > although I'm not sure what the rationale for not providing
> > > QApplication::instance() is.
> > > 
> > > What does the PySide team think about using QApplication.instance() in
> > > this way? Is it discouraged?
> > 
> > In C++ QCoreApplication::instance returns a QCoreApplication pointer and
> > QApplication::instance returns a QApplication pointer.
> 
> No, unless it was fixed recently: it's not in
> http://doc.qt.nokia.com/4.7/qapplication.html and
> QApplication::instance()->styleSheet()
> fails.

Yeah.. you are right, there's no QApplication::instance(), I thought there was 
one, anyway QCoreApplication.instance() in Python will return a QApplication 
if it is a QApplication.

and in C++ there's the qApp macro.

#define qApp (static_cast<QApplication *>(QCoreApplication::instance()))

 
> Maybe this is just an oversight and not a deliberate decision?
> 
> 
> Cheers,
> Farsmo

-- 
Hugo Parente Lima
INdT - Instituto Nokia de Tecnologia

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
PySide mailing list
[email protected]
http://lists.openbossa.org/listinfo/pyside

Reply via email to