[PyQt] Next SIP and PyQt4 Releases

Phil Thompson phil at riverbankcomputing.co.uk
Thu Sep 27 13:33:28 BST 2007


On Thursday 27 September 2007, Mike Tammerman wrote:
> I think QColorDialog cannot be instantiated or subclassed from PyQt. I
> don't really know if the same behaviour exists in C++. I looked at the
> source code of the QColorDialog::getColor function and it is
>
> QColor QColorDialog::getColor(const QColor& initial, QWidget *parent)
> {
>     QColorDialog *dlg = new QColorDialog(parent, true);  //modal
>     dlg->setWindowTitle(QColorDialog::tr("Select color"));
>     dlg->setColor(initial);
>     dlg->selectColor(initial);
>     int resultCode = dlg->exec();
>     QColor result;
>     if (resultCode == QDialog::Accepted)
>         result = dlg->color();
>     delete dlg;
>     return result;
> }
>
> Looking at the code, I can see that, it can be instantiated from C++.

The ctor isn't documented, so it's assumed that it's not part of the public 
API.

Phil


More information about the PyQt mailing list