60 #ifndef QT_NO_ACCESSIBILITY 71 # include <private/qmainwindowlayout_p.h> 77 # include "private/qwindowsurface_qws_p.h" 86 #include "private/qstylesheetstyle_p.h" 87 #include "private/qstyle_p.h" 88 #include "private/qinputcontext_p.h" 90 #include "private/qsoftkeymanager_p.h" 92 #if defined (Q_WS_WIN) 93 # include <private/qwininputcontext_p.h> 97 # include <private/qpaintengine_x11_p.h> 101 #include <private/qgraphicseffect_p.h> 102 #include <private/qwindowsurface_p.h> 103 #include <private/qbackingstore_p.h> 105 # include <private/qpaintengine_mac_p.h> 107 #include <private/qpaintengine_raster_p.h> 109 #if defined(Q_OS_SYMBIAN) 110 #include "private/qt_s60_p.h" 116 #include "QtGui/qgraphicsproxywidget.h" 117 #include "QtGui/qgraphicsscene.h" 118 #include "private/qgraphicsproxywidget_p.h" 119 #include "QtGui/qabstractscrollarea.h" 120 #include "private/qabstractscrollarea_p.h" 121 #include "private/qevent_p.h" 123 #include "private/qgraphicssystem_p.h" 124 #include "private/qgesturemanager_p.h" 126 #ifdef QT_KEYPAD_NAVIGATION 128 #endif // QT_KEYPAD_NAVIGATION 131 #include <aknappui.h> 134 #ifdef Q_OS_BLACKBERRY 135 #include <bps/navigator.h> 138 #ifdef Q_OS_BLACKBERRY_TABLET 139 #include <bps/orientation.h> 148 #if !defined(Q_WS_QWS) 149 static bool qt_enable_backingstore =
true;
155 qt_enable_backingstore = enable;
159 #if defined(QT_MAC_USE_COCOA) 160 bool qt_mac_clearDirtyOnWidgetInsideDrawWidget =
false;
179 # define QT_NO_PAINT_DEBUG 284 if (
QWidget *childWidget = qobject_cast<QWidget *>(child))
298 , extraPaintEngine(0)
301 #
if !defined(QT_NO_IM)
304 , inheritedFontResolveMask(0)
305 , inheritedPaletteResolveMask(0)
310 , leftLayoutItemMargin(0)
311 , topLayoutItemMargin(0)
312 , rightLayoutItemMargin(0)
313 , bottomLayoutItemMargin(0)
318 , dirtyOpaqueChildren(1)
324 , usesDoubleBufferedGLContext(0)
326 , inheritsInputMethodHints(0)
329 #
if defined(Q_WS_X11)
334 , nativeGesturePanEnabled(0)
336 #elif defined(Q_WS_MAC)
337 , needWindowChange(0)
340 #elif defined(Q_OS_SYMBIAN)
341 , symbianScreenNumber(0)
342 , fixNativeOrientationCalled(false)
343 , isGLGlobalShareWidget(0)
347 qFatal(
"QWidget: Must construct a QApplication before a QPaintDevice");
352 qFatal(
"Cannot mix incompatible Qt libraries");
357 drawRectOriginalAdded =
false;
358 originalDrawMethod =
true;
359 changeMethods =
false;
360 isInUnifiedToolbar =
false;
362 toolbar_ancestor = 0;
363 flushRequested =
false;
364 touchEventsEnabled =
false;
365 #endif // QT_MAC_USE_COCOA 366 #ifdef QWIDGET_EXTRA_DEBUG 367 static int count = 0;
368 qDebug() <<
"widgets" << ++count;
385 #ifndef QT_NO_GRAPHICSEFFECT 387 #endif //QT_NO_GRAPHICSEFFECT 403 #ifndef QT_NO_PROPERTIES 404 if (q->property(
"_q_DummyWindowSurface").toBool()) {
424 if (q->children().size() > 0) {
427 for (
int i = 0; i < childObjects.
size(); ++i) {
435 w->d_func()->setWSGeometry();
437 w->d_func()->setDirtyOpaqueRegion();
461 return qApp->inputContext();
480 return d->inputContext();
497 if (context ==
d->ic)
503 d->ic->setParent(
this);
533 #ifdef QT_KEYPAD_NAVIGATION 543 bool QWidget::hasEditFocus()
const 546 while (w->d_func()->extra && w->d_func()->extra->focus_proxy)
547 w = w->d_func()->extra->focus_proxy;
548 return QWidgetPrivate::editingWidget == w;
567 void QWidget::setEditFocus(
bool on)
570 while (f->d_func()->extra && f->d_func()->extra->focus_proxy)
571 f = f->d_func()->extra->focus_proxy;
573 if (QWidgetPrivate::editingWidget && QWidgetPrivate::editingWidget != f)
574 QWidgetPrivate::editingWidget->setEditFocus(
false);
579 if ((!on && !QWidgetPrivate::editingWidget)
580 || (on && QWidgetPrivate::editingWidget == f)) {
584 if (!on && QWidgetPrivate::editingWidget == f) {
585 QWidgetPrivate::editingWidget = 0;
590 QWidgetPrivate::editingWidget = f;
628 return d->extra &&
d->extra->autoFillBackground;
636 if (
d->extra->autoFillBackground == enabled)
639 d->extra->autoFillBackground =
enabled;
1149 #ifdef QT_NO_EXCEPTIONS 1153 QWidgetPrivate::allWidgets->
remove(that);
1193 d_func()->init(parent, f);
1209 d_func()->init(parent , f);
1302 qFatal(
"QWidget: Cannot create a QWidget when no GUI is being used");
1306 allWidgets->insert(q);
1316 #ifndef QT_NO_THREAD 1319 "Widgets must be created in the GUI thread.");
1323 #if defined(Q_WS_X11) 1324 if (desktopWidget) {
1327 xinfo = desktopWidget->d_func()->xinfo;
1329 #elif defined(Q_OS_SYMBIAN) 1330 if (desktopWidget) {
1333 #elif defined(Q_WS_QPA) 1334 if (desktopWidget) {
1335 int screen = desktopWidget->d_func()->topData()->screenIndex;
1336 topData()->screenIndex = screen;
1369 adjustQuitOnCloseAttribute();
1379 data.
crect = parentWidget ?
QRect(0,0,100,30) : QRect(0,0,360,640);
1382 data.
crect = parentWidget ?
QRect(0,0,100,30) : QRect(0,0,640,480);
1385 focus_next = focus_prev = q;
1389 else if (parentWidget)
1393 resolveLayoutDirection();
1399 #if defined(Q_WS_X11) 1400 data.
fnt.x11SetScreen(xinfo.screen());
1418 extraPaintEngine = 0;
1426 q->create(0,
true,
true);
1430 child->d_func()->createRecursively();
1460 if (
d->data.in_destructor)
1481 d->createWinId(window);
1491 if (flags & Qt::WStaticContents)
1493 if (flags & Qt::WDestructiveClose)
1495 if (flags & Qt::WShowModal)
1497 if (flags & Qt::WMouseNoMask)
1499 if (flags & Qt::WGroupLeader)
1501 if (flags & Qt::WNoMousePropagation)
1505 static int paintOnScreenEnv = -1;
1506 if (paintOnScreenEnv == -1)
1507 paintOnScreenEnv =
qgetenv(
"QT_ONSCREEN_PAINT").
toInt() > 0 ? 1 : 0;
1508 if (paintOnScreenEnv == 1)
1519 #if defined (Q_WS_WIN) && !defined(QT_NO_DRAGANDDROP) 1523 &&
d->extra &&
d->extra->dropTarget) {
1524 d->registerDropSite(
false);
1526 #endif // defined (Q_WS_WIN) && !defined(QT_NO_DRAGANDDROP) 1528 d->updateIsOpaque();
1531 d->create_sys(window, initializeWindow, destroyOldWindow);
1535 d->topData()->backingStore.destroy();
1537 d->topData()->backingStore.create(
this);
1546 extern void qt_eval_init_widget(
QWidget *w);
1547 qt_eval_init_widget(
this);
1552 d->setWindowIcon_sys(
true);
1553 if (
isWindow() && !
d->topData()->iconText.isEmpty())
1554 d->setWindowIconText_helper(
d->topData()->iconText);
1555 if (
isWindow() && !
d->topData()->caption.isEmpty())
1556 d->setWindowTitle_helper(
d->topData()->caption);
1558 d->updateSystemBackground();
1561 d->setWindowIcon_sys();
1575 d->data.in_destructor =
true;
1577 #if defined (QT_CHECK_STATE) 1582 #ifndef QT_NO_GESTURES 1588 d->registerDropSite(
false);
1590 #ifndef QT_NO_ACTION 1592 for (
int i = 0; i <
d->actions.size(); ++i) {
1599 #ifndef QT_NO_SHORTCUT 1611 Q_ASSERT(
d->focus_next->d_func()->focus_prev ==
this);
1612 Q_ASSERT(
d->focus_prev->d_func()->focus_next ==
this);
1614 if (
d->focus_next !=
this) {
1615 d->focus_next->d_func()->focus_prev =
d->focus_prev;
1616 d->focus_prev->d_func()->focus_next =
d->focus_next;
1617 d->focus_next =
d->focus_prev = 0;
1633 d->setDirtyOpaqueRegion();
1648 #if defined(Q_WS_WIN) || defined(Q_WS_X11)|| defined(Q_WS_MAC) 1650 qApp->d_func()->sendSyntheticEnterLeave(
this);
1652 #elif defined(Q_WS_QWS) || defined(Q_WS_QPA) 1654 qApp->d_func()->sendSyntheticEnterLeave(
this);
1659 if (
d->extra &&
d->extra->topextra &&
d->extra->topextra->backingStore) {
1666 d->extra->topextra->backingStore.destroy();
1670 bs->removeDirtyWidget(
this);
1672 bs->removeStaticWidget(
this);
1675 delete d->needsFlush;
1682 if (
d->declarativeData) {
1684 d->declarativeData = 0;
1687 #ifdef QT_MAC_USE_COCOA 1692 extern void qt_mac_clearCocoaViewQWidgetPointers(
QWidget *);
1693 qt_mac_clearCocoaViewQWidgetPointers(
this);
1696 if (!
d->children.isEmpty())
1697 d->deleteChildren();
1699 #ifndef QT_NO_ACCESSIBILITY 1712 if (QWidgetPrivate::allWidgets)
1713 QWidgetPrivate::allWidgets->
remove(
this);
1718 }
QT_CATCH(
const std::exception&) {
1734 bool userDesktopWidget = qt_desktopWidget != 0 && qt_desktopWidget != q && q->
windowType() ==
Qt::Desktop;
1735 if (mapper &&
data.
winid && !userDesktopWidget) {
1742 #if defined(Q_WS_X11) 1745 if (mapper &&
id && !userDesktopWidget) {
1749 if(oldWinId !=
id) {
1759 if (!extra->topextra) {
1777 #ifdef QT_MAC_USE_COCOA 1778 x->wasMaximized =
false;
1779 #endif // QT_MAC_USE_COCOA 1782 #ifdef QWIDGET_EXTRA_DEBUG 1783 static int count = 0;
1784 qDebug() <<
"tlextra" << ++count;
1786 #if defined(Q_WS_QPA) 1787 x->platformWindow = 0;
1807 extra->topextra = 0;
1808 #ifndef QT_NO_GRAPHICSVIEW 1809 extra->proxyWidget = 0;
1811 #ifndef QT_NO_CURSOR 1818 extra->customDpiX = 0;
1819 extra->customDpiY = 0;
1820 extra->explicitMinSize = 0;
1821 extra->explicitMaxSize = 0;
1822 extra->autoFillBackground = 0;
1823 extra->nativeChildrenForced = 0;
1824 extra->inRenderWithPainter = 0;
1827 #ifdef QWIDGET_EXTRA_DEBUG 1828 static int count = 0;
1829 qDebug() <<
"extra" << ++count;
1846 #ifndef QT_NO_CURSOR 1850 #ifndef QT_NO_STYLE_STYLESHEET 1852 if (
QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(extra->style))
1855 if (extra->topextra) {
1857 extra->topextra->backingStore.destroy();
1858 delete extra->topextra->icon;
1859 delete extra->topextra->iconPixmap;
1860 #if defined(Q_WS_QWS) && !defined(QT_NO_QWS_MANAGER) 1861 delete extra->topextra->qwsManager;
1863 delete extra->topextra->windowSurface;
1864 delete extra->topextra;
1893 above = (sibling == w);
1898 const QWExtra *siblingExtra = sibling->d_func()->extra;
1914 if (paintOnScreen()) {
1924 if (paintOnScreen())
1925 repaint_sys(region);
1927 bs->sync(q_func(), region);
1935 if (enable && !q->isWindow() && q->parentWidget() && !q->parentWidget()->updatesEnabled())
1949 w->d_func()->setUpdatesEnabled_helper(enable);
1967 #ifndef QT_NO_GRAPHICSVIEW 1968 if (!q->parentWidget() && extra && extra->proxyWidget) {
1970 inheritedPaletteResolveMask = p->d_func()->inheritedPaletteResolveMask | p->
palette().
resolve();
1972 #endif //QT_NO_GRAPHICSVIEW 1974 inheritedPaletteResolveMask = 0;
1989 #if defined(QT3_SUPPORT) 1990 q->paletteChange(q->palette());
2003 QRect r = effectiveRectFor(q->rect());
2024 if (!q->isVisible())
2034 && w->parentWidget()) {
2039 r &=
QRegion(ox, oy, w->width(), w->height());
2042 while(w->d_func()->children.at(i++) !=
static_cast<const QObject *
>(ignoreUpTo))
2044 for ( ; i < w->d_func()->children.size(); ++i) {
2045 if(
QWidget *sibling = qobject_cast<QWidget *>(w->d_func()->children.at(i))) {
2046 if(sibling->isVisible() && !sibling->isWindow()) {
2047 QRect siblingRect(ox+sibling->x(), oy+sibling->y(),
2048 sibling->width(), sibling->height());
2058 #ifndef QT_NO_GRAPHICSEFFECT 2073 #endif //QT_NO_GRAPHICSEFFECT 2079 dirtyOpaqueChildren =
true;
2081 #ifndef QT_NO_GRAPHICSEFFECT 2082 invalidateGraphicsEffectsRecursively();
2083 #endif //QT_NO_GRAPHICSEFFECT 2100 if (!dirtyOpaqueChildren)
2101 return opaqueChildren;
2133 const QRegion &r = getOpaqueChildren();
2135 source -= (r & clipRect);
2140 bool alsoNonOpaque)
const 2143 static int disableSubtractOpaqueSiblings =
qgetenv(
"QT_NO_SUBTRACTOPAQUESIBLINGS").
toInt();
2144 if (disableSubtractOpaqueSiblings || q->isWindow())
2147 #ifdef QT_MAC_USE_COCOA 2148 if (q->d_func()->isInUnifiedToolbar)
2150 #endif // QT_MAC_USE_COCOA 2152 QRect clipBoundingRect;
2153 bool dirtyClipBoundingRect =
true;
2156 bool dirtyParentClip =
true;
2167 const QRect widgetGeometry = w->d_func()->effectiveRectFor(w->
data->
crect);
2168 for (
int i = myIndex + 1; i < pd->
children.
size(); ++i) {
2173 const QRect siblingGeometry = sibling->d_func()->effectiveRectFor(sibling->
data->
crect);
2177 if (dirtyClipBoundingRect) {
2179 dirtyClipBoundingRect =
false;
2185 if (dirtyParentClip) {
2186 parentClip = sourceRegion.
translated(parentOffset);
2187 dirtyParentClip =
false;
2191 const QRect siblingClipRect(sibling->d_func()->clipRect());
2192 QRegion siblingDirty(parentClip);
2193 siblingDirty &= (siblingClipRect.translated(siblingPos));
2194 const bool hasMask = sibling->d_func()->extra && sibling->d_func()->extra->hasMask
2197 siblingDirty &= sibling->d_func()->extra->
mask.
translated(siblingPos);
2198 if (siblingDirty.isEmpty())
2201 if (sibling->d_func()->isOpaque || alsoNonOpaque) {
2204 sourceRegion -= siblingDirty;
2206 sourceRegion -= siblingGeometry.
translated(-parentOffset);
2209 if (hasDirtySiblingsAbove)
2210 *hasDirtySiblingsAbove =
true;
2213 QRegion opaqueSiblingChildren(sibling->d_func()->getOpaqueChildren());
2214 opaqueSiblingChildren.
translate(-parentOffset + siblingPos);
2215 sourceRegion -= opaqueSiblingChildren;
2220 dirtyClipBoundingRect =
true;
2221 dirtyParentClip =
true;
2226 dirtyParentClip =
true;
2237 #ifndef QT_NO_GRAPHICSEFFECT 2242 #endif //QT_NO_GRAPHICSEFFECT 2257 #if defined(Q_WS_QWS) 2259 #elif defined(QT_NO_BACKINGSTORE) 2268 return !qt_enable_backingstore;
2275 setDirtyOpaqueRegion();
2277 #ifndef QT_NO_GRAPHICSEFFECT 2283 #endif //QT_NO_GRAPHICSEFFECT 2296 if (S60->avkonComponentsSupportTransparency) {
2312 const QPalette &pal = q->palette();
2314 if (q->autoFillBackground()) {
2315 const QBrush &autoFillBrush = pal.
brush(q->backgroundRole());
2339 if (isOpaque == opaque)
2343 macUpdateIsOpaque();
2346 x11UpdateIsOpaque();
2349 winUpdateIsOpaque();
2352 s60UpdateIsOpaque();
2359 macUpdateIsOpaque();
2362 x11UpdateIsOpaque();
2365 winUpdateIsOpaque();
2368 s60UpdateIsOpaque();
2389 widget->d_func()->paintBackground(&p,
QRect(off,
size()));
2404 #if !defined(QT_NO_STYLE_S60) 2407 if (!qt_s60_fill_background(painter, rgn, brush))
2408 #endif // !defined(QT_NO_STYLE_S60) 2424 for (
int i = 0; i < rects.
size(); ++i)
2433 #ifndef QT_NO_SCROLLAREA 2434 bool resetBrushOrigin =
false;
2438 if (scrollArea && scrollArea->
viewport() == q) {
2442 resetBrushOrigin =
true;
2446 #endif // QT_NO_SCROLLAREA 2448 const QBrush autoFillBrush = q->palette().brush(q->backgroundRole());
2450 if ((flags & DrawAsRoot) && !(q->autoFillBackground() && autoFillBrush.
isOpaque())) {
2452 #if defined(Q_WS_QWS) || defined(Q_WS_QPA) 2453 if (!(flags & DontSetCompositionMode)) {
2467 if (q->autoFillBackground())
2477 #ifndef QT_NO_SCROLLAREA 2478 if (resetBrushOrigin)
2480 #endif // QT_NO_SCROLLAREA 2503 if (q == qt_button_down)
2519 return QWidgetPrivate::mapper ? QWidgetPrivate::mapper->
value(
id, 0) : 0;
2561 qDebug() <<
"QWidget::winId: creating native window for" <<
this;
2579 qDebug() <<
"QWidgetPrivate::createWinId for" << q << winid;
2584 if (!q->isWindow()) {
2630 qDebug() <<
"QWidget::createWinId" <<
this;
2660 if (!realParent && d_func()->inSetParent) {
2681 #ifndef QT_NO_STYLE_STYLESHEET 2706 return d->extra->styleSheet;
2736 #endif // QT_NO_STYLE_STYLESHEET 2746 if (
d->extra &&
d->extra->style)
2747 return d->extra->style;
2777 #ifndef QT_NO_STYLE_STYLESHEET 2782 d->setStyle_helper(style,
false);
2783 }
else if (qobject_cast<QStyleSheetStyle *>(
d->extra->style) || !
qApp->styleSheet().isEmpty()) {
2788 d->setStyle_helper(style,
false);
2798 QStyle *oldStyle = q->style();
2799 #ifndef QT_NO_STYLE_STYLESHEET 2813 #ifndef QT_NO_STYLE_STYLESHEET 2814 origStyle = extra->style.
data();
2816 extra->style = newStyle;
2825 macUpdateMetalAttribute();
2827 q->style()->polish(q);
2829 }
else if (metalHack) {
2830 macUpdateMetalAttribute();
2839 c->d_func()->inheritStyle();
2843 #ifndef QT_NO_STYLE_STYLESHEET 2844 if (!qobject_cast<QStyleSheetStyle*>(newStyle)) {
2846 cssStyle->clearWidgetFont(q);
2854 q->styleChange(*oldStyle);
2857 #ifndef QT_NO_STYLE_STYLESHEET 2867 #ifndef QT_NO_STYLE_STYLESHEET 2872 if (!q->styleSheet().isEmpty()) {
2878 QStyle *origStyle = proxy ? proxy->
base : (extra ? (
QStyle*)extra->style : 0);
2880 QStyle *parentStyle = (parent && parent->d_func()->extra) ? (
QStyle*)parent->d_func()->extra->
style : 0;
2884 QStyle *newStyle = parentStyle;
2887 else if (
QStyleSheetStyle *newProxy = qobject_cast<QStyleSheetStyle *>(parentStyle))
2890 setStyle_helper(newStyle,
true);
2896 if (origStyle == (extra ? (
QStyle*)extra->style : 0))
2905 setStyle_helper(origStyle,
true);
2906 #endif // QT_NO_STYLE_STYLESHEET 3301 #ifndef QT_NO_ACTION 3329 for(
int i = 0; i < actions.
count(); i++)
3345 qWarning(
"QWidget::insertAction: Attempt to insert null action");
3350 if(
d->actions.contains(action))
3353 int pos =
d->actions.indexOf(before);
3356 pos =
d->actions.size();
3358 d->actions.insert(pos, action);
3378 for(
int i = 0; i < actions.
count(); ++i)
3396 if (
d->actions.removeAll(action)) {
3412 #endif // QT_NO_ACTION 3451 d->setEnabled_helper(enable);
3458 if (enable && !q->isWindow() && q->parentWidget() && !q->parentWidget()->isEnabled())
3465 updateSystemBackground();
3467 if (!enable && q->window()->focusWidget() == q) {
3468 bool parentIsEnabled = (!q->parentWidget() || q->parentWidget()->isEnabled());
3469 if (!parentIsEnabled || !q->focusNextChild())
3477 w->d_func()->setEnabled_helper(enable);
3479 #if defined(Q_WS_X11) 3486 #if defined(Q_WS_MAC) 3487 setEnabled_helper_sys(enable);
3505 q->enabledChange(!enable);
3614 QRect fs =
d->frameStrut();
3700 QRect fs =
d->frameStrut();
3840 if (!
d->extra || !
d->extra->topextra)
3846 return d->topData()->normalGeometry;
3868 QRect r(0, 0, 0, 0);
3869 for (
int i = 0; i <
d->children.size(); ++i) {
3896 for (
int i = 0; i <
d->children.size(); ++i) {
3933 return d->extra ?
QSize(
d->extra->minw,
d->extra->minh) :
QSize(0, 0);
3958 return d->extra ?
QSize(
d->extra->maxw,
d->extra->maxh)
4052 return (
d->extra &&
d->extra->topextra)
4053 ?
QSize(
d->extra->topextra->incw,
d->extra->topextra->inch)
4076 return (
d->extra != 0 &&
d->extra->topextra != 0)
4077 ?
QSize(
d->extra->topextra->basew,
d->extra->topextra->baseh)
4086 if (q->isWindow()) {
4088 if (!maxWindowRect.
isEmpty()) {
4091 if (minw > maxWindowRect.
width())
4092 minw = maxWindowRect.
width();
4093 if (minh > maxWindowRect.
height())
4094 minh = maxWindowRect.
height();
4098 int mw = minw, mh = minh;
4104 qWarning(
"QWidget::setMinimumSize: (%s/%s) " 4105 "The largest allowed size is (%d,%d)",
4106 q->objectName().toLocal8Bit().data(), q->metaObject()->className(),
QWIDGETSIZE_MAX,
4111 if (minw < 0 || minh < 0) {
4112 qWarning(
"QWidget::setMinimumSize: (%s/%s) Negative sizes (%d,%d) " 4114 q->objectName().toLocal8Bit().data(), q->metaObject()->className(), minw, minh);
4115 minw = mw =
qMax(minw, 0);
4116 minh = mh =
qMax(minh, 0);
4119 if (extra->minw == mw && extra->minh == mh)
4141 if (!
d->setMinimumSize_helper(minw, minh))
4145 d->setConstraints_sys();
4154 #ifndef QT_NO_GRAPHICSVIEW 4156 if (
d->extra->proxyWidget)
4157 d->extra->proxyWidget->setMinimumSize(minw, minh);
4160 d->updateGeometry_helper(
d->extra->minw ==
d->extra->maxw &&
d->extra->minh ==
d->extra->maxh);
4167 qWarning(
"QWidget::setMaximumSize: (%s/%s) " 4168 "The largest allowed size is (%d,%d)",
4169 q->objectName().toLocal8Bit().data(), q->metaObject()->className(),
QWIDGETSIZE_MAX,
4174 if (maxw < 0 || maxh < 0) {
4175 qWarning(
"QWidget::setMaximumSize: (%s/%s) Negative sizes (%d,%d) " 4177 q->objectName().toLocal8Bit().data(), q->metaObject()->className(), maxw, maxh);
4178 maxw =
qMax(maxw, 0);
4179 maxh =
qMax(maxh, 0);
4182 if (extra->maxw == maxw && extra->maxh == maxh)
4204 if (!
d->setMaximumSize_helper(maxw, maxh))
4208 d->setConstraints_sys();
4215 #ifndef QT_NO_GRAPHICSVIEW 4217 if (
d->extra->proxyWidget)
4218 d->extra->proxyWidget->setMaximumSize(maxw, maxh);
4222 d->updateGeometry_helper(
d->extra->minw ==
d->extra->maxw &&
d->extra->minh ==
d->extra->maxh);
4244 d->setConstraints_sys();
4266 d->setConstraints_sys();
4308 bool minSizeSet =
d->setMinimumSize_helper(tmpW, tmpH);
4310 bool minSizeSet =
d->setMinimumSize_helper(w, h);
4312 bool maxSizeSet =
d->setMaximumSize_helper(w, h);
4313 if (!minSizeSet && !maxSizeSet)
4317 d->setConstraints_sys();
4319 d->updateGeometry_helper(
true);
4331 d->extra->explicitMinSize = expl;
4340 d->extra->explicitMinSize = expl;
4349 d->extra->explicitMaxSize = expl;
4358 d->extra->explicitMaxSize = expl;
4376 d->extra->explicitMinSize = explMin;
4377 d->extra->explicitMaxSize = explMax;
4396 d->extra->explicitMinSize = explMin;
4397 d->extra->explicitMaxSize = explMax;
4414 while (w != parent) {
4415 Q_ASSERT_X(w,
"QWidget::mapTo(QWidget *parent, const QPoint &pos)",
4416 "parent must be in parent hierarchy");
4438 while (w != parent) {
4439 Q_ASSERT_X(w,
"QWidget::mapFrom(QWidget *parent, const QPoint &pos)",
4440 "parent must be in parent hierarchy");
4534 Qt::BackgroundMode QWidget::backgroundMode()
const 4537 return Qt::NoBackground;
4540 return Qt::PaletteForeground;
4542 return Qt::PaletteButton;
4544 return Qt::PaletteLight;
4546 return Qt::PaletteMidlight;
4548 return Qt::PaletteDark;
4550 return Qt::PaletteMid;
4552 return Qt::PaletteText;
4554 return Qt::PaletteBrightText;
4556 return Qt::PaletteBase;
4558 return Qt::PaletteBackground;
4560 return Qt::PaletteShadow;
4562 return Qt::PaletteHighlight;
4564 return Qt::PaletteHighlightedText;
4566 return Qt::PaletteButtonText;
4568 return Qt::PaletteLink;
4570 return Qt::PaletteLinkVisited;
4574 return Qt::NoBackground;
4588 void QWidget::setBackgroundMode(Qt::BackgroundMode m, Qt::BackgroundMode)
4591 if(m == Qt::NoBackground) {
4599 case Qt::FixedColor:
4600 case Qt::FixedPixmap:
4602 case Qt::PaletteForeground:
4605 case Qt::PaletteButton:
4608 case Qt::PaletteLight:
4611 case Qt::PaletteMidlight:
4614 case Qt::PaletteDark:
4617 case Qt::PaletteMid:
4620 case Qt::PaletteText:
4623 case Qt::PaletteBrightText:
4626 case Qt::PaletteBase:
4629 case Qt::PaletteBackground:
4632 case Qt::PaletteShadow:
4635 case Qt::PaletteHighlight:
4638 case Qt::PaletteHighlightedText:
4641 case Qt::PaletteButtonText:
4644 case Qt::PaletteLink:
4647 case Qt::PaletteLinkVisited:
4650 case Qt::X11ParentRelative:
4712 d->updateSystemBackground();
4713 d->propagatePaletteChange();
4714 d->updateIsOpaque();
4777 d->updateSystemBackground();
4778 d->propagatePaletteChange();
4867 QPalette naturalPalette =
d->naturalWidgetPalette(
d->inheritedPaletteResolveMask);
4869 d->setPalette_helper(resolvedPalette);
4890 #ifndef QT_NO_GRAPHICSVIEW 4891 || (extra && extra->proxyWidget)
4897 QPalette inheritedPalette = p->palette();
4898 inheritedPalette.
resolve(inheritedMask);
4899 naturalPalette = inheritedPalette.
resolve(naturalPalette);
4901 naturalPalette = p->palette();
4905 #ifndef QT_NO_GRAPHICSVIEW 4906 else if (extra && extra->proxyWidget) {
4907 QPalette inheritedPalette = extra->proxyWidget->palette();
4908 inheritedPalette.
resolve(inheritedMask);
4909 naturalPalette = inheritedPalette.
resolve(naturalPalette);
4911 #endif //QT_NO_GRAPHICSVIEW 4914 return naturalPalette;
4929 QPalette naturalPalette = naturalWidgetPalette(inheritedPaletteResolveMask);
4931 setPalette_helper(resolvedPalette);
4940 updateSystemBackground();
4941 propagatePaletteChange();
5000 #ifndef QT_NO_STYLE_STYLESHEET 5002 if (
d->extra && (style = qobject_cast<const QStyleSheetStyle*>(
d->extra->style))) {
5013 QFont naturalFont =
d->naturalWidgetFont(
d->inheritedFontResolveMask);
5015 d->setFont_helper(resolvedFont);
5036 #ifndef QT_NO_GRAPHICSVIEW 5037 || (extra && extra->proxyWidget)
5043 QFont inheritedFont = p->font();
5044 inheritedFont.
resolve(inheritedMask);
5045 naturalFont = inheritedFont.
resolve(naturalFont);
5047 naturalFont = p->font();
5051 #ifndef QT_NO_GRAPHICSVIEW 5052 else if (extra && extra->proxyWidget) {
5053 QFont inheritedFont = extra->proxyWidget->font();
5054 inheritedFont.
resolve(inheritedMask);
5055 naturalFont = inheritedFont.
resolve(naturalFont);
5057 #endif //QT_NO_GRAPHICSVIEW 5076 QFont naturalFont = naturalWidgetFont(inheritedFontResolveMask);
5078 setFont_helper(resolvedFont);
5096 #ifndef QT_NO_STYLE_STYLESHEET 5105 #if defined(Q_WS_X11) 5107 data.
fnt.x11SetScreen(xinfo.screen());
5110 #ifndef QT_NO_GRAPHICSVIEW 5111 if (!q->parentWidget() && extra && extra->proxyWidget) {
5113 inheritedFontResolveMask = p->d_func()->inheritedFontResolveMask | p->
font().
resolve();
5115 #endif //QT_NO_GRAPHICSVIEW 5117 inheritedFontResolveMask = 0;
5125 #ifndef QT_NO_STYLE_STYLESHEET 5140 #ifndef QT_NO_STYLE_STYLESHEET 5164 w->d_func()->setLayoutDirection_helper(direction);
5209 d->setLayoutDirection_helper(direction);
5221 d->resolveLayoutDirection();
5277 #ifndef QT_NO_CURSOR 5282 return (
d->extra &&
d->extra->curs)
5294 #if !defined(Q_WS_MAC) && !defined(Q_WS_QWS) 5296 || (
d->extra &&
d->extra->curs))
5301 delete d->extra->curs;
5302 d->extra->curs = newCursor;
5305 d->setCursor_sys(cursor);
5315 delete d->extra->curs;
5320 d->unsetCursor_sys();
5373 const QRegion &sourceRegion, RenderFlags renderFlags)
5375 d_func()->render(target, targetOffset, sourceRegion, renderFlags,
false);
5395 const QRegion &sourceRegion, RenderFlags renderFlags)
5398 qWarning(
"QWidget::render: Null pointer to painter");
5403 qWarning(
"QWidget::render: Cannot render with an inactive painter");
5412 const bool inRenderWithPainter =
d->extra &&
d->extra->inRenderWithPainter;
5413 const QRegion toBePainted = !inRenderWithPainter ?
d->prepareToRender(sourceRegion, renderFlags)
5420 d->extra->inRenderWithPainter =
true;
5423 d->render_helper(painter, targetOffset, toBePainted, renderFlags);
5434 d->render_helper(painter, targetOffset, toBePainted, renderFlags);
5435 d->extra->inRenderWithPainter =
false;
5440 QPainter *oldPainter =
d->sharedPainter();
5441 d->setSharedPainter(painter);
5456 render(target, targetOffset, toBePainted, renderFlags);
5464 d->setSharedPainter(oldPainter);
5467 d->extra->inRenderWithPainter =
false;
5483 #ifndef QT_NO_GRAPHICSEFFECT 5487 return d->graphicsEffect;
5489 #endif //QT_NO_GRAPHICSEFFECT 5516 #ifndef QT_NO_GRAPHICSEFFECT 5520 if (
d->graphicsEffect == effect)
5523 if (
d->graphicsEffect) {
5524 d->invalidateBuffer(
rect());
5525 delete d->graphicsEffect;
5526 d->graphicsEffect = 0;
5533 d->graphicsEffect = effect;
5534 effect->d_func()->setGraphicsEffectSource(source);
5538 d->updateIsOpaque();
5540 #endif //QT_NO_GRAPHICSEFFECT 5553 return parent ? parent->d_func()->isAboutToShow() :
false;
5562 if (!isVisible && !isAboutToShow()) {
5564 (void)topLevel->d_func()->topData();
5574 hiddenWidgets.
append(widget);
5576 widget->d_func()->updateGeometry_helper(
true);
5582 if (topLevel->d_func()->
layout)
5586 QTLWExtra *topLevelExtra = topLevel->d_func()->maybeTopData();
5594 topLevel->d_func()->activateChildLayoutsRecursively();
5597 for (
int i = 0; i < hiddenWidgets.
size(); ++i) {
5603 }
else if (isVisible) {
5604 q->window()->d_func()->sendPendingMoveAndResizeEvents(
true,
true);
5610 toBePainted &= extra->mask;
5615 QWidget::RenderFlags renderFlags)
5623 const bool useDeviceCoordinates = originalTransform.
isScaling();
5624 if (!useDeviceCoordinates) {
5635 q->render(&pixmap,
QPoint(), toBePainted, renderFlags);
5649 transform.
translate(targetOffset.
x(), targetOffset.
y());
5659 QPixmap pixmap(deviceRect.size());
5668 q->render(&pixmapPainter,
QPoint(), toBePainted, renderFlags);
5669 pixmapPainter.
end();
5673 painter->
drawPixmap(deviceRect.topLeft(), pixmap);
5685 #if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA) 5686 if (qt_mac_clearDirtyOnWidgetInsideDrawWidget)
5691 if (backingStore && isInUnifiedToolbar)
5693 #endif // Q_WS_MAC && QT_MAC_USE_COCOA 5697 #if !defined(QT_NO_GRAPHICSEFFECT) && !defined(Q_WS_MAC) 5705 if (!sharedPainter) {
5714 context.
painter = sharedPainter;
5719 sharedPainter->
save();
5728 #endif //QT_NO_GRAFFICSEFFECT 5730 const bool asRoot = flags & DrawAsRoot;
5731 const bool alsoOnScreen = flags & DrawPaintOnScreen;
5732 const bool recursive = flags & DrawRecursive;
5733 const bool alsoInvisible = flags & DrawInvisible;
5738 if (asRoot && !alsoInvisible)
5739 toBePainted &= clipRect();
5740 if (!(flags & DontSubtractOpaqueChildren))
5741 subtractOpaqueChildren(toBePainted, q->rect());
5743 if (!toBePainted.isEmpty()) {
5744 bool onScreen = paintOnScreen();
5745 if (!onScreen || alsoOnScreen) {
5748 qWarning(
"QWidget::repaint: Recursive repaint detected");
5752 #ifndef QT_NO_PAINT_DEBUG 5757 setRedirected(pdev, -offset);
5769 paintEngine->d_func()->
systemClip = toBePainted;
5771 paintEngine->d_func()->
systemRect = q->data->crect;
5777 paintBackground(&p, toBePainted, (asRoot || onScreen) ? flags | DrawAsRoot : 0);
5785 QColor tint = q->palette().window().color();
5787 p.
fillRect(toBePainted.boundingRect(), tint);
5792 qDebug() <<
"painting" << q <<
"opaque ==" << isOpaque();
5793 qDebug() <<
"clipping to" << toBePainted <<
"location == " << offset
5794 <<
"geometry ==" <<
QRect(q->mapTo(q->window(),
QPoint(0, 0)), q->size());
5800 #if !defined(Q_WS_QWS) && !defined(Q_WS_QPA) 5801 if (backingStore && !onScreen && !asRoot && (q->internalWinId() || !q->nativeParentWidget()->isWindow()))
5811 restoreRedirected();
5815 paintEngine->d_func()->currentClipWidget = 0;
5820 qWarning(
"QWidget::repaint: It is dangerous to leave painters active on a widget outside of the PaintEvent");
5826 #ifndef QT_NO_PAINT_DEBUG 5830 }
else if (q->isWindow()) {
5849 #ifdef Q_BACKINGSTORE_SUBSURFACES 5850 , q->windowSurface()
5852 , sharedPainter, backingStore);
5857 const QRegion &sourceRegion, QWidget::RenderFlags renderFlags,
5861 qWarning(
"QWidget::render: null pointer to paint device");
5865 const bool inRenderWithPainter = extra && extra->inRenderWithPainter;
5866 QRegion paintRegion = !inRenderWithPainter && !readyToRender
5867 ? prepareToRender(sourceRegion, renderFlags)
5873 QPainter *oldSharedPainter = inRenderWithPainter ? sharedPainter() : 0;
5881 if (targetPainter && targetPainter->
isActive())
5882 setSharedPainter(targetPainter);
5890 QPoint offset = targetOffset;
5892 QPoint redirectionOffset;
5896 redirected = static_cast<QWidget *>(target)->d_func()->redirected(&redirectionOffset);
5901 target = redirected;
5902 offset -= redirectionOffset;
5905 if (!inRenderWithPainter) {
5907 const QRegion targetSystemClip = targetEngine->systemClip();
5908 if (!targetSystemClip.
isEmpty())
5909 paintRegion &= targetSystemClip.
translated(-offset);
5914 int flags = DrawPaintOnScreen | DrawInvisible;
5916 flags |= DrawAsRoot;
5919 flags |= DrawRecursive;
5921 flags |= DontSubtractOpaqueChildren;
5923 #if defined(Q_WS_QWS) || defined(Q_WS_QPA) 5924 flags |= DontSetCompositionMode;
5929 render_helper(&p, targetOffset, paintRegion, renderFlags);
5935 drawWidget(target, paintRegion, offset, flags, sharedPainter());
5938 if (oldSharedPainter)
5939 setSharedPainter(oldSharedPainter);
5942 drawWidget(target, paintRegion, offset, flags, 0);
5947 const QPoint &offset,
int flags
5948 #ifdef Q_BACKINGSTORE_SUBSURFACES
5955 bool dirtyBoundingRect =
true;
5956 const bool exludeOpaqueChildren = (flags & DontDrawOpaqueChildren);
5957 const bool excludeNativeChildren = (flags & DontDrawNativeChildren);
5961 if (x && !(exludeOpaqueChildren && x->d_func()->isOpaque) && !x->
isHidden() && !x->
isWindow()
5963 if (dirtyBoundingRect) {
5965 dirtyBoundingRect =
false;
5969 #ifdef Q_BACKINGSTORE_SUBSURFACES 5979 }
while (index >= 0);
5991 paintSiblingsRecursive(pdev, siblings, --index, wr, offset, flags
5992 #ifdef Q_BACKINGSTORE_SUBSURFACES
5995 , sharedPainter, backingStore);
5999 #ifndef QT_NO_GRAPHICSVIEW 6000 && (!w->d_func()->extra || !w->d_func()->extra->proxyWidget)
6008 wd->
drawWidget(pdev, wRegion, offset + widgetPos, flags, sharedPainter, backingStore);
6012 #ifndef QT_NO_GRAPHICSEFFECT 6016 return m_widget->rect();
6020 qWarning(
"QGraphicsEffectSource::boundingRect: Not yet implemented, lacking device context");
6024 return context->painter->worldTransform().mapRect(m_widget->rect());
6029 if (!context || context->painter != painter) {
6030 m_widget->render(painter);
6036 QRegion toBePainted = context->rgn;
6037 toBePainted &= m_widget->rect();
6042 wd->
drawWidget(context->pdev, toBePainted, context->offset, context->flags,
6043 context->sharedPainter, context->backingStore);
6050 if (!context && deviceCoordinates) {
6052 qWarning(
"QGraphicsEffectSource::pixmap: Not yet implemented, lacking device context");
6057 QRectF sourceRect = m_widget->rect();
6059 if (deviceCoordinates) {
6060 const QTransform &painterTransform = context->painter->worldTransform();
6061 sourceRect = painterTransform.
mapRect(sourceRect);
6062 pixmapOffset = painterTransform.
map(pixmapOffset);
6068 effectRect = m_widget->graphicsEffect()->boundingRectFor(sourceRect).toAlignedRect();
6075 *offset = effectRect.
topLeft();
6077 pixmapOffset -= effectRect.
topLeft();
6084 #endif //QT_NO_GRAPHICSEFFECT 6086 #ifndef QT_NO_GRAPHICSVIEW 6101 QWExtra *extra = origin->d_func()->extra;
6104 return nearestGraphicsProxyWidget(origin->
parentWidget());
6131 if (
locale == loc && !forceUpdate)
6145 w->d_func()->setLocale_helper(loc, forceUpdate);
6157 d->setLocale_helper(locale);
6172 setLocale_helper(q->isWindow()
6174 : q->parentWidget()->locale());
6220 if (
d->extra &&
d->extra->topextra) {
6221 if (!
d->extra->topextra->caption.isEmpty())
6222 return d->extra->topextra->caption;
6223 if (!
d->extra->topextra->filePath.isEmpty())
6246 QString cap = qt_eval_adapt_window_title(title);
6255 int placeHolderLength = 3;
6260 while (index != -1) {
6261 index += placeHolderLength;
6265 index += placeHolderLength;
6269 int lastIndex = cap.
lastIndexOf(placeHolder, index - 1);
6274 cap.
remove(lastIndex, 3);
6277 index = cap.
indexOf(placeHolder, index);
6305 d->topData()->iconText = iconText;
6306 d->setWindowIconText_helper(iconText);
6318 d->topData()->caption = title;
6319 d->setWindowTitle_helper(title);
6369 if (!
d->extra->topextra->icon)
6370 d->extra->topextra->icon =
new QIcon();
6371 *
d->extra->topextra->icon = icon;
6373 delete d->extra->topextra->iconPixmap;
6374 d->extra->topextra->iconPixmap = 0;
6376 d->setWindowIcon_sys();
6377 d->setWindowIcon_helper();
6397 return (
d->extra &&
d->extra->topextra) ?
d->extra->topextra->iconText :
QString();
6446 return (
d->extra &&
d->extra->topextra) ?
d->extra->topextra->filePath :
QString();
6457 d->extra->topextra->filePath = filePath;
6458 d->setWindowFilePath_helper(filePath);
6463 if (extra->topextra && extra->topextra->caption.isEmpty()) {
6469 setWindowTitle_helper(q->windowTitle());
6473 setWindowFilePath_sys(filePath);
6486 return (
d->extra &&
d->extra->topextra) ?
d->extra->topextra->role :
QString();
6495 #if defined(Q_WS_X11) 6497 d->topData()->role = role;
6540 if (!w && !
d->extra)
6551 d->extra->focus_proxy = w;
6564 return d->extra ? (
QWidget *)
d->extra->focus_proxy : 0;
6586 while (w->d_func()->extra && w->d_func()->extra->focus_proxy)
6587 w = w->d_func()->extra->focus_proxy;
6589 #ifndef QT_NO_GRAPHICSVIEW 6639 while (f->d_func()->extra && f->d_func()->extra->focus_proxy)
6640 f = f->d_func()->extra->focus_proxy;
6649 #ifndef QT_NO_GRAPHICSVIEW 6650 QWidget *previousProxyFocus = 0;
6652 if (topData->proxyWidget && topData->proxyWidget->hasFocus()) {
6653 previousProxyFocus = topData->proxyWidget->widget()->
focusWidget();
6654 if (previousProxyFocus && previousProxyFocus->
focusProxy())
6655 previousProxyFocus = previousProxyFocus->
focusProxy();
6656 if (previousProxyFocus ==
this && !topData->proxyWidget->d_func()->proxyIsGivingFocus)
6665 w->d_func()->focus_child = f;
6670 w->d_func()->focus_child = f;
6675 #ifndef QT_NO_GRAPHICSVIEW 6678 if (topData->proxyWidget && !topData->proxyWidget->hasFocus()) {
6679 topData->proxyWidget->d_func()->focusFromWidgetToProxy = 1;
6680 topData->proxyWidget->
setFocus(reason);
6681 topData->proxyWidget->d_func()->focusFromWidgetToProxy = 0;
6688 #ifndef QT_NO_ACCESSIBILITY 6700 #ifndef QT_NO_GRAPHICSVIEW 6702 if (topData->proxyWidget) {
6703 if (previousProxyFocus && previousProxyFocus != f) {
6712 #ifndef QT_NO_GRAPHICSVIEW 6715 if (topData->proxyWidget && topData->proxyWidget->hasFocus())
6716 topData->proxyWidget->d_func()->updateProxyInputMethodAcceptanceFromWidget();
6761 if (w->d_func()->focus_child ==
this)
6762 w->d_func()->focus_child = 0;
6765 #ifndef QT_NO_GRAPHICSVIEW 6766 QWExtra *topData = d_func()->extra;
6774 #if defined(Q_WS_WIN) 6780 #ifndef QT_NO_ACCESSIBILITY 6841 if (!
isWindow() && !isSubWindow && p)
6843 #ifndef QT_NO_GRAPHICSVIEW 6844 if (
d->extra &&
d->extra->proxyWidget)
6845 return d->extra->proxyWidget->focusNextPrevChild(next);
6848 if (!w)
return false;
6865 return const_cast<QWidget *
>(d_func()->focus_child);
6875 return const_cast<QWidget *
>(d_func()->focus_next);
6891 return const_cast<QWidget *
>(d_func()->focus_prev);
6918 #ifndef QT_NO_GRAPHICSVIEW 6919 if (
QWExtra *tlwExtra = tlw->d_func()->extra) {
6920 if (
isVisible() && tlwExtra->proxyWidget)
6921 return tlwExtra->proxyWidget->isActiveWindow();
6948 #if defined(Q_WS_WIN32) 6949 HWND active = GetActiveWindow();
6981 qWarning(
"QWidget::setTabOrder: 'first' and 'second' must be in the same window");
6992 for (
int i = l.
size()-1; i >= 0; --i) {
7010 QWidget *fn = first->d_func()->focus_next;
7012 if (fn == second || first == second)
7015 QWidget *sp = second->d_func()->focus_prev;
7016 QWidget *sn = second->d_func()->focus_next;
7018 fn->d_func()->focus_prev = second;
7019 first->d_func()->focus_next = second;
7021 second->d_func()->focus_next = fn;
7022 second->d_func()->focus_prev = first;
7024 sp->d_func()->focus_next = sn;
7025 sn->d_func()->focus_prev = sp;
7028 Q_ASSERT(first->d_func()->focus_next->d_func()->focus_prev == first);
7029 Q_ASSERT(first->d_func()->focus_prev->d_func()->focus_next == first);
7031 Q_ASSERT(second->d_func()->focus_next->d_func()->focus_prev == second);
7032 Q_ASSERT(second->d_func()->focus_prev->d_func()->focus_next == second);
7050 if (oldtlw == q->
window())
7054 focus_child->clearFocus();
7062 bool prevWasNew =
true;
7073 n->d_func()->focus_next = w;
7074 w->d_func()->focus_prev = n;
7081 o->d_func()->focus_next = w;
7082 w->d_func()->focus_prev = o;
7090 w = w->d_func()->focus_next;
7091 prevWasNew = currentIsNew;
7096 o->d_func()->focus_next = firstOld;
7097 firstOld->d_func()->focus_prev = o;
7100 if (!q->isWindow()) {
7104 QWidget *prev = topLevel->d_func()->focus_prev;
7106 topLevel->d_func()->focus_prev = n;
7107 prev->d_func()->focus_next = q;
7110 n->d_func()->focus_next = topLevel;
7113 n->d_func()->focus_next = q;
7132 if (p.
x() < r.
left())
7133 dx = r.
left() - p.
x();
7134 else if (p.
x() > r.
right())
7136 if (p.
y() < r.
top())
7137 dy = r.
top() - p.
y();
7157 QRect fs =
d->frameStrut();
7179 d->topData()->posFromMove =
true;
7184 d->setDirtyOpaqueRegion();
7206 d->setDirtyOpaqueRegion();
7219 d->topData()->posFromMove =
false;
7222 d->setDirtyOpaqueRegion();
7253 #ifdef QT_MAC_USE_COCOA 7261 newFramePosition.
moveTo(0, 0);
7262 newNormalPosition.
moveTo(0, 0);
7264 #endif // QT_MAC_USE_COCOA 7268 const quint32 magicNumber = 0x1D9D0CB;
7271 stream << magicNumber
7274 #ifdef QT_MAC_USE_COCOA 7276 << newNormalPosition
7280 #endif // QT_MAC_USE_COCOA 7315 if (geometry.
size() < 4)
7320 const quint32 magicNumber = 0x1D9D0CB;
7322 stream >> storedMagicNumber;
7323 if (storedMagicNumber != magicNumber)
7326 const quint16 currentMajorVersion = 1;
7330 stream >> majorVersion >> minorVersion;
7332 if (majorVersion != currentMajorVersion)
7336 QRect restoredFrameGeometry;
7337 QRect restoredNormalGeometry;
7338 qint32 restoredScreenNumber;
7342 stream >> restoredFrameGeometry
7343 >> restoredNormalGeometry
7344 >> restoredScreenNumber
7348 const int frameHeight = 20;
7349 if (!restoredFrameGeometry.
isValid())
7352 if (!restoredNormalGeometry.
isValid())
7354 if (!restoredNormalGeometry.
isValid()) {
7356 restoredNormalGeometry.
setSize(restoredNormalGeometry
7358 .expandedTo(d_func()->adjustedSize()));
7362 if (restoredScreenNumber >= desktop->
numScreens())
7378 if (!restoredFrameGeometry.
intersects(availableGeometry)) {
7383 restoredFrameGeometry.
moveTop(
qMax(restoredFrameGeometry.
top(), availableGeometry.
top()));
7385 if (!restoredNormalGeometry.
intersects(availableGeometry)) {
7387 restoredNormalGeometry.
moveLeft(
qMax(restoredNormalGeometry.
left(), availableGeometry.
left()));
7390 restoredNormalGeometry.
moveTop(
qMax(restoredNormalGeometry.
top(), availableGeometry.
top() + frameHeight));
7392 if (maximized || fullScreen) {
7406 if (restoredScreenNumber != desktop->
screenNumber(
this)) {
7419 d_func()->topData()->normalGeometry = restoredNormalGeometry;
7424 offset = d_func()->topData()->fullScreenOffset;
7452 if (left ==
d->leftmargin && top ==
d->topmargin
7453 && right ==
d->rightmargin && bottom ==
d->bottommargin)
7455 d->leftmargin =
left;
7458 d->bottommargin = bottom;
7513 *left =
d->leftmargin;
7515 *top =
d->topmargin;
7517 *right =
d->rightmargin;
7519 *bottom =
d->bottommargin;
7535 return QMargins(
d->leftmargin,
d->topmargin,
d->rightmargin,
d->bottommargin);
7635 if (
d->extra &&
d->extra->focus_proxy)
7636 d->extra->focus_proxy->setFocusPolicy(policy);
7674 d->setUpdatesEnabled_helper(enable);
7704 createRecursively();
7705 q->ensurePolished();
7711 if (!q->isWindow() && q->parentWidget()->d_func()->layout && !q->parentWidget()->data->in_show)
7712 q->parentWidget()->d_func()->layout->activate();
7724 disableUpdates = disableUpdates && q->updatesEnabled();
7748 child->d_func()->sendPendingMoveAndResizeEvents(recursive, disableUpdates);
7754 sendPendingMoveAndResizeEvents(
false,
true);
7765 if (childPrivate->
layout)
7769 const bool wasVisible = child->
isVisible();
7787 sendPendingMoveAndResizeEvents();
7793 showChildren(
false);
7796 if (q->parentWidget() && sendChildEvents)
7798 QEvent::ChildInserted);
7805 if (q->isWindow()) {
7820 bool isEmbedded =
false;
7821 #ifndef QT_NO_GRAPHICSVIEW 7822 if (q->isWindow()) {
7823 isEmbedded = q->graphicsProxyWidget() ? true :
false;
7826 if (ancestorProxy) {
7828 ancestorProxy->d_func()->embedSubWindow(q);
7839 #if defined(Q_WS_WIN) || defined(Q_WS_MAC) || defined(Q_OS_SYMBIAN) 7840 if (!isEmbedded && q->windowType() ==
Qt::Popup)
7841 qApp->d_func()->openPopup(q);
7848 if (!isEmbedded && q->isModal() && q->isWindow())
7856 #if !defined(Q_WS_WIN) && !defined(Q_WS_MAC) && !defined(Q_OS_SYMBIAN) 7857 if (!isEmbedded && q->windowType() ==
Qt::Popup)
7858 qApp->d_func()->openPopup(q);
7861 #ifndef QT_NO_ACCESSIBILITY 7902 bool isEmbedded =
false;
7903 #if !defined QT_NO_GRAPHICSVIEW 7909 if (!isEmbedded && (q->windowType() ==
Qt::Popup))
7910 qApp->d_func()->closePopup(q);
7915 if (!isEmbedded && q->isModal() && q->isWindow())
7918 #if defined(Q_WS_WIN) 7919 if (q->isWindow() && !(q->windowType() ==
Qt::Popup) && q->parentWidget()
7920 && !q->parentWidget()->isHidden() && q->isActiveWindow())
7921 q->parentWidget()->activateWindow();
7936 hideChildren(
false);
7941 #if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined (Q_WS_QWS) || defined(Q_WS_MAC) || defined(Q_WS_QPA) 7942 qApp->d_func()->sendSyntheticEnterLeave(q);
7948 q->focusNextPrevChild(
true);
7956 bs->removeDirtyWidget(q);
7958 #ifndef QT_NO_ACCESSIBILITY 8012 #if defined(Q_WS_X11) 8015 #elif defined(Q_WS_QWS) 8017 QApplicationPrivate::applyQWSSpecificCommandLineArguments(
this);
8021 Qt::WindowStates initialWindowState =
windowState();
8033 if (needUpdateGeometry)
8034 d->updateGeometry_helper(
true);
8041 d->layout->activate();
8052 parent->d_func()->setDirtyOpaqueRegion();
8076 #if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined (Q_WS_QWS) || defined(Q_WS_MAC) || defined(Q_WS_QPA) 8077 qApp->d_func()->sendSyntheticEnterLeave(
this);
8086 #if defined(Q_WS_WIN) 8091 LONG dwStyle = GetWindowLong(
winId(), GWL_STYLE);
8092 dwStyle &= ~WS_DISABLED;
8093 SetWindowLong(
winId(), GWL_STYLE, dwStyle);
8141 q->setVisible(
true);
8147 for (
int i = 0; i < childList.
size(); ++i) {
8155 widget->d_func()->showChildren(
true);
8160 widget->d_func()->show_recursive();
8170 for (
int i = 0; i < childList.
size(); ++i) {
8174 #ifdef QT_MAC_USE_COCOA 8188 if(widget == qt_button_down)
8190 #endif // QT_MAC_USE_COCOA 8195 widget->d_func()->hideChildren(spontaneous);
8205 widget->d_func()->hide_sys();
8208 #if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined (Q_WS_QWS) || defined(Q_WS_MAC) || defined(Q_WS_QPA) 8209 qApp->d_func()->sendSyntheticEnterLeave(widget);
8211 #ifndef QT_NO_ACCESSIBILITY 8233 if (mode != CloseNoEvent) {
8235 if (mode == CloseWithSpontaneousEvent)
8245 if (!that.
isNull() && !q->isHidden())
8253 quitOnClose = quitOnClose && (parentWidget.
isNull() || !parentWidget->
isVisible());
8260 bool lastWindowClosed =
true;
8261 for (
int i = 0; i < list.
size(); ++i) {
8265 lastWindowClosed =
false;
8268 if (lastWindowClosed)
8388 QRect QWidget::visibleRect()
const 8390 return d_func()->clipRect();
8408 QRect clipRect =
d->clipRect();
8412 d->subtractOpaqueChildren(r, clipRect);
8413 d->subtractOpaqueSiblings(r);
8429 QSize s = q->sizeHint();
8431 if (q->isWindow()) {
8432 Qt::Orientations exp;
8439 if (q->sizePolicy().hasHeightForWidth())
8441 exp = q->sizePolicy().expandingDirections();
8447 #if defined(Q_WS_X11) 8452 #if defined (Q_WS_WINCE) || defined (Q_OS_SYMBIAN) 8460 extra->sizeAdjusted =
true;
8464 QRect r = q->childrenRect();
8492 QSize s =
d->adjustedSize();
8495 d->layout->activate();
8524 return d->layout->totalSizeHint();
8525 return QSize(-1, -1);
8554 return d->layout->totalMinimumSize();
8555 return QSize(-1, -1);
8585 #if defined(Q_WS_WIN) 8590 LONG dwStyle = GetWindowLong(w->
winId(), GWL_STYLE);
8591 LONG newStyle = dwStyle;
8593 newStyle |= WS_DISABLED;
8595 newStyle &= ~WS_DISABLED;
8596 if (newStyle != dwStyle) {
8597 SetWindowLong(w->
winId(), GWL_STYLE, newStyle);
8642 switch(event->
type()) {
8654 #ifndef QT_NO_WHEELEVENT 8662 switch (event->
type()) {
8696 #ifndef QT_NO_WHEELEVENT 8701 #ifndef QT_NO_TABLETEVENT 8726 #ifdef QT_KEYPAD_NAVIGATION 8727 if (!k->
isAccepted() && QApplication::keypadNavigationEnabled()
8750 #ifndef QT_NO_WHATSTHIS 8753 &&
d->whatsThis.size()) {
8781 d->resolvePalette();
8783 if(
d->sendChildEvents)
8791 d->setWindowIcon_sys();
8792 d->setWindowIcon_helper();
8796 #ifdef QT_SOFTKEYS_ENABLED 8807 #ifndef QT_NO_STATUSTIP 8808 if (
d->statusTip.size()) {
8817 #ifndef QT_NO_STATUSTIP 8818 if (
d->statusTip.size()) {
8851 #ifndef QT_NO_CONTEXTMENU 8864 if (
d->actions.count()) {
8865 QMenu::exec(
d->actions, static_cast<QContextMenuEvent *>(event)->globalPos(),
8876 #endif // QT_NO_CONTEXTMENU 8878 #ifndef QT_NO_DRAGANDDROP 8914 d->resolvePalette();
8943 for (
int i = 0; i < childList.
size(); ++i) {
8949 #ifdef QT_SOFTKEYS_ENABLED 8963 for (
int i = 0; i < childList.
size(); ++i) {
8973 d->resolveLayoutDirection();
8978 d->layout->invalidate();
8983 d->syncBackingStore();
8986 update(static_cast<QUpdateLaterEvent*>(event)->region());
8993 for (
int i = 0; i < childList.
size(); ++i) {
8996 if (qobject_cast<QWidget *>(o) && static_cast<QWidget *>(o)->
isWindow()) {
9004 #if defined(Q_WS_WIN) 9009 #ifndef QT_NO_TOOLTIP 9011 if (!
d->toolTip.isEmpty())
9017 #ifndef QT_NO_WHATSTHIS 9019 if (
d->whatsThis.size())
9025 if (
d->whatsThis.isEmpty())
9029 #ifndef QT_NO_ACCESSIBILITY 9035 switch (ev->
type()) {
9036 #ifndef QT_NO_TOOLTIP 9041 #ifndef QT_NO_WHATSTHIS 9052 d->topData()->frameStrut.setCoords(0 ,0, 0, 0);
9054 #if defined(Q_WS_WIN) || defined(Q_WS_X11) 9055 d->topData()->embedded = 1;
9058 #ifndef QT_NO_ACTION 9062 #ifdef QT_SOFTKEYS_ENABLED 9075 for (
int i = 0; i < childList.
size(); ++i) {
9084 d->needWindowChange =
false;
9099 switch (touchEvent->
type()) {
9126 #ifndef QT_NO_GESTURES 9131 #ifndef QT_NO_PROPERTIES 9134 if (!
qstrncmp(propName,
"_q_customDpi", 12) && propName.
length() == 13) {
9138 const char axis = propName.
at(12);
9140 d->extra->customDpiX = value;
9141 else if (axis ==
'Y')
9142 d->extra->customDpiY = value;
9143 d->updateFont(
d->data.fnt);
9172 switch(event->
type()) {
9175 #ifndef QT_NO_ACCESSIBILITY 9186 d->layout->invalidate();
9189 d->data.fstrut_dirty =
true;
9272 if (!
rect().contains(event->
pos())){
9311 #ifndef QT_NO_WHEELEVENT 9330 #endif // QT_NO_WHEELEVENT 9332 #ifndef QT_NO_TABLETEVENT 9351 #endif // QT_NO_TABLETEVENT 9591 #ifndef QT_NO_ACTION 9631 #ifndef QT_NO_CONTEXTMENU 9649 #endif // QT_NO_CONTEXTMENU 9727 priv = priv->q_func()->parentWidget()->d_func();
9740 if (
d->imHints == hints)
9744 if (
d->ic ||
qApp->d_func()->inputContext) {
9753 #ifndef QT_NO_DRAGANDDROP 9821 #endif // QT_NO_DRAGANDDROP 9888 #if defined(Q_WS_MAC) 9924 #if defined(Q_WS_WIN) 9949 #if defined(Q_WS_X11) 9975 #if defined(Q_WS_QWS) 10029 if (m ==
d->polished)
10038 for (
int i = 0; i < children.
size(); ++i) {
10042 if (
QWidget *w = qobject_cast<QWidget *>(o))
10046 if (
d->parent &&
d->sendChildEvents) {
10061 return d->extra ?
d->extra->mask :
QRegion();
10075 return d_func()->
layout;
10107 qWarning(
"QWidget::setLayout: Cannot set layout to 0");
10112 qWarning(
"QWidget::setLayout: Attempting to set QLayout \"%s\" on %s \"%s\", which already has a" 10119 if (oldParent && oldParent !=
this) {
10126 qWarning(
"QWidget::setLayout: Attempting to set QLayout \"%s\" on %s \"%s\", when the QLayout already has a parent",
10134 l->d_func()->topLevel =
true;
10136 if (oldParent !=
this) {
10138 l->d_func()->reparentChildWidgets(
this);
10143 d->topData()->sizeAdjusted =
false;
10195 return d->size_policy;
10202 if (policy ==
d->size_policy)
10204 d->size_policy = policy;
10206 #ifndef QT_NO_GRAPHICSVIEW 10208 if (extra->proxyWidget)
10209 extra->proxyWidget->setSizePolicy(policy);
10216 d->topData()->sizeAdjusted =
false;
10285 return d_func()->childAt_helper(p,
false);
10300 return childAtRecursiveHelper(p, ignoreChildrenInDestructor, includeFrame);
10303 if (!pointInsideRectAndMask(p))
10305 return childAtRecursiveHelper(p, ignoreChildrenInDestructor);
10326 if (includeFrame && qobject_cast<QToolBar *>(child))
10333 if (!child->d_func()->pointInsideRectAndMask(childPoint))
10337 if (
QWidget *w = child->d_func()->childAtRecursiveHelper(childPoint, ignoreChildrenInDestructor))
10350 widgetItem->invalidateSizeCache();
10352 if (forceUpdate || !extra || extra->minw != extra->maxw || extra->minh != extra->maxh) {
10353 if (!q->isWindow() && !q->isHidden() && (parent = q->
parentWidget())) {
10354 if (parent->d_func()->
layout)
10375 d->updateGeometry_helper(
false);
10419 d->adjustQuitOnCloseAttribute();
10498 d->inSetParent =
true;
10505 desktopWidget = parent;
10506 bool newParent = (parent !=
parentWidget()) || !wasCreated || desktopWidget;
10508 #if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_MAC) || defined(Q_OS_SYMBIAN) 10509 if (newParent && parent && !desktopWidget) {
10511 #if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA) 10515 #endif // Q_WS_MAC && QT_MAC_USE_COCOA 10517 parent->d_func()->enforceNativeChildren();
10539 d->setParent_sys(parent, f);
10543 if (oldBsTracker && oldBsTracker != bsTracker)
10544 oldBsTracker->unregisterWidgetSubtree(
this);
10549 #ifdef Q_BACKINGSTORE_SUBSURFACES 10552 if (newParent && windowSurface) {
10555 oldBs->subSurfaces.removeAll(windowSurface);
10560 newBs->subSurfaces.append(windowSurface);
10570 oldBs->moveStaticWidgets(
this);
10578 d->reparentFocusWidgets(oldtlw);
10583 d->resolvePalette();
10585 d->resolveLayoutDirection();
10586 d->resolveLocale();
10593 #
if defined(
Q_WS_WIN) || defined(QT_OPENGL_ES)
10600 d->setEnabled_helper(parent ? parent->
isEnabled() :
true);
10602 d->setUpdatesEnabled_helper(parent ? parent->
updatesEnabled() :
true);
10607 if (parent &&
d->sendChildEvents) {
10611 if (parent->d_func()->pendingChildInsertedEvents.isEmpty()) {
10613 new QEvent(QEvent::ChildInsertedRequest),
10616 parent->d_func()->pendingChildInsertedEvents.append(
this);
10629 if (parent &&
d->sendChildEvents &&
d->polished) {
10645 d->updateIsOpaque();
10647 #ifndef QT_NO_GRAPHICSVIEW 10652 ancestorProxy->d_func()->unembedSubWindow(
this);
10656 ancestorProxy->d_func()->embedSubWindow(
this);
10660 d->inSetParent =
false;
10688 if (dx == 0 && dy == 0)
10691 #ifndef QT_NO_GRAPHICSVIEW 10696 if (!
d->dirty.isEmpty()) {
10697 foreach (
const QRect &
rect, (
d->dirty.translated(dx, dy)).rects())
10698 proxy->update(rect);
10700 proxy->scroll(dx, dy, proxy->subWidgetRect(
this));
10704 d->setDirtyOpaqueRegion();
10705 d->scroll_sys(dx, dy);
10726 if (dx == 0 && dy == 0)
10729 #ifndef QT_NO_GRAPHICSVIEW 10734 if (!
d->dirty.isEmpty()) {
10735 foreach (
const QRect &
rect, (
d->dirty.translated(dx, dy) & r).rects())
10736 proxy->update(rect);
10738 proxy->scroll(dx, dy, r.
translated(proxy->subWidgetRect(
this).topLeft().toPoint()));
10742 d->scroll_sys(dx, dy, r);
10810 #ifdef QT_MAC_USE_COCOA 10815 #endif // QT_MAC_USE_COCOA 10823 d->repaint_sys(rect);
10848 #ifdef QT_MAC_USE_COCOA 10853 #endif // QT_MAC_USE_COCOA 10861 d->repaint_sys(rgn);
10922 #ifdef QT_MAC_USE_COCOA 10927 #endif // QT_MAC_USE_COCOA 10932 d_func()->repaint_sys(r);
10960 #ifdef QT_MAC_USE_COCOA 10965 #endif // QT_MAC_USE_COCOA 10970 d_func()->repaint_sys(r);
10981 void QWidget::erase_helper(
int x,
int y,
int w,
int h)
10989 if (w != 0 && h != 0) {
11007 void QWidget::erase(
const QRegion& rgn)
11017 void QWidget::drawText_helper(
int x,
int y,
const QString &str)
11034 bool accepted =
close();
11035 if (alsoDelete && accepted && that)
11040 void QWidget::setIcon(
const QPixmap &i)
11050 const QPixmap *QWidget::icon()
const 11053 return (
d->extra &&
d->extra->topextra) ?
d->extra->topextra->iconPixmap : 0;
11056 #endif // QT3_SUPPORT 11066 if (attribute <
int(8*
sizeof(
uint))) {
11072 const int x = attribute - 8*
sizeof(
uint);
11073 const int int_off = x / (8*
sizeof(
uint));
11094 "QWidget::setAttribute(WidgetAttribute, bool)",
11095 "QWidgetPrivate::high_attributes[] too small to contain all attributes in WidgetAttribute");
11101 if (
d->noPaintOnScreen)
11108 switch (attribute) {
11110 #ifndef QT_NO_DRAGANDDROP 11121 d->registerDropSite(on);
11122 for (
int i = 0; i <
d->children.size(); ++i) {
11132 d->sendChildEvents = !on;
11135 d->receiveChildEvents = !on;
11139 d->setStyle_helper(
style(),
false,
true);
11142 d->macUpdateOpaqueSizeGrip();
11156 d->macUpdateHideOnSuspend();
11167 for (
int i = 0; i < 3; ++i) {
11168 if (MacSizes[i] != attribute)
11171 d->macUpdateSizeAttribute();
11224 #if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA) 11228 #endif // Q_WS_MAC && QT_MAC_USE_COCOA 11241 d->updateIsOpaque();
11242 #if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_OS_SYMBIAN) 11248 d->enforceNativeChildren();
11253 d->updateIsOpaque();
11256 d->updateIsOpaque();
11259 d->updateSystemBackground();
11263 d->macUpdateIgnoreMouseEvents();
11269 QInputContext *ic = focusWidget->d_func()->assignedInputContext();
11285 d->resolvePalette();
11287 d->resolveLocale();
11293 d->extra->compress_events = on;
11296 d->updateIsOpaque();
11300 d->updateX11AcceptFocus();
11314 surface->permanentState(),
QRegion());
11337 d->setNetWmWindowTypes();
11344 bs->addStaticWidget(
this);
11346 bs->removeStaticWidget(
this);
11350 #if defined(Q_OS_SYMBIAN) 11355 d->updateIsTranslucent();
11360 #if defined(Q_WS_WIN) || defined(Q_WS_MAC) || defined(Q_OS_SYMBIAN) 11362 d->registerTouchWindow();
11376 for (
int i = 0; i < 3; ++i) {
11377 if (orientations[i] != attribute)
11382 #ifdef Q_OS_BLACKBERRY 11384 navigator_rotation_lock(
false);
11386 #ifdef Q_OS_BLACKBERRY_TABLET 11390 orientation_get(&direction, 0);
11394 switch (direction) {
11395 case ORIENTATION_TOP_UP:
11396 case ORIENTATION_RIGHT_UP:
11397 rotation = portraitLocked ? 90 : 0;
11399 case ORIENTATION_BOTTOM_UP:
11400 case ORIENTATION_LEFT_UP:
11401 rotation = portraitLocked ? 270 : 180;
11407 navigator_set_orientation(rotation, 0);
11410 NAVIGATOR_PORTRAIT : NAVIGATOR_LANDSCAPE), 0);
11411 #endif // Q_OS_BLACKBERRY_TABLET 11412 navigator_rotation_lock(
true);
11414 #endif // Q_OS_BLACKBERRY 11417 CAknAppUiBase* appUi =
static_cast<CAknAppUiBase*
>(CEikonEnv::Static()->EikAppUi());
11418 const CAknAppUiBase::TAppUiOrientation s60orientations[] = {
11419 CAknAppUiBase::EAppUiOrientationPortrait,
11420 CAknAppUiBase::EAppUiOrientationLandscape,
11421 CAknAppUiBase::EAppUiOrientationAutomatic
11423 CAknAppUiBase::TAppUiOrientation s60orientation = CAknAppUiBase::EAppUiOrientationUnspecified;
11424 for (
int i = 0; i < 3; ++i) {
11426 s60orientation = s60orientations[i];
11430 QT_TRAP_THROWING(appUi->SetOrientationL(s60orientation));
11431 S60->orientationSet =
true;
11434 window->ensureFixNativeOrientation();
11456 const int x = attribute - 8*
sizeof(
uint);
11457 const int int_off = x / (8*
sizeof(
uint));
11458 return (
d->high_attributes[int_off] & (1<<(x-(int_off*8*
sizeof(
uint)))));
11494 return (
isWindow() &&
d->maybeTopData()) ?
d->maybeTopData()->opacity /
qreal(255.) :
qreal(1.0);
11513 #ifndef QT_NO_GRAPHICSVIEW 11519 scene->update(proxy->sceneBoundingRect());
11524 d->setWindowOpacity_sys(opacity);
11566 qWarning(
"QWidget::setWindowModified: The window title does not contain a '[*]' placeholder");
11571 d->setWindowModified_sys(mod);
11578 #ifndef QT_NO_TOOLTIP 11614 #endif // QT_NO_TOOLTIP 11617 #ifndef QT_NO_STATUSTIP 11638 return d->statusTip;
11640 #endif // QT_NO_STATUSTIP 11642 #ifndef QT_NO_WHATSTHIS 11664 return d->whatsThis;
11666 #endif // QT_NO_WHATSTHIS 11668 #ifndef QT_NO_ACCESSIBILITY 11687 d->accessibleName =
name;
11694 return d->accessibleName;
11712 d->accessibleDescription = description;
11719 return d->accessibleDescription;
11721 #endif // QT_NO_ACCESSIBILITY 11723 #ifndef QT_NO_SHORTCUT 11753 return qApp->d_func()->shortcutMap.addShortcut(
this, key, context);
11775 qApp->d_func()->shortcutMap.removeShortcut(
id,
this, 0);
11794 qApp->d_func()->shortcutMap.setShortcutEnabled(enable,
id,
this, 0);
11812 qApp->d_func()->shortcutMap.setShortcutAutoRepeat(enable,
id,
this, 0);
11814 #endif // QT_NO_SHORTCUT 11822 #if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) 11825 if (
d->assignedInputContext() ||
qApp->d_func()->inputContext) {
11831 #ifndef QT_NO_ACCESSIBILITY 11840 #if defined (Q_WS_WIN) 11853 return (HDC)
d->hd;
11854 return GetDC(
winId());
11868 if (hdc !=
d->hd && !ReleaseDC(
winId(), hdc))
11869 qErrnoWarning(
"QWidget::releaseDC(): failed to release HDC");
11906 const int parentChildCount = p->d_func()->
children.
size();
11907 if (parentChildCount < 2)
11912 if (from != parentChildCount -1)
11913 p->d_func()->
children.
move(from, parentChildCount - 1);
11916 else if (from == parentChildCount - 1)
11920 d->subtractOpaqueSiblings(region);
11921 d->invalidateBuffer(region);
11944 const int parentChildCount = p->d_func()->
children.
size();
11945 if (parentChildCount < 2)
11954 else if (from == 0)
11990 else if (from == to)
11994 d->stackUnder_sys(w);
12612 return QRect(0, 0, 1, 1);
12621 const_cast<QWidgetPrivate *>(
this)->updateFrameStrut();
12623 return maybeTopData() ? maybeTopData()->frameStrut :
QRect();
12626 #ifdef QT_KEYPAD_NAVIGATION 12640 QWidget *targetWidget = widgetInNavigationDirection(direction);
12643 return (targetWidget != 0);
12664 const int sourceX =
12665 (direction == DirectionNorth || direction == DirectionSouth) ?
12666 (sourceRect.
left() + (sourceRect.
right() - sourceRect.
left()) / 2)
12667 :(direction == DirectionEast ? sourceRect.
right() : sourceRect.
left());
12668 const int sourceY =
12669 (direction == DirectionEast || direction == DirectionWest) ?
12670 (sourceRect.
top() + (sourceRect.
bottom() - sourceRect.
top()) / 2)
12671 :(direction == DirectionSouth ? sourceRect.
bottom() : sourceRect.
top());
12672 const QPoint sourcePoint(sourceX, sourceY);
12677 int shortestDistance =
INT_MAX;
12689 if ( targetCandidate != sourceWidget
12693 && !(direction == DirectionNorth && targetCandidateRect.
bottom() > sourceRect.
top())
12695 && !(direction == DirectionEast && targetCandidateRect.
left() < sourceRect.
right())
12697 && !(direction == DirectionSouth && targetCandidateRect.
top() < sourceRect.
bottom())
12699 && !(direction == DirectionWest && targetCandidateRect.
right() > sourceRect.
left())
12706 const int targetCandidateDistance = pointToRect(sourcePoint, targetCandidateRect);
12707 if (targetCandidateDistance < shortestDistance) {
12708 shortestDistance = targetCandidateDistance;
12709 targetWidget = targetCandidate;
12713 return targetWidget;
12756 if (qobject_cast<const QTabWidget*>(tabWidget))
12778 #ifndef Q_BACKINGSTORE_SUBSURFACES 12802 #ifdef Q_BACKINGSTORE_SUBSURFACES 12804 bs->subSurfaces.append(surface);
12806 bs->subSurfaces.removeOne(oldSurface);
12828 #ifdef Q_BACKINGSTORE_SUBSURFACES 12829 if (bs && bs->subSurfaces.isEmpty())
12835 QTLWExtra *extra = w->d_func()->maybeTopData();
12843 #endif // Q_BACKINGSTORE_SUBSURFACES 12851 *left = (int)leftLayoutItemMargin;
12853 *top = (int)topLayoutItemMargin;
12855 *right = (int)rightLayoutItemMargin;
12857 *bottom = (int)bottomLayoutItemMargin;
12862 if (leftLayoutItemMargin == left
12863 && topLayoutItemMargin == top
12864 && rightLayoutItemMargin == right
12865 && bottomLayoutItemMargin == bottom)
12869 leftLayoutItemMargin = (
signed char)left;
12870 topLayoutItemMargin = (
signed char)top;
12871 rightLayoutItemMargin = (
signed char)right;
12872 bottomLayoutItemMargin = (
signed char)bottom;
12873 q->updateGeometry();
12886 QRect liRect = q->style()->subElementRect(element, opt, q);
12888 leftLayoutItemMargin = (
signed char)(opt->
rect.
left() - liRect.
left());
12889 topLayoutItemMargin = (
signed char)(opt->
rect.
top() - liRect.
top());
12890 rightLayoutItemMargin = (
signed char)(liRect.
right() - opt->
rect.
right());
12891 bottomLayoutItemMargin = (
signed char)(liRect.
bottom() - opt->
rect.
bottom());
12893 leftLayoutItemMargin = 0;
12894 topLayoutItemMargin = 0;
12895 rightLayoutItemMargin = 0;
12896 bottomLayoutItemMargin = 0;
12904 if (!q->parentWidget()) {
12917 return widget->
data;
12922 return widget->d_func();
12926 #ifndef QT_NO_GRAPHICSVIEW 12943 return d->extra->proxyWidget;
12957 #ifndef QT_NO_GESTURES 12967 d->gestureContext.insert(gesture, flags);
12980 if (
d->gestureContext.remove(gesture)) {
12982 manager->cleanupCachedGestures(
this, gesture);
12985 #endif // QT_NO_GESTURES 13232 if (newMask ==
d->extra->mask)
13235 #ifndef QT_NO_BACKINGSTORE 13236 const QRegion oldMask(
d->extra->mask);
13239 d->extra->mask = newMask;
13240 d->extra->hasMask = !newMask.
isEmpty();
13242 #ifndef QT_MAC_USE_COCOA 13247 d->setMask_sys(newMask);
13249 #ifndef QT_NO_BACKINGSTORE 13253 if (!
d->extra->hasMask) {
13258 d->setDirtyOpaqueRegion();
13267 parentExpose -= newMask;
13268 if (!parentExpose.
isEmpty()) {
13269 d->setDirtyOpaqueRegion();
13276 update(newMask - oldMask);
13350 #ifdef Q_OS_SYMBIAN 13351 void QWidgetPrivate::_q_cleanupWinIds()
13353 foreach (
WId wid, widCleanupList)
13355 widCleanupList.clear();
13359 #if QT_MAC_USE_COCOA 13360 void QWidgetPrivate::syncUnifiedMode() {
13369 if(changeMethods) {
13371 if(originalDrawMethod)
13374 if(!originalDrawMethod)
13379 #endif // QT_MAC_USE_COCOA 13383 #include "moc_qwidget.cpp"
The QVariant class acts like a union for the most common Qt data types.
void setSystemViewport(const QRegion ®ion)
static void clearGuards(QObject *)
T qobject_cast(QObject *object)
void setTransform(const QTransform &transform, bool combine=false)
Sets the world transformation matrix.
The QPainter class performs low-level painting on widgets and other paint devices.
QPaintDevice * device() const
Returns the paint device on which this painter is currently painting, or 0 if the painter is not acti...
The QColor class provides colors based on RGB, HSV or CMYK values.
QRect toAlignedRect() const
Returns a QRect based on the values of this rectangle that is the smallest possible integer rectangle...
virtual void unpolish(QWidget *)
Uninitialize the given {widget}'s appearance.
static QWidget * main_widget
static Qt::LayoutDirection layoutDirection()
The QWSWindowSurface class provides the drawing area for top-level windows in Qt for Embedded Linux...
static void updateAccessibility(QObject *, int who, Event reason)
Notifies accessibility clients about a change in object's accessibility information.
static QWidgetList allWidgets()
Returns a list of all the widgets in the application.
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items...
bool hasFocus() const
Returns true if this item is active, and it or its focus proxy has keyboard input focus; otherwise...
int totalHeightForWidth(int w) const
Also takes contentsMargins and menu bar into account.
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
The QKeyEvent class describes a key event.
bool isNull() const
Returns true if the rectangle is a null rectangle, otherwise returns false.
void setHeight(int h)
Sets the height of the rectangle to the given height.
The QCursor class provides a mouse cursor with an arbitrary shape.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
qreal opacity() const
Returns the opacity of the painter.
#define QT_END_NAMESPACE
This macro expands to.
const QRegion clipRegion() const
Returns the region currently visible on the screen.
Q_CORE_EXPORT QTextStream & ws(QTextStream &s)
QPaintDevice * paintDevice() const
Returns the device that this engine is painting on, if painting is active; otherwise returns 0...
QPointer< QWidget > widget
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
ColorRole
The ColorRole enum defines the different symbolic color roles used in current GUIs.
char * data()
Returns a pointer to the data stored in the byte array.
CompositionMode
Defines the modes supported for digital image compositing.
void moveLeft(int pos)
Moves the rectangle horizontally, leaving the rectangle's left edge at the given x coordinate...
T * data() const
Returns the value of the pointer referenced by this object.
static QWSDisplay * qwsDisplay()
const QGradient * gradient() const
Returns the gradient describing this brush.
bool isNull() const
Returns true if the referenced object has been destroyed or if there is no referenced object; otherwi...
The QWheelEvent class contains parameters that describe a wheel event.
static void postEvent(QObject *receiver, QEvent *event)
Adds the event event, with the object receiver as the receiver of the event, to an event queue and re...
void setSystemTransform(const QTransform &xform)
CoordinateMode coordinateMode() const
Returns the coordinate mode of this gradient.
QString & replace(int i, int len, QChar after)
void clearFocus()
Takes keyboard input focus from the item.
bool remove(const T &value)
The QByteArray class provides an array of bytes.
static QWidget * activeWindow()
Returns the application top-level window that has the keyboard input focus, or 0 if no application wi...
#define Q_WS_WIN
Defined on Windows.
QList< QWidget * > widgets
The QPointF class defines a point in the plane using floating point precision.
void restore()
Restores the current painter state (pops a saved state off the stack).
QString fileName() const
Returns the name of the file, excluding the path.
static QStyle * create(const QString &)
void moveRight(int pos)
Moves the rectangle horizontally, leaving the rectangle's right edge at the given x coordinate...
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=0, const QWidget *widget=0, QStyleHintReturn *returnData=0) const =0
Returns an integer representing the specified style hint for the given widget described by the provid...
QSize expandedTo(const QSize &) const
Returns a size holding the maximum width and height of this size and the given otherSize.
int left() const
Returns the x-coordinate of the rectangle's left edge.
QRect translated(int dx, int dy) const
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis...
int width() const
Returns the width of the rectangle.
static bool testAttribute(uint flag)
The QDynamicPropertyChangeEvent class contains event parameters for dynamic property change events...
The QGraphicsEffectSource class represents the source on which a QGraphicsEffect is installed on...
bool activate()
Redoes the layout for parentWidget() if necessary.
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
void flush(QWidget *, const QRegion &, const QPoint &)
Flushes the given region from the specified widget onto the screen.
void qt_mac_update_mouseTracking(QWidget *widget)
int count(const T &t) const
Returns the number of occurrences of value in the list.
static QPalette palette()
Returns the application palette.
QRect boundingRect() const
Returns the bounding rectangle of this region.
static QStyle * style()
Returns the application's style object.
void moveTo(int x, int t)
Moves the rectangle, leaving the top-left corner at the given position (x, y).
The QActionEvent class provides an event that is generated when a QAction is added, removed, or changed.
void invalidate()
Reimplemented Function
int height() const
Returns the height of the rectangle.
QWidget * focusWidget() const
Returns the widget that has an input focus for this input context.
int bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
The QString class provides a Unicode character string.
void setHeight(int h)
Sets the height to the given height.
T * qobject_cast(QObject *object)
virtual QWindowSurface * createWindowSurface(QWidget *widget) const =0
virtual bool hasHeightForWidth() const
Returns true if this layout's preferred height depends on its width; otherwise returns false...
The QHash class is a template class that provides a hash-table-based dictionary.
The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress...
bool isCopyOf(const QFont &) const
Returns true if this font and f are copies of each other, i.e.
The QObject class is the base class of all Qt objects.
bool activateUnifiedToolbarAfterFullScreen
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
void moveBottom(int pos)
Moves the rectangle vertically, leaving the rectangle's bottom edge at the given y coordinate...
void setBrushOrigin(int x, int y)
Sets the brush's origin to point (x, y).
QSize boundedTo(const QSize &) const
Returns a size holding the minimum width and height of this size and the given otherSize.
virtual int devType() const
The QChar class provides a 16-bit Unicode character.
static QGestureManager * instance()
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
const T value(const Key &key) const
Returns the value associated with the key.
void save()
Saves the current painter state (pushes the state onto a stack).
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
static void processEvents(QEventLoop::ProcessEventsFlags flags=QEventLoop::AllEvents)
Processes all pending events for the calling thread according to the specified flags until there are ...
bool paintingActive() const
const QPoint & pos() const
Returns the position of the mouse cursor, relative to the widget that received the event...
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
void setParent(QObject *)
Makes the object a child of parent.
Qt::Orientations expandingDirections() const
Returns whether this layout can make use of more space than sizeHint().
bool qt_mac_can_clickThrough(const QWidget *)
void setVersion(int)
Sets the version number of the data serialization format to v.
void setObjectName(const QString &name)
static QFont font()
Returns the default application font.
int top() const
Returns the top margin.
The QWSEvent class encapsulates an event in Qt for Embedded Linux.
void setWidth(int w)
Sets the width to the given width.
static const QRectF boundingRect(const QPointF *points, int pointCount)
void move(int from, int to)
Moves the item at index position from to index position to.
Q_CORE_EXPORT void qDebug(const char *,...)
static void quit()
Tells the application to exit with return code 0 (success).
Qt::KeyboardModifiers modifiers() const
Returns the keyboard modifier flags that existed immediately after the event occurred.
void setCurrentColorGroup(ColorGroup cg)
Set the palette's current color group to cg.
QRect systemRect() const
Retrieves the rect for drawing within the backing store.
int key() const
Returns the code of the key that was pressed or released.
void invalidateCache(InvalidateReason reason=SourceChanged) const
QFont resolve(const QFont &) const
Returns a new QFont that has attributes copied from other that have not been previously set on this f...
The QBitmap class provides monochrome (1-bit depth) pixmaps.
int width() const
Returns the width.
static QIcon windowIcon()
static QWidget * activeModalWidget()
Returns the active modal widget.
QRegion clipRegion() const
Returns the currently set clip region.
void drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position...
void append(const T &t)
Inserts value at the end of the list.
void requestRegion(int winId, const QString &surfacekey, const QByteArray &surfaceData, const QRegion ®ion)
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QMoveEvent class contains event parameters for move events.
The QRectF class defines a rectangle in the plane using floating point precision. ...
bool isCopyOf(const QPalette &p) const
Returns true if this palette and p are copies of each other, i.e.
QPoint qt_mac_nativeMapFromParent(const QWidget *child, const QPoint &pt)
QPoint brushOrigin() const
Returns the currently set brush origin.
void qt_mac_replaceDrawRectOriginal(void *window, QWidgetPrivate *widget)
The QAccessibleEvent class is used to query addition accessibility information about complex widgets...
virtual void update()
This virtual function is called when a state in the focus widget has changed.
static void setFocusWidget(QWidget *focus, Qt::FocusReason reason)
bool hasClipping() const
Returns true if clipping has been set; otherwise returns false.
The QStyleOption class stores the parameters used by QStyle functions.
QTouchEvent::DeviceType deviceType() const
Returns the touch device Type, which is of type QTouchEvent::DeviceType {DeviceType}.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
QDummyWindowSurface(QWidget *window)
void initFrom(const QWidget *w)
The QLayout class is the base class of geometry managers.
bool isActive() const
Returns true if begin() has been called and end() has not yet been called; otherwise returns false...
QSize size() const
Returns the size of the rectangle.
const T & at(int i) const
Returns the item at index position i in the list.
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
The QHideEvent class provides an event which is sent after a widget is hidden.
static bool sendSpontaneousEvent(QObject *receiver, QEvent *event)
The QResizeEvent class contains event parameters for resize events.
CompositionMode compositionMode() const
Returns the current composition mode.
const char * styleHint(const QFontDef &request)
static QWidget * hidden_focus_widget
Q_CORE_EXPORT void qWarning(const char *,...)
void setSize(const QSize &s)
Sets the size of the rectangle to the given size.
const_iterator insert(const T &value)
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QPaintDevice * paintDevice()
Implement this function to return the appropriate paint device.
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
void setTopLeft(const QPoint &p)
Set the top-left corner of the rectangle to the given position.
const QTransform & deviceTransform() const
Returns the matrix that transforms from logical coordinates to device coordinates of the platform dep...
QPaintEngine * paintEngine() const
Returns the paint engine that the painter is currently operating on if the painter is active; otherwi...
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
QPointF screenPos() const
Returns the screen position of this touch point.
void setValue(const QString &aText)
Set the description or help text for the given child() to text, thereby answering the request...
static void sendPostedEvents()
The QDragLeaveEvent class provides an event that is sent to a widget when a drag and drop action leav...
The QRegion class specifies a clip region for a painter.
QTransform systemTransform
Qt::BrushStyle style() const
Returns the brush style.
static int app_compile_version
void setCoords(int x1, int y1, int x2, int y2)
Sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its botto...
QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
QPixmap texture() const
Returns the custom brush pattern, or a null pixmap if no custom brush pattern has been set...
bool isOpaque() const
Returns true if the brush is fully opaque otherwise false.
The QShowEvent class provides an event that is sent when a widget is shown.
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...
static void setActiveWindow(QWidget *act)
Sets the active window to the active widget in response to a system event.
bool isEmpty() const
Returns true if the key sequence is empty; otherwise returns false.
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT
Returns the local 8-bit representation of the string as a QByteArray.
bool inherits(const char *classname) const
Returns true if this object is an instance of a class that inherits className or a QObject subclass t...
static QWidgetList topLevelWidgets()
Returns a list of the top-level widgets (windows) in the application.
The QWindowSurface class provides the drawing area for top-level windows.
struct OpaqueEventRef * EventRef
bool isEqual(ColorGroup cr1, ColorGroup cr2) const
Returns true (usually quickly) if color group cg1 is equal to cg2; otherwise returns false...
The QTabletEvent class contains parameters that describe a Tablet event.
void moveTopLeft(const QPoint &p)
Moves the rectangle, leaving the top-left corner at the given position.
const QBrush & brush(ColorGroup cg, ColorRole cr) const
Returns the brush in the specified color group, used for the given color role.
const T & at(int i) const
Returns the item at index position i in the vector.
The QMouseEvent class contains parameters that describe a mouse event.
Q_CORE_EXPORT QTextStream & center(QTextStream &s)
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
int length() const
Same as size().
void qt_mac_replaceDrawRect(void *window, QWidgetPrivate *widget)
The QChildEvent class contains event parameters for child object events.
void drawTiledPixmap(const QRectF &rect, const QPixmap &pm, const QPointF &offset=QPointF())
Draws a tiled pixmap, inside the given rectangle with its origin at the given position.
T & first()
Returns a reference to the first item in the list.
void fill(const QColor &fillColor=Qt::white)
Fills the pixmap with the given color.
const char * constData() const
Returns a pointer to the data stored in the byte array.
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
void setRenderHints(RenderHints hints, bool on=true)
Sets the given render hints on the painter if on is true; otherwise clears the render hints...
The QBrush class defines the fill pattern of shapes drawn by QPainter.
bool isNull() const
Returns true if this string is null; otherwise returns false.
QPoint center() const
Returns the center point of the rectangle.
bool unifiedTitleAndToolBarOnMac
whether the window uses the unified title and toolbar look on Mac OS X
static void updateSoftKeys()
virtual QPaintEngine * paintEngine() const =0
static QWidget * focusNextPrevChild_helper(QWidget *toplevel, bool next)
internal Helper function that returns the new focus widget, but does not set the focus reason...
Q_CORE_EXPORT void qFatal(const char *,...)
#define Q_ASSERT_X(cond, where, what)
bool isWidgetType() const
Returns true if the object is a widget; otherwise returns false.
int top() const
Returns the y-coordinate of the rectangle's top edge.
The QDropEvent class provides an event which is sent when a drag and drop action is completed...
static QWidget * activePopupWidget()
Returns the active popup widget.
The QKeySequence class encapsulates a key sequence as used by shortcuts.
The QWindowStateChangeEvent class provides the window state before a window state change...
void setClipRegion(const QRegion &, Qt::ClipOperation op=Qt::ReplaceClip)
Sets the clip region to the given region using the specified clip operation.
int right() const
Returns the x-coordinate of the rectangle's right edge.
int indexOf(const T &t, int from=0) const
Returns the index position of the first occurrence of value in the list, searching forward from index...
const QTransform & worldTransform() const
Returns the world transformation matrix.
void setCompositionMode(CompositionMode mode)
Sets the composition mode to the given mode.
void setAlphaF(qreal alpha)
Sets the alpha of this color to alpha.
Type
This enum type defines the valid event types in Qt.
static bool isBlockedByModal(QWidget *widget)
Returns true if widget is blocked by a modal window.
The QFont class specifies a font used for drawing text.
int y() const
Returns the y-coordinate of the rectangle's top edge.
The QStatusTipEvent class provides an event that is used to show messages in a status bar...
QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
int lastIndexOf(QChar c, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QPointF pos() const
Returns the position of this touch point, relative to the widget or QGraphicsItem that received the e...
Q_INVOKABLE QObject(QObject *parent=0)
Constructs an object with parent object parent.
void eraseRect(const QRectF &)
Erases the area inside the given rectangle.
int x() const
Returns the x-coordinate of the rectangle's left edge.
int toInt(bool *ok=0, int base=10) const
Returns the byte array converted to an int using base base, which is 10 by default and must be betwee...
QObject * parent() const
Returns a pointer to the parent object.
void setRect(int x, int y, int w, int h)
Sets the coordinates of the rectangle's top-left corner to ({x}, {y}), and its size to the given widt...
The QDragEnterEvent class provides an event which is sent to a widget when a drag and drop action ent...
The QPoint class defines a point in the plane using integer precision.
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
Q_DECL_CONSTEXPR const T & qBound(const T &min, const T &val, const T &max)
const QList< QTouchEvent::TouchPoint > & touchPoints() const
Returns the list of touch points contained in the touch event.
The QMainWindow class provides a main application window.
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...
int qstrncmp(const char *str1, const char *str2, uint len)
static void(* destroyed)(QAbstractDeclarativeData *, QObject *)
QString objectName() const
int height() const
Returns the height.
void qt_mac_fill_background(QPainter *painter, const QRegion &rgn, const QBrush &brush)
if(void) toggleToolbarShown
The QRect class defines a rectangle in the plane using integer precision.
bool isValid() const
Returns true if both the width and height is equal to or greater than 0; otherwise returns false...
virtual void reset()=0
This function can be reimplemented in a subclass to reset the state of the input method.
void saveWidgetFont(QWidget *w, const QFont &font) const
const QObjectList & children() const
Returns a list of child objects.
static void mouseEvent(MouseAction action, QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1)
int size() const
Returns the number of bytes in this byte array.
int y() const
Returns the y coordinate of this point.
static bool is_app_closing
static void applyX11SpecificCommandLineArguments(QWidget *main_widget)
bool isPrimary() const
Returns true if this touch point is the primary touch point.
QVariant property(const char *name) const
Returns the value of the object's name property.
The QPixmap class is an off-screen image representation that can be used as a paint device...
The TouchPoint class provides information about a touch point in a QTouchEvent.
virtual void polish(QWidget *)
Initializes the appearance of the given widget.
QScopedPointer< QObjectData > d_ptr
static void emitLastWindowClosed()
bool isNull() const
Returns true if both the width and height is 0; otherwise returns false.
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device...
int left() const
Returns the left margin.
bool autoDestruct() const
static Q_DECL_CONSTEXPR bool qFuzzyIsNull(double d)
void translate(int dx, int dy)
Translates (moves) the region dx along the X axis and dy along the Y axis.
void ignore()
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
The QTouchEvent class contains parameters that describe a touch event.
The QSize class defines the size of a two-dimensional object using integer point precision.
struct OpaqueEventHandlerCallRef * EventHandlerCallRef
QRegion translated(int dx, int dy) const
Returns a copy of the region that is translated dx along the x axis and dy along the y axis...
The QDataStream class provides serialization of binary data to a QIODevice.
bool intersects(const QRect &r) const
Returns true if this rectangle intersects with the given rectangle (i.
RenderHints renderHints() const
Returns a flag that specifies the rendering hints that are set for this painter.
removePostedEvents
Removes all events of the given eventType that were posted using postEvent() for receiver.
int x() const
Returns the x coordinate of this point.
QTouchEventSequence touchEvent(QWidget *widget=0, QTouchEvent::DeviceType deviceType=QTouchEvent::TouchScreen)
Creates and returns a QTouchEventSequence for the device deviceType to simulate events for widget...
static QString applicationName()
The QInputContext class abstracts the input method dependent data and composing state.
static Window sourceWindow
static bool testAttribute(Qt::ApplicationAttribute attribute)
Returns true if attribute attribute is set; otherwise returns false.
The QMargins class defines the four margins of a rectangle.
void moveTop(int pos)
Moves the rectangle vertically, leaving the rectangle's top edge at the given y coordinate.
QString & remove(int i, int len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
QLayout * layout()
Reimplemented Function
static QGraphicsSystem * graphicsSystem()
bool isValid() const
Returns true if the rectangle is valid, otherwise returns false.
static void showText(const QPoint &pos, const QString &text, QWidget *w=0)
Shows text as a "What's This?" window, at global position pos.
char at(int i) const
Returns the character at index position i in the byte array.
The QFileInfo class provides system-independent file information.
void setUnifiedTitleAndToolBarOnMac(bool set)
The QPaintEvent class contains event parameters for paint events.
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...
virtual void setFocusWidget(QWidget *w)
Sets the widget that has an input focus for this input context.
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
QGraphicsEffectSource * source() const
Returns a pointer to the source, which provides extra context information that can be useful for the ...
static Type type()
Returns the type of application (Tty , GuiClient, or GuiServer).
int bottom() const
Returns the bottom margin.
static void leaveModal(QWidget *)
static QWidget * focusWidget()
Returns the application widget that has the keyboard input focus, or 0 if no widget in this applicati...
bool qt_mac_is_macdrawer(const QWidget *w)
QRegion systemClip() const
Returns the system clip.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
static QString fileName(const QString &fileUrl)
int size() const
Returns the number of items in the vector.
void repolish(QWidget *widget)
void deleteLater()
Schedules this object for deletion.
QList< T > findChildren(const QString &aName=QString()) const
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.
int right() const
Returns the right margin.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
QRect rect
the area that should be used for various calculations and painting
void updateStyleSheetFont(QWidget *w) const
The QCloseEvent class contains parameters that describe a close event.
QWidget * window() const
Returns a pointer to the top-level window associated with this surface.
The QFocusEvent class contains event parameters for widget focus events.
static QPaintDevice * redirected(const QPaintDevice *device, QPoint *offset=0)
Using QWidget::render() obsoletes the use of this function.
static void enterModal(QWidget *)
The QAction class provides an abstract user interface action that can be inserted into widgets...
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
virtual void draw(QPainter *painter)=0
This pure virtual function draws the effect and is called whenever the source needs to be drawn...
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
int child() const
Returns the (1-based) index of the child to which the request applies.
The QWeakPointer class holds a weak reference to a shared pointer.
The QGraphicsEffect class is the base class for all graphics effects.
SubElement
This enum represents a sub-area of a widget.
Qt::CursorShape shape() const
Returns the cursor shape identifier.
QPalette resolve(const QPalette &) const
Returns a new QPalette that has attributes copied from other.
void qErrnoWarning(const char *msg,...)
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
Qt::LayoutDirection direction
void translate(const QPointF &offset)
Translates the coordinate system by the given offset; i.e.
The QPalette class contains color groups for each widget state.
The QIcon class provides scalable icons in different modes and states.