56 #include "QtGui/qwidget.h" 57 #include "private/qobject_p.h" 58 #include "QtCore/qrect.h" 59 #include "QtCore/qlocale.h" 60 #include "QtCore/qset.h" 61 #include "QtGui/qregion.h" 62 #include "QtGui/qsizepolicy.h" 63 #include "QtGui/qstyle.h" 64 #include "QtGui/qapplication.h" 65 #include <private/qgraphicseffect_p.h> 66 #include "QtGui/qgraphicsproxywidget.h" 67 #include "QtGui/qgraphicsscene.h" 68 #include "QtGui/qgraphicsview.h" 69 #include <private/qgesture_p.h> 72 #include "QtCore/qt_windows.h" 73 #include <private/qdnd_p.h> 77 #include "QtGui/qx11info_x11.h" 81 #include <private/qt_mac_p.h> 85 #include "QtGui/qinputcontext.h" 86 #include "QtGui/qscreen_qws.h" 89 #if defined(Q_OS_SYMBIAN) 90 class RDrawableWindow;
102 #if defined(Q_WS_MAC) 105 #if defined(Q_WS_QPA) 116 class QUnifiedToolbarSurface;
128 void registerWidget(
QWidget *w);
129 void unregisterWidget(
QWidget *w);
130 void unregisterWidgetSubtree(
QWidget *w);
147 inline operator bool()
const 193 #if defined(Q_WS_X11) // <----------------------------------------------------------- X11 207 #elif defined(Q_WS_WIN) // <--------------------------------------------------------- WIN 208 uint hotkeyRegistered: 1;
211 #elif defined(Q_WS_MAC) // <--------------------------------------------------------- MAC 213 uint isSetGeometry : 1;
217 WindowGroupRef group;
219 quint32 savedWindowAttributesFromMaximized;
220 #ifdef QT_MAC_USE_COCOA 226 #endif // QT_MAC_USE_COCOA 228 #elif defined(Q_WS_QWS) // <--------------------------------------------------------- QWS 229 #ifndef QT_NO_QWS_MANAGER 230 QWSManager *qwsManager;
232 #elif defined(Q_OS_SYMBIAN) 234 uint nativeWindowTransparencyEnabled : 1;
235 uint forcedToRaster : 1;
236 uint noSystemRotationDisabled : 1;
237 #elif defined(Q_WS_QPA) 250 #ifndef QT_NO_GRAPHICSVIEW 281 #if defined(Q_WS_WIN) // <----------------------------------------------------------- WIN 282 #ifndef QT_NO_DRAGANDDROP 286 #elif defined(Q_WS_X11) // <--------------------------------------------------------- X11 287 uint compress_events : 1;
289 #elif defined(Q_WS_MAC) // <------------------------------------------------------ MAC 290 #ifdef QT_MAC_USE_COCOA 295 #elif defined(Q_OS_SYMBIAN) // <----------------------------------------------------- Symbian 305 uint receiveNativePaintEvents : 1;
310 enum NativePaintMode {
337 NativePaintMode nativePaintMode;
371 DrawPaintOnScreen = 0x02,
372 DrawRecursive = 0x04,
373 DrawInvisible = 0x08,
374 DontSubtractOpaqueChildren = 0x10,
375 DontSetCompositionMode = 0x20,
376 DontDrawOpaqueChildren = 0x40,
377 DontDrawNativeChildren = 0x80
383 CloseWithSpontaneousEvent
387 DirectionNorth = 0x01,
388 DirectionEast = 0x10,
389 DirectionSouth = 0x02,
401 void setSharedPainter(
QPainter *painter);
403 void init(
QWidget *desktopWidget, Qt::WindowFlags f);
404 void create_sys(
WId window,
bool initializeWindow,
bool destroyOldWindow);
405 void createRecursively();
406 void createWinId(
WId id = 0);
408 void createTLExtra();
411 void createSysExtra();
412 void deleteSysExtra();
413 void createTLSysExtra();
414 void deleteTLSysExtra();
415 void updateSystemBackground();
416 void propagatePaletteChange();
418 void setPalette_helper(
const QPalette &);
419 void resolvePalette();
420 QPalette naturalWidgetPalette(
uint inheritedMask)
const;
422 void setMask_sys(
const QRegion &);
425 void activateSymbianWindow(
WId wid = 0);
426 void _q_cleanupWinIds();
431 void stackUnder_sys(
QWidget *);
435 void updateFont(
const QFont &);
442 QFont naturalWidgetFont(
uint inheritedMask)
const;
445 void resolveLayoutDirection();
447 void setLocale_helper(
const QLocale &
l,
bool forceUpdate =
false);
448 void resolveLocale();
450 void setStyle_helper(
QStyle *newStyle,
bool propagate,
bool metalHack =
false);
453 void setUpdatesEnabled_helper(
bool );
455 void paintBackground(
QPainter *,
const QRegion &,
int flags = DrawAsRoot)
const;
456 bool isAboutToShow()
const;
457 QRegion prepareToRender(
const QRegion ®ion, QWidget::RenderFlags renderFlags);
459 QWidget::RenderFlags renderFlags);
461 QWidget::RenderFlags renderFlags,
bool readyToRender);
468 #ifdef Q_BACKINGSTORE_SUBSURFACES
475 bool endSharedPainter();
476 #ifndef QT_NO_GRAPHICSVIEW 481 void repaint_sys(
const QRegion &rgn);
483 QRect clipRect()
const;
485 void subtractOpaqueChildren(
QRegion &rgn,
const QRect &clipRect)
const;
486 void subtractOpaqueSiblings(
QRegion &source,
bool *hasDirtySiblingsAbove = 0,
487 bool alsoNonOpaque =
false)
const;
488 void clipToEffectiveMask(
QRegion ®ion)
const;
489 void updateIsOpaque();
490 void setOpaque(
bool opaque);
491 void updateIsTranslucent();
492 bool paintOnScreen()
const;
493 #ifndef QT_NO_GRAPHICSEFFECT 494 void invalidateGraphicsEffectsRecursively();
495 #endif //QT_NO_GRAPHICSEFFECT 497 const QRegion &getOpaqueChildren()
const;
498 void setDirtyOpaqueRegion();
502 void setWindowIcon_helper();
503 void setWindowIcon_sys(
bool forceReset =
false);
504 void setWindowOpacity_sys(
qreal opacity);
505 void adjustQuitOnCloseAttribute();
507 void scrollChildren(
int dx,
int dy);
508 void moveRect(
const QRect &,
int dx,
int dy);
509 void scrollRect(
const QRect &,
int dx,
int dy);
510 void invalidateBuffer_resizeHelper(
const QPoint &oldPos,
const QSize &oldSize);
512 void invalidateBuffer(
const QRegion &);
513 void invalidateBuffer(
const QRect &);
514 bool isOverlapped(
const QRect&)
const;
515 void syncBackingStore();
516 void syncBackingStore(
const QRegion ®ion);
518 void reparentFocusWidgets(
QWidget *oldtlw);
520 static int pointToRect(
const QPoint &p,
const QRect &r);
523 void showChildren(
bool spontaneous);
524 void hideChildren(
bool spontaneous);
525 void setParent_sys(
QWidget *parent, Qt::WindowFlags);
526 void scroll_sys(
int dx,
int dy);
527 void scroll_sys(
int dx,
int dy,
const QRect &r);
528 void deactivateWidgetCleanup();
529 void setGeometry_sys(
int,
int,
int,
int,
bool);
530 void sendPendingMoveAndResizeEvents(
bool recursive =
false,
bool disableUpdates =
false);
531 void activateChildLayoutsRecursively();
532 void show_recursive();
537 void _q_showIfNotHidden();
539 void setEnabled_helper(
bool);
540 void registerDropSite(
bool);
541 static void adjustFlags(Qt::WindowFlags &flags,
QWidget *w = 0);
543 void updateFrameStrut();
544 QRect frameStrut()
const;
546 #ifdef QT_KEYPAD_NAVIGATION 553 void setWindowIconText_sys(
const QString &cap);
554 void setWindowIconText_helper(
const QString &cap);
555 void setWindowTitle_sys(
const QString &cap);
558 void setCursor_sys(
const QCursor &cursor);
559 void unsetCursor_sys();
562 void setWindowTitle_helper(
const QString &cap);
563 void setWindowFilePath_helper(
const QString &filePath);
565 bool setMinimumSize_helper(
int &minw,
int &minh);
566 bool setMaximumSize_helper(
int &maxw,
int &maxh);
567 virtual bool hasHeightForWidth()
const;
568 void setConstraints_sys();
569 bool pointInsideRectAndMask(
const QPoint &)
const;
571 QWidget *childAtRecursiveHelper(
const QPoint &p,
bool,
bool includeFrame =
false)
const;
572 void updateGeometry_helper(
bool forceUpdate);
574 void getLayoutItemMargins(
int *
left,
int *top,
int *
right,
int *bottom)
const;
603 #ifndef QT_NO_GRAPHICSVIEW 624 redirectDev = replacement;
625 redirectOffset = offset;
631 *offset = redirectDev ? redirectOffset :
QPoint();
643 if (extra->nativeChildrenForced)
645 extra->nativeChildrenForced = 1;
647 for (
int i = 0; i < children.
size(); ++i) {
648 if (
QWidget *child = qobject_cast<QWidget *>(children.
at(i)))
655 return extra ? extra->nativeChildrenForced :
false;
660 #ifndef QT_NO_GRAPHICSEFFECT 661 if (graphicsEffect && graphicsEffect->isEnabled())
662 return graphicsEffect->boundingRectFor(rect).toAlignedRect();
663 #endif //QT_NO_GRAPHICSEFFECT 667 QSize adjustedSize()
const;
682 #ifndef Q_WS_QWS // Almost cross-platform :-) 683 void setWSGeometry(
bool dontShow=
false,
const QRect &oldRect =
QRect());
686 {
return p -
data.wrect.topLeft(); }
689 {
return p +
data.wrect.topLeft(); }
716 #if !defined(QT_NO_IM) 720 #ifdef QT_KEYPAD_NAVIGATION 727 #ifndef QT_NO_TOOLTIP 730 #ifndef QT_NO_STATUSTIP 733 #ifndef QT_NO_WHATSTHIS 736 #ifndef QT_NO_ACCESSIBILITY 762 #ifndef QT_NO_GESTURES 783 #if defined(Q_WS_X11) // <----------------------------------------------------------- X11 789 void setWindowRole();
790 void sendStartupMessage(
const char *message)
const;
791 void setNetWmWindowTypes();
792 void x11UpdateIsOpaque();
793 bool isBackgroundInherited()
const;
794 void updateX11AcceptFocus();
797 #elif defined(Q_WS_WIN) // <--------------------------------------------------------- WIN 798 uint noPaintOnScreen : 1;
799 #ifndef QT_NO_GESTURES 800 uint nativeGesturePanEnabled : 1;
802 bool shouldShowMaximizeButton();
803 void winUpdateIsOpaque();
804 void reparentChildren();
805 #ifndef QT_NO_DRAGANDDROP 809 void grabMouseWhileInWindow();
810 void registerTouchWindow();
811 void winSetupGestures();
812 #elif defined(Q_WS_MAC) // <--------------------------------------------------------- MAC 814 uint needWindowChange : 1;
822 GlWidgetInfo(
QWidget *widget) : widget(widget), lastUpdateWidget(0) { }
823 bool operator==(
const GlWidgetInfo &other)
const {
return (widget == other.widget); }
833 EventHandlerRef window_event;
839 void macUpdateSizeAttribute();
840 void macUpdateHideOnSuspend();
841 void macUpdateOpaqueSizeGrip();
842 void macUpdateIgnoreMouseEvents();
843 void macUpdateMetalAttribute();
844 void macUpdateIsOpaque();
845 void macSetNeedsDisplay(
QRegion region);
846 void setEnabled_helper_sys(
bool enable);
847 bool isRealWindow()
const;
848 void adjustWithinMaxAndMinSize(
int &w,
int &h);
849 void applyMaxAndMinSizeOnWindow();
850 void update_sys(
const QRect &rect);
851 void update_sys(
const QRegion &rgn);
852 void setGeometry_sys_helper(
int,
int,
int,
int,
bool);
853 void setWindowModified_sys(
bool b);
854 void updateMaximizeButton_sys();
855 void setWindowFilePath_sys(
const QString &filePath);
856 void createWindow_sys();
857 void recreateMacWindow();
858 #ifndef QT_MAC_USE_COCOA 859 void initWindowPtr();
860 void finishCreateWindow_sys_Carbon(
OSWindowRef windowRef);
862 void setSubWindowStacking(
bool set);
863 void setWindowLevel();
864 void finishCreateWindow_sys_Cocoa(
void * windowRef);
865 void syncCocoaMask();
866 void finishCocoaMaskSetup();
867 void syncUnifiedMode();
869 bool drawRectOriginalAdded;
871 bool originalDrawMethod;
876 bool isInUnifiedToolbar;
877 QUnifiedToolbarSurface *unifiedSurface;
881 bool touchEventsEnabled;
882 #endif // QT_MAC_USE_COCOA 883 void determineWindowClass();
884 void transferChildren();
885 bool qt_mac_dnd_event(
uint, DragRef);
886 void toggleDrawers(
bool);
888 static bool qt_create_root_win();
889 static void qt_clean_root_win();
890 static bool qt_mac_update_sizer(
QWidget *,
int up = 0);
894 void registerTouchWindow(
bool enable =
true);
895 #elif defined(Q_WS_QWS) // <--------------------------------------------------------- QWS 896 void setMaxWindowState_helper();
897 void setFullScreenSize_helper();
899 QRegion localRequestedRegion()
const;
900 QRegion localAllocatedRegion()
const;
902 friend class QWSManager;
903 friend class QWSManagerPrivate;
906 void updateCursor()
const;
909 #elif defined(Q_WS_QPA) // <--------------------------------------------------------- QPA 910 void setMaxWindowState_helper();
911 void setFullScreenSize_helper();
913 void updateCursor()
const;
915 #elif defined(Q_OS_SYMBIAN) // <--------------------------------------------------------- SYMBIAN 918 int symbianScreenNumber;
919 bool fixNativeOrientationCalled;
920 void s60UpdateIsOpaque();
921 void reparentChildren();
922 void registerTouchWindow();
924 uint isGLGlobalShareWidget : 1;
933 : pdev(d), rgn(r), offset(o), flags(f), sharedPainter(p), backingStore(b), painter(0) {}
944 #ifndef QT_NO_GRAPHICSEFFECT 953 { m_widget->d_func()->graphicsEffect = 0; }
963 updateDueToGraphicsEffect =
true;
965 updateDueToGraphicsEffect =
false;
985 {
return m_widget->window()->rect(); }
997 #endif //QT_NO_GRAPHICSEFFECT 1012 return extra ? extra->
topextra : 0;
1018 QTLWExtra *x = q->window()->d_func()->maybeTopData();
1025 QTLWExtra *x = q->window()->d_func()->topData();
1039 QTLWExtra *x = q->window()->d_func()->maybeTopData();
1045 #endif // QWIDGET_P_H The QPainter class performs low-level painting on widgets and other paint devices.
The QCursor class provides a mouse cursor with an arbitrary shape.
QPointF mapToScene(const QPoint &point) const
Returns the viewport coordinate point mapped to scene coordinates.
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
ColorRole
The ColorRole enum defines the different symbolic color roles used in current GUIs.
static QScreen * getScreen(const QWidget *w)
static Expression::Ptr create(Expression *const expr, const YYLTYPE &sourceLocator, const ParserContext *const parseInfo)
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
struct CGImage * CGImageRef
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
The QString class provides a Unicode character string.
The QHash class is a template class that provides a hash-table-based dictionary.
RequestSoftwareInputPanel
This enum describes under what circumstances a software input panel will be requested by input capabl...
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
static const uint Default
The QDecoration class is a base class for window decorations in Qt for Embedded Linux.
static const QRectF boundingRect(const QPointF *points, int pointCount)
QFont resolve(const QFont &) const
Returns a new QFont that has attributes copied from other that have not been previously set on this f...
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QRectF class defines a rectangle in the plane using floating point precision. ...
QList< QGraphicsView * > views() const
Returns a list of all the views that display this scene.
The QStyleOption class stores the parameters used by QStyle functions.
The QLayout class is the base class of geometry managers.
const T & at(int i) const
Returns the item at index position i in the list.
The QImage class provides a hardware-independent image representation that allows direct access to th...
bool contains(const QPoint &p) const
Returns true if the region contains the point p; otherwise returns false.
static const char * data(const QByteArray &arr)
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
QRectF sceneRect
the scene rectangle; the bounding rectangle of the scene
The QRegion class specifies a clip region for a painter.
PixmapPadMode
This enum describes how the pixmap returned from sourcePixmap should be padded.
The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a g...
struct OpaqueRgnHandle * RgnHandle
QRect toRect() const
Returns a QRect based on the values of this rectangle.
The QWindowSurface class provides the drawing area for top-level windows.
struct OpaqueEventRef * EventRef
The QX11Info class provides information about the X display configuration.
#define Q_DECLARE_PUBLIC(Class)
The QFont class specifies a font used for drawing text.
The QPoint class defines a point in the plane using integer precision.
int size() const
Returns the number of items in the list.
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
The QRect class defines a rectangle in the plane using integer precision.
#define Q_AUTOTEST_EXPORT
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
QWidgetBackingStore * backingStore
The QPixmap class is an off-screen image representation that can be used as a paint device...
static QWSWindow * keyboardGrabber
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
The QSize class defines the size of a two-dimensional object using integer point precision.
struct OpaqueEventHandlerCallRef * EventHandlerCallRef
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.
The QInputContext class abstracts the input method dependent data and composing state.
void translate(int dx, int dy)
Moves the rectangle dx along the x axis and dy along the y axis, relative to the current position...
static void setLayoutItemMargins(int left, int top, int right, int bottom, QRect *rect, Qt::LayoutDirection dir)
The QEvent class is the base class of all event classes.
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
bool operator==(QBool b1, bool b2)
QWidgetPaintContext(QPaintDevice *d, const QRegion &r, const QPoint &o, int f, QPainter *p, QWidgetBackingStore *b)
The QGraphicsEffect class is the base class for all graphics effects.
SubElement
This enum represents a sub-area of a widget.
struct OpaqueIconRef * IconRef
The QList class is a template class that provides lists.
Qt::LayoutDirection direction
The QPalette class contains color groups for each widget state.
The QIcon class provides scalable icons in different modes and states.