This file is indexed.

/usr/share/sip/PyQt4/QtGui/qwidget.sip is in python-qt4-dev 4.9.1-2ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
// qwidget.sip generated by MetaSIP on Fri Feb 10 10:35:12 2012
//
// This file is part of the QtGui Python extension module.
//
// Copyright (c) 2011 Riverbank Computing Limited <info@riverbankcomputing.com>
// 
// 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.


%ModuleCode
#include <qwidget.h>
%End

class QWidget : QObject, QPaintDevice
{
%TypeHeaderCode
#include <qwidget.h>
%End

%TypeCode
// Transfer ownership of all widgets in a layout to their new parent.
static void qtgui_TransferLayoutWidgets(QLayout *lay, PyObject *pw)
{
    int n = lay->count();

    for (int i = 0; i < n; ++i)
    {
        QLayoutItem *item = lay->itemAt(i);
        QWidget *w = item->widget();

        if (w)
        {
            PyObject *obj = sipGetPyObject(w, sipType_QWidget);

            if (obj)
                sipTransferTo(obj, pw);
        }
        else
        {
            QLayout *l = item->layout();

            if (l)
                qtgui_TransferLayoutWidgets(l, pw);
        }
    }
}
%End

public:
%If (Qt_4_2_0 -)
    QWidget(QWidget *parent /TransferThis/ = 0, Qt::WindowFlags flags = 0);
%End
%If (- Qt_4_2_0)
    QWidget(QWidget *parent /TransferThis/ = 0, Qt::WFlags flags = 0);
%End
    virtual ~QWidget();
    virtual int devType() const;
    QStyle *style() const;
    void setStyle(QStyle * /KeepReference/);
    bool isEnabledTo(QWidget *) const;

public slots:
    void setEnabled(bool);
    void setDisabled(bool);
    void setWindowModified(bool);

public:
    QRect frameGeometry() const;
    QRect normalGeometry() const;
    int x() const;
    int y() const;
    QPoint pos() const;
    QSize frameSize() const;
    QRect childrenRect() const;
    QRegion childrenRegion() const;
    QSize minimumSize() const;
    QSize maximumSize() const;
    void setMinimumSize(int minw, int minh);
    void setMaximumSize(int maxw, int maxh);
    void setMinimumWidth(int minw);
    void setMinimumHeight(int minh);
    void setMaximumWidth(int maxw);
    void setMaximumHeight(int maxh);
    QSize sizeIncrement() const;
    void setSizeIncrement(int w, int h);
    QSize baseSize() const;
    void setBaseSize(int basew, int baseh);
    void setFixedSize(const QSize &);
    void setFixedSize(int w, int h);
    void setFixedWidth(int w);
    void setFixedHeight(int h);
    QPoint mapToGlobal(const QPoint &) const;
    QPoint mapFromGlobal(const QPoint &) const;
    QPoint mapToParent(const QPoint &) const;
    QPoint mapFromParent(const QPoint &) const;
    QPoint mapTo(QWidget *, const QPoint &) const;
    QPoint mapFrom(QWidget *, const QPoint &) const;
    QWidget *window() const;
    QWidget *topLevelWidget() const;
    const QPalette &palette() const;
    void setPalette(const QPalette &);
    void setBackgroundRole(QPalette::ColorRole);
    QPalette::ColorRole backgroundRole() const;
    void setForegroundRole(QPalette::ColorRole);
    QPalette::ColorRole foregroundRole() const;
    void setFont(const QFont &);
    QCursor cursor() const;
    void setCursor(const QCursor &);
    void unsetCursor();
    void setMask(const QBitmap &);
    void setMask(const QRegion &);
    QRegion mask() const;
    void clearMask();
    void setWindowTitle(const QString &);
    QString windowTitle() const;
    void setWindowIcon(const QIcon &icon);
    QIcon windowIcon() const;
    void setWindowIconText(const QString &);
    QString windowIconText() const;
    void setWindowRole(const QString &);
    QString windowRole() const;
    void setWindowOpacity(qreal level);
    qreal windowOpacity() const;
    bool isWindowModified() const;
%If (PyQt_ToolTip)
    void setToolTip(const QString &);
%End
%If (PyQt_ToolTip)
    QString toolTip() const;
%End
%If (PyQt_StatusTip)
    void setStatusTip(const QString &);
%End
%If (PyQt_StatusTip)
    QString statusTip() const;
%End
%If (PyQt_WhatsThis)
    void setWhatsThis(const QString &);
%End
%If (PyQt_WhatsThis)
    QString whatsThis() const;
%End
%If (PyQt_Accessibility)
    QString accessibleName() const;
%End
%If (PyQt_Accessibility)
    void setAccessibleName(const QString &name);
%End
%If (PyQt_Accessibility)
    QString accessibleDescription() const;
%End
%If (PyQt_Accessibility)
    void setAccessibleDescription(const QString &description);
%End
    void setLayoutDirection(Qt::LayoutDirection direction);
    Qt::LayoutDirection layoutDirection() const;
    void unsetLayoutDirection();
    bool isRightToLeft() const;
    bool isLeftToRight() const;

public slots:
    void setFocus();

public:
    bool isActiveWindow() const;
    void activateWindow();
    void clearFocus();
    void setFocus(Qt::FocusReason reason);
    Qt::FocusPolicy focusPolicy() const;
    void setFocusPolicy(Qt::FocusPolicy policy);
    bool hasFocus() const;
    static void setTabOrder(QWidget *, QWidget *);
    void setFocusProxy(QWidget * /KeepReference/);
    QWidget *focusProxy() const;
    Qt::ContextMenuPolicy contextMenuPolicy() const;
    void setContextMenuPolicy(Qt::ContextMenuPolicy policy);
    void grabMouse();
    void grabMouse(const QCursor &);
    void releaseMouse();
    void grabKeyboard();
    void releaseKeyboard();
    int grabShortcut(const QKeySequence &key, Qt::ShortcutContext context = Qt::WindowShortcut);
    void releaseShortcut(int id);
    void setShortcutEnabled(int id, bool enabled = true);
    static QWidget *mouseGrabber();
    static QWidget *keyboardGrabber();
    void setUpdatesEnabled(bool enable);

public slots:
    void update();
    void repaint();

public:
    void update(const QRect &);
    void update(const QRegion &);
    void repaint(int x, int y, int w, int h);
    void repaint(const QRect &);
    void repaint(const QRegion &);

public slots:
    virtual void setVisible(bool visible);
    void setHidden(bool hidden);
    void show();
    void hide();

public:
    void setShown(bool shown);

public slots:
    void showMinimized();
    void showMaximized();
    void showFullScreen();
    void showNormal();
    bool close();
    void raise() /PyName=raise_/;
    void lower();

public:
    void stackUnder(QWidget *);
    void move(const QPoint &);
    void resize(const QSize &);
    void setGeometry(const QRect &);
    void adjustSize();
    bool isVisibleTo(QWidget *) const;
    bool isMinimized() const;
    bool isMaximized() const;
    bool isFullScreen() const;
    Qt::WindowStates windowState() const;
    void setWindowState(Qt::WindowStates state);
    void overrideWindowState(Qt::WindowStates state);
    virtual QSize sizeHint() const;
    virtual QSize minimumSizeHint() const;
    QSizePolicy sizePolicy() const;
    void setSizePolicy(QSizePolicy);
    virtual int heightForWidth(int) const;
    QRegion visibleRegion() const;
    void setContentsMargins(int left, int top, int right, int bottom);
    void getContentsMargins(int *left, int *top, int *right, int *bottom) const;
    QRect contentsRect() const;
    QLayout *layout() const;
    void setLayout(QLayout * /Transfer/);
%MethodCode
        Py_BEGIN_ALLOW_THREADS
        sipCpp->setLayout(a0);
        Py_END_ALLOW_THREADS
        
        // Internally Qt has reparented all of the widgets in the layout, so we need
        // to update the ownership hierachy.
        qtgui_TransferLayoutWidgets(a0, sipSelf);
%End

    void updateGeometry();
    void setParent(QWidget *parent /TransferThis/);
%If (Qt_4_2_0 -)
    void setParent(QWidget *parent /TransferThis/, Qt::WindowFlags f);
%End
%If (- Qt_4_2_0)
    void setParent(QWidget *parent /TransferThis/, Qt::WFlags f);
%End
    void scroll(int dx, int dy);
    void scroll(int dx, int dy, const QRect &);
    QWidget *focusWidget() const;
    QWidget *nextInFocusChain() const;
    bool acceptDrops() const;
    void setAcceptDrops(bool on);
    void addAction(QAction *action);
    void addActions(QList<QAction*> actions);
    void insertAction(QAction *before, QAction *action);
    void insertActions(QAction *before, QList<QAction*> actions);
    void removeAction(QAction *action);
    QList<QAction*> actions() const;
    void setWindowFlags(Qt::WindowFlags type);
    void overrideWindowFlags(Qt::WindowFlags type);
    static QWidget *find(WId);
    QWidget *childAt(const QPoint &p) const;
%If (WS_X11)
    const QX11Info &x11Info() const;
%End
%If (WS_X11)
    Qt::HANDLE x11PictureHandle() const;
%End
%If (WS_X11 || WS_MACX)
    Qt::HANDLE handle() const;
%End
    void setAttribute(Qt::WidgetAttribute attribute, bool on = true);
    virtual QPaintEngine *paintEngine() const;
    void ensurePolished() const;
    QInputContext *inputContext();
    void setInputContext(QInputContext * /Transfer/);
    bool isAncestorOf(const QWidget *child) const;

signals:
    void customContextMenuRequested(const QPoint &pos);

protected:
    virtual bool event(QEvent *);
    virtual void mousePressEvent(QMouseEvent *);
    virtual void mouseReleaseEvent(QMouseEvent *);
    virtual void mouseDoubleClickEvent(QMouseEvent *);
    virtual void mouseMoveEvent(QMouseEvent *);
    virtual void wheelEvent(QWheelEvent *);
    virtual void keyPressEvent(QKeyEvent *);
    virtual void keyReleaseEvent(QKeyEvent *);
    virtual void focusInEvent(QFocusEvent *);
    virtual void focusOutEvent(QFocusEvent *);
    virtual void enterEvent(QEvent *);
    virtual void leaveEvent(QEvent *);
    virtual void paintEvent(QPaintEvent *);
    virtual void moveEvent(QMoveEvent *);
    virtual void resizeEvent(QResizeEvent *);
    virtual void closeEvent(QCloseEvent *);
    virtual void contextMenuEvent(QContextMenuEvent *);
    virtual void tabletEvent(QTabletEvent *);
    virtual void actionEvent(QActionEvent *);
    virtual void dragEnterEvent(QDragEnterEvent *);
    virtual void dragMoveEvent(QDragMoveEvent *);
    virtual void dragLeaveEvent(QDragLeaveEvent *);
    virtual void dropEvent(QDropEvent *);
    virtual void showEvent(QShowEvent *);
    virtual void hideEvent(QHideEvent *);
%If (WS_WIN)
    virtual bool winEvent(MSG *message, long *result);
%End
    virtual void changeEvent(QEvent *);
    virtual int metric(QPaintDevice::PaintDeviceMetric) const;
    virtual void inputMethodEvent(QInputMethodEvent *);

public:
    virtual QVariant inputMethodQuery(Qt::InputMethodQuery) const;

protected:
    void resetInputContext();
    void updateMicroFocus();
    void create(WId window = 0, bool initializeWindow = true, bool destroyOldWindow = true);
    void destroy(bool destroyWindow = true, bool destroySubWindows = true);
    virtual bool focusNextPrevChild(bool next);
    bool focusNextChild();
    bool focusPreviousChild();
    virtual void enabledChange(bool);
    virtual void paletteChange(const QPalette &);
    virtual void fontChange(const QFont &);
    virtual void windowActivationChange(bool);
    virtual void languageChange();

public:
    QWidget *childAt(int ax, int ay) const;
    Qt::WindowType windowType() const;
    Qt::WindowFlags windowFlags() const;
    WId winId() const;
    bool isTopLevel() const;
    bool isWindow() const;
    bool isEnabled() const;
    bool isModal() const;
    bool isEnabledToTLW() const;
    int minimumWidth() const;
    int minimumHeight() const;
    int maximumWidth() const;
    int maximumHeight() const;
    void setMinimumSize(const QSize &s);
    void setMaximumSize(const QSize &s);
    void setSizeIncrement(const QSize &s);
    void setBaseSize(const QSize &s);
    const QFont &font() const;
    QFontMetrics fontMetrics() const;
    QFontInfo fontInfo() const;
    void setMouseTracking(bool enable);
    bool hasMouseTracking() const;
    bool underMouse() const;
    bool updatesEnabled() const;
    void update(int ax, int ay, int aw, int ah);
    bool isVisible() const;
    bool isHidden() const;
    void move(int ax, int ay);
    void resize(int w, int h);
    void setGeometry(int ax, int ay, int aw, int ah);
    QRect rect() const;
    const QRect &geometry() const;
    QSize size() const;
    int width() const;
    int height() const;
    QWidget *parentWidget() const;
    void setSizePolicy(QSizePolicy::Policy hor, QSizePolicy::Policy ver);
    bool testAttribute(Qt::WidgetAttribute attribute) const;
    Qt::WindowModality windowModality() const;
    void setWindowModality(Qt::WindowModality windowModality);
    bool autoFillBackground() const;
    void setAutoFillBackground(bool enabled);
%If (Qt_4_2_0 -)
    void setStyleSheet(const QString &styleSheet);
%End
%If (Qt_4_2_0 -)
    QString styleSheet() const;
%End
%If (Qt_4_2_0 -)
    void setShortcutAutoRepeat(int id, bool enabled = true);
%End
%If (Qt_4_2_0 -)
    QByteArray saveGeometry() const;
%End
%If (Qt_4_2_0 -)
    bool restoreGeometry(const QByteArray &geometry);
%End
%If (Qt_4_3_0 -)

    enum RenderFlag
    {
        DrawWindowBackground,
        DrawChildren,
        IgnoreMask,
    };

%End
%If (Qt_4_3_0 -)
    typedef QFlags<QWidget::RenderFlag> RenderFlags;
%End
%If (Qt_4_4_0 -)
    void render(QPaintDevice *target, const QPoint &targetOffset = QPoint(), const QRegion &sourceRegion = QRegion(), QFlags<QWidget::RenderFlag> flags = QWidget::DrawWindowBackground|QWidget::DrawChildren);
%End
%If (Qt_4_4_0 -)
    void render(QPainter *painter, const QPoint &targetOffset = QPoint(), const QRegion &sourceRegion = QRegion(), QFlags<QWidget::RenderFlag> flags = QWidget::DrawWindowBackground|QWidget::DrawChildren);
%End
%If (Qt_4_3_0 -)
    void setLocale(const QLocale &locale);
%End
%If (Qt_4_3_0 -)
    QLocale locale() const;
%End
%If (Qt_4_3_0 -)
    void unsetLocale();
%End
%If (Qt_4_4_0 -)
    WId effectiveWinId() const;
%End
%If (Qt_4_4_0 -)
    QWidget *nativeParentWidget() const;
%End
%If (Qt_4_4_0 -)
    void setWindowFilePath(const QString &filePath);
%End
%If (Qt_4_4_0 -)
    QString windowFilePath() const;
%End
%If (Qt_4_5_0 -)
    QGraphicsProxyWidget *graphicsProxyWidget() const;
%End
%If (Qt_4_6_0 -)
    QGraphicsEffect *graphicsEffect() const;
%End
%If (Qt_4_6_0 -)
    void setGraphicsEffect(QGraphicsEffect *effect /Transfer/);
%End
%If (Qt_4_6_0 -)
    void grabGesture(Qt::GestureType type, Qt::GestureFlags flags = Qt::GestureFlags(0));
%End
%If (Qt_4_6_0 -)
    void ungrabGesture(Qt::GestureType type);
%End
%If (Qt_4_6_0 -)
    void setContentsMargins(const QMargins &margins);
%End
%If (Qt_4_6_0 -)
    QMargins contentsMargins() const;
%End
%If (Qt_4_6_0 -)
    QWidget *previousInFocusChain() const;
%End
%If (Qt_4_6_0 -)
    Qt::InputMethodHints inputMethodHints() const;
%End
%If (Qt_4_6_0 -)
    void setInputMethodHints(Qt::InputMethodHints hints);
%End

private:
    QWidget(const QWidget &);
};

%If (Qt_4_3_0 -)
QFlags<QWidget::RenderFlag> operator|(QWidget::RenderFlag f1, QFlags<QWidget::RenderFlag> f2);
%End