-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hey,

On Saturday 01 November 2003 00:25, you wrote:
> On Friday 31 October 2003 9:49 pm, Roland Schulz wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Hey,
> >
> > trying to change the sip layer makes great advancement. Overwriting the
> > className function already makes the Preview working!! Overwriting
> > metaObject also makes signals, slots and propterties (partly) working!!
> > So I think this will work.
>
> How have you "overwritten" the className function?
Adding it to sipqtQWidget.h by hand. See the attached file.

> > What I did for className is that I added to sipqtQWidget.h:
> > virtual const char *className() const {return "FileChooser";}


> > How should I do this in qwidget.sip? How can I get the classname (of
> > course harding it is only for testing)? Calling className from Python
> > space gives the correct result, so this should be doable. How can I
> > access variables defined in the Python claass? Is there a way to tell sip
> > to add this className method to all classes?
>
> Use the /AutoGen/ option to automatically generate methods, but I'm not
> convinced this is going to help. 
What does this /AutoGen/ function?

> Remind me how Designer calls the factory
> function to create the widget.
designer creates an object PyQWidgetPlugin from the library and calls the 
create method. Create uses pythonize to call the createWidget method in the 
Python class. 

regards
Roland
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)

iD8DBQE/o3DcV/hlvQgMogsRAqdfAJ43N3o73mCX519p96IPWW0LjNOZ3ACglqgD
+f7RPf+rck6iQSBg3q99t0Y=
=/8/h
-----END PGP SIGNATURE-----
// C++ interface header file.
//
// Generated by SIP 3.8 (build 109) on Fri Oct 31 14:41:26 2003
//
// Copyright (c) 2003
// 	Riverbank Computing Limited <[EMAIL PROTECTED]>
// 
// This file is part of PyQt.
// 
// This copy of PyQt is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2, or (at your option) any later
// version.
// 
// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
// details.
// 
// You should have received a copy of the GNU General Public License along with
// PyQt; see the file LICENSE.  If not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

#ifndef _qtQWidget_h
#define	_qtQWidget_h

#line 63 "sip/qwidget.sip"
#include <qwidget.h>
#include <qmetaobject.h>
#include <private/qucom_p.h>
#line 30 "sipqtQWidget.h"

#include "sipqtQObject.h"
#include "sipqtQPaintDevice.h"
#include "sipqtQRect.h"
#include "sipqtQPoint.h"
#include "sipqtQSize.h"
#include "sipqtQColor.h"
#include "sipqtQPixmap.h"
#include "sipqtQColorGroup.h"
#include "sipqtQPalette.h"
#include "sipqtQBrush.h"
#include "sipqtQFont.h"
#include "sipqtQFontMetrics.h"
#include "sipqtQFontInfo.h"
#include "sipqtQCursor.h"
#include "sipqtQStyle.h"
#include "sipqtQString.h"
#include "sipqtQRegion.h"
#include "sipqtQBitmap.h"
#include "sipqtQSizePolicy.h"
#include "sipqtQLayout.h"
#include "sipqtQEvent.h"
#include "sipqtQMouseEvent.h"
#include "sipqtQKeyEvent.h"
#include "sipqtQFocusEvent.h"
#include "sipqtQPaintEvent.h"
#include "sipqtQMoveEvent.h"
#include "sipqtQResizeEvent.h"
#include "sipqtQCloseEvent.h"
#include "sipqtQContextMenuEvent.h"
#include "sipqtQIMEvent.h"
#include "sipqtQTabletEvent.h"
#include "sipqtQWheelEvent.h"
#include "sipqtQDragEnterEvent.h"
#include "sipqtQDragMoveEvent.h"
#include "sipqtQDragLeaveEvent.h"
#include "sipqtQDropEvent.h"
#include "sipqtQShowEvent.h"
#include "sipqtQHideEvent.h"


extern SIP_MODULE_EXTERN sipLazyAttrDef sipClassAttrTab_QWidget;

extern SIP_MODULE_EXTERN const void *sipCast_QWidget Py_PROTO((const void *,PyObject *));
extern SIP_MODULE_EXTERN PyObject *sipNew_QWidget Py_PROTO((PyObject *,PyObject *));


class SIP_MODULE_EXTERN sipQWidget : public QWidget
{
public:
	sipQWidget(QWidget *,const char *,unsigned);
        virtual const char *className() const {return "FileChooser";}
	virtual QMetaObject *metaObject() const {
    static QMetaObject *metaObj = 0;
    if ( metaObj )
	return metaObj;
    QMetaObject* parentObject = QWidget::staticMetaObject();
#ifndef QT_NO_PROPERTIES
    static const QMetaEnum::Item enum_0[] = {
	{ "File",  (int) 0 },
	{ "Directory",  (int) 1 }
    };
    static const QMetaEnum enum_tbl[] = {
	{ "Mode", 2, enum_0, FALSE }
    };
#endif // QT_NO_PROPERTIES
    static const QUParameter param_slot_0[] = {
	{ "fn", &static_QUType_QString, 0, QUParameter::In }
    };
    static const QUMethod slot_0 = {"setFileName", 1, param_slot_0 };
    static const QUParameter param_slot_1[] = {
	{ "m", &static_QUType_enum, 
#ifndef QT_NO_PROPERTIES
	  &enum_tbl[0]
#else
	  0
#endif // QT_NO_PROPERTIES
	  , QUParameter::In }
    };
    static const QUMethod slot_1 = {"setMode", 1, param_slot_1 };
    static const QUMethod slot_2 = {"chooseFile", 0, 0 };
    static const QMetaData slot_tbl[] = {
	{ "setFileName(const QString&)", &slot_0, QMetaData::Public },
	{ "setMode(Mode)", &slot_1, QMetaData::Public },
	{ "chooseFile()", &slot_2, QMetaData::Private }
    };
    static const QUParameter param_signal_0[] = {
	{ 0, &static_QUType_QString, 0, QUParameter::In }
    };
    static const QUMethod signal_0 = {"fileNameChanged", 1, param_signal_0 };
    static const QMetaData signal_tbl[] = {
	{ "fileNameChanged(const QString&)", &signal_0, QMetaData::Public }
    };
#ifndef QT_NO_PROPERTIES
    static const QMetaProperty props_tbl[2] = {
 	{ "Mode","mode", 0x0107, &metaObj, &enum_tbl[0], -1 },
	{ "QString","fileName", 0x3000103, &metaObj, 0, -1 }
    };
#endif // QT_NO_PROPERTIES
    metaObj = QMetaObject::new_metaobject(
	"FileChooser", parentObject,
	slot_tbl, 3,
	signal_tbl, 1,
#ifndef QT_NO_PROPERTIES
	props_tbl, 2,
	enum_tbl, 1,
#endif // QT_NO_PROPERTIES
	0, 0 );
//TODO    cleanUp_FileChooser.setMetaObject( metaObj );
    return metaObj;
	}

	~sipQWidget();
	int resolution() const;
	void setResolution(int);
	void customEvent(QCustomEvent *);
	void childEvent(QChildEvent *);
	void timerEvent(QTimerEvent *);
	QVariant property(const char *) const;
	bool setProperty(const char *,const QVariant&);
	void removeChild(QObject *);
	void insertChild(QObject *);
	void setName(const char *);
	bool eventFilter(QObject *,QEvent *);
	bool event(QEvent *);
	void setMicroFocusHint(int,int,int,int,bool,QFont *);
	static void sipVH_setMicroFocusHint(const sipMethodCache *,sipThisType *,int,int,int,int,bool,QFont *);
	void setKeyCompression(bool);
	static void sipVH_setKeyCompression(const sipMethodCache *,sipThisType *,bool);
	void setWFlags(unsigned);
	static void sipVH_setWFlags(const sipMethodCache *,sipThisType *,unsigned);
	void setWState(unsigned);
	static void sipVH_setWState(const sipMethodCache *,sipThisType *,unsigned);
	void destroy(bool,bool);
	static void sipVH_destroy(const sipMethodCache *,sipThisType *,bool,bool);
	void create(unsigned long,bool,bool);
	static void sipVH_create(const sipMethodCache *,sipThisType *,unsigned long,bool,bool);
	void styleChange(QStyle&);
	static void sipVH_styleChange(const sipMethodCache *,sipThisType *,QStyle&);
	void updateMask();
	static void sipVH_updateMask(const sipMethodCache *,sipThisType *);
	void hideEvent(QHideEvent *);
	static void sipVH_hideEvent(const sipMethodCache *,sipThisType *,QHideEvent *);
	void showEvent(QShowEvent *);
	static void sipVH_showEvent(const sipMethodCache *,sipThisType *,QShowEvent *);
	void dropEvent(QDropEvent *);
	static void sipVH_dropEvent(const sipMethodCache *,sipThisType *,QDropEvent *);
	void dragLeaveEvent(QDragLeaveEvent *);
	static void sipVH_dragLeaveEvent(const sipMethodCache *,sipThisType *,QDragLeaveEvent *);
	void dragMoveEvent(QDragMoveEvent *);
	static void sipVH_dragMoveEvent(const sipMethodCache *,sipThisType *,QDragMoveEvent *);
	void dragEnterEvent(QDragEnterEvent *);
	static void sipVH_dragEnterEvent(const sipMethodCache *,sipThisType *,QDragEnterEvent *);
	void wheelEvent(QWheelEvent *);
	static void sipVH_wheelEvent(const sipMethodCache *,sipThisType *,QWheelEvent *);
	bool focusNextPrevChild(bool);
	static bool sipVH_focusNextPrevChild(const sipMethodCache *,sipThisType *,bool);
	void windowActivationChange(bool);
	static void sipVH_windowActivationChange(const sipMethodCache *,sipThisType *,bool);
	void fontChange(const QFont&);
	static void sipVH_fontChange(const sipMethodCache *,sipThisType *,const QFont&);
	void paletteChange(const QPalette&);
	static void sipVH_paletteChange(const sipMethodCache *,sipThisType *,const QPalette&);
	void enabledChange(bool);
	static void sipVH_enabledChange(const sipMethodCache *,sipThisType *,bool);
	void tabletEvent(QTabletEvent *);
	static void sipVH_tabletEvent(const sipMethodCache *,sipThisType *,QTabletEvent *);
	void imEndEvent(QIMEvent *);
	static void sipVH_imEndEvent(const sipMethodCache *,sipThisType *,QIMEvent *);
	void imComposeEvent(QIMEvent *);
	static void sipVH_imComposeEvent(const sipMethodCache *,sipThisType *,QIMEvent *);
	void imStartEvent(QIMEvent *);
	static void sipVH_imStartEvent(const sipMethodCache *,sipThisType *,QIMEvent *);
	void contextMenuEvent(QContextMenuEvent *);
	static void sipVH_contextMenuEvent(const sipMethodCache *,sipThisType *,QContextMenuEvent *);
	void closeEvent(QCloseEvent *);
	static void sipVH_closeEvent(const sipMethodCache *,sipThisType *,QCloseEvent *);
	void resizeEvent(QResizeEvent *);
	static void sipVH_resizeEvent(const sipMethodCache *,sipThisType *,QResizeEvent *);
	void moveEvent(QMoveEvent *);
	static void sipVH_moveEvent(const sipMethodCache *,sipThisType *,QMoveEvent *);
	void paintEvent(QPaintEvent *);
	static void sipVH_paintEvent(const sipMethodCache *,sipThisType *,QPaintEvent *);
	void leaveEvent(QEvent *);
	static void sipVH_leaveEvent(const sipMethodCache *,sipThisType *,QEvent *);
	void enterEvent(QEvent *);
	static void sipVH_enterEvent(const sipMethodCache *,sipThisType *,QEvent *);
	void focusOutEvent(QFocusEvent *);
	static void sipVH_focusOutEvent(const sipMethodCache *,sipThisType *,QFocusEvent *);
	void focusInEvent(QFocusEvent *);
	static void sipVH_focusInEvent(const sipMethodCache *,sipThisType *,QFocusEvent *);
	void keyReleaseEvent(QKeyEvent *);
	static void sipVH_keyReleaseEvent(const sipMethodCache *,sipThisType *,QKeyEvent *);
	void keyPressEvent(QKeyEvent *);
	static void sipVH_keyPressEvent(const sipMethodCache *,sipThisType *,QKeyEvent *);
	void mouseMoveEvent(QMouseEvent *);
	static void sipVH_mouseMoveEvent(const sipMethodCache *,sipThisType *,QMouseEvent *);
	void mouseDoubleClickEvent(QMouseEvent *);
	static void sipVH_mouseDoubleClickEvent(const sipMethodCache *,sipThisType *,QMouseEvent *);
	void mouseReleaseEvent(QMouseEvent *);
	static void sipVH_mouseReleaseEvent(const sipMethodCache *,sipThisType *,QMouseEvent *);
	void mousePressEvent(QMouseEvent *);
	static void sipVH_mousePressEvent(const sipMethodCache *,sipThisType *,QMouseEvent *);
	void setGeometry(const QRect&);
	static void sipVH_setGeometry(const sipMethodCache *,sipThisType *,const QRect&);
	void polish();
	static void sipVH_polish(const sipMethodCache *,sipThisType *);
	void showNormal();
	static void sipVH_showNormal(const sipMethodCache *,sipThisType *);
	void showMaximized();
	static void sipVH_showMaximized(const sipMethodCache *,sipThisType *);
	void showMinimized();
	static void sipVH_showMinimized(const sipMethodCache *,sipThisType *);
	void setUpdatesEnabled(bool);
	static void sipVH_setUpdatesEnabled(const sipMethodCache *,sipThisType *,bool);
	void setFocus();
	static void sipVH_setFocus(const sipMethodCache *,sipThisType *);
	void setMouseTracking(bool);
	static void sipVH_setMouseTracking(const sipMethodCache *,sipThisType *,bool);
	void setIconText(const QString&);
	static void sipVH_setIconText(const sipMethodCache *,sipThisType *,const QString&);
	void setIcon(const QPixmap&);
	static void sipVH_setIcon(const sipMethodCache *,sipThisType *,const QPixmap&);
	void setCaption(const QString&);
	static void sipVH_setCaption(const sipMethodCache *,sipThisType *,const QString&);
	void setGeometry(int,int,int,int);
	static void sipVH_setGeometry(const sipMethodCache *,sipThisType *,int,int,int,int);
	void resize(int,int);
	static void sipVH_resize(const sipMethodCache *,sipThisType *,int,int);
	void move(int,int);
	static void sipVH_move(const sipMethodCache *,sipThisType *,int,int);
	void hide();
	static void sipVH_hide(const sipMethodCache *,sipThisType *);
	void show();
	static void sipVH_show(const sipMethodCache *,sipThisType *);
	void setEnabled(bool);
	static void sipVH_setEnabled(const sipMethodCache *,sipThisType *,bool);
	void adjustSize();
	static void sipVH_adjustSize(const sipMethodCache *,sipThisType *);
	void setBackgroundOrigin(QWidget::BackgroundOrigin);
	static void sipVH_setBackgroundOrigin(const sipMethodCache *,sipThisType *,QWidget::BackgroundOrigin);
	bool customWhatsThis() const;
	static bool sipVH_customWhatsThis(const sipMethodCache *,sipThisType *);
	void setAutoMask(bool);
	static void sipVH_setAutoMask(const sipMethodCache *,sipThisType *,bool);
	void setAcceptDrops(bool);
	static void sipVH_setAcceptDrops(const sipMethodCache *,sipThisType *,bool);
	void reparent(QWidget *,unsigned,const QPoint&,bool);
	static void sipVH_reparent(const sipMethodCache *,sipThisType *,QWidget *,unsigned,const QPoint&,bool);
	int heightForWidth(int) const;
	static int sipVH_heightForWidth(const sipMethodCache *,sipThisType *,int);
	void setSizePolicy(QSizePolicy);
	static void sipVH_setSizePolicy(const sipMethodCache *,sipThisType *,QSizePolicy);
	QSizePolicy sizePolicy() const;
	static QSizePolicy sipVH_sizePolicy(const sipMethodCache *,sipThisType *);
	QSize minimumSizeHint() const;
	static QSize sipVH_minimumSizeHint(const sipMethodCache *,sipThisType *);
	bool close(bool);
	static bool sipVH_close(const sipMethodCache *,sipThisType *,bool);
	void setFocusProxy(QWidget *);
	static void sipVH_setFocusProxy(const sipMethodCache *,sipThisType *,QWidget *);
	void setFocusPolicy(QWidget::FocusPolicy);
	static void sipVH_setFocusPolicy(const sipMethodCache *,sipThisType *,QWidget::FocusPolicy);
	void setActiveWindow();
	static void sipVH_setActiveWindow(const sipMethodCache *,sipThisType *);
	void setMask(const QRegion&);
	static void sipVH_setMask(const sipMethodCache *,sipThisType *,const QRegion&);
	void setMask(const QBitmap&);
	static void sipVH_setMask(const sipMethodCache *,sipThisType *,const QBitmap&);
	void unsetCursor();
	static void sipVH_unsetCursor(const sipMethodCache *,sipThisType *);
	void setBackgroundMode(Qt::BackgroundMode);
	static void sipVH_setBackgroundMode(const sipMethodCache *,sipThisType *,Qt::BackgroundMode);
	void setSizeIncrement(int,int);
	static void sipVH_setSizeIncrement(const sipMethodCache *,sipThisType *,int,int);
	void setMaximumSize(int,int);
	static void sipVH_setMaximumSize(const sipMethodCache *,sipThisType *,int,int);
	void setMinimumSize(int,int);
	static void sipVH_setMinimumSize(const sipMethodCache *,sipThisType *,int,int);
	QSize sizeHint() const;
	static QSize sipVH_sizeHint(const sipMethodCache *,sipThisType *);
	void setCursor(const QCursor&);
	static void sipVH_setCursor(const sipMethodCache *,sipThisType *,const QCursor&);
	void setFont(const QFont&);
	static void sipVH_setFont(const sipMethodCache *,sipThisType *,const QFont&);
	void setPaletteBackgroundPixmap(const QPixmap&);
	static void sipVH_setPaletteBackgroundPixmap(const sipMethodCache *,sipThisType *,const QPixmap&);
	void setPaletteBackgroundColor(const QColor&);
	static void sipVH_setPaletteBackgroundColor(const sipMethodCache *,sipThisType *,const QColor&);
	void setPalette(const QPalette&);
	static void sipVH_setPalette(const sipMethodCache *,sipThisType *,const QPalette&);
	void setErasePixmap(const QPixmap&);
	static void sipVH_setErasePixmap(const sipMethodCache *,sipThisType *,const QPixmap&);
	void setEraseColor(const QColor&);
	static void sipVH_setEraseColor(const sipMethodCache *,sipThisType *,const QColor&);

	// There is a public member function for every protected member
	// function visible from this class.

	const QObject * sipProtect_sender();
	void sipProtect_timerEvent(QTimerEvent *);
	void sipProtect_childEvent(QChildEvent *);
	void sipProtect_customEvent(QCustomEvent *);
	bool sipProtect_event(QEvent *);
	void sipProtect_mousePressEvent(QMouseEvent *);
	void sipProtect_mouseReleaseEvent(QMouseEvent *);
	void sipProtect_mouseDoubleClickEvent(QMouseEvent *);
	void sipProtect_mouseMoveEvent(QMouseEvent *);
	void sipProtect_keyPressEvent(QKeyEvent *);
	void sipProtect_keyReleaseEvent(QKeyEvent *);
	void sipProtect_focusInEvent(QFocusEvent *);
	void sipProtect_focusOutEvent(QFocusEvent *);
	void sipProtect_enterEvent(QEvent *);
	void sipProtect_leaveEvent(QEvent *);
	void sipProtect_paintEvent(QPaintEvent *);
	void sipProtect_moveEvent(QMoveEvent *);
	void sipProtect_resizeEvent(QResizeEvent *);
	void sipProtect_closeEvent(QCloseEvent *);
	void sipProtect_contextMenuEvent(QContextMenuEvent *);
	void sipProtect_imStartEvent(QIMEvent *);
	void sipProtect_imComposeEvent(QIMEvent *);
	void sipProtect_imEndEvent(QIMEvent *);
	void sipProtect_tabletEvent(QTabletEvent *);
	void sipProtect_enabledChange(bool);
	void sipProtect_paletteChange(const QPalette&);
	void sipProtect_fontChange(const QFont&);
	void sipProtect_windowActivationChange(bool);
	void sipProtect_resetInputContext();
	unsigned sipProtect_getWFlags();
	void sipProtect_clearWFlags(unsigned);
	bool sipProtect_focusNextPrevChild(bool);
	void sipProtect_wheelEvent(QWheelEvent *);
	void sipProtect_dragEnterEvent(QDragEnterEvent *);
	void sipProtect_dragMoveEvent(QDragMoveEvent *);
	void sipProtect_dragLeaveEvent(QDragLeaveEvent *);
	void sipProtect_dropEvent(QDropEvent *);
	void sipProtect_showEvent(QShowEvent *);
	void sipProtect_hideEvent(QHideEvent *);
	void sipProtect_updateMask();
	void sipProtect_styleChange(QStyle&);
	int sipProtect_metric(int);
	void sipProtect_create(unsigned long,bool,bool);
	void sipProtect_destroy(bool,bool);
	unsigned sipProtect_getWState();
	void sipProtect_setWState(unsigned);
	void sipProtect_clearWState(unsigned);
	void sipProtect_setWFlags(unsigned);
	void sipProtect_setKeyCompression(bool);
	void sipProtect_setMicroFocusHint(int,int,int,int,bool,QFont *);

	// There is a public member function for every Qt signal that can be
	// emitted by this object.  This function is called by Python to emit
	// the signal.

	int sipEmit_destroyed(PyObject *sipArgs);

	sipThisType *sipPyThis;

private:
	sipQWidget(const sipQWidget &);
	sipQWidget &operator = (const sipQWidget &);

	sipMethodCache sipPyMethods[97];
};

extern SIP_MODULE_EXTERN QWidget *sipForceConvertTo_QWidget Py_PROTO((PyObject *,int *));

#endif

Reply via email to