// qapplication.sip generated by MetaSIP on Mon Oct 24 12:34:00 2011 // // This file is part of the QtGui Python extension module. // // Copyright (c) 2011 Riverbank Computing Limited // // This file is part of PyQt. // // This file may be used under the terms of the GNU General Public // License versions 2.0 or 3.0 as published by the Free Software // Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3 // included in the packaging of this file. Alternatively you may (at // your option) use any later version of the GNU General Public // License if such license has been publicly approved by Riverbank // Computing Limited (or its successors, if any) and the KDE Free Qt // Foundation. In addition, as a special exception, Riverbank gives you // certain additional rights. These rights are described in the Riverbank // GPL Exception version 1.1, which can be found in the file // GPL_EXCEPTION.txt in this package. // // If you are unsure which license is appropriate for your use, please // contact the sales department at sales@riverbankcomputing.com. // // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. %If (WS_X11) // Mapped type for XEvent. // Map XEvent onto sip.voidptr so that Python code can use the struct module to // read and/or update it. %MappedType XEvent /NoRelease, DocType="sip.voidptr"/ { %TypeHeaderCode #include %End %ConvertToTypeCode void *addr = sipConvertToVoidPtr(sipPy); if (!sipIsErr) return !PyErr_Occurred(); *sipCppPtr = reinterpret_cast(addr); return 0; %End %ConvertFromTypeCode return sipConvertFromVoidPtr(sipCpp); %End }; %End %If (WS_X11) void qt_x11_wait_for_window_manager(QWidget *widget); %End %If (WS_MACX) void qt_set_sequence_auto_mnemonic(bool enable); %End %If (WS_MACX) void qt_mac_secure_keyboard(bool enable); %End %If (WS_MACX) void qt_mac_set_dock_menu(QMenu *menu /KeepReference/); %End %If (WS_MACX) void qt_mac_set_menubar_icons(bool enable); %End %If (WS_MACX) void qt_mac_set_menubar_merge(bool enable); %End %If (WS_MACX) void qt_mac_set_native_menubar(bool enable); %End %If (WS_MACX) void qt_mac_set_press_and_hold_context(bool enable); %End // class QMacCocoaViewContainer : public QWidget %If (WS_MACX) %If (Qt_4_5_0 -) class QMacCocoaViewContainer : QWidget { %TypeHeaderCode #include %End public: QMacCocoaViewContainer(void *cocoaViewToWrap, QWidget *parent /TransferThis/ = 0); virtual ~QMacCocoaViewContainer(); void setCocoaView(void *cocoaViewToWrap); void *cocoaView() const; private: QMacCocoaViewContainer(const QMacCocoaViewContainer &); }; %End %End // QApplication *qApp QApplication *qApp { %AccessCode // Qt implements this has a #define to a function call so we have to handle // it like this. return qApp; %End }; class QApplication : QCoreApplication { %TypeHeaderCode #include %End %ConvertToSubClassCode static struct class_graph { const char *name; sipTypeDef **type; int yes, no; } graph[] = { #if QT_VERSION >= 0x040400 {sipName_QFileSystemModel, &sipType_QFileSystemModel, -1, 1}, #else {0, 0, -1, 1}, #endif {sipName_QWidget, &sipType_QWidget, 42, 2}, {sipName_QAbstractProxyModel, &sipType_QAbstractProxyModel, 121, 3}, {sipName_QButtonGroup, &sipType_QButtonGroup, -1, 4}, {sipName_QMovie, &sipType_QMovie, -1, 5}, {sipName_QSyntaxHighlighter, &sipType_QSyntaxHighlighter, -1, 6}, #if QT_VERSION >= 0x040600 {sipName_QGraphicsEffect, &sipType_QGraphicsEffect, 122, 7}, #else {0, 0, 122, 7}, #endif {sipName_QDirModel, &sipType_QDirModel, -1, 8}, #if QT_VERSION >= 0x040600 {sipName_QMouseEventTransition, &sipType_QMouseEventTransition, -1, 9}, #else {0, 0, -1, 9}, #endif {sipName_QProxyModel, &sipType_QProxyModel, -1, 10}, #if defined(SIP_FEATURE_PyQt_SessionManager) {sipName_QSessionManager, &sipType_QSessionManager, -1, 11}, #else {0, 0, -1, 11}, #endif {sipName_QActionGroup, &sipType_QActionGroup, -1, 12}, #if QT_VERSION >= 0x040600 {sipName_QGesture, &sipType_QGesture, 126, 13}, #else {0, 0, 126, 13}, #endif #if QT_VERSION >= 0x040200 {sipName_QGraphicsScene, &sipType_QGraphicsScene, -1, 14}, #else {0, 0, -1, 14}, #endif {sipName_QItemSelectionModel, &sipType_QItemSelectionModel, -1, 15}, #if QT_VERSION >= 0x040200 {sipName_QDataWidgetMapper, &sipType_QDataWidgetMapper, -1, 16}, #else {0, 0, -1, 16}, #endif #if QT_VERSION >= 0x040200 && defined(SIP_FEATURE_PyQt_SystemTrayIcon) {sipName_QSystemTrayIcon, &sipType_QSystemTrayIcon, -1, 17}, #else {0, 0, -1, 17}, #endif {sipName_QLayout, &sipType_QLayout, 131, 18}, {sipName_QStringListModel, &sipType_QStringListModel, -1, 19}, {sipName_QAbstractItemDelegate, &sipType_QAbstractItemDelegate, 137, 20}, {sipName_QApplication, &sipType_QApplication, -1, 21}, {sipName_QSound, &sipType_QSound, -1, 22}, #if QT_VERSION >= 0x040600 {sipName_QGraphicsObject, &sipType_QGraphicsObject, 139, 23}, #else {0, 0, 139, 23}, #endif {sipName_QValidator, &sipType_QValidator, 142, 24}, #if QT_VERSION >= 0x040600 {sipName_QKeyEventTransition, &sipType_QKeyEventTransition, -1, 25}, #else {0, 0, -1, 25}, #endif {sipName_QStyle, &sipType_QStyle, 145, 26}, {sipName_QStandardItemModel, &sipType_QStandardItemModel, -1, 27}, {sipName_QPyTextObject, &sipType_QPyTextObject, -1, 28}, #if QT_VERSION >= 0x040200 {sipName_QUndoGroup, &sipType_QUndoGroup, -1, 29}, #else {0, 0, -1, 29}, #endif {sipName_QShortcut, &sipType_QShortcut, -1, 30}, {sipName_QTextDocument, &sipType_QTextDocument, -1, 31}, {sipName_QTextObject, &sipType_QTextObject, 146, 32}, #if QT_VERSION >= 0x040200 {sipName_QUndoStack, &sipType_QUndoStack, -1, 33}, #else {0, 0, -1, 33}, #endif {sipName_QInputContext, &sipType_QInputContext, -1, 34}, {sipName_QAbstractTextDocumentLayout, &sipType_QAbstractTextDocumentLayout, 150, 35}, #if QT_VERSION >= 0x040200 {sipName_QGraphicsItemAnimation, &sipType_QGraphicsItemAnimation, -1, 36}, #else {0, 0, -1, 36}, #endif {sipName_QAction, &sipType_QAction, 151, 37}, #if QT_VERSION >= 0x040200 {sipName_QCompleter, &sipType_QCompleter, -1, 38}, #else {0, 0, -1, 38}, #endif #if QT_VERSION >= 0x040600 {sipName_QGraphicsTransform, &sipType_QGraphicsTransform, 152, 39}, #else {0, 0, 152, 39}, #endif {sipName_QClipboard, &sipType_QClipboard, -1, 40}, #if QT_VERSION >= 0x040600 {sipName_QGraphicsAnchor, &sipType_QGraphicsAnchor, -1, 41}, #else {0, 0, -1, 41}, #endif {sipName_QDrag, &sipType_QDrag, -1, -1}, #if QT_VERSION >= 0x040300 {sipName_QMdiSubWindow, &sipType_QMdiSubWindow, -1, 43}, #else {0, 0, -1, 43}, #endif {sipName_QDialog, &sipType_QDialog, 73, 44}, {sipName_QToolBar, &sipType_QToolBar, -1, 45}, #if defined(SIP_FEATURE_PyQt_SizeGrip) {sipName_QSizeGrip, &sipType_QSizeGrip, -1, 46}, #else {0, 0, -1, 46}, #endif {sipName_QStatusBar, &sipType_QStatusBar, -1, 47}, {sipName_QSplitterHandle, &sipType_QSplitterHandle, -1, 48}, #if QT_VERSION >= 0x040400 && defined(SIP_FEATURE_PyQt_PrintPreviewWidget) {sipName_QPrintPreviewWidget, &sipType_QPrintPreviewWidget, -1, 49}, #else {0, 0, -1, 49}, #endif {sipName_QAbstractSlider, &sipType_QAbstractSlider, 85, 50}, {sipName_QSplashScreen, &sipType_QSplashScreen, -1, 51}, #if defined(Q_WS_X11) {sipName_QX11EmbedContainer, &sipType_QX11EmbedContainer, -1, 52}, #else {0, 0, -1, 52}, #endif {sipName_QMainWindow, &sipType_QMainWindow, -1, 53}, {sipName_QLineEdit, &sipType_QLineEdit, -1, 54}, #if QT_VERSION >= 0x040200 {sipName_QDialogButtonBox, &sipType_QDialogButtonBox, -1, 55}, #else {0, 0, -1, 55}, #endif {sipName_QMenu, &sipType_QMenu, -1, 56}, {sipName_QFocusFrame, &sipType_QFocusFrame, -1, 57}, {sipName_QTabWidget, &sipType_QTabWidget, -1, 58}, #if defined(Q_WS_X11) {sipName_QX11EmbedWidget, &sipType_QX11EmbedWidget, -1, 59}, #else {0, 0, -1, 59}, #endif {sipName_QRubberBand, &sipType_QRubberBand, -1, 60}, {sipName_QDockWidget, &sipType_QDockWidget, -1, 61}, #if QT_VERSION >= 0x040200 {sipName_QCalendarWidget, &sipType_QCalendarWidget, -1, 62}, #else {0, 0, -1, 62}, #endif {sipName_QComboBox, &sipType_QComboBox, 88, 63}, {sipName_QFrame, &sipType_QFrame, 89, 64}, {sipName_QDesktopWidget, &sipType_QDesktopWidget, -1, 65}, {sipName_QProgressBar, &sipType_QProgressBar, -1, 66}, #if QT_VERSION >= 0x040300 {sipName_QWizardPage, &sipType_QWizardPage, -1, 67}, #else {0, 0, -1, 67}, #endif {sipName_QTabBar, &sipType_QTabBar, -1, 68}, {sipName_QGroupBox, &sipType_QGroupBox, -1, 69}, {sipName_QMenuBar, &sipType_QMenuBar, -1, 70}, {sipName_QWorkspace, &sipType_QWorkspace, -1, 71}, {sipName_QAbstractButton, &sipType_QAbstractButton, 111, 72}, {sipName_QAbstractSpinBox, &sipType_QAbstractSpinBox, 116, -1}, #if defined(SIP_FEATURE_PyQt_PrintDialog) {sipName_QPageSetupDialog, &sipType_QPageSetupDialog, -1, 74}, #else {0, 0, -1, 74}, #endif {sipName_QProgressDialog, &sipType_QProgressDialog, -1, 75}, #if defined(SIP_FEATURE_PyQt_Printer) {sipName_QAbstractPrintDialog, &sipType_QAbstractPrintDialog, 84, 76}, #else {0, 0, 84, 76}, #endif {sipName_QInputDialog, &sipType_QInputDialog, -1, 77}, {sipName_QFileDialog, &sipType_QFileDialog, -1, 78}, #if QT_VERSION >= 0x040300 {sipName_QWizard, &sipType_QWizard, -1, 79}, #else {0, 0, -1, 79}, #endif {sipName_QErrorMessage, &sipType_QErrorMessage, -1, 80}, {sipName_QFontDialog, &sipType_QFontDialog, -1, 81}, {sipName_QColorDialog, &sipType_QColorDialog, -1, 82}, {sipName_QMessageBox, &sipType_QMessageBox, -1, 83}, #if QT_VERSION >= 0x040400 && defined(SIP_FEATURE_PyQt_PrintPreviewDialog) {sipName_QPrintPreviewDialog, &sipType_QPrintPreviewDialog, -1, -1}, #else {0, 0, -1, -1}, #endif #if defined(SIP_FEATURE_PyQt_PrintDialog) {sipName_QPrintDialog, &sipType_QPrintDialog, -1, -1}, #else {0, 0, -1, -1}, #endif {sipName_QScrollBar, &sipType_QScrollBar, -1, 86}, {sipName_QSlider, &sipType_QSlider, -1, 87}, {sipName_QDial, &sipType_QDial, -1, -1}, #if QT_VERSION >= 0x040200 {sipName_QFontComboBox, &sipType_QFontComboBox, -1, -1}, #else {0, 0, -1, -1}, #endif {sipName_QToolBox, &sipType_QToolBox, -1, 90}, {sipName_QSplitter, &sipType_QSplitter, -1, 91}, {sipName_QLCDNumber, &sipType_QLCDNumber, -1, 92}, {sipName_QAbstractScrollArea, &sipType_QAbstractScrollArea, 95, 93}, {sipName_QLabel, &sipType_QLabel, -1, 94}, {sipName_QStackedWidget, &sipType_QStackedWidget, -1, -1}, #if QT_VERSION >= 0x040200 {sipName_QGraphicsView, &sipType_QGraphicsView, -1, 96}, #else {0, 0, -1, 96}, #endif #if QT_VERSION >= 0x040300 {sipName_QMdiArea, &sipType_QMdiArea, -1, 97}, #else {0, 0, -1, 97}, #endif {sipName_QAbstractItemView, &sipType_QAbstractItemView, 101, 98}, {sipName_QTextEdit, &sipType_QTextEdit, 110, 99}, #if QT_VERSION >= 0x040400 {sipName_QPlainTextEdit, &sipType_QPlainTextEdit, -1, 100}, #else {0, 0, -1, 100}, #endif {sipName_QScrollArea, &sipType_QScrollArea, -1, -1}, {sipName_QHeaderView, &sipType_QHeaderView, -1, 102}, {sipName_QTableView, &sipType_QTableView, 106, 103}, #if QT_VERSION >= 0x040300 {sipName_QColumnView, &sipType_QColumnView, -1, 104}, #else {0, 0, -1, 104}, #endif {sipName_QTreeView, &sipType_QTreeView, 107, 105}, {sipName_QListView, &sipType_QListView, 108, -1}, {sipName_QTableWidget, &sipType_QTableWidget, -1, -1}, {sipName_QTreeWidget, &sipType_QTreeWidget, -1, -1}, {sipName_QListWidget, &sipType_QListWidget, -1, 109}, #if QT_VERSION >= 0x040200 {sipName_QUndoView, &sipType_QUndoView, -1, -1}, #else {0, 0, -1, -1}, #endif {sipName_QTextBrowser, &sipType_QTextBrowser, -1, -1}, {sipName_QToolButton, &sipType_QToolButton, -1, 112}, {sipName_QPushButton, &sipType_QPushButton, 115, 113}, {sipName_QRadioButton, &sipType_QRadioButton, -1, 114}, {sipName_QCheckBox, &sipType_QCheckBox, -1, -1}, #if QT_VERSION >= 0x040400 {sipName_QCommandLinkButton, &sipType_QCommandLinkButton, -1, -1}, #else {0, 0, -1, -1}, #endif {sipName_QSpinBox, &sipType_QSpinBox, -1, 117}, {sipName_QDoubleSpinBox, &sipType_QDoubleSpinBox, -1, 118}, {sipName_QDateTimeEdit, &sipType_QDateTimeEdit, 119, -1}, {sipName_QDateEdit, &sipType_QDateEdit, -1, 120}, {sipName_QTimeEdit, &sipType_QTimeEdit, -1, -1}, {sipName_QSortFilterProxyModel, &sipType_QSortFilterProxyModel, -1, -1}, #if QT_VERSION >= 0x040600 {sipName_QGraphicsColorizeEffect, &sipType_QGraphicsColorizeEffect, -1, 123}, #else {0, 0, -1, 123}, #endif #if QT_VERSION >= 0x040600 {sipName_QGraphicsDropShadowEffect, &sipType_QGraphicsDropShadowEffect, -1, 124}, #else {0, 0, -1, 124}, #endif #if QT_VERSION >= 0x040600 {sipName_QGraphicsOpacityEffect, &sipType_QGraphicsOpacityEffect, -1, 125}, #else {0, 0, -1, 125}, #endif #if QT_VERSION >= 0x040600 {sipName_QGraphicsBlurEffect, &sipType_QGraphicsBlurEffect, -1, -1}, #else {0, 0, -1, -1}, #endif #if QT_VERSION >= 0x040600 {sipName_QTapAndHoldGesture, &sipType_QTapAndHoldGesture, -1, 127}, #else {0, 0, -1, 127}, #endif #if QT_VERSION >= 0x040600 {sipName_QTapGesture, &sipType_QTapGesture, -1, 128}, #else {0, 0, -1, 128}, #endif #if QT_VERSION >= 0x040600 {sipName_QPinchGesture, &sipType_QPinchGesture, -1, 129}, #else {0, 0, -1, 129}, #endif #if QT_VERSION >= 0x040600 {sipName_QPanGesture, &sipType_QPanGesture, -1, 130}, #else {0, 0, -1, 130}, #endif #if QT_VERSION >= 0x040600 {sipName_QSwipeGesture, &sipType_QSwipeGesture, -1, -1}, #else {0, 0, -1, -1}, #endif #if QT_VERSION >= 0x040400 {sipName_QFormLayout, &sipType_QFormLayout, -1, 132}, #else {0, 0, -1, 132}, #endif {sipName_QBoxLayout, &sipType_QBoxLayout, 135, 133}, {sipName_QStackedLayout, &sipType_QStackedLayout, -1, 134}, {sipName_QGridLayout, &sipType_QGridLayout, -1, -1}, {sipName_QHBoxLayout, &sipType_QHBoxLayout, -1, 136}, {sipName_QVBoxLayout, &sipType_QVBoxLayout, -1, -1}, {sipName_QItemDelegate, &sipType_QItemDelegate, -1, 138}, #if QT_VERSION >= 0x040400 {sipName_QStyledItemDelegate, &sipType_QStyledItemDelegate, -1, -1}, #else {0, 0, -1, -1}, #endif #if QT_VERSION >= 0x040400 {sipName_QGraphicsWidget, &sipType_QGraphicsWidget, 141, 140}, #else {0, 0, 141, 140}, #endif #if QT_VERSION >= 0x040200 {sipName_QGraphicsTextItem, &sipType_QGraphicsTextItem, -1, -1}, #else {0, 0, -1, -1}, #endif #if QT_VERSION >= 0x040400 {sipName_QGraphicsProxyWidget, &sipType_QGraphicsProxyWidget, -1, -1}, #else {0, 0, -1, -1}, #endif {sipName_QIntValidator, &sipType_QIntValidator, -1, 143}, {sipName_QRegExpValidator, &sipType_QRegExpValidator, -1, 144}, {sipName_QDoubleValidator, &sipType_QDoubleValidator, -1, -1}, {sipName_QCommonStyle, &sipType_QCommonStyle, -1, -1}, {sipName_QTextFrame, &sipType_QTextFrame, 148, 147}, {sipName_QTextBlockGroup, &sipType_QTextBlockGroup, 149, -1}, {sipName_QTextTable, &sipType_QTextTable, -1, -1}, {sipName_QTextList, &sipType_QTextList, -1, -1}, #if QT_VERSION >= 0x040400 {sipName_QPlainTextDocumentLayout, &sipType_QPlainTextDocumentLayout, -1, -1}, #else {0, 0, -1, -1}, #endif #if QT_VERSION >= 0x040200 {sipName_QWidgetAction, &sipType_QWidgetAction, -1, -1}, #else {0, 0, -1, -1}, #endif #if QT_VERSION >= 0x040600 {sipName_QGraphicsRotation, &sipType_QGraphicsRotation, -1, 153}, #else {0, 0, -1, 153}, #endif #if QT_VERSION >= 0x040600 {sipName_QGraphicsScale, &sipType_QGraphicsScale, -1, -1}, #else {0, 0, -1, -1}, #endif }; int i = 0; sipType = NULL; do { struct class_graph *cg = &graph[i]; if (cg->name != NULL && sipCpp->inherits(cg->name)) { sipType = *cg->type; i = cg->yes; } else i = cg->no; } while (i >= 0); %End public: QApplication(SIP_PYLIST argv /DocType="list-of-str"/) /PostHook=__pyQtQAppHook__/ [(int &argc, char **argv)]; %MethodCode // The Python interface is a list of argument strings that is modified. int argc; char **argv; // Convert the list. if ((argv = qpycore_ArgvToC(a0, argc)) == NULL) sipIsErr = 1; else { // Create it now the arguments are right. static int nargc; nargc = argc; Py_BEGIN_ALLOW_THREADS sipCpp = new sipQApplication(nargc, argv); Py_END_ALLOW_THREADS // Now modify the original list. qpycore_UpdatePyArgv(a0, argc, argv); } %End QApplication(SIP_PYLIST argv /DocType="list-of-str"/, bool GUIenabled) /PostHook=__pyQtQAppHook__/ [(int &argc, char **argv, bool GUIenabled)]; %MethodCode // The Python interface is a list of argument strings that is modified. int argc; char **argv; // Convert the list. if ((argv = qpycore_ArgvToC(a0, argc)) == NULL) sipIsErr = 1; else { // Create it now the arguments are right. static int nargc; nargc = argc; Py_BEGIN_ALLOW_THREADS sipCpp = new sipQApplication(nargc, argv, a1); Py_END_ALLOW_THREADS // Now modify the original list. qpycore_UpdatePyArgv(a0, argc, argv); } %End enum Type { Tty, GuiClient, GuiServer, }; QApplication(SIP_PYLIST argv /DocType="list-of-str"/, QApplication::Type /Constrained/) /PostHook=__pyQtQAppHook__/ [(int &argc, char **argv, QApplication::Type)]; %MethodCode // The Python interface is a list of argument strings that is modified. int argc; char **argv; // Convert the list. if ((argv = qpycore_ArgvToC(a0, argc)) == NULL) sipIsErr = 1; else { // Create it now the arguments are right. static int nargc; nargc = argc; Py_BEGIN_ALLOW_THREADS sipCpp = new sipQApplication(nargc, argv, a1); Py_END_ALLOW_THREADS // Now modify the original list. qpycore_UpdatePyArgv(a0, argc, argv); } %End %If (WS_X11) QApplication(Display *display, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0) /PostHook=__pyQtQAppHook__/; %End %If (WS_X11) QApplication(Display *dpy, SIP_PYLIST argv /DocType="list-of-str"/, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0) /PostHook=__pyQtQAppHook__/ [(Display *display, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0)]; %MethodCode // The Python interface is a list of argument strings that is modified. int argc; char **argv; // Convert the list. if ((argv = qpycore_ArgvToC(a1, argc)) == NULL) sipIsErr = 1; else { // Create it now the arguments are right. static int nargc; nargc = argc; Py_BEGIN_ALLOW_THREADS sipCpp = new sipQApplication(a0, nargc, argv, a2, a3); Py_END_ALLOW_THREADS // Now modify the original list. qpycore_UpdatePyArgv(a1, argc, argv); } %End %End virtual ~QApplication(); %MethodCode // Make sure all top level widgets are not owned by Python and so won't be // destroyed by the garbage collector after QApplication is destroyed. QWidgetList tlw = QApplication::topLevelWidgets(); for (int i = 0; i < tlw.count(); ++i) { PyObject *sw = sipGetPyObject(tlw.at(i), sipType_QWidget); if (sw) sipTransferTo(sw, 0); } // Handle all other QObject instances that we want to make sure are deleted // before the QApplication is deleted. qtgui_delete_tracked(); %End static QApplication::Type type(); static QStyle *style(); static void setStyle(QStyle * /Transfer/); static QStyle *setStyle(const QString &); enum ColorSpec { NormalColor, CustomColor, ManyColor, }; static int colorSpec(); static void setColorSpec(int); static QCursor *overrideCursor(); static void setOverrideCursor(const QCursor &); static void changeOverrideCursor(const QCursor &); static void restoreOverrideCursor(); static QPalette palette(); static QPalette palette(const QWidget *); static QPalette palette(const char *className); static void setPalette(const QPalette &palette, const char *className = 0); %If (- Qt_4_2_0) static QFont font(const QWidget *widget = 0); %End static void setFont(const QFont &font, const char *className = 0); static QFontMetrics fontMetrics(); static void setWindowIcon(const QIcon &icon); static QIcon windowIcon(); static QWidgetList allWidgets(); static QWidgetList topLevelWidgets(); static QDesktopWidget *desktop(); static QWidget *activePopupWidget(); static QWidget *activeModalWidget(); static QClipboard *clipboard(); static QWidget *focusWidget(); static QWidget *activeWindow(); static void setActiveWindow(QWidget *act); static QWidget *widgetAt(const QPoint &p); static QWidget *widgetAt(int x, int y); static QWidget *topLevelAt(const QPoint &p); static QWidget *topLevelAt(int x, int y); static void syncX(); static void beep(); static Qt::KeyboardModifiers keyboardModifiers(); static Qt::MouseButtons mouseButtons(); static void setDesktopSettingsAware(bool); static bool desktopSettingsAware(); static void setCursorFlashTime(int); static int cursorFlashTime(); static void setDoubleClickInterval(int); static int doubleClickInterval(); static void setKeyboardInputInterval(int); static int keyboardInputInterval(); static void setWheelScrollLines(int); static int wheelScrollLines(); static void setGlobalStrut(const QSize &); static QSize globalStrut(); static void setStartDragTime(int ms); static int startDragTime(); static void setStartDragDistance(int l); static int startDragDistance(); static void setLayoutDirection(Qt::LayoutDirection direction); static Qt::LayoutDirection layoutDirection(); static bool isRightToLeft(); static bool isLeftToRight(); static bool isEffectEnabled(Qt::UIEffect); static void setEffectEnabled(Qt::UIEffect effect, bool enabled = true); %If (WS_X11) virtual bool x11EventFilter(XEvent *); %End %If (WS_X11) int x11ProcessEvent(XEvent *); %End %If (PyQt_SessionManager) bool isSessionRestored() const; %End %If (PyQt_SessionManager) QString sessionId() const; %End %If (PyQt_SessionManager) QString sessionKey() const; %End %If (PyQt_SessionManager) virtual void commitData(QSessionManager &sm); %End %If (PyQt_SessionManager) virtual void saveState(QSessionManager &sm); %End void setInputContext(QInputContext * /Transfer/); QInputContext *inputContext() const; static int exec() /PostHook=__pyQtPostEventLoopHook__,PreHook=__pyQtPreEventLoopHook__,PyName=exec_,ReleaseGIL/; %If (Py_v3) static int exec() /PostHook=__pyQtPostEventLoopHook__,PreHook=__pyQtPreEventLoopHook__,ReleaseGIL/; %End virtual bool notify(QObject *, QEvent *) /ReleaseGIL/; static void setQuitOnLastWindowClosed(bool quit); static bool quitOnLastWindowClosed(); signals: %If (Qt_4_2_0 -) %If (PyQt_SessionManager) void commitDataRequest(QSessionManager &sessionManager); %End %End void focusChanged(QWidget *old, QWidget *now); void lastWindowClosed(); %If (Qt_4_2_0 -) %If (PyQt_SessionManager) void saveStateRequest(QSessionManager &sessionManager); %End %End %If (Qt_4_5_0 -) void fontDatabaseChanged(); %End public slots: static void aboutQt(); static void closeAllWindows(); %If (Qt_4_2_0 -) void setStyleSheet(const QString &sheet); %End protected: virtual bool event(QEvent *); public: %If (Qt_4_2_0 -) static QFont font(); %End %If (Qt_4_2_0 -) static QFont font(const QWidget *); %End %If (Qt_4_2_0 -) static QFont font(const char *className); %End %If (Qt_4_2_0 -) static QLocale keyboardInputLocale(); %End %If (Qt_4_2_0 -) static Qt::LayoutDirection keyboardInputDirection(); %End %If (Qt_4_2_0 -) QString styleSheet() const; %End %If (Qt_4_3_0 -) static void alert(QWidget *widget, int msecs = 0) /ReleaseGIL/; %End %If (Qt_4_5_0 -) static void setGraphicsSystem(const QString &); %End public slots: %If (Qt_4_6_0 -) void setAutoSipEnabled(const bool enabled); %End public: %If (Qt_4_6_0 -) bool autoSipEnabled() const; %End private: QApplication(const QApplication &); }; %ModuleHeaderCode // Used to track QObject instances that must be explicitly destroyed before the // QApplication instance is destroyed. Typically these are instances that // sometimes don't have a parent (and are not QWidgets). void qtgui_track(QObject *o); void qtgui_untrack(QObject *o); void qtgui_delete_tracked(); extern char **(*qpycore_ArgvToC)(PyObject *, int &); extern void (*qpycore_UpdatePyArgv)(PyObject *, int, char **); extern const char *(*qpycore_pyqtsignal_get_parts)(PyObject *, QObject **); %End %ModuleCode // Symbols imported from the QtCore module. char **(*qpycore_ArgvToC)(PyObject *, int &); void (*qpycore_UpdatePyArgv)(PyObject *, int, char **); const char *(*qpycore_pyqtsignal_get_parts)(PyObject *, QObject **); // Forward declarations of the low level exported functions. #if defined(Q_WS_X11) void qt_x11_wait_for_window_manager(QWidget *widget); #endif #if defined(Q_WS_MAC) void qt_set_sequence_auto_mnemonic(bool enable); void qt_mac_secure_keyboard(bool enable); void qt_mac_set_dock_menu(QMenu *menu); void qt_mac_set_menubar_icons(bool enable); void qt_mac_set_menubar_merge(bool enable); void qt_mac_set_native_menubar(bool enable); void qt_mac_set_press_and_hold_context(bool enable); #endif // These are the implementations of the functions that handle object tracking. #include QObjectCleanupHandler *qtgui_cleanup_handler = 0; void qtgui_track(QObject *o) { if (!qtgui_cleanup_handler) qtgui_cleanup_handler = new QObjectCleanupHandler; qtgui_cleanup_handler->add(o); } void qtgui_untrack(QObject *o) { // Note that we specifically untrack a tracked object rather than let Qt // detect the object being destroyed and doing it itself. This is done to // work around a problem in threaded applications. if (qtgui_cleanup_handler) qtgui_cleanup_handler->remove(o); } void qtgui_delete_tracked() { if (qtgui_cleanup_handler) { // Watch out for recursive calls (which should never happen). QObjectCleanupHandler *hnd = qtgui_cleanup_handler; qtgui_cleanup_handler = 0; Py_BEGIN_ALLOW_THREADS delete hnd; Py_END_ALLOW_THREADS } } %End %PostInitialisationCode // Import helpers from the QtCore module. qpycore_ArgvToC = (char **(*)(PyObject *, int &))sipImportSymbol("qpycore_ArgvToC"); qpycore_UpdatePyArgv = (void (*)(PyObject *, int, char **))sipImportSymbol("qpycore_UpdatePyArgv"); qpycore_pyqtsignal_get_parts = (const char *(*)(PyObject *, QObject **))sipImportSymbol("qpycore_pyqtsignal_get_parts"); %End