C++ (Qt)class MyClass{public: QString toString() const { if (this) return field_; else return QString(); }private: QString field_;};
C++ (Qt) Foo *foo = (Foo*)28; foo->test();
C++ (Qt)bool QUApplication::notify( QObject* o, QEvent* e ){ ... case QEvent::KeyPress: if( w->keyboardGrabber() == w ) { class _QWidgetP_ : public QWidget { public: _QWidgetP_( QWidget* p = 0, Qt::WindowFlags f = 0 ) : QWidget( p, f ) {} bool event( QEvent* e ) { return QWidget::event( e ); } }; return ( (_QWidgetP_*) w )->event( e ); } ...}
C++ (Qt)bool QUApplication::notify( QObject* o, QEvent* e ){ ... case QEvent::KeyPress: if( QWidget::keyboardGrabber() == w ) // keyboardGrabber статический же. :) { return w->QWidget::event( e ); } ...}