| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/kernel/qwidget.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||||||||||||||
| 11 | - | |||||||||||||||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||||||||||||||
| 13 | - | |||||||||||||||||||||||||||||||||||||
| 14 | - | |||||||||||||||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||||||||||||||
| 17 | - | |||||||||||||||||||||||||||||||||||||
| 18 | - | |||||||||||||||||||||||||||||||||||||
| 19 | - | |||||||||||||||||||||||||||||||||||||
| 20 | - | |||||||||||||||||||||||||||||||||||||
| 21 | - | |||||||||||||||||||||||||||||||||||||
| 22 | static bool qt_enable_backingstore = true; | - | ||||||||||||||||||||||||||||||||||||
| 23 | static inline bool qRectIntersects(const QRect &r1, const QRect &r2) | - | ||||||||||||||||||||||||||||||||||||
| 24 | { | - | ||||||||||||||||||||||||||||||||||||
| 25 | return never executed: (qMax(r1.left(), r2.left()) <= qMin(r1.right(), r2.right()) &&return (qMax(r1.left(), r2.left()) <= qMin(r1.right(), r2.right()) && qMax(r1.top(), r2.top()) <= qMin(r1.bottom(), r2.bottom()));never executed: return (qMax(r1.left(), r2.left()) <= qMin(r1.right(), r2.right()) && qMax(r1.top(), r2.top()) <= qMin(r1.bottom(), r2.bottom())); | 0 | ||||||||||||||||||||||||||||||||||||
| 26 | qMax(r1.top(), r2.top()) <= qMin(r1.bottom(), r2.bottom())); never executed: return (qMax(r1.left(), r2.left()) <= qMin(r1.right(), r2.right()) && qMax(r1.top(), r2.top()) <= qMin(r1.bottom(), r2.bottom())); | 0 | ||||||||||||||||||||||||||||||||||||
| 27 | } | - | ||||||||||||||||||||||||||||||||||||
| 28 | - | |||||||||||||||||||||||||||||||||||||
| 29 | static inline bool hasBackingStoreSupport() | - | ||||||||||||||||||||||||||||||||||||
| 30 | { | - | ||||||||||||||||||||||||||||||||||||
| 31 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 32 | } | - | ||||||||||||||||||||||||||||||||||||
| 33 | - | |||||||||||||||||||||||||||||||||||||
| 34 | - | |||||||||||||||||||||||||||||||||||||
| 35 | - | |||||||||||||||||||||||||||||||||||||
| 36 | - | |||||||||||||||||||||||||||||||||||||
| 37 | - | |||||||||||||||||||||||||||||||||||||
| 38 | extern bool qt_sendSpontaneousEvent(QObject*, QEvent*); | - | ||||||||||||||||||||||||||||||||||||
| 39 | extern QDesktopWidget *qt_desktopWidget; | - | ||||||||||||||||||||||||||||||||||||
| 40 | QWidgetBackingStoreTracker::QWidgetBackingStoreTracker() | - | ||||||||||||||||||||||||||||||||||||
| 41 | : m_ptr(0) | - | ||||||||||||||||||||||||||||||||||||
| 42 | { | - | ||||||||||||||||||||||||||||||||||||
| 43 | - | |||||||||||||||||||||||||||||||||||||
| 44 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 45 | - | |||||||||||||||||||||||||||||||||||||
| 46 | QWidgetBackingStoreTracker::~QWidgetBackingStoreTracker() | - | ||||||||||||||||||||||||||||||||||||
| 47 | { | - | ||||||||||||||||||||||||||||||||||||
| 48 | delete m_ptr; | - | ||||||||||||||||||||||||||||||||||||
| 49 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 50 | - | |||||||||||||||||||||||||||||||||||||
| 51 | - | |||||||||||||||||||||||||||||||||||||
| 52 | - | |||||||||||||||||||||||||||||||||||||
| 53 | - | |||||||||||||||||||||||||||||||||||||
| 54 | - | |||||||||||||||||||||||||||||||||||||
| 55 | - | |||||||||||||||||||||||||||||||||||||
| 56 | - | |||||||||||||||||||||||||||||||||||||
| 57 | void QWidgetBackingStoreTracker::create(QWidget *widget) | - | ||||||||||||||||||||||||||||||||||||
| 58 | { | - | ||||||||||||||||||||||||||||||||||||
| 59 | destroy(); | - | ||||||||||||||||||||||||||||||||||||
| 60 | m_ptr = new QWidgetBackingStore(widget); | - | ||||||||||||||||||||||||||||||||||||
| 61 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 62 | - | |||||||||||||||||||||||||||||||||||||
| 63 | - | |||||||||||||||||||||||||||||||||||||
| 64 | - | |||||||||||||||||||||||||||||||||||||
| 65 | - | |||||||||||||||||||||||||||||||||||||
| 66 | - | |||||||||||||||||||||||||||||||||||||
| 67 | - | |||||||||||||||||||||||||||||||||||||
| 68 | void QWidgetBackingStoreTracker::destroy() | - | ||||||||||||||||||||||||||||||||||||
| 69 | { | - | ||||||||||||||||||||||||||||||||||||
| 70 | delete m_ptr; | - | ||||||||||||||||||||||||||||||||||||
| 71 | m_ptr = 0; | - | ||||||||||||||||||||||||||||||||||||
| 72 | m_widgets.clear(); | - | ||||||||||||||||||||||||||||||||||||
| 73 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 74 | - | |||||||||||||||||||||||||||||||||||||
| 75 | - | |||||||||||||||||||||||||||||||||||||
| 76 | - | |||||||||||||||||||||||||||||||||||||
| 77 | - | |||||||||||||||||||||||||||||||||||||
| 78 | - | |||||||||||||||||||||||||||||||||||||
| 79 | - | |||||||||||||||||||||||||||||||||||||
| 80 | void QWidgetBackingStoreTracker::registerWidget(QWidget *w) | - | ||||||||||||||||||||||||||||||||||||
| 81 | { | - | ||||||||||||||||||||||||||||||||||||
| 82 | ((!(m_ptr)) ? qt_assert("m_ptr",__FILE__,203) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 83 | ((!(w->internalWinId())) ? qt_assert("w->internalWinId()",__FILE__,204) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 84 | ((!(qt_widget_private(w)->maybeBackingStore() == m_ptr)) ? qt_assert("qt_widget_private(w)->maybeBackingStore() == m_ptr",__FILE__,205) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 85 | m_widgets.insert(w); | - | ||||||||||||||||||||||||||||||||||||
| 86 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 87 | void QWidgetBackingStoreTracker::unregisterWidget(QWidget *w) | - | ||||||||||||||||||||||||||||||||||||
| 88 | { | - | ||||||||||||||||||||||||||||||||||||
| 89 | if (m_widgets.remove(w)
| 0 | ||||||||||||||||||||||||||||||||||||
| 90 | delete m_ptr; | - | ||||||||||||||||||||||||||||||||||||
| 91 | m_ptr = 0; | - | ||||||||||||||||||||||||||||||||||||
| 92 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 93 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 94 | - | |||||||||||||||||||||||||||||||||||||
| 95 | - | |||||||||||||||||||||||||||||||||||||
| 96 | - | |||||||||||||||||||||||||||||||||||||
| 97 | - | |||||||||||||||||||||||||||||||||||||
| 98 | - | |||||||||||||||||||||||||||||||||||||
| 99 | void QWidgetBackingStoreTracker::unregisterWidgetSubtree(QWidget *widget) | - | ||||||||||||||||||||||||||||||||||||
| 100 | { | - | ||||||||||||||||||||||||||||||||||||
| 101 | unregisterWidget(widget); | - | ||||||||||||||||||||||||||||||||||||
| 102 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(widget->children())>::type> _container_((widget->children())); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QObject *child = *_container_.i; _container_.control; _container_.control = 0) | - | ||||||||||||||||||||||||||||||||||||
| 103 | if (QWidget *childWidget = qobject_cast<QWidget *>(child)
| 0 | ||||||||||||||||||||||||||||||||||||
| 104 | unregisterWidgetSubtree(childWidget); never executed: unregisterWidgetSubtree(childWidget); | 0 | ||||||||||||||||||||||||||||||||||||
| 105 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 106 | - | |||||||||||||||||||||||||||||||||||||
| 107 | QWidgetPrivate::QWidgetPrivate(int version) | - | ||||||||||||||||||||||||||||||||||||
| 108 | : QObjectPrivate(version) | - | ||||||||||||||||||||||||||||||||||||
| 109 | , extra(0) | - | ||||||||||||||||||||||||||||||||||||
| 110 | , focus_next(0) | - | ||||||||||||||||||||||||||||||||||||
| 111 | , focus_prev(0) | - | ||||||||||||||||||||||||||||||||||||
| 112 | , focus_child(0) | - | ||||||||||||||||||||||||||||||||||||
| 113 | , layout(0) | - | ||||||||||||||||||||||||||||||||||||
| 114 | , needsFlush(0) | - | ||||||||||||||||||||||||||||||||||||
| 115 | , redirectDev(0) | - | ||||||||||||||||||||||||||||||||||||
| 116 | , widgetItem(0) | - | ||||||||||||||||||||||||||||||||||||
| 117 | , extraPaintEngine(0) | - | ||||||||||||||||||||||||||||||||||||
| 118 | , polished(0) | - | ||||||||||||||||||||||||||||||||||||
| 119 | , graphicsEffect(0) | - | ||||||||||||||||||||||||||||||||||||
| 120 | - | |||||||||||||||||||||||||||||||||||||
| 121 | , imHints(Qt::ImhNone) | - | ||||||||||||||||||||||||||||||||||||
| 122 | - | |||||||||||||||||||||||||||||||||||||
| 123 | - | |||||||||||||||||||||||||||||||||||||
| 124 | , toolTipDuration(-1) | - | ||||||||||||||||||||||||||||||||||||
| 125 | - | |||||||||||||||||||||||||||||||||||||
| 126 | , inheritedFontResolveMask(0) | - | ||||||||||||||||||||||||||||||||||||
| 127 | , inheritedPaletteResolveMask(0) | - | ||||||||||||||||||||||||||||||||||||
| 128 | , leftmargin(0) | - | ||||||||||||||||||||||||||||||||||||
| 129 | , topmargin(0) | - | ||||||||||||||||||||||||||||||||||||
| 130 | , rightmargin(0) | - | ||||||||||||||||||||||||||||||||||||
| 131 | , bottommargin(0) | - | ||||||||||||||||||||||||||||||||||||
| 132 | , leftLayoutItemMargin(0) | - | ||||||||||||||||||||||||||||||||||||
| 133 | , topLayoutItemMargin(0) | - | ||||||||||||||||||||||||||||||||||||
| 134 | , rightLayoutItemMargin(0) | - | ||||||||||||||||||||||||||||||||||||
| 135 | , bottomLayoutItemMargin(0) | - | ||||||||||||||||||||||||||||||||||||
| 136 | , hd(0) | - | ||||||||||||||||||||||||||||||||||||
| 137 | , size_policy(QSizePolicy::Preferred, QSizePolicy::Preferred) | - | ||||||||||||||||||||||||||||||||||||
| 138 | , fg_role(QPalette::NoRole) | - | ||||||||||||||||||||||||||||||||||||
| 139 | , bg_role(QPalette::NoRole) | - | ||||||||||||||||||||||||||||||||||||
| 140 | , dirtyOpaqueChildren(1) | - | ||||||||||||||||||||||||||||||||||||
| 141 | , isOpaque(0) | - | ||||||||||||||||||||||||||||||||||||
| 142 | , retainSizeWhenHiddenChanged(0) | - | ||||||||||||||||||||||||||||||||||||
| 143 | , inDirtyList(0) | - | ||||||||||||||||||||||||||||||||||||
| 144 | , isScrolled(0) | - | ||||||||||||||||||||||||||||||||||||
| 145 | , isMoved(0) | - | ||||||||||||||||||||||||||||||||||||
| 146 | , usesDoubleBufferedGLContext(0) | - | ||||||||||||||||||||||||||||||||||||
| 147 | , mustHaveWindowHandle(0) | - | ||||||||||||||||||||||||||||||||||||
| 148 | , renderToTexture(0) | - | ||||||||||||||||||||||||||||||||||||
| 149 | , textureChildSeen(0) | - | ||||||||||||||||||||||||||||||||||||
| 150 | - | |||||||||||||||||||||||||||||||||||||
| 151 | , inheritsInputMethodHints(0) | - | ||||||||||||||||||||||||||||||||||||
| 152 | - | |||||||||||||||||||||||||||||||||||||
| 153 | - | |||||||||||||||||||||||||||||||||||||
| 154 | , renderToTextureReallyDirty(1) | - | ||||||||||||||||||||||||||||||||||||
| 155 | , renderToTextureComposeActive(0) | - | ||||||||||||||||||||||||||||||||||||
| 156 | - | |||||||||||||||||||||||||||||||||||||
| 157 | , childrenHiddenByWState(0) | - | ||||||||||||||||||||||||||||||||||||
| 158 | , childrenShownByExpose(0) | - | ||||||||||||||||||||||||||||||||||||
| 159 | { | - | ||||||||||||||||||||||||||||||||||||
| 160 | if (__builtin_expect(!!(!(static_cast<QApplication *>(QCoreApplication::instance()))), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 161 | QMessageLogger(__FILE__, 304, __PRETTY_FUNCTION__).fatal("QWidget: Must construct a QApplication before a QWidget"); | - | ||||||||||||||||||||||||||||||||||||
| 162 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 163 | } | - | ||||||||||||||||||||||||||||||||||||
| 164 | - | |||||||||||||||||||||||||||||||||||||
| 165 | - | |||||||||||||||||||||||||||||||||||||
| 166 | - | |||||||||||||||||||||||||||||||||||||
| 167 | - | |||||||||||||||||||||||||||||||||||||
| 168 | (void)version;; | - | ||||||||||||||||||||||||||||||||||||
| 169 | - | |||||||||||||||||||||||||||||||||||||
| 170 | - | |||||||||||||||||||||||||||||||||||||
| 171 | - | |||||||||||||||||||||||||||||||||||||
| 172 | - | |||||||||||||||||||||||||||||||||||||
| 173 | - | |||||||||||||||||||||||||||||||||||||
| 174 | - | |||||||||||||||||||||||||||||||||||||
| 175 | isWidget = true; | - | ||||||||||||||||||||||||||||||||||||
| 176 | memset(high_attributes, 0, sizeof(high_attributes)); | - | ||||||||||||||||||||||||||||||||||||
| 177 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 178 | - | |||||||||||||||||||||||||||||||||||||
| 179 | - | |||||||||||||||||||||||||||||||||||||
| 180 | QWidgetPrivate::~QWidgetPrivate() | - | ||||||||||||||||||||||||||||||||||||
| 181 | { | - | ||||||||||||||||||||||||||||||||||||
| 182 | if (widgetItem
| 0 | ||||||||||||||||||||||||||||||||||||
| 183 | widgetItem->wid = 0; never executed: widgetItem->wid = 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 184 | - | |||||||||||||||||||||||||||||||||||||
| 185 | if (extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 186 | deleteExtra(); never executed: deleteExtra(); | 0 | ||||||||||||||||||||||||||||||||||||
| 187 | - | |||||||||||||||||||||||||||||||||||||
| 188 | - | |||||||||||||||||||||||||||||||||||||
| 189 | delete graphicsEffect; | - | ||||||||||||||||||||||||||||||||||||
| 190 | - | |||||||||||||||||||||||||||||||||||||
| 191 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 192 | - | |||||||||||||||||||||||||||||||||||||
| 193 | - | |||||||||||||||||||||||||||||||||||||
| 194 | - | |||||||||||||||||||||||||||||||||||||
| 195 | - | |||||||||||||||||||||||||||||||||||||
| 196 | void QWidgetPrivate::scrollChildren(int dx, int dy) | - | ||||||||||||||||||||||||||||||||||||
| 197 | { | - | ||||||||||||||||||||||||||||||||||||
| 198 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 199 | if (q->children().size() > 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 200 | QPoint pd(dx, dy); | - | ||||||||||||||||||||||||||||||||||||
| 201 | QObjectList childObjects = q->children(); | - | ||||||||||||||||||||||||||||||||||||
| 202 | for (int i = 0; i < childObjects.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 203 | QWidget *w = qobject_cast<QWidget*>(childObjects.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 204 | if (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 205 | QPoint oldp = w->pos(); | - | ||||||||||||||||||||||||||||||||||||
| 206 | QRect r(w->pos() + pd, w->size()); | - | ||||||||||||||||||||||||||||||||||||
| 207 | w->data->crect = r; | - | ||||||||||||||||||||||||||||||||||||
| 208 | if (w->testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 209 | w->d_func()->setWSGeometry(); never executed: w->d_func()->setWSGeometry(); | 0 | ||||||||||||||||||||||||||||||||||||
| 210 | w->d_func()->setDirtyOpaqueRegion(); | - | ||||||||||||||||||||||||||||||||||||
| 211 | QMoveEvent e(r.topLeft(), oldp); | - | ||||||||||||||||||||||||||||||||||||
| 212 | QApplication::sendEvent(w, &e); | - | ||||||||||||||||||||||||||||||||||||
| 213 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 214 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 215 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 216 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 217 | - | |||||||||||||||||||||||||||||||||||||
| 218 | void QWidgetPrivate::setWSGeometry() | - | ||||||||||||||||||||||||||||||||||||
| 219 | { | - | ||||||||||||||||||||||||||||||||||||
| 220 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 221 | if (QWindow *window = q->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 222 | window->setGeometry(data.crect); never executed: window->setGeometry(data.crect); | 0 | ||||||||||||||||||||||||||||||||||||
| 223 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 224 | - | |||||||||||||||||||||||||||||||||||||
| 225 | void QWidgetPrivate::updateWidgetTransform(QEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 226 | { | - | ||||||||||||||||||||||||||||||||||||
| 227 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 228 | if (q == QGuiApplication::focusObject()
| 0 | ||||||||||||||||||||||||||||||||||||
| 229 | QTransform t; | - | ||||||||||||||||||||||||||||||||||||
| 230 | QPoint p = q->mapTo(q->topLevelWidget(), QPoint(0,0)); | - | ||||||||||||||||||||||||||||||||||||
| 231 | t.translate(p.x(), p.y()); | - | ||||||||||||||||||||||||||||||||||||
| 232 | QGuiApplication::inputMethod()->setInputItemTransform(t); | - | ||||||||||||||||||||||||||||||||||||
| 233 | QGuiApplication::inputMethod()->setInputItemRectangle(q->rect()); | - | ||||||||||||||||||||||||||||||||||||
| 234 | QGuiApplication::inputMethod()->update(Qt::ImInputItemClipRectangle); | - | ||||||||||||||||||||||||||||||||||||
| 235 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 236 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 237 | bool QWidget::autoFillBackground() const | - | ||||||||||||||||||||||||||||||||||||
| 238 | { | - | ||||||||||||||||||||||||||||||||||||
| 239 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 240 | return never executed: d->extra && d->extra->autoFillBackground;return d->extra && d->extra->autoFillBackground;never executed: return d->extra && d->extra->autoFillBackground; | 0 | ||||||||||||||||||||||||||||||||||||
| 241 | } | - | ||||||||||||||||||||||||||||||||||||
| 242 | - | |||||||||||||||||||||||||||||||||||||
| 243 | void QWidget::setAutoFillBackground(bool enabled) | - | ||||||||||||||||||||||||||||||||||||
| 244 | { | - | ||||||||||||||||||||||||||||||||||||
| 245 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 246 | if (!d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 247 | d->createExtra(); never executed: d->createExtra(); | 0 | ||||||||||||||||||||||||||||||||||||
| 248 | if (d->extra->autoFillBackground == enabled
| 0 | ||||||||||||||||||||||||||||||||||||
| 249 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 250 | - | |||||||||||||||||||||||||||||||||||||
| 251 | d->extra->autoFillBackground = enabled; | - | ||||||||||||||||||||||||||||||||||||
| 252 | d->updateIsOpaque(); | - | ||||||||||||||||||||||||||||||||||||
| 253 | update(); | - | ||||||||||||||||||||||||||||||||||||
| 254 | d->updateIsOpaque(); | - | ||||||||||||||||||||||||||||||||||||
| 255 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 256 | QWidgetMapper *QWidgetPrivate::mapper = 0; | - | ||||||||||||||||||||||||||||||||||||
| 257 | QWidgetSet *QWidgetPrivate::allWidgets = 0; | - | ||||||||||||||||||||||||||||||||||||
| 258 | - | |||||||||||||||||||||||||||||||||||||
| 259 | - | |||||||||||||||||||||||||||||||||||||
| 260 | - | |||||||||||||||||||||||||||||||||||||
| 261 | - | |||||||||||||||||||||||||||||||||||||
| 262 | - | |||||||||||||||||||||||||||||||||||||
| 263 | - | |||||||||||||||||||||||||||||||||||||
| 264 | QRegion qt_dirtyRegion(QWidget *widget) | - | ||||||||||||||||||||||||||||||||||||
| 265 | { | - | ||||||||||||||||||||||||||||||||||||
| 266 | if (!widget
| 0 | ||||||||||||||||||||||||||||||||||||
| 267 | return never executed: QRegion();return QRegion();never executed: return QRegion(); | 0 | ||||||||||||||||||||||||||||||||||||
| 268 | - | |||||||||||||||||||||||||||||||||||||
| 269 | QWidgetBackingStore *bs = qt_widget_private(widget)->maybeBackingStore(); | - | ||||||||||||||||||||||||||||||||||||
| 270 | if (!bs
| 0 | ||||||||||||||||||||||||||||||||||||
| 271 | return never executed: QRegion();return QRegion();never executed: return QRegion(); | 0 | ||||||||||||||||||||||||||||||||||||
| 272 | - | |||||||||||||||||||||||||||||||||||||
| 273 | return never executed: bs->dirtyRegion(widget);return bs->dirtyRegion(widget);never executed: return bs->dirtyRegion(widget); | 0 | ||||||||||||||||||||||||||||||||||||
| 274 | } | - | ||||||||||||||||||||||||||||||||||||
| 275 | struct QWidgetExceptionCleaner | - | ||||||||||||||||||||||||||||||||||||
| 276 | { | - | ||||||||||||||||||||||||||||||||||||
| 277 | - | |||||||||||||||||||||||||||||||||||||
| 278 | static inline void cleanup(QWidget *that, QWidgetPrivate *d) | - | ||||||||||||||||||||||||||||||||||||
| 279 | { | - | ||||||||||||||||||||||||||||||||||||
| 280 | - | |||||||||||||||||||||||||||||||||||||
| 281 | (void)that;; | - | ||||||||||||||||||||||||||||||||||||
| 282 | (void)d;; | - | ||||||||||||||||||||||||||||||||||||
| 283 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 284 | }; | - | ||||||||||||||||||||||||||||||||||||
| 285 | QWidget::QWidget(QWidget *parent, Qt::WindowFlags f) | - | ||||||||||||||||||||||||||||||||||||
| 286 | : QObject(*new QWidgetPrivate, 0), QPaintDevice() | - | ||||||||||||||||||||||||||||||||||||
| 287 | { | - | ||||||||||||||||||||||||||||||||||||
| 288 | if (true) { | - | ||||||||||||||||||||||||||||||||||||
| 289 | d_func()->init(parent, f); | - | ||||||||||||||||||||||||||||||||||||
| 290 | } never executed: else {end of blockdead code: { QWidgetExceptionCleaner::cleanup(this, d_func()); qt_noop(); } | - | ||||||||||||||||||||||||||||||||||||
| 291 | QWidgetExceptionCleaner::cleanup(this, d_func()); dead code: { QWidgetExceptionCleaner::cleanup(this, d_func()); qt_noop(); } | - | ||||||||||||||||||||||||||||||||||||
| 292 | qt_noop(); dead code: { QWidgetExceptionCleaner::cleanup(this, d_func()); qt_noop(); } | - | ||||||||||||||||||||||||||||||||||||
| 293 | } dead code: { QWidgetExceptionCleaner::cleanup(this, d_func()); qt_noop(); } | - | ||||||||||||||||||||||||||||||||||||
| 294 | } | - | ||||||||||||||||||||||||||||||||||||
| 295 | - | |||||||||||||||||||||||||||||||||||||
| 296 | - | |||||||||||||||||||||||||||||||||||||
| 297 | - | |||||||||||||||||||||||||||||||||||||
| 298 | - | |||||||||||||||||||||||||||||||||||||
| 299 | QWidget::QWidget(QWidgetPrivate &dd, QWidget* parent, Qt::WindowFlags f) | - | ||||||||||||||||||||||||||||||||||||
| 300 | : QObject(dd, 0), QPaintDevice() | - | ||||||||||||||||||||||||||||||||||||
| 301 | { | - | ||||||||||||||||||||||||||||||||||||
| 302 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 303 | if (true) { | - | ||||||||||||||||||||||||||||||||||||
| 304 | d->init(parent, f); | - | ||||||||||||||||||||||||||||||||||||
| 305 | } never executed: else {end of blockdead code: { QWidgetExceptionCleaner::cleanup(this, d_func()); qt_noop(); } | - | ||||||||||||||||||||||||||||||||||||
| 306 | QWidgetExceptionCleaner::cleanup(this, d_func()); dead code: { QWidgetExceptionCleaner::cleanup(this, d_func()); qt_noop(); } | - | ||||||||||||||||||||||||||||||||||||
| 307 | qt_noop(); dead code: { QWidgetExceptionCleaner::cleanup(this, d_func()); qt_noop(); } | - | ||||||||||||||||||||||||||||||||||||
| 308 | } dead code: { QWidgetExceptionCleaner::cleanup(this, d_func()); qt_noop(); } | - | ||||||||||||||||||||||||||||||||||||
| 309 | } | - | ||||||||||||||||||||||||||||||||||||
| 310 | - | |||||||||||||||||||||||||||||||||||||
| 311 | - | |||||||||||||||||||||||||||||||||||||
| 312 | - | |||||||||||||||||||||||||||||||||||||
| 313 | - | |||||||||||||||||||||||||||||||||||||
| 314 | int QWidget::devType() const | - | ||||||||||||||||||||||||||||||||||||
| 315 | { | - | ||||||||||||||||||||||||||||||||||||
| 316 | return never executed: QInternal::Widget;return QInternal::Widget;never executed: return QInternal::Widget; | 0 | ||||||||||||||||||||||||||||||||||||
| 317 | } | - | ||||||||||||||||||||||||||||||||||||
| 318 | - | |||||||||||||||||||||||||||||||||||||
| 319 | - | |||||||||||||||||||||||||||||||||||||
| 320 | - | |||||||||||||||||||||||||||||||||||||
| 321 | void QWidgetPrivate::adjustFlags(Qt::WindowFlags &flags, QWidget *w) | - | ||||||||||||||||||||||||||||||||||||
| 322 | { | - | ||||||||||||||||||||||||||||||||||||
| 323 | bool customize = (flags & (Qt::CustomizeWindowHint | - | ||||||||||||||||||||||||||||||||||||
| 324 | | Qt::FramelessWindowHint | - | ||||||||||||||||||||||||||||||||||||
| 325 | | Qt::WindowTitleHint | - | ||||||||||||||||||||||||||||||||||||
| 326 | | Qt::WindowSystemMenuHint | - | ||||||||||||||||||||||||||||||||||||
| 327 | | Qt::WindowMinimizeButtonHint | - | ||||||||||||||||||||||||||||||||||||
| 328 | | Qt::WindowMaximizeButtonHint | - | ||||||||||||||||||||||||||||||||||||
| 329 | | Qt::WindowCloseButtonHint | - | ||||||||||||||||||||||||||||||||||||
| 330 | | Qt::WindowContextHelpButtonHint)); | - | ||||||||||||||||||||||||||||||||||||
| 331 | - | |||||||||||||||||||||||||||||||||||||
| 332 | uint type = (flags & Qt::WindowType_Mask); | - | ||||||||||||||||||||||||||||||||||||
| 333 | - | |||||||||||||||||||||||||||||||||||||
| 334 | if ((type == Qt::Widget
| 0 | ||||||||||||||||||||||||||||||||||||
| 335 | type = Qt::Window; | - | ||||||||||||||||||||||||||||||||||||
| 336 | flags |= Qt::Window; | - | ||||||||||||||||||||||||||||||||||||
| 337 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 338 | - | |||||||||||||||||||||||||||||||||||||
| 339 | if (flags & Qt::CustomizeWindowHint
| 0 | ||||||||||||||||||||||||||||||||||||
| 340 | - | |||||||||||||||||||||||||||||||||||||
| 341 | - | |||||||||||||||||||||||||||||||||||||
| 342 | - | |||||||||||||||||||||||||||||||||||||
| 343 | - | |||||||||||||||||||||||||||||||||||||
| 344 | - | |||||||||||||||||||||||||||||||||||||
| 345 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 346 | - | |||||||||||||||||||||||||||||||||||||
| 347 | - | |||||||||||||||||||||||||||||||||||||
| 348 | - | |||||||||||||||||||||||||||||||||||||
| 349 | ) { | - | ||||||||||||||||||||||||||||||||||||
| 350 | flags |= Qt::WindowSystemMenuHint; | - | ||||||||||||||||||||||||||||||||||||
| 351 | - | |||||||||||||||||||||||||||||||||||||
| 352 | - | |||||||||||||||||||||||||||||||||||||
| 353 | - | |||||||||||||||||||||||||||||||||||||
| 354 | - | |||||||||||||||||||||||||||||||||||||
| 355 | flags |= Qt::WindowTitleHint; | - | ||||||||||||||||||||||||||||||||||||
| 356 | flags &= ~Qt::FramelessWindowHint; | - | ||||||||||||||||||||||||||||||||||||
| 357 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 358 | } never executed: else if (customizeend of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 359 | - | |||||||||||||||||||||||||||||||||||||
| 360 | - | |||||||||||||||||||||||||||||||||||||
| 361 | - | |||||||||||||||||||||||||||||||||||||
| 362 | flags |= Qt::WindowSystemMenuHint; | - | ||||||||||||||||||||||||||||||||||||
| 363 | flags |= Qt::WindowTitleHint; | - | ||||||||||||||||||||||||||||||||||||
| 364 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 365 | if (customize
| 0 | ||||||||||||||||||||||||||||||||||||
| 366 | ; never executed: ; | 0 | ||||||||||||||||||||||||||||||||||||
| 367 | else if (type == Qt::Dialog
| 0 | ||||||||||||||||||||||||||||||||||||
| 368 | - | |||||||||||||||||||||||||||||||||||||
| 369 | flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowContextHelpButtonHint | Qt::WindowCloseButtonHint; never executed: flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowContextHelpButtonHint | Qt::WindowCloseButtonHint; | 0 | ||||||||||||||||||||||||||||||||||||
| 370 | - | |||||||||||||||||||||||||||||||||||||
| 371 | - | |||||||||||||||||||||||||||||||||||||
| 372 | - | |||||||||||||||||||||||||||||||||||||
| 373 | else if (type == Qt::Tool
| 0 | ||||||||||||||||||||||||||||||||||||
| 374 | flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint; never executed: flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint; | 0 | ||||||||||||||||||||||||||||||||||||
| 375 | else | - | ||||||||||||||||||||||||||||||||||||
| 376 | flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | never executed: flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint | Qt::WindowFullscreenButtonHint; | 0 | ||||||||||||||||||||||||||||||||||||
| 377 | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint | Qt::WindowFullscreenButtonHint; never executed: flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint | Qt::WindowFullscreenButtonHint; | 0 | ||||||||||||||||||||||||||||||||||||
| 378 | if (w->testAttribute(Qt::WA_TransparentForMouseEvents)
| 0 | ||||||||||||||||||||||||||||||||||||
| 379 | flags |= Qt::WindowTransparentForInput; never executed: flags |= Qt::WindowTransparentForInput; | 0 | ||||||||||||||||||||||||||||||||||||
| 380 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 381 | - | |||||||||||||||||||||||||||||||||||||
| 382 | void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f) | - | ||||||||||||||||||||||||||||||||||||
| 383 | { | - | ||||||||||||||||||||||||||||||||||||
| 384 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 385 | if (__builtin_expect(!!(!qobject_cast<QApplication *>(QCoreApplication::instance())), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 386 | QMessageLogger(__FILE__, 1136, __PRETTY_FUNCTION__).fatal("QWidget: Cannot create a QWidget without QApplication"); never executed: QMessageLogger(__FILE__, 1136, __PRETTY_FUNCTION__).fatal("QWidget: Cannot create a QWidget without QApplication"); | 0 | ||||||||||||||||||||||||||||||||||||
| 387 | - | |||||||||||||||||||||||||||||||||||||
| 388 | ((!(allWidgets)) ? qt_assert("allWidgets",__FILE__,1138) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 389 | if (allWidgets
| 0 | ||||||||||||||||||||||||||||||||||||
| 390 | allWidgets->insert(q); never executed: allWidgets->insert(q); | 0 | ||||||||||||||||||||||||||||||||||||
| 391 | - | |||||||||||||||||||||||||||||||||||||
| 392 | int targetScreen = -1; | - | ||||||||||||||||||||||||||||||||||||
| 393 | if (parentWidget
| 0 | ||||||||||||||||||||||||||||||||||||
| 394 | const QDesktopScreenWidget *sw = qobject_cast<const QDesktopScreenWidget *>(parentWidget); | - | ||||||||||||||||||||||||||||||||||||
| 395 | targetScreen = sw
| 0 | ||||||||||||||||||||||||||||||||||||
| 396 | parentWidget = 0; | - | ||||||||||||||||||||||||||||||||||||
| 397 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 398 | - | |||||||||||||||||||||||||||||||||||||
| 399 | q->data = &data; | - | ||||||||||||||||||||||||||||||||||||
| 400 | - | |||||||||||||||||||||||||||||||||||||
| 401 | - | |||||||||||||||||||||||||||||||||||||
| 402 | if (!parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 403 | ((!(q->thread() == (static_cast<QApplication *>(QCoreApplication::instance()))->thread())) ? qt_assert_x("QWidget", "Widgets must be created in the GUI thread.", | - | ||||||||||||||||||||||||||||||||||||
| 404 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||
| 405 | , | - | ||||||||||||||||||||||||||||||||||||
| 406 | 1154 | - | ||||||||||||||||||||||||||||||||||||
| 407 | ) : qt_noop()) | - | ||||||||||||||||||||||||||||||||||||
| 408 | ; | - | ||||||||||||||||||||||||||||||||||||
| 409 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 410 | if (targetScreen >= 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 411 | topData()->initialScreenIndex = targetScreen; | - | ||||||||||||||||||||||||||||||||||||
| 412 | if (QWindow *window = q->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 413 | window->setScreen(QGuiApplication::screens().value(targetScreen, nullptr)); never executed: window->setScreen(QGuiApplication::screens().value(targetScreen, nullptr)); | 0 | ||||||||||||||||||||||||||||||||||||
| 414 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 415 | - | |||||||||||||||||||||||||||||||||||||
| 416 | data.fstrut_dirty = true; | - | ||||||||||||||||||||||||||||||||||||
| 417 | - | |||||||||||||||||||||||||||||||||||||
| 418 | data.winid = 0; | - | ||||||||||||||||||||||||||||||||||||
| 419 | data.widget_attributes = 0; | - | ||||||||||||||||||||||||||||||||||||
| 420 | data.window_flags = f; | - | ||||||||||||||||||||||||||||||||||||
| 421 | data.window_state = 0; | - | ||||||||||||||||||||||||||||||||||||
| 422 | data.focus_policy = 0; | - | ||||||||||||||||||||||||||||||||||||
| 423 | data.context_menu_policy = Qt::DefaultContextMenu; | - | ||||||||||||||||||||||||||||||||||||
| 424 | data.window_modality = Qt::NonModal; | - | ||||||||||||||||||||||||||||||||||||
| 425 | - | |||||||||||||||||||||||||||||||||||||
| 426 | data.sizehint_forced = 0; | - | ||||||||||||||||||||||||||||||||||||
| 427 | data.is_closing = 0; | - | ||||||||||||||||||||||||||||||||||||
| 428 | data.in_show = 0; | - | ||||||||||||||||||||||||||||||||||||
| 429 | data.in_set_window_state = 0; | - | ||||||||||||||||||||||||||||||||||||
| 430 | data.in_destructor = false; | - | ||||||||||||||||||||||||||||||||||||
| 431 | - | |||||||||||||||||||||||||||||||||||||
| 432 | - | |||||||||||||||||||||||||||||||||||||
| 433 | if (f & Qt::MSWindowsOwnDC
| 0 | ||||||||||||||||||||||||||||||||||||
| 434 | mustHaveWindowHandle = 1; | - | ||||||||||||||||||||||||||||||||||||
| 435 | q->setAttribute(Qt::WA_NativeWindow); | - | ||||||||||||||||||||||||||||||||||||
| 436 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 437 | - | |||||||||||||||||||||||||||||||||||||
| 438 | - | |||||||||||||||||||||||||||||||||||||
| 439 | - | |||||||||||||||||||||||||||||||||||||
| 440 | - | |||||||||||||||||||||||||||||||||||||
| 441 | q->setAttribute(Qt::WA_QuitOnClose); | - | ||||||||||||||||||||||||||||||||||||
| 442 | adjustQuitOnCloseAttribute(); | - | ||||||||||||||||||||||||||||||||||||
| 443 | - | |||||||||||||||||||||||||||||||||||||
| 444 | q->setAttribute(Qt::WA_WState_Hidden); | - | ||||||||||||||||||||||||||||||||||||
| 445 | - | |||||||||||||||||||||||||||||||||||||
| 446 | - | |||||||||||||||||||||||||||||||||||||
| 447 | data.crect = parentWidget
| 0 | ||||||||||||||||||||||||||||||||||||
| 448 | focus_next = focus_prev = q; | - | ||||||||||||||||||||||||||||||||||||
| 449 | - | |||||||||||||||||||||||||||||||||||||
| 450 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 451 | q->create(); never executed: q->create(); | 0 | ||||||||||||||||||||||||||||||||||||
| 452 | else if (parentWidget
| 0 | ||||||||||||||||||||||||||||||||||||
| 453 | q->setParent(parentWidget, data.window_flags); never executed: q->setParent(parentWidget, data.window_flags); | 0 | ||||||||||||||||||||||||||||||||||||
| 454 | else { | - | ||||||||||||||||||||||||||||||||||||
| 455 | adjustFlags(data.window_flags, q); | - | ||||||||||||||||||||||||||||||||||||
| 456 | resolveLayoutDirection(); | - | ||||||||||||||||||||||||||||||||||||
| 457 | - | |||||||||||||||||||||||||||||||||||||
| 458 | const QBrush &background = q->palette().brush(QPalette::Window); | - | ||||||||||||||||||||||||||||||||||||
| 459 | setOpaque(q->isWindow() && background.style() != Qt::NoBrush && background.isOpaque()); | - | ||||||||||||||||||||||||||||||||||||
| 460 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 461 | data.fnt = QFont(data.fnt, q); | - | ||||||||||||||||||||||||||||||||||||
| 462 | - | |||||||||||||||||||||||||||||||||||||
| 463 | - | |||||||||||||||||||||||||||||||||||||
| 464 | - | |||||||||||||||||||||||||||||||||||||
| 465 | - | |||||||||||||||||||||||||||||||||||||
| 466 | q->setAttribute(Qt::WA_PendingMoveEvent); | - | ||||||||||||||||||||||||||||||||||||
| 467 | q->setAttribute(Qt::WA_PendingResizeEvent); | - | ||||||||||||||||||||||||||||||||||||
| 468 | - | |||||||||||||||||||||||||||||||||||||
| 469 | if (++
| 0 | ||||||||||||||||||||||||||||||||||||
| 470 | QWidgetPrivate::maxInstances = QWidgetPrivate::instanceCounter; never executed: QWidgetPrivate::maxInstances = QWidgetPrivate::instanceCounter; | 0 | ||||||||||||||||||||||||||||||||||||
| 471 | - | |||||||||||||||||||||||||||||||||||||
| 472 | if (QApplicationPrivate::testAttribute(Qt::AA_ImmediateWidgetCreation)
| 0 | ||||||||||||||||||||||||||||||||||||
| 473 | q->create(); never executed: q->create(); | 0 | ||||||||||||||||||||||||||||||||||||
| 474 | - | |||||||||||||||||||||||||||||||||||||
| 475 | QEvent e(QEvent::Create); | - | ||||||||||||||||||||||||||||||||||||
| 476 | QApplication::sendEvent(q, &e); | - | ||||||||||||||||||||||||||||||||||||
| 477 | QApplication::postEvent(q, new QEvent(QEvent::PolishRequest)); | - | ||||||||||||||||||||||||||||||||||||
| 478 | - | |||||||||||||||||||||||||||||||||||||
| 479 | extraPaintEngine = 0; | - | ||||||||||||||||||||||||||||||||||||
| 480 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 481 | - | |||||||||||||||||||||||||||||||||||||
| 482 | - | |||||||||||||||||||||||||||||||||||||
| 483 | - | |||||||||||||||||||||||||||||||||||||
| 484 | void QWidgetPrivate::createRecursively() | - | ||||||||||||||||||||||||||||||||||||
| 485 | { | - | ||||||||||||||||||||||||||||||||||||
| 486 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 487 | q->create(0, true, true); | - | ||||||||||||||||||||||||||||||||||||
| 488 | for (int i = 0; i < children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 489 | QWidget *child = qobject_cast<QWidget *>(children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 490 | if (child
| 0 | ||||||||||||||||||||||||||||||||||||
| 491 | child->d_func()->createRecursively(); never executed: child->d_func()->createRecursively(); | 0 | ||||||||||||||||||||||||||||||||||||
| 492 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 493 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 494 | void QWidget::create(WId window, bool initializeWindow, bool destroyOldWindow) | - | ||||||||||||||||||||||||||||||||||||
| 495 | { | - | ||||||||||||||||||||||||||||||||||||
| 496 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 497 | if (__builtin_expect(!!(window), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 498 | QMessageLogger(__FILE__, 1289, __PRETTY_FUNCTION__).warning("QWidget::create(): Parameter 'window' does not have any effect."); never executed: QMessageLogger(__FILE__, 1289, __PRETTY_FUNCTION__).warning("QWidget::create(): Parameter 'window' does not have any effect."); | 0 | ||||||||||||||||||||||||||||||||||||
| 499 | if (testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 500 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 501 | - | |||||||||||||||||||||||||||||||||||||
| 502 | if (d->data.in_destructor
| 0 | ||||||||||||||||||||||||||||||||||||
| 503 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 504 | - | |||||||||||||||||||||||||||||||||||||
| 505 | Qt::WindowType type = windowType(); | - | ||||||||||||||||||||||||||||||||||||
| 506 | Qt::WindowFlags &flags = data->window_flags; | - | ||||||||||||||||||||||||||||||||||||
| 507 | - | |||||||||||||||||||||||||||||||||||||
| 508 | if ((type == Qt::Widget
| 0 | ||||||||||||||||||||||||||||||||||||
| 509 | type = Qt::Window; | - | ||||||||||||||||||||||||||||||||||||
| 510 | flags |= Qt::Window; | - | ||||||||||||||||||||||||||||||||||||
| 511 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 512 | - | |||||||||||||||||||||||||||||||||||||
| 513 | if (QWidget *parent = parentWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 514 | if (type & Qt::Window
| 0 | ||||||||||||||||||||||||||||||||||||
| 515 | if (!parent->testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 516 | parent->createWinId(); never executed: parent->createWinId(); | 0 | ||||||||||||||||||||||||||||||||||||
| 517 | } never executed: else if (testAttribute(Qt::WA_NativeWindow)end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 518 | && !testAttribute(Qt::WA_DontCreateNativeAncestors)
| 0 | ||||||||||||||||||||||||||||||||||||
| 519 | - | |||||||||||||||||||||||||||||||||||||
| 520 | - | |||||||||||||||||||||||||||||||||||||
| 521 | - | |||||||||||||||||||||||||||||||||||||
| 522 | d->createWinId(); | - | ||||||||||||||||||||||||||||||||||||
| 523 | - | |||||||||||||||||||||||||||||||||||||
| 524 | ((!(testAttribute(Qt::WA_WState_Created))) ? qt_assert("testAttribute(Qt::WA_WState_Created)",__FILE__,1315) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 525 | ((!(internalWinId())) ? qt_assert("internalWinId()",__FILE__,1316) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 526 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 527 | } | - | ||||||||||||||||||||||||||||||||||||
| 528 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 529 | - | |||||||||||||||||||||||||||||||||||||
| 530 | - | |||||||||||||||||||||||||||||||||||||
| 531 | static const bool paintOnScreenEnv = qEnvironmentVariableIntValue("QT_ONSCREEN_PAINT") > 0; | - | ||||||||||||||||||||||||||||||||||||
| 532 | if (paintOnScreenEnv
| 0 | ||||||||||||||||||||||||||||||||||||
| 533 | setAttribute(Qt::WA_PaintOnScreen); never executed: setAttribute(Qt::WA_PaintOnScreen); | 0 | ||||||||||||||||||||||||||||||||||||
| 534 | - | |||||||||||||||||||||||||||||||||||||
| 535 | if (QApplicationPrivate::testAttribute(Qt::AA_NativeWindows)
| 0 | ||||||||||||||||||||||||||||||||||||
| 536 | setAttribute(Qt::WA_NativeWindow); never executed: setAttribute(Qt::WA_NativeWindow); | 0 | ||||||||||||||||||||||||||||||||||||
| 537 | d->updateIsOpaque(); | - | ||||||||||||||||||||||||||||||||||||
| 538 | - | |||||||||||||||||||||||||||||||||||||
| 539 | setAttribute(Qt::WA_WState_Created); | - | ||||||||||||||||||||||||||||||||||||
| 540 | d->create_sys(window, initializeWindow, destroyOldWindow); | - | ||||||||||||||||||||||||||||||||||||
| 541 | - | |||||||||||||||||||||||||||||||||||||
| 542 | - | |||||||||||||||||||||||||||||||||||||
| 543 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 544 | d->topData()->backingStoreTracker.destroy(); | - | ||||||||||||||||||||||||||||||||||||
| 545 | if (hasBackingStoreSupport()
| 0 | ||||||||||||||||||||||||||||||||||||
| 546 | d->topData()->backingStoreTracker.create(this); never executed: d->topData()->backingStoreTracker.create(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 547 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 548 | - | |||||||||||||||||||||||||||||||||||||
| 549 | d->setModal_sys(); | - | ||||||||||||||||||||||||||||||||||||
| 550 | - | |||||||||||||||||||||||||||||||||||||
| 551 | if (!isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 552 | setAttribute(Qt::WA_DropSiteRegistered, true); never executed: setAttribute(Qt::WA_DropSiteRegistered, true); | 0 | ||||||||||||||||||||||||||||||||||||
| 553 | - | |||||||||||||||||||||||||||||||||||||
| 554 | - | |||||||||||||||||||||||||||||||||||||
| 555 | - | |||||||||||||||||||||||||||||||||||||
| 556 | - | |||||||||||||||||||||||||||||||||||||
| 557 | - | |||||||||||||||||||||||||||||||||||||
| 558 | - | |||||||||||||||||||||||||||||||||||||
| 559 | - | |||||||||||||||||||||||||||||||||||||
| 560 | if (testAttribute(Qt::WA_SetWindowIcon)
| 0 | ||||||||||||||||||||||||||||||||||||
| 561 | d->setWindowIcon_sys(); never executed: d->setWindowIcon_sys(); | 0 | ||||||||||||||||||||||||||||||||||||
| 562 | - | |||||||||||||||||||||||||||||||||||||
| 563 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 564 | d->setWindowIconText_helper(d->topData()->iconText); never executed: d->setWindowIconText_helper(d->topData()->iconText); | 0 | ||||||||||||||||||||||||||||||||||||
| 565 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 566 | d->setWindowTitle_helper(d->topData()->caption); never executed: d->setWindowTitle_helper(d->topData()->caption); | 0 | ||||||||||||||||||||||||||||||||||||
| 567 | if (windowType() != Qt::Desktop
| 0 | ||||||||||||||||||||||||||||||||||||
| 568 | d->updateSystemBackground(); | - | ||||||||||||||||||||||||||||||||||||
| 569 | - | |||||||||||||||||||||||||||||||||||||
| 570 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 571 | d->setWindowIcon_sys(); never executed: d->setWindowIcon_sys(); | 0 | ||||||||||||||||||||||||||||||||||||
| 572 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 573 | - | |||||||||||||||||||||||||||||||||||||
| 574 | - | |||||||||||||||||||||||||||||||||||||
| 575 | - | |||||||||||||||||||||||||||||||||||||
| 576 | - | |||||||||||||||||||||||||||||||||||||
| 577 | - | |||||||||||||||||||||||||||||||||||||
| 578 | - | |||||||||||||||||||||||||||||||||||||
| 579 | d->updateFrameStrut(); | - | ||||||||||||||||||||||||||||||||||||
| 580 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 581 | - | |||||||||||||||||||||||||||||||||||||
| 582 | void q_createNativeChildrenAndSetParent(const QWidget *parentWidget) | - | ||||||||||||||||||||||||||||||||||||
| 583 | { | - | ||||||||||||||||||||||||||||||||||||
| 584 | QObjectList children = parentWidget->children(); | - | ||||||||||||||||||||||||||||||||||||
| 585 | for (int i = 0; i < children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 586 | if (children.at(i)->isWidgetType()
| 0 | ||||||||||||||||||||||||||||||||||||
| 587 | const QWidget *childWidget = qobject_cast<const QWidget *>(children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 588 | if (childWidget
| 0 | ||||||||||||||||||||||||||||||||||||
| 589 | if (childWidget->testAttribute(Qt::WA_NativeWindow)
| 0 | ||||||||||||||||||||||||||||||||||||
| 590 | if (!childWidget->internalWinId()
| 0 | ||||||||||||||||||||||||||||||||||||
| 591 | childWidget->winId(); never executed: childWidget->winId(); | 0 | ||||||||||||||||||||||||||||||||||||
| 592 | if (childWidget->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 593 | if (childWidget->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 594 | childWidget->windowHandle()->setTransientParent(parentWidget->window()->windowHandle()); | - | ||||||||||||||||||||||||||||||||||||
| 595 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 596 | childWidget->windowHandle()->setParent(childWidget->nativeParentWidget()->windowHandle()); | - | ||||||||||||||||||||||||||||||||||||
| 597 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 598 | } | - | ||||||||||||||||||||||||||||||||||||
| 599 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 600 | q_createNativeChildrenAndSetParent(childWidget); | - | ||||||||||||||||||||||||||||||||||||
| 601 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 602 | } | - | ||||||||||||||||||||||||||||||||||||
| 603 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 604 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 605 | - | |||||||||||||||||||||||||||||||||||||
| 606 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 607 | - | |||||||||||||||||||||||||||||||||||||
| 608 | void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyOldWindow) | - | ||||||||||||||||||||||||||||||||||||
| 609 | { | - | ||||||||||||||||||||||||||||||||||||
| 610 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 611 | - | |||||||||||||||||||||||||||||||||||||
| 612 | (void)window;; | - | ||||||||||||||||||||||||||||||||||||
| 613 | (void)initializeWindow;; | - | ||||||||||||||||||||||||||||||||||||
| 614 | (void)destroyOldWindow;; | - | ||||||||||||||||||||||||||||||||||||
| 615 | - | |||||||||||||||||||||||||||||||||||||
| 616 | Qt::WindowFlags flags = data.window_flags; | - | ||||||||||||||||||||||||||||||||||||
| 617 | - | |||||||||||||||||||||||||||||||||||||
| 618 | if (!q->testAttribute(Qt::WA_NativeWindow)
| 0 | ||||||||||||||||||||||||||||||||||||
| 619 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 620 | - | |||||||||||||||||||||||||||||||||||||
| 621 | QWindow *win = topData()->window; | - | ||||||||||||||||||||||||||||||||||||
| 622 | - | |||||||||||||||||||||||||||||||||||||
| 623 | - | |||||||||||||||||||||||||||||||||||||
| 624 | if (!win
| 0 | ||||||||||||||||||||||||||||||||||||
| 625 | createTLSysExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 626 | win = topData()->window; | - | ||||||||||||||||||||||||||||||||||||
| 627 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 628 | - | |||||||||||||||||||||||||||||||||||||
| 629 | const auto dynamicPropertyNames = q->dynamicPropertyNames(); | - | ||||||||||||||||||||||||||||||||||||
| 630 | for (const QByteArray &propertyName : dynamicPropertyNames) { | - | ||||||||||||||||||||||||||||||||||||
| 631 | if (!qstrncmp(propertyName, "_q_platform_", 12)
| 0 | ||||||||||||||||||||||||||||||||||||
| 632 | win->setProperty(propertyName, q->property(propertyName)); never executed: win->setProperty(propertyName, q->property(propertyName)); | 0 | ||||||||||||||||||||||||||||||||||||
| 633 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 634 | - | |||||||||||||||||||||||||||||||||||||
| 635 | if (q->testAttribute(Qt::WA_ShowWithoutActivating)
| 0 | ||||||||||||||||||||||||||||||||||||
| 636 | win->setProperty("_q_showWithoutActivating", QVariant(true)); never executed: win->setProperty("_q_showWithoutActivating", QVariant(true)); | 0 | ||||||||||||||||||||||||||||||||||||
| 637 | if (q->testAttribute(Qt::WA_MacAlwaysShowToolWindow)
| 0 | ||||||||||||||||||||||||||||||||||||
| 638 | win->setProperty("_q_macAlwaysShowToolWindow", QVariant::fromValue(QVariant(true))); never executed: win->setProperty("_q_macAlwaysShowToolWindow", QVariant::fromValue(QVariant(true))); | 0 | ||||||||||||||||||||||||||||||||||||
| 639 | setNetWmWindowTypes(true); | - | ||||||||||||||||||||||||||||||||||||
| 640 | win->setFlags(data.window_flags); | - | ||||||||||||||||||||||||||||||||||||
| 641 | fixPosIncludesFrame(); | - | ||||||||||||||||||||||||||||||||||||
| 642 | if (q->testAttribute(Qt::WA_Moved)
| 0 | ||||||||||||||||||||||||||||||||||||
| 643 | || !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowManagement)
| 0 | ||||||||||||||||||||||||||||||||||||
| 644 | win->setGeometry(q->geometry()); never executed: win->setGeometry(q->geometry()); | 0 | ||||||||||||||||||||||||||||||||||||
| 645 | else | - | ||||||||||||||||||||||||||||||||||||
| 646 | win->resize(q->size()); never executed: win->resize(q->size()); | 0 | ||||||||||||||||||||||||||||||||||||
| 647 | if (win->isTopLevel()
| 0 | ||||||||||||||||||||||||||||||||||||
| 648 | int screenNumber = topData()->initialScreenIndex; | - | ||||||||||||||||||||||||||||||||||||
| 649 | topData()->initialScreenIndex = -1; | - | ||||||||||||||||||||||||||||||||||||
| 650 | if (screenNumber < 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 651 | screenNumber = q->windowType() != Qt::Desktop
| 0 | ||||||||||||||||||||||||||||||||||||
| 652 | ? QApplication::desktop()->screenNumber(q) : 0; | - | ||||||||||||||||||||||||||||||||||||
| 653 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 654 | win->setScreen(QGuiApplication::screens().value(screenNumber, nullptr)); | - | ||||||||||||||||||||||||||||||||||||
| 655 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 656 | - | |||||||||||||||||||||||||||||||||||||
| 657 | QSurfaceFormat format = win->requestedFormat(); | - | ||||||||||||||||||||||||||||||||||||
| 658 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 659 | && q->testAttribute(Qt::WA_TranslucentBackground)
| 0 | ||||||||||||||||||||||||||||||||||||
| 660 | format.setAlphaBufferSize(8); | - | ||||||||||||||||||||||||||||||||||||
| 661 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 662 | win->setFormat(format); | - | ||||||||||||||||||||||||||||||||||||
| 663 | - | |||||||||||||||||||||||||||||||||||||
| 664 | if (QWidget *nativeParent = q->nativeParentWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 665 | if (nativeParent->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 666 | if (flags & Qt::Window
| 0 | ||||||||||||||||||||||||||||||||||||
| 667 | win->setTransientParent(nativeParent->window()->windowHandle()); | - | ||||||||||||||||||||||||||||||||||||
| 668 | win->setParent(0); | - | ||||||||||||||||||||||||||||||||||||
| 669 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 670 | win->setTransientParent(0); | - | ||||||||||||||||||||||||||||||||||||
| 671 | win->setParent(nativeParent->windowHandle()); | - | ||||||||||||||||||||||||||||||||||||
| 672 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 673 | } | - | ||||||||||||||||||||||||||||||||||||
| 674 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 675 | - | |||||||||||||||||||||||||||||||||||||
| 676 | qt_window_private(win)->positionPolicy = topData()->posIncludesFrame
| 0 | ||||||||||||||||||||||||||||||||||||
| 677 | QWindowPrivate::WindowFrameInclusive : QWindowPrivate::WindowFrameExclusive; | - | ||||||||||||||||||||||||||||||||||||
| 678 | win->create(); | - | ||||||||||||||||||||||||||||||||||||
| 679 | - | |||||||||||||||||||||||||||||||||||||
| 680 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 681 | win->handle()->setFrameStrutEventsEnabled(true); never executed: win->handle()->setFrameStrutEventsEnabled(true); | 0 | ||||||||||||||||||||||||||||||||||||
| 682 | - | |||||||||||||||||||||||||||||||||||||
| 683 | data.window_flags = win->flags(); | - | ||||||||||||||||||||||||||||||||||||
| 684 | - | |||||||||||||||||||||||||||||||||||||
| 685 | if (!topData()->role.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||
| 686 | QXcbWindowFunctions::setWmWindowRole(win, topData()->role.toLatin1()); never executed: QXcbWindowFunctions::setWmWindowRole(win, topData()->role.toLatin1()); | 0 | ||||||||||||||||||||||||||||||||||||
| 687 | - | |||||||||||||||||||||||||||||||||||||
| 688 | QBackingStore *store = q->backingStore(); | - | ||||||||||||||||||||||||||||||||||||
| 689 | - | |||||||||||||||||||||||||||||||||||||
| 690 | if (!store
| 0 | ||||||||||||||||||||||||||||||||||||
| 691 | if (win
| 0 | ||||||||||||||||||||||||||||||||||||
| 692 | if (q->isTopLevel()
| 0 | ||||||||||||||||||||||||||||||||||||
| 693 | q->setBackingStore(new QBackingStore(win)); never executed: q->setBackingStore(new QBackingStore(win)); | 0 | ||||||||||||||||||||||||||||||||||||
| 694 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 695 | q->setAttribute(Qt::WA_PaintOnScreen, true); | - | ||||||||||||||||||||||||||||||||||||
| 696 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 697 | } | - | ||||||||||||||||||||||||||||||||||||
| 698 | - | |||||||||||||||||||||||||||||||||||||
| 699 | setWindowModified_helper(); | - | ||||||||||||||||||||||||||||||||||||
| 700 | WId id = win->winId(); | - | ||||||||||||||||||||||||||||||||||||
| 701 | - | |||||||||||||||||||||||||||||||||||||
| 702 | ((!(id != WId(0))) ? qt_assert("id != WId(0)",__FILE__,1508) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 703 | setWinId(id); | - | ||||||||||||||||||||||||||||||||||||
| 704 | - | |||||||||||||||||||||||||||||||||||||
| 705 | - | |||||||||||||||||||||||||||||||||||||
| 706 | q_createNativeChildrenAndSetParent(q); | - | ||||||||||||||||||||||||||||||||||||
| 707 | - | |||||||||||||||||||||||||||||||||||||
| 708 | if (extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 709 | setMask_sys(extra->mask); never executed: setMask_sys(extra->mask); | 0 | ||||||||||||||||||||||||||||||||||||
| 710 | - | |||||||||||||||||||||||||||||||||||||
| 711 | if (data.crect.width() == 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 712 | q->setAttribute(Qt::WA_OutsideWSRange, true); | - | ||||||||||||||||||||||||||||||||||||
| 713 | } never executed: else if (q->isVisible()end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 714 | - | |||||||||||||||||||||||||||||||||||||
| 715 | win->setVisible(true); | - | ||||||||||||||||||||||||||||||||||||
| 716 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 717 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 718 | - | |||||||||||||||||||||||||||||||||||||
| 719 | - | |||||||||||||||||||||||||||||||||||||
| 720 | - | |||||||||||||||||||||||||||||||||||||
| 721 | - | |||||||||||||||||||||||||||||||||||||
| 722 | - | |||||||||||||||||||||||||||||||||||||
| 723 | void QWidgetPrivate::createTLSysExtra() | - | ||||||||||||||||||||||||||||||||||||
| 724 | { | - | ||||||||||||||||||||||||||||||||||||
| 725 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 726 | if (!extra->topextra->window
| 0 | ||||||||||||||||||||||||||||||||||||
| 727 | extra->topextra->window = new QWidgetWindow(q); | - | ||||||||||||||||||||||||||||||||||||
| 728 | if (extra->minw
| 0 | ||||||||||||||||||||||||||||||||||||
| 729 | extra->topextra->window->setMinimumSize(QSize(extra->minw, extra->minh)); never executed: extra->topextra->window->setMinimumSize(QSize(extra->minw, extra->minh)); | 0 | ||||||||||||||||||||||||||||||||||||
| 730 | if (extra->maxw != ((1<<24)-1)
| 0 | ||||||||||||||||||||||||||||||||||||
| 731 | extra->topextra->window->setMaximumSize(QSize(extra->maxw, extra->maxh)); never executed: extra->topextra->window->setMaximumSize(QSize(extra->maxw, extra->maxh)); | 0 | ||||||||||||||||||||||||||||||||||||
| 732 | if (extra->topextra->opacity != 255
| 0 | ||||||||||||||||||||||||||||||||||||
| 733 | extra->topextra->window->setOpacity(qreal(extra->topextra->opacity) / qreal(255)); never executed: extra->topextra->window->setOpacity(qreal(extra->topextra->opacity) / qreal(255)); | 0 | ||||||||||||||||||||||||||||||||||||
| 734 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 735 | - | |||||||||||||||||||||||||||||||||||||
| 736 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 737 | QWidget::~QWidget() | - | ||||||||||||||||||||||||||||||||||||
| 738 | { | - | ||||||||||||||||||||||||||||||||||||
| 739 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 740 | d->data.in_destructor = true; | - | ||||||||||||||||||||||||||||||||||||
| 741 | - | |||||||||||||||||||||||||||||||||||||
| 742 | - | |||||||||||||||||||||||||||||||||||||
| 743 | - | |||||||||||||||||||||||||||||||||||||
| 744 | - | |||||||||||||||||||||||||||||||||||||
| 745 | - | |||||||||||||||||||||||||||||||||||||
| 746 | - | |||||||||||||||||||||||||||||||||||||
| 747 | - | |||||||||||||||||||||||||||||||||||||
| 748 | if (QGestureManager *manager = QGestureManager::instance()
| 0 | ||||||||||||||||||||||||||||||||||||
| 749 | - | |||||||||||||||||||||||||||||||||||||
| 750 | for (auto it = d->gestureContext.keyBegin(), end = d->gestureContext.keyEnd(); it != end
| 0 | ||||||||||||||||||||||||||||||||||||
| 751 | manager->cleanupCachedGestures(this, *it); never executed: manager->cleanupCachedGestures(this, *it); | 0 | ||||||||||||||||||||||||||||||||||||
| 752 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 753 | d->gestureContext.clear(); | - | ||||||||||||||||||||||||||||||||||||
| 754 | - | |||||||||||||||||||||||||||||||||||||
| 755 | - | |||||||||||||||||||||||||||||||||||||
| 756 | - | |||||||||||||||||||||||||||||||||||||
| 757 | d->registerDropSite(false); | - | ||||||||||||||||||||||||||||||||||||
| 758 | - | |||||||||||||||||||||||||||||||||||||
| 759 | - | |||||||||||||||||||||||||||||||||||||
| 760 | - | |||||||||||||||||||||||||||||||||||||
| 761 | for (int i = 0; i < d->actions.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 762 | QActionPrivate *apriv = d->actions.at(i)->d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 763 | apriv->widgets.removeAll(this); | - | ||||||||||||||||||||||||||||||||||||
| 764 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 765 | d->actions.clear(); | - | ||||||||||||||||||||||||||||||||||||
| 766 | - | |||||||||||||||||||||||||||||||||||||
| 767 | - | |||||||||||||||||||||||||||||||||||||
| 768 | - | |||||||||||||||||||||||||||||||||||||
| 769 | - | |||||||||||||||||||||||||||||||||||||
| 770 | - | |||||||||||||||||||||||||||||||||||||
| 771 | if (!QApplicationPrivate::is_app_closing
| 0 | ||||||||||||||||||||||||||||||||||||
| 772 | (static_cast< never executed: QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.removeShortcut(0, this, QKeySequence());(static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.removeShortcut(0, this, QKeySequence());never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.removeShortcut(0, this, QKeySequence()); | 0 | ||||||||||||||||||||||||||||||||||||
| 773 | - | |||||||||||||||||||||||||||||||||||||
| 774 | - | |||||||||||||||||||||||||||||||||||||
| 775 | - | |||||||||||||||||||||||||||||||||||||
| 776 | delete d->layout; | - | ||||||||||||||||||||||||||||||||||||
| 777 | d->layout = 0; | - | ||||||||||||||||||||||||||||||||||||
| 778 | - | |||||||||||||||||||||||||||||||||||||
| 779 | - | |||||||||||||||||||||||||||||||||||||
| 780 | ((!(d->focus_next->d_func()->focus_prev == this)) ? qt_assert("d->focus_next->d_func()->focus_prev == this",__FILE__,1602) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 781 | ((!(d->focus_prev->d_func()->focus_next == this)) ? qt_assert("d->focus_prev->d_func()->focus_next == this",__FILE__,1603) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 782 | - | |||||||||||||||||||||||||||||||||||||
| 783 | if (d->focus_next != this
| 0 | ||||||||||||||||||||||||||||||||||||
| 784 | d->focus_next->d_func()->focus_prev = d->focus_prev; | - | ||||||||||||||||||||||||||||||||||||
| 785 | d->focus_prev->d_func()->focus_next = d->focus_next; | - | ||||||||||||||||||||||||||||||||||||
| 786 | d->focus_next = d->focus_prev = 0; | - | ||||||||||||||||||||||||||||||||||||
| 787 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 788 | - | |||||||||||||||||||||||||||||||||||||
| 789 | - | |||||||||||||||||||||||||||||||||||||
| 790 | if (true) { | - | ||||||||||||||||||||||||||||||||||||
| 791 | - | |||||||||||||||||||||||||||||||||||||
| 792 | const QWidget* w = this; | - | ||||||||||||||||||||||||||||||||||||
| 793 | while (w->d_func()->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 794 | w = w->d_func()->extra->focus_proxy; never executed: w = w->d_func()->extra->focus_proxy; | 0 | ||||||||||||||||||||||||||||||||||||
| 795 | QWidget *window = w->window(); | - | ||||||||||||||||||||||||||||||||||||
| 796 | QWExtra *e = window
| 0 | ||||||||||||||||||||||||||||||||||||
| 797 | if (!e
| 0 | ||||||||||||||||||||||||||||||||||||
| 798 | - | |||||||||||||||||||||||||||||||||||||
| 799 | clearFocus(); never executed: clearFocus(); | 0 | ||||||||||||||||||||||||||||||||||||
| 800 | } never executed: else {end of blockdead code: { } | - | ||||||||||||||||||||||||||||||||||||
| 801 | - | |||||||||||||||||||||||||||||||||||||
| 802 | } dead code: { } | - | ||||||||||||||||||||||||||||||||||||
| 803 | - | |||||||||||||||||||||||||||||||||||||
| 804 | d->setDirtyOpaqueRegion(); | - | ||||||||||||||||||||||||||||||||||||
| 805 | - | |||||||||||||||||||||||||||||||||||||
| 806 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 807 | if (true) { | - | ||||||||||||||||||||||||||||||||||||
| 808 | d->close_helper(QWidgetPrivate::CloseNoEvent); | - | ||||||||||||||||||||||||||||||||||||
| 809 | } never executed: else {end of blockdead code: { if (true) { hide(); } else { } } | - | ||||||||||||||||||||||||||||||||||||
| 810 | - | |||||||||||||||||||||||||||||||||||||
| 811 | if (true) { dead code: { if (true) { hide(); } else { } } | - | ||||||||||||||||||||||||||||||||||||
| 812 | hide(); dead code: { if (true) { hide(); } else { } } | - | ||||||||||||||||||||||||||||||||||||
| 813 | } else { dead code: { }dead code: { if (true) { hide(); } else { } } | - | ||||||||||||||||||||||||||||||||||||
| 814 | - | |||||||||||||||||||||||||||||||||||||
| 815 | } dead code: { }dead code: { if (true) { hide(); } else { } } | - | ||||||||||||||||||||||||||||||||||||
| 816 | } dead code: { if (true) { hide(); } else { } } | - | ||||||||||||||||||||||||||||||||||||
| 817 | } | - | ||||||||||||||||||||||||||||||||||||
| 818 | - | |||||||||||||||||||||||||||||||||||||
| 819 | - | |||||||||||||||||||||||||||||||||||||
| 820 | - | |||||||||||||||||||||||||||||||||||||
| 821 | - | |||||||||||||||||||||||||||||||||||||
| 822 | - | |||||||||||||||||||||||||||||||||||||
| 823 | - | |||||||||||||||||||||||||||||||||||||
| 824 | else if (isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 825 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->sendSyntheticEnterLeave(this); | - | ||||||||||||||||||||||||||||||||||||
| 826 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 827 | - | |||||||||||||||||||||||||||||||||||||
| 828 | if (QWidgetBackingStore *bs = d->maybeBackingStore()
| 0 | ||||||||||||||||||||||||||||||||||||
| 829 | bs->removeDirtyWidget(this); | - | ||||||||||||||||||||||||||||||||||||
| 830 | if (testAttribute(Qt::WA_StaticContents)
| 0 | ||||||||||||||||||||||||||||||||||||
| 831 | bs->removeStaticWidget(this); never executed: bs->removeStaticWidget(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 832 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 833 | - | |||||||||||||||||||||||||||||||||||||
| 834 | delete d->needsFlush; | - | ||||||||||||||||||||||||||||||||||||
| 835 | d->needsFlush = 0; | - | ||||||||||||||||||||||||||||||||||||
| 836 | - | |||||||||||||||||||||||||||||||||||||
| 837 | - | |||||||||||||||||||||||||||||||||||||
| 838 | - | |||||||||||||||||||||||||||||||||||||
| 839 | bool blocked = d->blockSig; | - | ||||||||||||||||||||||||||||||||||||
| 840 | d->blockSig = 0; | - | ||||||||||||||||||||||||||||||||||||
| 841 | - | |||||||||||||||||||||||||||||||||||||
| 842 | if (d->isSignalConnected(0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 843 | if (true) { | - | ||||||||||||||||||||||||||||||||||||
| 844 | destroyed(this); | - | ||||||||||||||||||||||||||||||||||||
| 845 | } never executed: else {end of blockdead code: { QMessageLogger(__FILE__, 1670, __PRETTY_FUNCTION__).warning("Detected an unexpected exception in ~QWidget while emitting destroyed()."); qt_noop(); } | - | ||||||||||||||||||||||||||||||||||||
| 846 | - | |||||||||||||||||||||||||||||||||||||
| 847 | - | |||||||||||||||||||||||||||||||||||||
| 848 | QMessageLogger(__FILE__, 1670, __PRETTY_FUNCTION__).warning("Detected an unexpected exception in ~QWidget while emitting destroyed()."); dead code: { QMessageLogger(__FILE__, 1670, __PRETTY_FUNCTION__).warning("Detected an unexpected exception in ~QWidget while emitting destroyed()."); qt_noop(); } | - | ||||||||||||||||||||||||||||||||||||
| 849 | qt_noop(); dead code: { QMessageLogger(__FILE__, 1670, __PRETTY_FUNCTION__).warning("Detected an unexpected exception in ~QWidget while emitting destroyed()."); qt_noop(); } | - | ||||||||||||||||||||||||||||||||||||
| 850 | } dead code: { QMessageLogger(__FILE__, 1670, __PRETTY_FUNCTION__).warning("Detected an unexpected exception in ~QWidget while emitting destroyed()."); qt_noop(); } | - | ||||||||||||||||||||||||||||||||||||
| 851 | } | - | ||||||||||||||||||||||||||||||||||||
| 852 | - | |||||||||||||||||||||||||||||||||||||
| 853 | if (d->declarativeData
| 0 | ||||||||||||||||||||||||||||||||||||
| 854 | if (static_cast<
| 0 | ||||||||||||||||||||||||||||||||||||
| 855 | if (QAbstractDeclarativeData::destroyed_qml1
| 0 | ||||||||||||||||||||||||||||||||||||
| 856 | QAbstractDeclarativeData::destroyed_qml1(d->declarativeData, this); never executed: QAbstractDeclarativeData::destroyed_qml1(d->declarativeData, this); | 0 | ||||||||||||||||||||||||||||||||||||
| 857 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 858 | if (QAbstractDeclarativeData::destroyed
| 0 | ||||||||||||||||||||||||||||||||||||
| 859 | QAbstractDeclarativeData::destroyed(d->declarativeData, this); never executed: QAbstractDeclarativeData::destroyed(d->declarativeData, this); | 0 | ||||||||||||||||||||||||||||||||||||
| 860 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 861 | d->declarativeData = 0; | - | ||||||||||||||||||||||||||||||||||||
| 862 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 863 | - | |||||||||||||||||||||||||||||||||||||
| 864 | d->blockSig = blocked; | - | ||||||||||||||||||||||||||||||||||||
| 865 | if (!d->children.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 866 | d->deleteChildren(); never executed: d->deleteChildren(); | 0 | ||||||||||||||||||||||||||||||||||||
| 867 | - | |||||||||||||||||||||||||||||||||||||
| 868 | QApplication::removePostedEvents(this); | - | ||||||||||||||||||||||||||||||||||||
| 869 | - | |||||||||||||||||||||||||||||||||||||
| 870 | if (true) { | - | ||||||||||||||||||||||||||||||||||||
| 871 | destroy(); | - | ||||||||||||||||||||||||||||||||||||
| 872 | } never executed: else {end of blockdead code: { } | - | ||||||||||||||||||||||||||||||||||||
| 873 | - | |||||||||||||||||||||||||||||||||||||
| 874 | } dead code: { } | - | ||||||||||||||||||||||||||||||||||||
| 875 | --QWidgetPrivate::instanceCounter; | - | ||||||||||||||||||||||||||||||||||||
| 876 | - | |||||||||||||||||||||||||||||||||||||
| 877 | if (QWidgetPrivate::allWidgets
| 0 | ||||||||||||||||||||||||||||||||||||
| 878 | QWidgetPrivate::allWidgets->remove(this); never executed: QWidgetPrivate::allWidgets->remove(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 879 | - | |||||||||||||||||||||||||||||||||||||
| 880 | if (true) { | - | ||||||||||||||||||||||||||||||||||||
| 881 | QEvent e(QEvent::Destroy); | - | ||||||||||||||||||||||||||||||||||||
| 882 | QCoreApplication::sendEvent(this, &e); | - | ||||||||||||||||||||||||||||||||||||
| 883 | } never executed: else {end of blockdead code: { } | - | ||||||||||||||||||||||||||||||||||||
| 884 | - | |||||||||||||||||||||||||||||||||||||
| 885 | } dead code: { } | - | ||||||||||||||||||||||||||||||||||||
| 886 | } | - | ||||||||||||||||||||||||||||||||||||
| 887 | - | |||||||||||||||||||||||||||||||||||||
| 888 | int QWidgetPrivate::instanceCounter = 0; | - | ||||||||||||||||||||||||||||||||||||
| 889 | int QWidgetPrivate::maxInstances = 0; | - | ||||||||||||||||||||||||||||||||||||
| 890 | - | |||||||||||||||||||||||||||||||||||||
| 891 | void QWidgetPrivate::setWinId(WId id) | - | ||||||||||||||||||||||||||||||||||||
| 892 | { | - | ||||||||||||||||||||||||||||||||||||
| 893 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 894 | - | |||||||||||||||||||||||||||||||||||||
| 895 | - | |||||||||||||||||||||||||||||||||||||
| 896 | - | |||||||||||||||||||||||||||||||||||||
| 897 | - | |||||||||||||||||||||||||||||||||||||
| 898 | - | |||||||||||||||||||||||||||||||||||||
| 899 | bool userDesktopWidget = qt_desktopWidget != 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 900 | if (mapper
| 0 | ||||||||||||||||||||||||||||||||||||
| 901 | mapper->remove(data.winid); | - | ||||||||||||||||||||||||||||||||||||
| 902 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 903 | - | |||||||||||||||||||||||||||||||||||||
| 904 | const WId oldWinId = data.winid; | - | ||||||||||||||||||||||||||||||||||||
| 905 | - | |||||||||||||||||||||||||||||||||||||
| 906 | data.winid = id; | - | ||||||||||||||||||||||||||||||||||||
| 907 | - | |||||||||||||||||||||||||||||||||||||
| 908 | - | |||||||||||||||||||||||||||||||||||||
| 909 | - | |||||||||||||||||||||||||||||||||||||
| 910 | if (mapper
| 0 | ||||||||||||||||||||||||||||||||||||
| 911 | mapper->insert(data.winid, q); | - | ||||||||||||||||||||||||||||||||||||
| 912 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 913 | - | |||||||||||||||||||||||||||||||||||||
| 914 | if(oldWinId != id
| 0 | ||||||||||||||||||||||||||||||||||||
| 915 | QEvent e(QEvent::WinIdChange); | - | ||||||||||||||||||||||||||||||||||||
| 916 | QCoreApplication::sendEvent(q, &e); | - | ||||||||||||||||||||||||||||||||||||
| 917 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 918 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 919 | - | |||||||||||||||||||||||||||||||||||||
| 920 | void QWidgetPrivate::createTLExtra() | - | ||||||||||||||||||||||||||||||||||||
| 921 | { | - | ||||||||||||||||||||||||||||||||||||
| 922 | if (!extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 923 | createExtra(); never executed: createExtra(); | 0 | ||||||||||||||||||||||||||||||||||||
| 924 | if (!extra->topextra
| 0 | ||||||||||||||||||||||||||||||||||||
| 925 | QTLWExtra* x = extra->topextra = new QTLWExtra; | - | ||||||||||||||||||||||||||||||||||||
| 926 | x->icon = 0; | - | ||||||||||||||||||||||||||||||||||||
| 927 | x->backingStore = 0; | - | ||||||||||||||||||||||||||||||||||||
| 928 | x->sharedPainter = 0; | - | ||||||||||||||||||||||||||||||||||||
| 929 | x->incw = x->inch = 0; | - | ||||||||||||||||||||||||||||||||||||
| 930 | x->basew = x->baseh = 0; | - | ||||||||||||||||||||||||||||||||||||
| 931 | x->frameStrut.setCoords(0, 0, 0, 0); | - | ||||||||||||||||||||||||||||||||||||
| 932 | x->normalGeometry = QRect(0,0,-1,-1); | - | ||||||||||||||||||||||||||||||||||||
| 933 | x->savedFlags = 0; | - | ||||||||||||||||||||||||||||||||||||
| 934 | x->opacity = 255; | - | ||||||||||||||||||||||||||||||||||||
| 935 | x->posIncludesFrame = 0; | - | ||||||||||||||||||||||||||||||||||||
| 936 | x->sizeAdjusted = false; | - | ||||||||||||||||||||||||||||||||||||
| 937 | x->inTopLevelResize = false; | - | ||||||||||||||||||||||||||||||||||||
| 938 | x->inRepaint = false; | - | ||||||||||||||||||||||||||||||||||||
| 939 | x->embedded = 0; | - | ||||||||||||||||||||||||||||||||||||
| 940 | x->window = 0; | - | ||||||||||||||||||||||||||||||||||||
| 941 | x->shareContext = 0; | - | ||||||||||||||||||||||||||||||||||||
| 942 | x->initialScreenIndex = -1; | - | ||||||||||||||||||||||||||||||||||||
| 943 | - | |||||||||||||||||||||||||||||||||||||
| 944 | - | |||||||||||||||||||||||||||||||||||||
| 945 | - | |||||||||||||||||||||||||||||||||||||
| 946 | - | |||||||||||||||||||||||||||||||||||||
| 947 | - | |||||||||||||||||||||||||||||||||||||
| 948 | - | |||||||||||||||||||||||||||||||||||||
| 949 | - | |||||||||||||||||||||||||||||||||||||
| 950 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 951 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 952 | - | |||||||||||||||||||||||||||||||||||||
| 953 | - | |||||||||||||||||||||||||||||||||||||
| 954 | - | |||||||||||||||||||||||||||||||||||||
| 955 | - | |||||||||||||||||||||||||||||||||||||
| 956 | - | |||||||||||||||||||||||||||||||||||||
| 957 | - | |||||||||||||||||||||||||||||||||||||
| 958 | void QWidgetPrivate::createExtra() | - | ||||||||||||||||||||||||||||||||||||
| 959 | { | - | ||||||||||||||||||||||||||||||||||||
| 960 | if (!extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 961 | extra = new QWExtra; | - | ||||||||||||||||||||||||||||||||||||
| 962 | extra->glContext = 0; | - | ||||||||||||||||||||||||||||||||||||
| 963 | extra->topextra = 0; | - | ||||||||||||||||||||||||||||||||||||
| 964 | - | |||||||||||||||||||||||||||||||||||||
| 965 | extra->proxyWidget = 0; | - | ||||||||||||||||||||||||||||||||||||
| 966 | - | |||||||||||||||||||||||||||||||||||||
| 967 | - | |||||||||||||||||||||||||||||||||||||
| 968 | extra->curs = 0; | - | ||||||||||||||||||||||||||||||||||||
| 969 | - | |||||||||||||||||||||||||||||||||||||
| 970 | extra->minw = 0; | - | ||||||||||||||||||||||||||||||||||||
| 971 | extra->minh = 0; | - | ||||||||||||||||||||||||||||||||||||
| 972 | extra->maxw = ((1<<24)-1); | - | ||||||||||||||||||||||||||||||||||||
| 973 | extra->maxh = ((1<<24)-1); | - | ||||||||||||||||||||||||||||||||||||
| 974 | extra->customDpiX = 0; | - | ||||||||||||||||||||||||||||||||||||
| 975 | extra->customDpiY = 0; | - | ||||||||||||||||||||||||||||||||||||
| 976 | extra->explicitMinSize = 0; | - | ||||||||||||||||||||||||||||||||||||
| 977 | extra->explicitMaxSize = 0; | - | ||||||||||||||||||||||||||||||||||||
| 978 | extra->autoFillBackground = 0; | - | ||||||||||||||||||||||||||||||||||||
| 979 | extra->nativeChildrenForced = 0; | - | ||||||||||||||||||||||||||||||||||||
| 980 | extra->inRenderWithPainter = 0; | - | ||||||||||||||||||||||||||||||||||||
| 981 | extra->hasWindowContainer = false; | - | ||||||||||||||||||||||||||||||||||||
| 982 | extra->hasMask = 0; | - | ||||||||||||||||||||||||||||||||||||
| 983 | createSysExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 984 | - | |||||||||||||||||||||||||||||||||||||
| 985 | - | |||||||||||||||||||||||||||||||||||||
| 986 | - | |||||||||||||||||||||||||||||||||||||
| 987 | - | |||||||||||||||||||||||||||||||||||||
| 988 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 989 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 990 | - | |||||||||||||||||||||||||||||||||||||
| 991 | void QWidgetPrivate::createSysExtra() | - | ||||||||||||||||||||||||||||||||||||
| 992 | { | - | ||||||||||||||||||||||||||||||||||||
| 993 | } | - | ||||||||||||||||||||||||||||||||||||
| 994 | - | |||||||||||||||||||||||||||||||||||||
| 995 | - | |||||||||||||||||||||||||||||||||||||
| 996 | - | |||||||||||||||||||||||||||||||||||||
| 997 | - | |||||||||||||||||||||||||||||||||||||
| 998 | - | |||||||||||||||||||||||||||||||||||||
| 999 | - | |||||||||||||||||||||||||||||||||||||
| 1000 | void QWidgetPrivate::deleteExtra() | - | ||||||||||||||||||||||||||||||||||||
| 1001 | { | - | ||||||||||||||||||||||||||||||||||||
| 1002 | if (extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 1003 | - | |||||||||||||||||||||||||||||||||||||
| 1004 | delete extra->curs; | - | ||||||||||||||||||||||||||||||||||||
| 1005 | - | |||||||||||||||||||||||||||||||||||||
| 1006 | deleteSysExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 1007 | - | |||||||||||||||||||||||||||||||||||||
| 1008 | - | |||||||||||||||||||||||||||||||||||||
| 1009 | if (QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(extra->style)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1010 | proxy->deref(); never executed: proxy->deref(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1011 | - | |||||||||||||||||||||||||||||||||||||
| 1012 | if (extra->topextra
| 0 | ||||||||||||||||||||||||||||||||||||
| 1013 | deleteTLSysExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 1014 | - | |||||||||||||||||||||||||||||||||||||
| 1015 | delete extra->topextra->icon; | - | ||||||||||||||||||||||||||||||||||||
| 1016 | delete extra->topextra; | - | ||||||||||||||||||||||||||||||||||||
| 1017 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1018 | delete extra; | - | ||||||||||||||||||||||||||||||||||||
| 1019 | - | |||||||||||||||||||||||||||||||||||||
| 1020 | extra = 0; | - | ||||||||||||||||||||||||||||||||||||
| 1021 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1022 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1023 | - | |||||||||||||||||||||||||||||||||||||
| 1024 | void QWidgetPrivate::deleteSysExtra() | - | ||||||||||||||||||||||||||||||||||||
| 1025 | { | - | ||||||||||||||||||||||||||||||||||||
| 1026 | } | - | ||||||||||||||||||||||||||||||||||||
| 1027 | - | |||||||||||||||||||||||||||||||||||||
| 1028 | static void deleteBackingStore(QWidgetPrivate *d) | - | ||||||||||||||||||||||||||||||||||||
| 1029 | { | - | ||||||||||||||||||||||||||||||||||||
| 1030 | QTLWExtra *topData = d->topData(); | - | ||||||||||||||||||||||||||||||||||||
| 1031 | - | |||||||||||||||||||||||||||||||||||||
| 1032 | - | |||||||||||||||||||||||||||||||||||||
| 1033 | - | |||||||||||||||||||||||||||||||||||||
| 1034 | - | |||||||||||||||||||||||||||||||||||||
| 1035 | - | |||||||||||||||||||||||||||||||||||||
| 1036 | QScopedPointer<QOffscreenSurface> tempSurface; | - | ||||||||||||||||||||||||||||||||||||
| 1037 | - | |||||||||||||||||||||||||||||||||||||
| 1038 | if (d->textureChildSeen
| 0 | ||||||||||||||||||||||||||||||||||||
| 1039 | if (topData->window->handle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1040 | topData->shareContext->makeCurrent(topData->window); | - | ||||||||||||||||||||||||||||||||||||
| 1041 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1042 | tempSurface.reset(new QOffscreenSurface); | - | ||||||||||||||||||||||||||||||||||||
| 1043 | tempSurface->setFormat(topData->shareContext->format()); | - | ||||||||||||||||||||||||||||||||||||
| 1044 | tempSurface->create(); | - | ||||||||||||||||||||||||||||||||||||
| 1045 | topData->shareContext->makeCurrent(tempSurface.data()); | - | ||||||||||||||||||||||||||||||||||||
| 1046 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1047 | } | - | ||||||||||||||||||||||||||||||||||||
| 1048 | - | |||||||||||||||||||||||||||||||||||||
| 1049 | - | |||||||||||||||||||||||||||||||||||||
| 1050 | delete topData->backingStore; | - | ||||||||||||||||||||||||||||||||||||
| 1051 | topData->backingStore = 0; | - | ||||||||||||||||||||||||||||||||||||
| 1052 | - | |||||||||||||||||||||||||||||||||||||
| 1053 | - | |||||||||||||||||||||||||||||||||||||
| 1054 | if (d->textureChildSeen
| 0 | ||||||||||||||||||||||||||||||||||||
| 1055 | topData->shareContext->doneCurrent(); never executed: topData->shareContext->doneCurrent(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1056 | - | |||||||||||||||||||||||||||||||||||||
| 1057 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1058 | - | |||||||||||||||||||||||||||||||||||||
| 1059 | void QWidgetPrivate::deleteTLSysExtra() | - | ||||||||||||||||||||||||||||||||||||
| 1060 | { | - | ||||||||||||||||||||||||||||||||||||
| 1061 | if (extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 1062 | - | |||||||||||||||||||||||||||||||||||||
| 1063 | - | |||||||||||||||||||||||||||||||||||||
| 1064 | - | |||||||||||||||||||||||||||||||||||||
| 1065 | - | |||||||||||||||||||||||||||||||||||||
| 1066 | extra->topextra->backingStoreTracker.destroy(); | - | ||||||||||||||||||||||||||||||||||||
| 1067 | deleteBackingStore(this); | - | ||||||||||||||||||||||||||||||||||||
| 1068 | - | |||||||||||||||||||||||||||||||||||||
| 1069 | qDeleteAll(extra->topextra->widgetTextures); | - | ||||||||||||||||||||||||||||||||||||
| 1070 | extra->topextra->widgetTextures.clear(); | - | ||||||||||||||||||||||||||||||||||||
| 1071 | delete extra->topextra->shareContext; | - | ||||||||||||||||||||||||||||||||||||
| 1072 | extra->topextra->shareContext = 0; | - | ||||||||||||||||||||||||||||||||||||
| 1073 | - | |||||||||||||||||||||||||||||||||||||
| 1074 | - | |||||||||||||||||||||||||||||||||||||
| 1075 | - | |||||||||||||||||||||||||||||||||||||
| 1076 | - | |||||||||||||||||||||||||||||||||||||
| 1077 | - | |||||||||||||||||||||||||||||||||||||
| 1078 | - | |||||||||||||||||||||||||||||||||||||
| 1079 | if (extra->topextra->window
| 0 | ||||||||||||||||||||||||||||||||||||
| 1080 | extra->topextra->window->destroy(); | - | ||||||||||||||||||||||||||||||||||||
| 1081 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1082 | delete extra->topextra->window; | - | ||||||||||||||||||||||||||||||||||||
| 1083 | extra->topextra->window = 0; | - | ||||||||||||||||||||||||||||||||||||
| 1084 | - | |||||||||||||||||||||||||||||||||||||
| 1085 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1086 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1087 | - | |||||||||||||||||||||||||||||||||||||
| 1088 | - | |||||||||||||||||||||||||||||||||||||
| 1089 | - | |||||||||||||||||||||||||||||||||||||
| 1090 | - | |||||||||||||||||||||||||||||||||||||
| 1091 | - | |||||||||||||||||||||||||||||||||||||
| 1092 | - | |||||||||||||||||||||||||||||||||||||
| 1093 | bool QWidgetPrivate::isOverlapped(const QRect &rect) const | - | ||||||||||||||||||||||||||||||||||||
| 1094 | { | - | ||||||||||||||||||||||||||||||||||||
| 1095 | const QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1096 | - | |||||||||||||||||||||||||||||||||||||
| 1097 | const QWidget *w = q; | - | ||||||||||||||||||||||||||||||||||||
| 1098 | QRect r = rect; | - | ||||||||||||||||||||||||||||||||||||
| 1099 | while (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 1100 | if (w->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1101 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 1102 | QWidgetPrivate *pd = w->parentWidget()->d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1103 | bool above = false; | - | ||||||||||||||||||||||||||||||||||||
| 1104 | for (int i = 0; i < pd->children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1105 | QWidget *sibling = qobject_cast<QWidget *>(pd->children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 1106 | if (!sibling
| 0 | ||||||||||||||||||||||||||||||||||||
| 1107 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 1108 | if (!above
| 0 | ||||||||||||||||||||||||||||||||||||
| 1109 | above = (sibling == w); | - | ||||||||||||||||||||||||||||||||||||
| 1110 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 1111 | } | - | ||||||||||||||||||||||||||||||||||||
| 1112 | - | |||||||||||||||||||||||||||||||||||||
| 1113 | if (qRectIntersects(sibling->d_func()->effectiveRectFor(sibling->data->crect), r)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1114 | const QWExtra *siblingExtra = sibling->d_func()->extra; | - | ||||||||||||||||||||||||||||||||||||
| 1115 | if (siblingExtra
| 0 | ||||||||||||||||||||||||||||||||||||
| 1116 | && !siblingExtra->mask.translated(sibling->data->crect.topLeft()).intersects(r)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1117 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 1118 | } | - | ||||||||||||||||||||||||||||||||||||
| 1119 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 1120 | } | - | ||||||||||||||||||||||||||||||||||||
| 1121 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1122 | w = w->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 1123 | r.translate(pd->data.crect.topLeft()); | - | ||||||||||||||||||||||||||||||||||||
| 1124 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1125 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 1126 | } | - | ||||||||||||||||||||||||||||||||||||
| 1127 | - | |||||||||||||||||||||||||||||||||||||
| 1128 | void QWidgetPrivate::syncBackingStore() | - | ||||||||||||||||||||||||||||||||||||
| 1129 | { | - | ||||||||||||||||||||||||||||||||||||
| 1130 | if (paintOnScreen()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1131 | repaint_sys(dirty); | - | ||||||||||||||||||||||||||||||||||||
| 1132 | dirty = QRegion(); | - | ||||||||||||||||||||||||||||||||||||
| 1133 | } never executed: else if (QWidgetBackingStore *bs = maybeBackingStore()end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 1134 | bs->sync(); | - | ||||||||||||||||||||||||||||||||||||
| 1135 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1136 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1137 | - | |||||||||||||||||||||||||||||||||||||
| 1138 | void QWidgetPrivate::syncBackingStore(const QRegion ®ion) | - | ||||||||||||||||||||||||||||||||||||
| 1139 | { | - | ||||||||||||||||||||||||||||||||||||
| 1140 | if (paintOnScreen()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1141 | repaint_sys(region); never executed: repaint_sys(region); | 0 | ||||||||||||||||||||||||||||||||||||
| 1142 | else if (QWidgetBackingStore *bs = maybeBackingStore()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1143 | bs->sync(q_func(), region); | - | ||||||||||||||||||||||||||||||||||||
| 1144 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1145 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1146 | - | |||||||||||||||||||||||||||||||||||||
| 1147 | void QWidgetPrivate::setUpdatesEnabled_helper(bool enable) | - | ||||||||||||||||||||||||||||||||||||
| 1148 | { | - | ||||||||||||||||||||||||||||||||||||
| 1149 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1150 | - | |||||||||||||||||||||||||||||||||||||
| 1151 | if (enable
| 0 | ||||||||||||||||||||||||||||||||||||
| 1152 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1153 | - | |||||||||||||||||||||||||||||||||||||
| 1154 | if (enable != q->testAttribute(Qt::WA_UpdatesDisabled)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1155 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1156 | - | |||||||||||||||||||||||||||||||||||||
| 1157 | q->setAttribute(Qt::WA_UpdatesDisabled, !enable); | - | ||||||||||||||||||||||||||||||||||||
| 1158 | if (enable
| 0 | ||||||||||||||||||||||||||||||||||||
| 1159 | q->update(); never executed: q->update(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1160 | - | |||||||||||||||||||||||||||||||||||||
| 1161 | Qt::WidgetAttribute attribute = enable
| 0 | ||||||||||||||||||||||||||||||||||||
| 1162 | for (int i = 0; i < children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1163 | QWidget *w = qobject_cast<QWidget *>(children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 1164 | if (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 1165 | w->d_func()->setUpdatesEnabled_helper(enable); never executed: w->d_func()->setUpdatesEnabled_helper(enable); | 0 | ||||||||||||||||||||||||||||||||||||
| 1166 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1167 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1168 | void QWidgetPrivate::propagatePaletteChange() | - | ||||||||||||||||||||||||||||||||||||
| 1169 | { | - | ||||||||||||||||||||||||||||||||||||
| 1170 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1171 | - | |||||||||||||||||||||||||||||||||||||
| 1172 | - | |||||||||||||||||||||||||||||||||||||
| 1173 | if (!q->parentWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1174 | QGraphicsProxyWidget *p = extra->proxyWidget; | - | ||||||||||||||||||||||||||||||||||||
| 1175 | inheritedPaletteResolveMask = p->d_func()->inheritedPaletteResolveMask | p->palette().resolve(); | - | ||||||||||||||||||||||||||||||||||||
| 1176 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1177 | - | |||||||||||||||||||||||||||||||||||||
| 1178 | if (q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1179 | inheritedPaletteResolveMask = 0; | - | ||||||||||||||||||||||||||||||||||||
| 1180 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1181 | int mask = data.pal.resolve() | inheritedPaletteResolveMask; | - | ||||||||||||||||||||||||||||||||||||
| 1182 | - | |||||||||||||||||||||||||||||||||||||
| 1183 | const bool useStyleSheetPropagationInWidgetStyles = | - | ||||||||||||||||||||||||||||||||||||
| 1184 | QCoreApplication::testAttribute(Qt::AA_UseStyleSheetPropagationInWidgetStyles); | - | ||||||||||||||||||||||||||||||||||||
| 1185 | - | |||||||||||||||||||||||||||||||||||||
| 1186 | QEvent pc(QEvent::PaletteChange); | - | ||||||||||||||||||||||||||||||||||||
| 1187 | QApplication::sendEvent(q, &pc); | - | ||||||||||||||||||||||||||||||||||||
| 1188 | for (int i = 0; i < children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1189 | QWidget *w = qobject_cast<QWidget*>(children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 1190 | if (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 1191 | && (!w->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1192 | QWidgetPrivate *wd = w->d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1193 | wd->inheritedPaletteResolveMask = mask; | - | ||||||||||||||||||||||||||||||||||||
| 1194 | wd->resolvePalette(); | - | ||||||||||||||||||||||||||||||||||||
| 1195 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1196 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1197 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1198 | - | |||||||||||||||||||||||||||||||||||||
| 1199 | - | |||||||||||||||||||||||||||||||||||||
| 1200 | - | |||||||||||||||||||||||||||||||||||||
| 1201 | - | |||||||||||||||||||||||||||||||||||||
| 1202 | QRect QWidgetPrivate::clipRect() const | - | ||||||||||||||||||||||||||||||||||||
| 1203 | { | - | ||||||||||||||||||||||||||||||||||||
| 1204 | const QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1205 | const QWidget * w = q; | - | ||||||||||||||||||||||||||||||||||||
| 1206 | if (!w->isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1207 | return never executed: QRect();return QRect();never executed: return QRect(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1208 | QRect r = effectiveRectFor(q->rect()); | - | ||||||||||||||||||||||||||||||||||||
| 1209 | int ox = 0; | - | ||||||||||||||||||||||||||||||||||||
| 1210 | int oy = 0; | - | ||||||||||||||||||||||||||||||||||||
| 1211 | while (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 1212 | && w->isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1213 | && !w->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1214 | && w->parentWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1215 | ox -= w->x(); | - | ||||||||||||||||||||||||||||||||||||
| 1216 | oy -= w->y(); | - | ||||||||||||||||||||||||||||||||||||
| 1217 | w = w->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 1218 | r &= QRect(ox, oy, w->width(), w->height()); | - | ||||||||||||||||||||||||||||||||||||
| 1219 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1220 | return never executed: r;return r;never executed: return r; | 0 | ||||||||||||||||||||||||||||||||||||
| 1221 | } | - | ||||||||||||||||||||||||||||||||||||
| 1222 | - | |||||||||||||||||||||||||||||||||||||
| 1223 | - | |||||||||||||||||||||||||||||||||||||
| 1224 | - | |||||||||||||||||||||||||||||||||||||
| 1225 | - | |||||||||||||||||||||||||||||||||||||
| 1226 | QRegion QWidgetPrivate::clipRegion() const | - | ||||||||||||||||||||||||||||||||||||
| 1227 | { | - | ||||||||||||||||||||||||||||||||||||
| 1228 | const QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1229 | if (!q->isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1230 | return never executed: QRegion();return QRegion();never executed: return QRegion(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1231 | QRegion r(q->rect()); | - | ||||||||||||||||||||||||||||||||||||
| 1232 | const QWidget * w = q; | - | ||||||||||||||||||||||||||||||||||||
| 1233 | const QWidget *ignoreUpTo; | - | ||||||||||||||||||||||||||||||||||||
| 1234 | int ox = 0; | - | ||||||||||||||||||||||||||||||||||||
| 1235 | int oy = 0; | - | ||||||||||||||||||||||||||||||||||||
| 1236 | while (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 1237 | && w->isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1238 | && !w->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1239 | && w->parentWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1240 | ox -= w->x(); | - | ||||||||||||||||||||||||||||||||||||
| 1241 | oy -= w->y(); | - | ||||||||||||||||||||||||||||||||||||
| 1242 | ignoreUpTo = w; | - | ||||||||||||||||||||||||||||||||||||
| 1243 | w = w->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 1244 | r &= QRegion(ox, oy, w->width(), w->height()); | - | ||||||||||||||||||||||||||||||||||||
| 1245 | - | |||||||||||||||||||||||||||||||||||||
| 1246 | int i = 0; | - | ||||||||||||||||||||||||||||||||||||
| 1247 | while(w->d_func()->children.at(i++) != static_cast<const QObject *>(ignoreUpTo)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1248 | ; never executed: ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1249 | for ( ; i < w->d_func()->children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1250 | if(QWidget *sibling = qobject_cast<QWidget *>(w->d_func()->children.at(i))
| 0 | ||||||||||||||||||||||||||||||||||||
| 1251 | if(sibling->isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1252 | QRect siblingRect(ox+sibling->x(), oy+sibling->y(), | - | ||||||||||||||||||||||||||||||||||||
| 1253 | sibling->width(), sibling->height()); | - | ||||||||||||||||||||||||||||||||||||
| 1254 | if (qRectIntersects(siblingRect, q->rect())
| 0 | ||||||||||||||||||||||||||||||||||||
| 1255 | r -= QRegion(siblingRect); never executed: r -= QRegion(siblingRect); | 0 | ||||||||||||||||||||||||||||||||||||
| 1256 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1257 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1258 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1259 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1260 | return never executed: r;return r;never executed: return r; | 0 | ||||||||||||||||||||||||||||||||||||
| 1261 | } | - | ||||||||||||||||||||||||||||||||||||
| 1262 | - | |||||||||||||||||||||||||||||||||||||
| 1263 | void QWidgetPrivate::setSystemClip(QPaintDevice *paintDevice, const QRegion ®ion) | - | ||||||||||||||||||||||||||||||||||||
| 1264 | { | - | ||||||||||||||||||||||||||||||||||||
| 1265 | - | |||||||||||||||||||||||||||||||||||||
| 1266 | QPaintEngine *paintEngine = paintDevice->paintEngine(); | - | ||||||||||||||||||||||||||||||||||||
| 1267 | QTransform scaleTransform; | - | ||||||||||||||||||||||||||||||||||||
| 1268 | const qreal devicePixelRatio = paintDevice->devicePixelRatioF(); | - | ||||||||||||||||||||||||||||||||||||
| 1269 | scaleTransform.scale(devicePixelRatio, devicePixelRatio); | - | ||||||||||||||||||||||||||||||||||||
| 1270 | paintEngine->d_func()->systemClip = scaleTransform.map(region); | - | ||||||||||||||||||||||||||||||||||||
| 1271 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1272 | - | |||||||||||||||||||||||||||||||||||||
| 1273 | - | |||||||||||||||||||||||||||||||||||||
| 1274 | void QWidgetPrivate::invalidateGraphicsEffectsRecursively() | - | ||||||||||||||||||||||||||||||||||||
| 1275 | { | - | ||||||||||||||||||||||||||||||||||||
| 1276 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1277 | QWidget *w = q; | - | ||||||||||||||||||||||||||||||||||||
| 1278 | do { | - | ||||||||||||||||||||||||||||||||||||
| 1279 | if (w->graphicsEffect()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1280 | QWidgetEffectSourcePrivate *sourced = | - | ||||||||||||||||||||||||||||||||||||
| 1281 | static_cast<QWidgetEffectSourcePrivate *>(w->graphicsEffect()->source()->d_func()); | - | ||||||||||||||||||||||||||||||||||||
| 1282 | if (!sourced->updateDueToGraphicsEffect
| 0 | ||||||||||||||||||||||||||||||||||||
| 1283 | w->graphicsEffect()->source()->d_func()->invalidateCache(); never executed: w->graphicsEffect()->source()->d_func()->invalidateCache(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1284 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1285 | w = w->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 1286 | } never executed: while (wend of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 1287 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1288 | - | |||||||||||||||||||||||||||||||||||||
| 1289 | - | |||||||||||||||||||||||||||||||||||||
| 1290 | void QWidgetPrivate::setDirtyOpaqueRegion() | - | ||||||||||||||||||||||||||||||||||||
| 1291 | { | - | ||||||||||||||||||||||||||||||||||||
| 1292 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1293 | - | |||||||||||||||||||||||||||||||||||||
| 1294 | dirtyOpaqueChildren = true; | - | ||||||||||||||||||||||||||||||||||||
| 1295 | - | |||||||||||||||||||||||||||||||||||||
| 1296 | - | |||||||||||||||||||||||||||||||||||||
| 1297 | invalidateGraphicsEffectsRecursively(); | - | ||||||||||||||||||||||||||||||||||||
| 1298 | - | |||||||||||||||||||||||||||||||||||||
| 1299 | - | |||||||||||||||||||||||||||||||||||||
| 1300 | if (q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1301 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1302 | - | |||||||||||||||||||||||||||||||||||||
| 1303 | QWidget *parent = q->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 1304 | if (!parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 1305 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1306 | - | |||||||||||||||||||||||||||||||||||||
| 1307 | - | |||||||||||||||||||||||||||||||||||||
| 1308 | QWidgetPrivate *pd = parent->d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1309 | if (!pd->dirtyOpaqueChildren
| 0 | ||||||||||||||||||||||||||||||||||||
| 1310 | pd->setDirtyOpaqueRegion(); never executed: pd->setDirtyOpaqueRegion(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1311 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1312 | - | |||||||||||||||||||||||||||||||||||||
| 1313 | const QRegion &QWidgetPrivate::getOpaqueChildren() const | - | ||||||||||||||||||||||||||||||||||||
| 1314 | { | - | ||||||||||||||||||||||||||||||||||||
| 1315 | if (!dirtyOpaqueChildren
| 0 | ||||||||||||||||||||||||||||||||||||
| 1316 | return never executed: opaqueChildren;return opaqueChildren;never executed: return opaqueChildren; | 0 | ||||||||||||||||||||||||||||||||||||
| 1317 | - | |||||||||||||||||||||||||||||||||||||
| 1318 | QWidgetPrivate *that = const_cast<QWidgetPrivate*>(this); | - | ||||||||||||||||||||||||||||||||||||
| 1319 | that->opaqueChildren = QRegion(); | - | ||||||||||||||||||||||||||||||||||||
| 1320 | - | |||||||||||||||||||||||||||||||||||||
| 1321 | for (int i = 0; i < children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1322 | QWidget *child = qobject_cast<QWidget *>(children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 1323 | if (!child
| 0 | ||||||||||||||||||||||||||||||||||||
| 1324 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 1325 | - | |||||||||||||||||||||||||||||||||||||
| 1326 | const QPoint offset = child->geometry().topLeft(); | - | ||||||||||||||||||||||||||||||||||||
| 1327 | QWidgetPrivate *childd = child->d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1328 | QRegion r = childd->isOpaque
| 0 | ||||||||||||||||||||||||||||||||||||
| 1329 | if (childd->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 1330 | r &= childd->extra->mask; never executed: r &= childd->extra->mask; | 0 | ||||||||||||||||||||||||||||||||||||
| 1331 | if (r.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1332 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 1333 | r.translate(offset); | - | ||||||||||||||||||||||||||||||||||||
| 1334 | that->opaqueChildren += r; | - | ||||||||||||||||||||||||||||||||||||
| 1335 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1336 | - | |||||||||||||||||||||||||||||||||||||
| 1337 | that->opaqueChildren &= q_func()->rect(); | - | ||||||||||||||||||||||||||||||||||||
| 1338 | that->dirtyOpaqueChildren = false; | - | ||||||||||||||||||||||||||||||||||||
| 1339 | - | |||||||||||||||||||||||||||||||||||||
| 1340 | return never executed: that->opaqueChildren;return that->opaqueChildren;never executed: return that->opaqueChildren; | 0 | ||||||||||||||||||||||||||||||||||||
| 1341 | } | - | ||||||||||||||||||||||||||||||||||||
| 1342 | - | |||||||||||||||||||||||||||||||||||||
| 1343 | void QWidgetPrivate::subtractOpaqueChildren(QRegion &source, const QRect &clipRect) const | - | ||||||||||||||||||||||||||||||||||||
| 1344 | { | - | ||||||||||||||||||||||||||||||||||||
| 1345 | if (children.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1346 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1347 | - | |||||||||||||||||||||||||||||||||||||
| 1348 | const QRegion &r = getOpaqueChildren(); | - | ||||||||||||||||||||||||||||||||||||
| 1349 | if (!r.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1350 | source -= (r & clipRect); never executed: source -= (r & clipRect); | 0 | ||||||||||||||||||||||||||||||||||||
| 1351 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1352 | - | |||||||||||||||||||||||||||||||||||||
| 1353 | - | |||||||||||||||||||||||||||||||||||||
| 1354 | void QWidgetPrivate::subtractOpaqueSiblings(QRegion &sourceRegion, bool *hasDirtySiblingsAbove, | - | ||||||||||||||||||||||||||||||||||||
| 1355 | bool alsoNonOpaque) const | - | ||||||||||||||||||||||||||||||||||||
| 1356 | { | - | ||||||||||||||||||||||||||||||||||||
| 1357 | const QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1358 | static int disableSubtractOpaqueSiblings = qEnvironmentVariableIntValue("QT_NO_SUBTRACTOPAQUESIBLINGS"); | - | ||||||||||||||||||||||||||||||||||||
| 1359 | if (disableSubtractOpaqueSiblings
| 0 | ||||||||||||||||||||||||||||||||||||
| 1360 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1361 | - | |||||||||||||||||||||||||||||||||||||
| 1362 | - | |||||||||||||||||||||||||||||||||||||
| 1363 | - | |||||||||||||||||||||||||||||||||||||
| 1364 | - | |||||||||||||||||||||||||||||||||||||
| 1365 | - | |||||||||||||||||||||||||||||||||||||
| 1366 | - | |||||||||||||||||||||||||||||||||||||
| 1367 | QRect clipBoundingRect; | - | ||||||||||||||||||||||||||||||||||||
| 1368 | bool dirtyClipBoundingRect = true; | - | ||||||||||||||||||||||||||||||||||||
| 1369 | - | |||||||||||||||||||||||||||||||||||||
| 1370 | QRegion parentClip; | - | ||||||||||||||||||||||||||||||||||||
| 1371 | bool dirtyParentClip = true; | - | ||||||||||||||||||||||||||||||||||||
| 1372 | - | |||||||||||||||||||||||||||||||||||||
| 1373 | QPoint parentOffset = data.crect.topLeft(); | - | ||||||||||||||||||||||||||||||||||||
| 1374 | - | |||||||||||||||||||||||||||||||||||||
| 1375 | const QWidget *w = q; | - | ||||||||||||||||||||||||||||||||||||
| 1376 | - | |||||||||||||||||||||||||||||||||||||
| 1377 | while (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 1378 | if (w->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1379 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 1380 | QWidgetPrivate *pd = w->parentWidget()->d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1381 | const int myIndex = pd->children.indexOf(const_cast<QWidget *>(w)); | - | ||||||||||||||||||||||||||||||||||||
| 1382 | const QRect widgetGeometry = w->d_func()->effectiveRectFor(w->data->crect); | - | ||||||||||||||||||||||||||||||||||||
| 1383 | for (int i = myIndex + 1; i < pd->children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1384 | QWidget *sibling = qobject_cast<QWidget *>(pd->children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 1385 | if (!sibling
| 0 | ||||||||||||||||||||||||||||||||||||
| 1386 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 1387 | - | |||||||||||||||||||||||||||||||||||||
| 1388 | const QRect siblingGeometry = sibling->d_func()->effectiveRectFor(sibling->data->crect); | - | ||||||||||||||||||||||||||||||||||||
| 1389 | if (!qRectIntersects(siblingGeometry, widgetGeometry)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1390 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 1391 | - | |||||||||||||||||||||||||||||||||||||
| 1392 | if (dirtyClipBoundingRect
| 0 | ||||||||||||||||||||||||||||||||||||
| 1393 | clipBoundingRect = sourceRegion.boundingRect(); | - | ||||||||||||||||||||||||||||||||||||
| 1394 | dirtyClipBoundingRect = false; | - | ||||||||||||||||||||||||||||||||||||
| 1395 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1396 | - | |||||||||||||||||||||||||||||||||||||
| 1397 | if (!qRectIntersects(siblingGeometry, clipBoundingRect.translated(parentOffset))
| 0 | ||||||||||||||||||||||||||||||||||||
| 1398 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 1399 | - | |||||||||||||||||||||||||||||||||||||
| 1400 | if (dirtyParentClip
| 0 | ||||||||||||||||||||||||||||||||||||
| 1401 | parentClip = sourceRegion.translated(parentOffset); | - | ||||||||||||||||||||||||||||||||||||
| 1402 | dirtyParentClip = false; | - | ||||||||||||||||||||||||||||||||||||
| 1403 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1404 | - | |||||||||||||||||||||||||||||||||||||
| 1405 | const QPoint siblingPos(sibling->data->crect.topLeft()); | - | ||||||||||||||||||||||||||||||||||||
| 1406 | const QRect siblingClipRect(sibling->d_func()->clipRect()); | - | ||||||||||||||||||||||||||||||||||||
| 1407 | QRegion siblingDirty(parentClip); | - | ||||||||||||||||||||||||||||||||||||
| 1408 | siblingDirty &= (siblingClipRect.translated(siblingPos)); | - | ||||||||||||||||||||||||||||||||||||
| 1409 | const bool hasMask = sibling->d_func()->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 1410 | && !sibling->d_func()->graphicsEffect
| 0 | ||||||||||||||||||||||||||||||||||||
| 1411 | if (hasMask
| 0 | ||||||||||||||||||||||||||||||||||||
| 1412 | siblingDirty &= sibling->d_func()->extra->mask.translated(siblingPos); never executed: siblingDirty &= sibling->d_func()->extra->mask.translated(siblingPos); | 0 | ||||||||||||||||||||||||||||||||||||
| 1413 | if (siblingDirty.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1414 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 1415 | - | |||||||||||||||||||||||||||||||||||||
| 1416 | if (sibling->d_func()->isOpaque
| 0 | ||||||||||||||||||||||||||||||||||||
| 1417 | if (hasMask
| 0 | ||||||||||||||||||||||||||||||||||||
| 1418 | siblingDirty.translate(-parentOffset); | - | ||||||||||||||||||||||||||||||||||||
| 1419 | sourceRegion -= siblingDirty; | - | ||||||||||||||||||||||||||||||||||||
| 1420 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1421 | sourceRegion -= siblingGeometry.translated(-parentOffset); | - | ||||||||||||||||||||||||||||||||||||
| 1422 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1423 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 1424 | if (hasDirtySiblingsAbove
| 0 | ||||||||||||||||||||||||||||||||||||
| 1425 | * never executed: hasDirtySiblingsAbove = true;*hasDirtySiblingsAbove = true;never executed: *hasDirtySiblingsAbove = true; | 0 | ||||||||||||||||||||||||||||||||||||
| 1426 | if (sibling->d_func()->children.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1427 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 1428 | QRegion opaqueSiblingChildren(sibling->d_func()->getOpaqueChildren()); | - | ||||||||||||||||||||||||||||||||||||
| 1429 | opaqueSiblingChildren.translate(-parentOffset + siblingPos); | - | ||||||||||||||||||||||||||||||||||||
| 1430 | sourceRegion -= opaqueSiblingChildren; | - | ||||||||||||||||||||||||||||||||||||
| 1431 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1432 | if (sourceRegion.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1433 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1434 | - | |||||||||||||||||||||||||||||||||||||
| 1435 | dirtyClipBoundingRect = true; | - | ||||||||||||||||||||||||||||||||||||
| 1436 | dirtyParentClip = true; | - | ||||||||||||||||||||||||||||||||||||
| 1437 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1438 | - | |||||||||||||||||||||||||||||||||||||
| 1439 | w = w->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 1440 | parentOffset += pd->data.crect.topLeft(); | - | ||||||||||||||||||||||||||||||||||||
| 1441 | dirtyParentClip = true; | - | ||||||||||||||||||||||||||||||||||||
| 1442 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1443 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1444 | - | |||||||||||||||||||||||||||||||||||||
| 1445 | void QWidgetPrivate::clipToEffectiveMask(QRegion ®ion) const | - | ||||||||||||||||||||||||||||||||||||
| 1446 | { | - | ||||||||||||||||||||||||||||||||||||
| 1447 | const QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1448 | - | |||||||||||||||||||||||||||||||||||||
| 1449 | const QWidget *w = q; | - | ||||||||||||||||||||||||||||||||||||
| 1450 | QPoint offset; | - | ||||||||||||||||||||||||||||||||||||
| 1451 | - | |||||||||||||||||||||||||||||||||||||
| 1452 | - | |||||||||||||||||||||||||||||||||||||
| 1453 | if (graphicsEffect
| 0 | ||||||||||||||||||||||||||||||||||||
| 1454 | w = q->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 1455 | offset -= data.crect.topLeft(); | - | ||||||||||||||||||||||||||||||||||||
| 1456 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1457 | - | |||||||||||||||||||||||||||||||||||||
| 1458 | - | |||||||||||||||||||||||||||||||||||||
| 1459 | while (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 1460 | const QWidgetPrivate *wd = w->d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1461 | if (wd->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 1462 | region &= (
never executed: region &= (w != q) ? wd->extra->mask.translated(offset) : wd->extra->mask; | 0 | ||||||||||||||||||||||||||||||||||||
| 1463 | if (w->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1464 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1465 | offset -= wd->data.crect.topLeft(); | - | ||||||||||||||||||||||||||||||||||||
| 1466 | w = w->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 1467 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1468 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1469 | - | |||||||||||||||||||||||||||||||||||||
| 1470 | bool QWidgetPrivate::paintOnScreen() const | - | ||||||||||||||||||||||||||||||||||||
| 1471 | { | - | ||||||||||||||||||||||||||||||||||||
| 1472 | - | |||||||||||||||||||||||||||||||||||||
| 1473 | - | |||||||||||||||||||||||||||||||||||||
| 1474 | - | |||||||||||||||||||||||||||||||||||||
| 1475 | const QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1476 | if (q->testAttribute(Qt::WA_PaintOnScreen)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1477 | || (!q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1478 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 1479 | } | - | ||||||||||||||||||||||||||||||||||||
| 1480 | - | |||||||||||||||||||||||||||||||||||||
| 1481 | return never executed: !qt_enable_backingstore;return !qt_enable_backingstore;never executed: return !qt_enable_backingstore; | 0 | ||||||||||||||||||||||||||||||||||||
| 1482 | - | |||||||||||||||||||||||||||||||||||||
| 1483 | } | - | ||||||||||||||||||||||||||||||||||||
| 1484 | - | |||||||||||||||||||||||||||||||||||||
| 1485 | void QWidgetPrivate::updateIsOpaque() | - | ||||||||||||||||||||||||||||||||||||
| 1486 | { | - | ||||||||||||||||||||||||||||||||||||
| 1487 | - | |||||||||||||||||||||||||||||||||||||
| 1488 | setDirtyOpaqueRegion(); | - | ||||||||||||||||||||||||||||||||||||
| 1489 | - | |||||||||||||||||||||||||||||||||||||
| 1490 | - | |||||||||||||||||||||||||||||||||||||
| 1491 | if (graphicsEffect
| 0 | ||||||||||||||||||||||||||||||||||||
| 1492 | - | |||||||||||||||||||||||||||||||||||||
| 1493 | setOpaque(false); | - | ||||||||||||||||||||||||||||||||||||
| 1494 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1495 | } | - | ||||||||||||||||||||||||||||||||||||
| 1496 | - | |||||||||||||||||||||||||||||||||||||
| 1497 | - | |||||||||||||||||||||||||||||||||||||
| 1498 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1499 | - | |||||||||||||||||||||||||||||||||||||
| 1500 | - | |||||||||||||||||||||||||||||||||||||
| 1501 | - | |||||||||||||||||||||||||||||||||||||
| 1502 | - | |||||||||||||||||||||||||||||||||||||
| 1503 | - | |||||||||||||||||||||||||||||||||||||
| 1504 | - | |||||||||||||||||||||||||||||||||||||
| 1505 | - | |||||||||||||||||||||||||||||||||||||
| 1506 | if (q->testAttribute(Qt::WA_OpaquePaintEvent)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1507 | setOpaque(true); | - | ||||||||||||||||||||||||||||||||||||
| 1508 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1509 | } | - | ||||||||||||||||||||||||||||||||||||
| 1510 | - | |||||||||||||||||||||||||||||||||||||
| 1511 | const QPalette &pal = q->palette(); | - | ||||||||||||||||||||||||||||||||||||
| 1512 | - | |||||||||||||||||||||||||||||||||||||
| 1513 | if (q->autoFillBackground()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1514 | const QBrush &autoFillBrush = pal.brush(q->backgroundRole()); | - | ||||||||||||||||||||||||||||||||||||
| 1515 | if (autoFillBrush.style() != Qt::NoBrush
| 0 | ||||||||||||||||||||||||||||||||||||
| 1516 | setOpaque(true); | - | ||||||||||||||||||||||||||||||||||||
| 1517 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1518 | } | - | ||||||||||||||||||||||||||||||||||||
| 1519 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1520 | - | |||||||||||||||||||||||||||||||||||||
| 1521 | if (q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1522 | const QBrush &windowBrush = q->palette().brush(QPalette::Window); | - | ||||||||||||||||||||||||||||||||||||
| 1523 | if (windowBrush.style() != Qt::NoBrush
| 0 | ||||||||||||||||||||||||||||||||||||
| 1524 | setOpaque(true); | - | ||||||||||||||||||||||||||||||||||||
| 1525 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1526 | } | - | ||||||||||||||||||||||||||||||||||||
| 1527 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1528 | setOpaque(false); | - | ||||||||||||||||||||||||||||||||||||
| 1529 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1530 | - | |||||||||||||||||||||||||||||||||||||
| 1531 | void QWidgetPrivate::setOpaque(bool opaque) | - | ||||||||||||||||||||||||||||||||||||
| 1532 | { | - | ||||||||||||||||||||||||||||||||||||
| 1533 | if (isOpaque != opaque
| 0 | ||||||||||||||||||||||||||||||||||||
| 1534 | isOpaque = opaque; | - | ||||||||||||||||||||||||||||||||||||
| 1535 | updateIsTranslucent(); | - | ||||||||||||||||||||||||||||||||||||
| 1536 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1537 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1538 | - | |||||||||||||||||||||||||||||||||||||
| 1539 | void QWidgetPrivate::updateIsTranslucent() | - | ||||||||||||||||||||||||||||||||||||
| 1540 | { | - | ||||||||||||||||||||||||||||||||||||
| 1541 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1542 | if (QWindow *window = q->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1543 | QSurfaceFormat format = window->format(); | - | ||||||||||||||||||||||||||||||||||||
| 1544 | const int oldAlpha = format.alphaBufferSize(); | - | ||||||||||||||||||||||||||||||||||||
| 1545 | const int newAlpha = q->testAttribute(Qt::WA_TranslucentBackground)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1546 | if (oldAlpha != newAlpha
| 0 | ||||||||||||||||||||||||||||||||||||
| 1547 | format.setAlphaBufferSize(newAlpha); | - | ||||||||||||||||||||||||||||||||||||
| 1548 | window->setFormat(format); | - | ||||||||||||||||||||||||||||||||||||
| 1549 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1550 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1551 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1552 | - | |||||||||||||||||||||||||||||||||||||
| 1553 | static inline void fillRegion(QPainter *painter, const QRegion &rgn, const QBrush &brush) | - | ||||||||||||||||||||||||||||||||||||
| 1554 | { | - | ||||||||||||||||||||||||||||||||||||
| 1555 | ((!(painter)) ? qt_assert("painter",__FILE__,2395) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 1556 | - | |||||||||||||||||||||||||||||||||||||
| 1557 | if (brush.style() == Qt::TexturePattern
| 0 | ||||||||||||||||||||||||||||||||||||
| 1558 | - | |||||||||||||||||||||||||||||||||||||
| 1559 | - | |||||||||||||||||||||||||||||||||||||
| 1560 | - | |||||||||||||||||||||||||||||||||||||
| 1561 | - | |||||||||||||||||||||||||||||||||||||
| 1562 | - | |||||||||||||||||||||||||||||||||||||
| 1563 | - | |||||||||||||||||||||||||||||||||||||
| 1564 | - | |||||||||||||||||||||||||||||||||||||
| 1565 | { | - | ||||||||||||||||||||||||||||||||||||
| 1566 | const QRect rect(rgn.boundingRect()); | - | ||||||||||||||||||||||||||||||||||||
| 1567 | painter->setClipRegion(rgn); | - | ||||||||||||||||||||||||||||||||||||
| 1568 | painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft()); | - | ||||||||||||||||||||||||||||||||||||
| 1569 | } | - | ||||||||||||||||||||||||||||||||||||
| 1570 | - | |||||||||||||||||||||||||||||||||||||
| 1571 | - | |||||||||||||||||||||||||||||||||||||
| 1572 | } never executed: else if (brush.gradient()end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 1573 | && brush.gradient()->coordinateMode() == QGradient::ObjectBoundingMode
| 0 | ||||||||||||||||||||||||||||||||||||
| 1574 | painter->save(); | - | ||||||||||||||||||||||||||||||||||||
| 1575 | painter->setClipRegion(rgn); | - | ||||||||||||||||||||||||||||||||||||
| 1576 | painter->fillRect(0, 0, painter->device()->width(), painter->device()->height(), brush); | - | ||||||||||||||||||||||||||||||||||||
| 1577 | painter->restore(); | - | ||||||||||||||||||||||||||||||||||||
| 1578 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1579 | const QVector<QRect> &rects = rgn.rects(); | - | ||||||||||||||||||||||||||||||||||||
| 1580 | for (int i = 0; i < rects.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1581 | painter->fillRect(rects.at(i), brush); never executed: painter->fillRect(rects.at(i), brush); | 0 | ||||||||||||||||||||||||||||||||||||
| 1582 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1583 | } | - | ||||||||||||||||||||||||||||||||||||
| 1584 | - | |||||||||||||||||||||||||||||||||||||
| 1585 | void QWidgetPrivate::paintBackground(QPainter *painter, const QRegion &rgn, int flags) const | - | ||||||||||||||||||||||||||||||||||||
| 1586 | { | - | ||||||||||||||||||||||||||||||||||||
| 1587 | const QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1588 | - | |||||||||||||||||||||||||||||||||||||
| 1589 | - | |||||||||||||||||||||||||||||||||||||
| 1590 | bool resetBrushOrigin = false; | - | ||||||||||||||||||||||||||||||||||||
| 1591 | QPointF oldBrushOrigin; | - | ||||||||||||||||||||||||||||||||||||
| 1592 | - | |||||||||||||||||||||||||||||||||||||
| 1593 | QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea *>(parent); | - | ||||||||||||||||||||||||||||||||||||
| 1594 | if (scrollArea
| 0 | ||||||||||||||||||||||||||||||||||||
| 1595 | QObjectData *scrollPrivate = static_cast<QWidget *>(scrollArea)->d_ptr.data(); | - | ||||||||||||||||||||||||||||||||||||
| 1596 | QAbstractScrollAreaPrivate *priv = static_cast<QAbstractScrollAreaPrivate *>(scrollPrivate); | - | ||||||||||||||||||||||||||||||||||||
| 1597 | oldBrushOrigin = painter->brushOrigin(); | - | ||||||||||||||||||||||||||||||||||||
| 1598 | resetBrushOrigin = true; | - | ||||||||||||||||||||||||||||||||||||
| 1599 | painter->setBrushOrigin(-priv->contentsOffset()); | - | ||||||||||||||||||||||||||||||||||||
| 1600 | - | |||||||||||||||||||||||||||||||||||||
| 1601 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1602 | - | |||||||||||||||||||||||||||||||||||||
| 1603 | - | |||||||||||||||||||||||||||||||||||||
| 1604 | const QBrush autoFillBrush = q->palette().brush(q->backgroundRole()); | - | ||||||||||||||||||||||||||||||||||||
| 1605 | - | |||||||||||||||||||||||||||||||||||||
| 1606 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 1607 | const QBrush bg = q->palette().brush(QPalette::Window); | - | ||||||||||||||||||||||||||||||||||||
| 1608 | if (!(flags & DontSetCompositionMode)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1609 | - | |||||||||||||||||||||||||||||||||||||
| 1610 | QPainter::CompositionMode oldMode = painter->compositionMode(); | - | ||||||||||||||||||||||||||||||||||||
| 1611 | painter->setCompositionMode(QPainter::CompositionMode_Source); | - | ||||||||||||||||||||||||||||||||||||
| 1612 | fillRegion(painter, rgn, bg); | - | ||||||||||||||||||||||||||||||||||||
| 1613 | painter->setCompositionMode(oldMode); | - | ||||||||||||||||||||||||||||||||||||
| 1614 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1615 | fillRegion(painter, rgn, bg); | - | ||||||||||||||||||||||||||||||||||||
| 1616 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1617 | } | - | ||||||||||||||||||||||||||||||||||||
| 1618 | - | |||||||||||||||||||||||||||||||||||||
| 1619 | if (q->autoFillBackground()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1620 | fillRegion(painter, rgn, autoFillBrush); never executed: fillRegion(painter, rgn, autoFillBrush); | 0 | ||||||||||||||||||||||||||||||||||||
| 1621 | - | |||||||||||||||||||||||||||||||||||||
| 1622 | if (q->testAttribute(Qt::WA_StyledBackground)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1623 | painter->setClipRegion(rgn); | - | ||||||||||||||||||||||||||||||||||||
| 1624 | QStyleOption opt; | - | ||||||||||||||||||||||||||||||||||||
| 1625 | opt.initFrom(q); | - | ||||||||||||||||||||||||||||||||||||
| 1626 | q->style()->drawPrimitive(QStyle::PE_Widget, &opt, painter, q); | - | ||||||||||||||||||||||||||||||||||||
| 1627 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1628 | - | |||||||||||||||||||||||||||||||||||||
| 1629 | - | |||||||||||||||||||||||||||||||||||||
| 1630 | if (resetBrushOrigin
| 0 | ||||||||||||||||||||||||||||||||||||
| 1631 | painter->setBrushOrigin(oldBrushOrigin); never executed: painter->setBrushOrigin(oldBrushOrigin); | 0 | ||||||||||||||||||||||||||||||||||||
| 1632 | - | |||||||||||||||||||||||||||||||||||||
| 1633 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1634 | extern QWidget *qt_button_down; | - | ||||||||||||||||||||||||||||||||||||
| 1635 | - | |||||||||||||||||||||||||||||||||||||
| 1636 | - | |||||||||||||||||||||||||||||||||||||
| 1637 | void QWidgetPrivate::deactivateWidgetCleanup() | - | ||||||||||||||||||||||||||||||||||||
| 1638 | { | - | ||||||||||||||||||||||||||||||||||||
| 1639 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1640 | - | |||||||||||||||||||||||||||||||||||||
| 1641 | if (QApplication::activeWindow() == q
| 0 | ||||||||||||||||||||||||||||||||||||
| 1642 | QApplication::setActiveWindow(0); never executed: QApplication::setActiveWindow(0); | 0 | ||||||||||||||||||||||||||||||||||||
| 1643 | - | |||||||||||||||||||||||||||||||||||||
| 1644 | if (q == qt_button_down
| 0 | ||||||||||||||||||||||||||||||||||||
| 1645 | qt_button_down = 0; never executed: qt_button_down = 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 1646 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1647 | QWidget *QWidget::find(WId id) | - | ||||||||||||||||||||||||||||||||||||
| 1648 | { | - | ||||||||||||||||||||||||||||||||||||
| 1649 | return never executed: QWidgetPrivate::mapper ? QWidgetPrivate::mapper->value(id, 0) : 0;return QWidgetPrivate::mapper ? QWidgetPrivate::mapper->value(id, 0) : 0;never executed: return QWidgetPrivate::mapper ? QWidgetPrivate::mapper->value(id, 0) : 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 1650 | } | - | ||||||||||||||||||||||||||||||||||||
| 1651 | WId QWidget::winId() const | - | ||||||||||||||||||||||||||||||||||||
| 1652 | { | - | ||||||||||||||||||||||||||||||||||||
| 1653 | if (!testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1654 | - | |||||||||||||||||||||||||||||||||||||
| 1655 | - | |||||||||||||||||||||||||||||||||||||
| 1656 | - | |||||||||||||||||||||||||||||||||||||
| 1657 | QWidget *that = const_cast<QWidget*>(this); | - | ||||||||||||||||||||||||||||||||||||
| 1658 | that->setAttribute(Qt::WA_NativeWindow); | - | ||||||||||||||||||||||||||||||||||||
| 1659 | that->d_func()->createWinId(); | - | ||||||||||||||||||||||||||||||||||||
| 1660 | return never executed: that->data->winid;return that->data->winid;never executed: return that->data->winid; | 0 | ||||||||||||||||||||||||||||||||||||
| 1661 | } | - | ||||||||||||||||||||||||||||||||||||
| 1662 | return never executed: data->winid;return data->winid;never executed: return data->winid; | 0 | ||||||||||||||||||||||||||||||||||||
| 1663 | } | - | ||||||||||||||||||||||||||||||||||||
| 1664 | - | |||||||||||||||||||||||||||||||||||||
| 1665 | void QWidgetPrivate::createWinId() | - | ||||||||||||||||||||||||||||||||||||
| 1666 | { | - | ||||||||||||||||||||||||||||||||||||
| 1667 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1668 | - | |||||||||||||||||||||||||||||||||||||
| 1669 | - | |||||||||||||||||||||||||||||||||||||
| 1670 | - | |||||||||||||||||||||||||||||||||||||
| 1671 | - | |||||||||||||||||||||||||||||||||||||
| 1672 | const bool forceNativeWindow = q->testAttribute(Qt::WA_NativeWindow); | - | ||||||||||||||||||||||||||||||||||||
| 1673 | if (!q->testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1674 | if (!q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1675 | QWidget *parent = q->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 1676 | QWidgetPrivate *pd = parent->d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1677 | if (forceNativeWindow
| 0 | ||||||||||||||||||||||||||||||||||||
| 1678 | parent->setAttribute(Qt::WA_NativeWindow); never executed: parent->setAttribute(Qt::WA_NativeWindow); | 0 | ||||||||||||||||||||||||||||||||||||
| 1679 | if (!parent->internalWinId()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1680 | pd->createWinId(); | - | ||||||||||||||||||||||||||||||||||||
| 1681 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1682 | - | |||||||||||||||||||||||||||||||||||||
| 1683 | for (int i = 0; i < pd->children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1684 | QWidget *w = qobject_cast<QWidget *>(pd->children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 1685 | if (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 1686 | || (!w->internalWinId()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1687 | w->create(); | - | ||||||||||||||||||||||||||||||||||||
| 1688 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1689 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1690 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1691 | q->create(); | - | ||||||||||||||||||||||||||||||||||||
| 1692 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1693 | } | - | ||||||||||||||||||||||||||||||||||||
| 1694 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1695 | void QWidget::createWinId() | - | ||||||||||||||||||||||||||||||||||||
| 1696 | { | - | ||||||||||||||||||||||||||||||||||||
| 1697 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1698 | - | |||||||||||||||||||||||||||||||||||||
| 1699 | - | |||||||||||||||||||||||||||||||||||||
| 1700 | - | |||||||||||||||||||||||||||||||||||||
| 1701 | - | |||||||||||||||||||||||||||||||||||||
| 1702 | d->createWinId(); | - | ||||||||||||||||||||||||||||||||||||
| 1703 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1704 | WId QWidget::effectiveWinId() const | - | ||||||||||||||||||||||||||||||||||||
| 1705 | { | - | ||||||||||||||||||||||||||||||||||||
| 1706 | const WId id = internalWinId(); | - | ||||||||||||||||||||||||||||||||||||
| 1707 | if (id
| 0 | ||||||||||||||||||||||||||||||||||||
| 1708 | return never executed: id;return id;never executed: return id; | 0 | ||||||||||||||||||||||||||||||||||||
| 1709 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||
| 1710 | return never executed: realParent->internalWinId();return realParent->internalWinId();never executed: return realParent->internalWinId(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1711 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 1712 | } | - | ||||||||||||||||||||||||||||||||||||
| 1713 | QWindow *QWidget::windowHandle() const | - | ||||||||||||||||||||||||||||||||||||
| 1714 | { | - | ||||||||||||||||||||||||||||||||||||
| 1715 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1716 | QTLWExtra *extra = d->maybeTopData(); | - | ||||||||||||||||||||||||||||||||||||
| 1717 | if (extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 1718 | return never executed: extra->window;return extra->window;never executed: return extra->window; | 0 | ||||||||||||||||||||||||||||||||||||
| 1719 | - | |||||||||||||||||||||||||||||||||||||
| 1720 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 1721 | } | - | ||||||||||||||||||||||||||||||||||||
| 1722 | QString QWidget::styleSheet() const | - | ||||||||||||||||||||||||||||||||||||
| 1723 | { | - | ||||||||||||||||||||||||||||||||||||
| 1724 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1725 | if (!d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 1726 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1727 | return never executed: d->extra->styleSheet;return d->extra->styleSheet;never executed: return d->extra->styleSheet; | 0 | ||||||||||||||||||||||||||||||||||||
| 1728 | } | - | ||||||||||||||||||||||||||||||||||||
| 1729 | - | |||||||||||||||||||||||||||||||||||||
| 1730 | void QWidget::setStyleSheet(const QString& styleSheet) | - | ||||||||||||||||||||||||||||||||||||
| 1731 | { | - | ||||||||||||||||||||||||||||||||||||
| 1732 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1733 | if (data->in_destructor
| 0 | ||||||||||||||||||||||||||||||||||||
| 1734 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1735 | d->createExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 1736 | - | |||||||||||||||||||||||||||||||||||||
| 1737 | QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(d->extra->style); | - | ||||||||||||||||||||||||||||||||||||
| 1738 | d->extra->styleSheet = styleSheet; | - | ||||||||||||||||||||||||||||||||||||
| 1739 | if (styleSheet.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1740 | if (!proxy
| 0 | ||||||||||||||||||||||||||||||||||||
| 1741 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1742 | - | |||||||||||||||||||||||||||||||||||||
| 1743 | d->inheritStyle(); | - | ||||||||||||||||||||||||||||||||||||
| 1744 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1745 | } | - | ||||||||||||||||||||||||||||||||||||
| 1746 | - | |||||||||||||||||||||||||||||||||||||
| 1747 | if (proxy
| 0 | ||||||||||||||||||||||||||||||||||||
| 1748 | if (d->polished
| 0 | ||||||||||||||||||||||||||||||||||||
| 1749 | proxy->repolish(this); never executed: proxy->repolish(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 1750 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1751 | } | - | ||||||||||||||||||||||||||||||||||||
| 1752 | - | |||||||||||||||||||||||||||||||||||||
| 1753 | if (testAttribute(Qt::WA_SetStyle)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1754 | d->setStyle_helper(new QStyleSheetStyle(d->extra->style), true); | - | ||||||||||||||||||||||||||||||||||||
| 1755 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1756 | d->setStyle_helper(new QStyleSheetStyle(0), true); | - | ||||||||||||||||||||||||||||||||||||
| 1757 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1758 | } | - | ||||||||||||||||||||||||||||||||||||
| 1759 | - | |||||||||||||||||||||||||||||||||||||
| 1760 | - | |||||||||||||||||||||||||||||||||||||
| 1761 | - | |||||||||||||||||||||||||||||||||||||
| 1762 | - | |||||||||||||||||||||||||||||||||||||
| 1763 | - | |||||||||||||||||||||||||||||||||||||
| 1764 | - | |||||||||||||||||||||||||||||||||||||
| 1765 | - | |||||||||||||||||||||||||||||||||||||
| 1766 | QStyle *QWidget::style() const | - | ||||||||||||||||||||||||||||||||||||
| 1767 | { | - | ||||||||||||||||||||||||||||||||||||
| 1768 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1769 | - | |||||||||||||||||||||||||||||||||||||
| 1770 | if (d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 1771 | return never executed: d->extra->style;return d->extra->style;never executed: return d->extra->style; | 0 | ||||||||||||||||||||||||||||||||||||
| 1772 | return never executed: QApplication::style();return QApplication::style();never executed: return QApplication::style(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1773 | } | - | ||||||||||||||||||||||||||||||||||||
| 1774 | void QWidget::setStyle(QStyle *style) | - | ||||||||||||||||||||||||||||||||||||
| 1775 | { | - | ||||||||||||||||||||||||||||||||||||
| 1776 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1777 | setAttribute(Qt::WA_SetStyle, style != 0); | - | ||||||||||||||||||||||||||||||||||||
| 1778 | d->createExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 1779 | - | |||||||||||||||||||||||||||||||||||||
| 1780 | if (QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(style)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1781 | - | |||||||||||||||||||||||||||||||||||||
| 1782 | - | |||||||||||||||||||||||||||||||||||||
| 1783 | proxy->ref(); | - | ||||||||||||||||||||||||||||||||||||
| 1784 | d->setStyle_helper(style, false); | - | ||||||||||||||||||||||||||||||||||||
| 1785 | } never executed: else if (qobject_cast<QStyleSheetStyle *>(d->extra->style)end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 1786 | - | |||||||||||||||||||||||||||||||||||||
| 1787 | d->setStyle_helper(new QStyleSheetStyle(style), true); | - | ||||||||||||||||||||||||||||||||||||
| 1788 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1789 | - | |||||||||||||||||||||||||||||||||||||
| 1790 | d->setStyle_helper(style, false); never executed: d->setStyle_helper(style, false); | 0 | ||||||||||||||||||||||||||||||||||||
| 1791 | } | - | ||||||||||||||||||||||||||||||||||||
| 1792 | - | |||||||||||||||||||||||||||||||||||||
| 1793 | void QWidgetPrivate::setStyle_helper(QStyle *newStyle, bool propagate, bool | - | ||||||||||||||||||||||||||||||||||||
| 1794 | - | |||||||||||||||||||||||||||||||||||||
| 1795 | - | |||||||||||||||||||||||||||||||||||||
| 1796 | - | |||||||||||||||||||||||||||||||||||||
| 1797 | ) | - | ||||||||||||||||||||||||||||||||||||
| 1798 | { | - | ||||||||||||||||||||||||||||||||||||
| 1799 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1800 | QStyle *oldStyle = q->style(); | - | ||||||||||||||||||||||||||||||||||||
| 1801 | - | |||||||||||||||||||||||||||||||||||||
| 1802 | QPointer<QStyle> origStyle; | - | ||||||||||||||||||||||||||||||||||||
| 1803 | { | - | ||||||||||||||||||||||||||||||||||||
| 1804 | createExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 1805 | - | |||||||||||||||||||||||||||||||||||||
| 1806 | - | |||||||||||||||||||||||||||||||||||||
| 1807 | origStyle = extra->style.data(); | - | ||||||||||||||||||||||||||||||||||||
| 1808 | - | |||||||||||||||||||||||||||||||||||||
| 1809 | extra->style = newStyle; | - | ||||||||||||||||||||||||||||||||||||
| 1810 | } | - | ||||||||||||||||||||||||||||||||||||
| 1811 | - | |||||||||||||||||||||||||||||||||||||
| 1812 | - | |||||||||||||||||||||||||||||||||||||
| 1813 | if (q->windowType() != Qt::Desktop
| 0 | ||||||||||||||||||||||||||||||||||||
| 1814 | if (polished
| 0 | ||||||||||||||||||||||||||||||||||||
| 1815 | oldStyle->unpolish(q); | - | ||||||||||||||||||||||||||||||||||||
| 1816 | - | |||||||||||||||||||||||||||||||||||||
| 1817 | - | |||||||||||||||||||||||||||||||||||||
| 1818 | - | |||||||||||||||||||||||||||||||||||||
| 1819 | - | |||||||||||||||||||||||||||||||||||||
| 1820 | q->style()->polish(q); | - | ||||||||||||||||||||||||||||||||||||
| 1821 | - | |||||||||||||||||||||||||||||||||||||
| 1822 | - | |||||||||||||||||||||||||||||||||||||
| 1823 | - | |||||||||||||||||||||||||||||||||||||
| 1824 | - | |||||||||||||||||||||||||||||||||||||
| 1825 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1826 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1827 | - | |||||||||||||||||||||||||||||||||||||
| 1828 | if (propagate
| 0 | ||||||||||||||||||||||||||||||||||||
| 1829 | - | |||||||||||||||||||||||||||||||||||||
| 1830 | const QObjectList childrenList = children; | - | ||||||||||||||||||||||||||||||||||||
| 1831 | for (int i = 0; i < childrenList.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1832 | QWidget *c = qobject_cast<QWidget*>(childrenList.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 1833 | if (c
| 0 | ||||||||||||||||||||||||||||||||||||
| 1834 | c->d_func()->inheritStyle(); never executed: c->d_func()->inheritStyle(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1835 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1836 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1837 | - | |||||||||||||||||||||||||||||||||||||
| 1838 | - | |||||||||||||||||||||||||||||||||||||
| 1839 | if (!qobject_cast<QStyleSheetStyle*>(newStyle)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1840 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||
| 1841 | cssStyle->clearWidgetFont(q); | - | ||||||||||||||||||||||||||||||||||||
| 1842 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1843 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1844 | - | |||||||||||||||||||||||||||||||||||||
| 1845 | - | |||||||||||||||||||||||||||||||||||||
| 1846 | QEvent e(QEvent::StyleChange); | - | ||||||||||||||||||||||||||||||||||||
| 1847 | QApplication::sendEvent(q, &e); | - | ||||||||||||||||||||||||||||||||||||
| 1848 | - | |||||||||||||||||||||||||||||||||||||
| 1849 | - | |||||||||||||||||||||||||||||||||||||
| 1850 | - | |||||||||||||||||||||||||||||||||||||
| 1851 | if (QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(origStyle.data())
| 0 | ||||||||||||||||||||||||||||||||||||
| 1852 | proxy->deref(); never executed: proxy->deref(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1853 | - | |||||||||||||||||||||||||||||||||||||
| 1854 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1855 | - | |||||||||||||||||||||||||||||||||||||
| 1856 | - | |||||||||||||||||||||||||||||||||||||
| 1857 | void QWidgetPrivate::inheritStyle() | - | ||||||||||||||||||||||||||||||||||||
| 1858 | { | - | ||||||||||||||||||||||||||||||||||||
| 1859 | - | |||||||||||||||||||||||||||||||||||||
| 1860 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1861 | - | |||||||||||||||||||||||||||||||||||||
| 1862 | QStyleSheetStyle *proxy = extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 1863 | - | |||||||||||||||||||||||||||||||||||||
| 1864 | if (!q->styleSheet().isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1865 | ((!(proxy)) ? qt_assert("proxy",__FILE__,2842) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 1866 | proxy->repolish(q); | - | ||||||||||||||||||||||||||||||||||||
| 1867 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1868 | } | - | ||||||||||||||||||||||||||||||||||||
| 1869 | - | |||||||||||||||||||||||||||||||||||||
| 1870 | QStyle *origStyle = proxy
| 0 | ||||||||||||||||||||||||||||||||||||
| 1871 | QWidget *parent = q->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 1872 | QStyle *parentStyle = (parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 1873 | - | |||||||||||||||||||||||||||||||||||||
| 1874 | - | |||||||||||||||||||||||||||||||||||||
| 1875 | if (!(static_cast<QApplication *>(QCoreApplication::instance()))->styleSheet().isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1876 | QStyle *newStyle = parentStyle; | - | ||||||||||||||||||||||||||||||||||||
| 1877 | if (q->testAttribute(Qt::WA_SetStyle)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1878 | newStyle = new QStyleSheetStyle(origStyle); never executed: newStyle = new QStyleSheetStyle(origStyle); | 0 | ||||||||||||||||||||||||||||||||||||
| 1879 | else if (QStyleSheetStyle *newProxy = qobject_cast<QStyleSheetStyle *>(parentStyle)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1880 | newProxy->ref(); never executed: newProxy->ref(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1881 | - | |||||||||||||||||||||||||||||||||||||
| 1882 | setStyle_helper(newStyle, true); | - | ||||||||||||||||||||||||||||||||||||
| 1883 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1884 | } | - | ||||||||||||||||||||||||||||||||||||
| 1885 | - | |||||||||||||||||||||||||||||||||||||
| 1886 | - | |||||||||||||||||||||||||||||||||||||
| 1887 | - | |||||||||||||||||||||||||||||||||||||
| 1888 | if (origStyle == (extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 1889 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1890 | - | |||||||||||||||||||||||||||||||||||||
| 1891 | - | |||||||||||||||||||||||||||||||||||||
| 1892 | - | |||||||||||||||||||||||||||||||||||||
| 1893 | - | |||||||||||||||||||||||||||||||||||||
| 1894 | if (!q->testAttribute(Qt::WA_SetStyle)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1895 | origStyle = 0; never executed: origStyle = 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 1896 | - | |||||||||||||||||||||||||||||||||||||
| 1897 | setStyle_helper(origStyle, true); | - | ||||||||||||||||||||||||||||||||||||
| 1898 | - | |||||||||||||||||||||||||||||||||||||
| 1899 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1900 | Qt::WindowModality QWidget::windowModality() const | - | ||||||||||||||||||||||||||||||||||||
| 1901 | { | - | ||||||||||||||||||||||||||||||||||||
| 1902 | return never executed: static_cast<Qt::WindowModality>(data->window_modality);return static_cast<Qt::WindowModality>(data->window_modality);never executed: return static_cast<Qt::WindowModality>(data->window_modality); | 0 | ||||||||||||||||||||||||||||||||||||
| 1903 | } | - | ||||||||||||||||||||||||||||||||||||
| 1904 | - | |||||||||||||||||||||||||||||||||||||
| 1905 | void QWidget::setWindowModality(Qt::WindowModality windowModality) | - | ||||||||||||||||||||||||||||||||||||
| 1906 | { | - | ||||||||||||||||||||||||||||||||||||
| 1907 | data->window_modality = windowModality; | - | ||||||||||||||||||||||||||||||||||||
| 1908 | - | |||||||||||||||||||||||||||||||||||||
| 1909 | setAttribute(Qt::WA_ShowModal, (data->window_modality != Qt::NonModal)); | - | ||||||||||||||||||||||||||||||||||||
| 1910 | setAttribute(Qt::WA_SetWindowModality, true); | - | ||||||||||||||||||||||||||||||||||||
| 1911 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1912 | - | |||||||||||||||||||||||||||||||||||||
| 1913 | void QWidgetPrivate::setModal_sys() | - | ||||||||||||||||||||||||||||||||||||
| 1914 | { | - | ||||||||||||||||||||||||||||||||||||
| 1915 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1916 | if (q->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1917 | q->windowHandle()->setModality(q->windowModality()); never executed: q->windowHandle()->setModality(q->windowModality()); | 0 | ||||||||||||||||||||||||||||||||||||
| 1918 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1919 | bool QWidget::isMinimized() const | - | ||||||||||||||||||||||||||||||||||||
| 1920 | { return never executed: data->window_state & Qt::WindowMinimized;return data->window_state & Qt::WindowMinimized;never executed: }return data->window_state & Qt::WindowMinimized; | 0 | ||||||||||||||||||||||||||||||||||||
| 1921 | void QWidget::showMinimized() | - | ||||||||||||||||||||||||||||||||||||
| 1922 | { | - | ||||||||||||||||||||||||||||||||||||
| 1923 | bool isMin = isMinimized(); | - | ||||||||||||||||||||||||||||||||||||
| 1924 | if (isMin
| 0 | ||||||||||||||||||||||||||||||||||||
| 1925 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1926 | - | |||||||||||||||||||||||||||||||||||||
| 1927 | ensurePolished(); | - | ||||||||||||||||||||||||||||||||||||
| 1928 | - | |||||||||||||||||||||||||||||||||||||
| 1929 | if (!isMin
| 0 | ||||||||||||||||||||||||||||||||||||
| 1930 | setWindowState((windowState() & ~Qt::WindowActive) | Qt::WindowMinimized); never executed: setWindowState((windowState() & ~Qt::WindowActive) | Qt::WindowMinimized); | 0 | ||||||||||||||||||||||||||||||||||||
| 1931 | setVisible(true); | - | ||||||||||||||||||||||||||||||||||||
| 1932 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1933 | bool QWidget::isMaximized() const | - | ||||||||||||||||||||||||||||||||||||
| 1934 | { return never executed: data->window_state & Qt::WindowMaximized;return data->window_state & Qt::WindowMaximized;never executed: }return data->window_state & Qt::WindowMaximized; | 0 | ||||||||||||||||||||||||||||||||||||
| 1935 | Qt::WindowStates QWidget::windowState() const | - | ||||||||||||||||||||||||||||||||||||
| 1936 | { | - | ||||||||||||||||||||||||||||||||||||
| 1937 | return never executed: Qt::WindowStates(data->window_state);return Qt::WindowStates(data->window_state);never executed: return Qt::WindowStates(data->window_state); | 0 | ||||||||||||||||||||||||||||||||||||
| 1938 | } | - | ||||||||||||||||||||||||||||||||||||
| 1939 | void QWidget::overrideWindowState(Qt::WindowStates newstate) | - | ||||||||||||||||||||||||||||||||||||
| 1940 | { | - | ||||||||||||||||||||||||||||||||||||
| 1941 | QWindowStateChangeEvent e(Qt::WindowStates(data->window_state), true); | - | ||||||||||||||||||||||||||||||||||||
| 1942 | data->window_state = newstate; | - | ||||||||||||||||||||||||||||||||||||
| 1943 | QApplication::sendEvent(this, &e); | - | ||||||||||||||||||||||||||||||||||||
| 1944 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1945 | - | |||||||||||||||||||||||||||||||||||||
| 1946 | Qt::WindowState effectiveState(Qt::WindowStates state) | - | ||||||||||||||||||||||||||||||||||||
| 1947 | { | - | ||||||||||||||||||||||||||||||||||||
| 1948 | if (state & Qt::WindowMinimized
| 0 | ||||||||||||||||||||||||||||||||||||
| 1949 | return never executed: Qt::WindowMinimized;return Qt::WindowMinimized;never executed: return Qt::WindowMinimized; | 0 | ||||||||||||||||||||||||||||||||||||
| 1950 | else if (state & Qt::WindowFullScreen
| 0 | ||||||||||||||||||||||||||||||||||||
| 1951 | return never executed: Qt::WindowFullScreen;return Qt::WindowFullScreen;never executed: return Qt::WindowFullScreen; | 0 | ||||||||||||||||||||||||||||||||||||
| 1952 | else if (state & Qt::WindowMaximized
| 0 | ||||||||||||||||||||||||||||||||||||
| 1953 | return never executed: Qt::WindowMaximized;return Qt::WindowMaximized;never executed: return Qt::WindowMaximized; | 0 | ||||||||||||||||||||||||||||||||||||
| 1954 | return never executed: Qt::WindowNoState;return Qt::WindowNoState;never executed: return Qt::WindowNoState; | 0 | ||||||||||||||||||||||||||||||||||||
| 1955 | } | - | ||||||||||||||||||||||||||||||||||||
| 1956 | void QWidget::setWindowState(Qt::WindowStates newstate) | - | ||||||||||||||||||||||||||||||||||||
| 1957 | { | - | ||||||||||||||||||||||||||||||||||||
| 1958 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 1959 | Qt::WindowStates oldstate = windowState(); | - | ||||||||||||||||||||||||||||||||||||
| 1960 | if (oldstate == newstate
| 0 | ||||||||||||||||||||||||||||||||||||
| 1961 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 1962 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1963 | create(); never executed: create(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1964 | - | |||||||||||||||||||||||||||||||||||||
| 1965 | data->window_state = newstate; | - | ||||||||||||||||||||||||||||||||||||
| 1966 | data->in_set_window_state = 1; | - | ||||||||||||||||||||||||||||||||||||
| 1967 | Qt::WindowState newEffectiveState = effectiveState(newstate); | - | ||||||||||||||||||||||||||||||||||||
| 1968 | Qt::WindowState oldEffectiveState = effectiveState(oldstate); | - | ||||||||||||||||||||||||||||||||||||
| 1969 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 1970 | - | |||||||||||||||||||||||||||||||||||||
| 1971 | if (!testAttribute(Qt::WA_Resized)
| 0 | ||||||||||||||||||||||||||||||||||||
| 1972 | adjustSize(); never executed: adjustSize(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1973 | - | |||||||||||||||||||||||||||||||||||||
| 1974 | d->createTLExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 1975 | if (oldEffectiveState == Qt::WindowNoState
| 0 | ||||||||||||||||||||||||||||||||||||
| 1976 | d->topData()->normalGeometry = geometry(); never executed: d->topData()->normalGeometry = geometry(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1977 | - | |||||||||||||||||||||||||||||||||||||
| 1978 | ((!(windowHandle())) ? qt_assert("windowHandle()",__FILE__,3106) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 1979 | windowHandle()->setWindowState(newEffectiveState); | - | ||||||||||||||||||||||||||||||||||||
| 1980 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1981 | data->in_set_window_state = 0; | - | ||||||||||||||||||||||||||||||||||||
| 1982 | - | |||||||||||||||||||||||||||||||||||||
| 1983 | if (newstate & Qt::WindowActive
| 0 | ||||||||||||||||||||||||||||||||||||
| 1984 | activateWindow(); never executed: activateWindow(); | 0 | ||||||||||||||||||||||||||||||||||||
| 1985 | - | |||||||||||||||||||||||||||||||||||||
| 1986 | QWindowStateChangeEvent e(oldstate); | - | ||||||||||||||||||||||||||||||||||||
| 1987 | QApplication::sendEvent(this, &e); | - | ||||||||||||||||||||||||||||||||||||
| 1988 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1989 | bool QWidget::isFullScreen() const | - | ||||||||||||||||||||||||||||||||||||
| 1990 | { return never executed: data->window_state & Qt::WindowFullScreen;return data->window_state & Qt::WindowFullScreen;never executed: }return data->window_state & Qt::WindowFullScreen; | 0 | ||||||||||||||||||||||||||||||||||||
| 1991 | void QWidget::showFullScreen() | - | ||||||||||||||||||||||||||||||||||||
| 1992 | { | - | ||||||||||||||||||||||||||||||||||||
| 1993 | ensurePolished(); | - | ||||||||||||||||||||||||||||||||||||
| 1994 | - | |||||||||||||||||||||||||||||||||||||
| 1995 | setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowMaximized)) | - | ||||||||||||||||||||||||||||||||||||
| 1996 | | Qt::WindowFullScreen); | - | ||||||||||||||||||||||||||||||||||||
| 1997 | setVisible(true); | - | ||||||||||||||||||||||||||||||||||||
| 1998 | - | |||||||||||||||||||||||||||||||||||||
| 1999 | - | |||||||||||||||||||||||||||||||||||||
| 2000 | activateWindow(); | - | ||||||||||||||||||||||||||||||||||||
| 2001 | - | |||||||||||||||||||||||||||||||||||||
| 2002 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2003 | void QWidget::showMaximized() | - | ||||||||||||||||||||||||||||||||||||
| 2004 | { | - | ||||||||||||||||||||||||||||||||||||
| 2005 | ensurePolished(); | - | ||||||||||||||||||||||||||||||||||||
| 2006 | - | |||||||||||||||||||||||||||||||||||||
| 2007 | setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowFullScreen)) | - | ||||||||||||||||||||||||||||||||||||
| 2008 | | Qt::WindowMaximized); | - | ||||||||||||||||||||||||||||||||||||
| 2009 | setVisible(true); | - | ||||||||||||||||||||||||||||||||||||
| 2010 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2011 | void QWidget::showNormal() | - | ||||||||||||||||||||||||||||||||||||
| 2012 | { | - | ||||||||||||||||||||||||||||||||||||
| 2013 | ensurePolished(); | - | ||||||||||||||||||||||||||||||||||||
| 2014 | - | |||||||||||||||||||||||||||||||||||||
| 2015 | setWindowState(windowState() & ~(Qt::WindowMinimized | - | ||||||||||||||||||||||||||||||||||||
| 2016 | | Qt::WindowMaximized | - | ||||||||||||||||||||||||||||||||||||
| 2017 | | Qt::WindowFullScreen)); | - | ||||||||||||||||||||||||||||||||||||
| 2018 | setVisible(true); | - | ||||||||||||||||||||||||||||||||||||
| 2019 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2020 | bool QWidget::isEnabledTo(const QWidget *ancestor) const | - | ||||||||||||||||||||||||||||||||||||
| 2021 | { | - | ||||||||||||||||||||||||||||||||||||
| 2022 | const QWidget * w = this; | - | ||||||||||||||||||||||||||||||||||||
| 2023 | while (!w->testAttribute(Qt::WA_ForceDisabled)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2024 | && !w->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2025 | && w->parentWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2026 | && w->parentWidget() != ancestor
| 0 | ||||||||||||||||||||||||||||||||||||
| 2027 | w = w->parentWidget(); never executed: w = w->parentWidget(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2028 | return never executed: !w->testAttribute(Qt::WA_ForceDisabled);return !w->testAttribute(Qt::WA_ForceDisabled);never executed: return !w->testAttribute(Qt::WA_ForceDisabled); | 0 | ||||||||||||||||||||||||||||||||||||
| 2029 | } | - | ||||||||||||||||||||||||||||||||||||
| 2030 | void QWidget::addAction(QAction *action) | - | ||||||||||||||||||||||||||||||||||||
| 2031 | { | - | ||||||||||||||||||||||||||||||||||||
| 2032 | insertAction(0, action); | - | ||||||||||||||||||||||||||||||||||||
| 2033 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2034 | void QWidget::addActions(QList<QAction*> actions) | - | ||||||||||||||||||||||||||||||||||||
| 2035 | - | |||||||||||||||||||||||||||||||||||||
| 2036 | { | - | ||||||||||||||||||||||||||||||||||||
| 2037 | for(int i = 0; i < actions.count()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2038 | insertAction(0, actions.at(i)); never executed: insertAction(0, actions.at(i)); | 0 | ||||||||||||||||||||||||||||||||||||
| 2039 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2040 | void QWidget::insertAction(QAction *before, QAction *action) | - | ||||||||||||||||||||||||||||||||||||
| 2041 | { | - | ||||||||||||||||||||||||||||||||||||
| 2042 | if (__builtin_expect(!!(!action), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2043 | QMessageLogger(__FILE__, 3322, __PRETTY_FUNCTION__).warning("QWidget::insertAction: Attempt to insert null action"); | - | ||||||||||||||||||||||||||||||||||||
| 2044 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2045 | } | - | ||||||||||||||||||||||||||||||||||||
| 2046 | - | |||||||||||||||||||||||||||||||||||||
| 2047 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2048 | if(d->actions.contains(action)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2049 | removeAction(action); never executed: removeAction(action); | 0 | ||||||||||||||||||||||||||||||||||||
| 2050 | - | |||||||||||||||||||||||||||||||||||||
| 2051 | int pos = d->actions.indexOf(before); | - | ||||||||||||||||||||||||||||||||||||
| 2052 | if (pos < 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 2053 | before = 0; | - | ||||||||||||||||||||||||||||||||||||
| 2054 | pos = d->actions.size(); | - | ||||||||||||||||||||||||||||||||||||
| 2055 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2056 | d->actions.insert(pos, action); | - | ||||||||||||||||||||||||||||||||||||
| 2057 | - | |||||||||||||||||||||||||||||||||||||
| 2058 | QActionPrivate *apriv = action->d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2059 | apriv->widgets.append(this); | - | ||||||||||||||||||||||||||||||||||||
| 2060 | - | |||||||||||||||||||||||||||||||||||||
| 2061 | QActionEvent e(QEvent::ActionAdded, action, before); | - | ||||||||||||||||||||||||||||||||||||
| 2062 | QApplication::sendEvent(this, &e); | - | ||||||||||||||||||||||||||||||||||||
| 2063 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2064 | void QWidget::insertActions(QAction *before, QList<QAction*> actions) | - | ||||||||||||||||||||||||||||||||||||
| 2065 | - | |||||||||||||||||||||||||||||||||||||
| 2066 | { | - | ||||||||||||||||||||||||||||||||||||
| 2067 | for(int i = 0; i < actions.count()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2068 | insertAction(before, actions.at(i)); never executed: insertAction(before, actions.at(i)); | 0 | ||||||||||||||||||||||||||||||||||||
| 2069 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2070 | - | |||||||||||||||||||||||||||||||||||||
| 2071 | - | |||||||||||||||||||||||||||||||||||||
| 2072 | - | |||||||||||||||||||||||||||||||||||||
| 2073 | - | |||||||||||||||||||||||||||||||||||||
| 2074 | - | |||||||||||||||||||||||||||||||||||||
| 2075 | void QWidget::removeAction(QAction *action) | - | ||||||||||||||||||||||||||||||||||||
| 2076 | { | - | ||||||||||||||||||||||||||||||||||||
| 2077 | if (!action
| 0 | ||||||||||||||||||||||||||||||||||||
| 2078 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2079 | - | |||||||||||||||||||||||||||||||||||||
| 2080 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2081 | - | |||||||||||||||||||||||||||||||||||||
| 2082 | QActionPrivate *apriv = action->d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2083 | apriv->widgets.removeAll(this); | - | ||||||||||||||||||||||||||||||||||||
| 2084 | - | |||||||||||||||||||||||||||||||||||||
| 2085 | if (d->actions.removeAll(action)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2086 | QActionEvent e(QEvent::ActionRemoved, action); | - | ||||||||||||||||||||||||||||||||||||
| 2087 | QApplication::sendEvent(this, &e); | - | ||||||||||||||||||||||||||||||||||||
| 2088 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2089 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2090 | - | |||||||||||||||||||||||||||||||||||||
| 2091 | - | |||||||||||||||||||||||||||||||||||||
| 2092 | - | |||||||||||||||||||||||||||||||||||||
| 2093 | - | |||||||||||||||||||||||||||||||||||||
| 2094 | - | |||||||||||||||||||||||||||||||||||||
| 2095 | - | |||||||||||||||||||||||||||||||||||||
| 2096 | QList<QAction*> QWidget::actions() const | - | ||||||||||||||||||||||||||||||||||||
| 2097 | { | - | ||||||||||||||||||||||||||||||||||||
| 2098 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2099 | return never executed: d->actions;return d->actions;never executed: return d->actions; | 0 | ||||||||||||||||||||||||||||||||||||
| 2100 | } | - | ||||||||||||||||||||||||||||||||||||
| 2101 | void QWidget::setEnabled(bool enable) | - | ||||||||||||||||||||||||||||||||||||
| 2102 | { | - | ||||||||||||||||||||||||||||||||||||
| 2103 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2104 | setAttribute(Qt::WA_ForceDisabled, !enable); | - | ||||||||||||||||||||||||||||||||||||
| 2105 | d->setEnabled_helper(enable); | - | ||||||||||||||||||||||||||||||||||||
| 2106 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2107 | - | |||||||||||||||||||||||||||||||||||||
| 2108 | void QWidgetPrivate::setEnabled_helper(bool enable) | - | ||||||||||||||||||||||||||||||||||||
| 2109 | { | - | ||||||||||||||||||||||||||||||||||||
| 2110 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2111 | - | |||||||||||||||||||||||||||||||||||||
| 2112 | if (enable
| 0 | ||||||||||||||||||||||||||||||||||||
| 2113 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2114 | - | |||||||||||||||||||||||||||||||||||||
| 2115 | if (enable != q->testAttribute(Qt::WA_Disabled)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2116 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2117 | - | |||||||||||||||||||||||||||||||||||||
| 2118 | q->setAttribute(Qt::WA_Disabled, !enable); | - | ||||||||||||||||||||||||||||||||||||
| 2119 | updateSystemBackground(); | - | ||||||||||||||||||||||||||||||||||||
| 2120 | - | |||||||||||||||||||||||||||||||||||||
| 2121 | if (!enable
| 0 | ||||||||||||||||||||||||||||||||||||
| 2122 | bool parentIsEnabled = (!q->parentWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2123 | if (!parentIsEnabled
| 0 | ||||||||||||||||||||||||||||||||||||
| 2124 | q->clearFocus(); never executed: q->clearFocus(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2125 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2126 | - | |||||||||||||||||||||||||||||||||||||
| 2127 | Qt::WidgetAttribute attribute = enable
| 0 | ||||||||||||||||||||||||||||||||||||
| 2128 | for (int i = 0; i < children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2129 | QWidget *w = qobject_cast<QWidget *>(children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 2130 | if (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 2131 | w->d_func()->setEnabled_helper(enable); never executed: w->d_func()->setEnabled_helper(enable); | 0 | ||||||||||||||||||||||||||||||||||||
| 2132 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2133 | if (q->testAttribute(Qt::WA_SetCursor)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2134 | - | |||||||||||||||||||||||||||||||||||||
| 2135 | - | |||||||||||||||||||||||||||||||||||||
| 2136 | qt_qpa_set_cursor(q, false); | - | ||||||||||||||||||||||||||||||||||||
| 2137 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2138 | - | |||||||||||||||||||||||||||||||||||||
| 2139 | - | |||||||||||||||||||||||||||||||||||||
| 2140 | - | |||||||||||||||||||||||||||||||||||||
| 2141 | - | |||||||||||||||||||||||||||||||||||||
| 2142 | - | |||||||||||||||||||||||||||||||||||||
| 2143 | if (q->testAttribute(Qt::WA_InputMethodEnabled)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2144 | QWidget *focusWidget = effectiveFocusWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 2145 | - | |||||||||||||||||||||||||||||||||||||
| 2146 | if (enable
| 0 | ||||||||||||||||||||||||||||||||||||
| 2147 | if (focusWidget->testAttribute(Qt::WA_InputMethodEnabled)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2148 | QGuiApplication::inputMethod()->update(Qt::ImEnabled); never executed: QGuiApplication::inputMethod()->update(Qt::ImEnabled); | 0 | ||||||||||||||||||||||||||||||||||||
| 2149 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2150 | QGuiApplication::inputMethod()->commit(); | - | ||||||||||||||||||||||||||||||||||||
| 2151 | QGuiApplication::inputMethod()->update(Qt::ImEnabled); | - | ||||||||||||||||||||||||||||||||||||
| 2152 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2153 | } | - | ||||||||||||||||||||||||||||||||||||
| 2154 | - | |||||||||||||||||||||||||||||||||||||
| 2155 | QEvent e(QEvent::EnabledChange); | - | ||||||||||||||||||||||||||||||||||||
| 2156 | QApplication::sendEvent(q, &e); | - | ||||||||||||||||||||||||||||||||||||
| 2157 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2158 | bool QWidget::acceptDrops() const | - | ||||||||||||||||||||||||||||||||||||
| 2159 | { | - | ||||||||||||||||||||||||||||||||||||
| 2160 | return never executed: testAttribute(Qt::WA_AcceptDrops);return testAttribute(Qt::WA_AcceptDrops);never executed: return testAttribute(Qt::WA_AcceptDrops); | 0 | ||||||||||||||||||||||||||||||||||||
| 2161 | } | - | ||||||||||||||||||||||||||||||||||||
| 2162 | - | |||||||||||||||||||||||||||||||||||||
| 2163 | void QWidget::setAcceptDrops(bool on) | - | ||||||||||||||||||||||||||||||||||||
| 2164 | { | - | ||||||||||||||||||||||||||||||||||||
| 2165 | setAttribute(Qt::WA_AcceptDrops, on); | - | ||||||||||||||||||||||||||||||||||||
| 2166 | - | |||||||||||||||||||||||||||||||||||||
| 2167 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2168 | - | |||||||||||||||||||||||||||||||||||||
| 2169 | void QWidgetPrivate::registerDropSite(bool on) | - | ||||||||||||||||||||||||||||||||||||
| 2170 | { | - | ||||||||||||||||||||||||||||||||||||
| 2171 | (void)on;; | - | ||||||||||||||||||||||||||||||||||||
| 2172 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2173 | void QWidget::setDisabled(bool disable) | - | ||||||||||||||||||||||||||||||||||||
| 2174 | { | - | ||||||||||||||||||||||||||||||||||||
| 2175 | setEnabled(!disable); | - | ||||||||||||||||||||||||||||||||||||
| 2176 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2177 | QRect QWidget::frameGeometry() const | - | ||||||||||||||||||||||||||||||||||||
| 2178 | { | - | ||||||||||||||||||||||||||||||||||||
| 2179 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2180 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2181 | QRect fs = d->frameStrut(); | - | ||||||||||||||||||||||||||||||||||||
| 2182 | return never executed: QRect(data->crect.x() - fs.left(),return QRect(data->crect.x() - fs.left(), data->crect.y() - fs.top(), data->crect.width() + fs.left() + fs.right(), data->crect.height() + fs.top() + fs.bottom());never executed: return QRect(data->crect.x() - fs.left(), data->crect.y() - fs.top(), data->crect.width() + fs.left() + fs.right(), data->crect.height() + fs.top() + fs.bottom()); | 0 | ||||||||||||||||||||||||||||||||||||
| 2183 | data->crect.y() - fs.top(), never executed: return QRect(data->crect.x() - fs.left(), data->crect.y() - fs.top(), data->crect.width() + fs.left() + fs.right(), data->crect.height() + fs.top() + fs.bottom()); | 0 | ||||||||||||||||||||||||||||||||||||
| 2184 | data->crect.width() + fs.left() + fs.right(), never executed: return QRect(data->crect.x() - fs.left(), data->crect.y() - fs.top(), data->crect.width() + fs.left() + fs.right(), data->crect.height() + fs.top() + fs.bottom()); | 0 | ||||||||||||||||||||||||||||||||||||
| 2185 | data->crect.height() + fs.top() + fs.bottom()); never executed: return QRect(data->crect.x() - fs.left(), data->crect.y() - fs.top(), data->crect.width() + fs.left() + fs.right(), data->crect.height() + fs.top() + fs.bottom()); | 0 | ||||||||||||||||||||||||||||||||||||
| 2186 | } | - | ||||||||||||||||||||||||||||||||||||
| 2187 | return never executed: data->crect;return data->crect;never executed: return data->crect; | 0 | ||||||||||||||||||||||||||||||||||||
| 2188 | } | - | ||||||||||||||||||||||||||||||||||||
| 2189 | int QWidget::x() const | - | ||||||||||||||||||||||||||||||||||||
| 2190 | { | - | ||||||||||||||||||||||||||||||||||||
| 2191 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2192 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2193 | return never executed: data->crect.x() - d->frameStrut().left();return data->crect.x() - d->frameStrut().left();never executed: return data->crect.x() - d->frameStrut().left(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2194 | return never executed: data->crect.x();return data->crect.x();never executed: return data->crect.x(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2195 | } | - | ||||||||||||||||||||||||||||||||||||
| 2196 | int QWidget::y() const | - | ||||||||||||||||||||||||||||||||||||
| 2197 | { | - | ||||||||||||||||||||||||||||||||||||
| 2198 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2199 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2200 | return never executed: data->crect.y() - d->frameStrut().top();return data->crect.y() - d->frameStrut().top();never executed: return data->crect.y() - d->frameStrut().top(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2201 | return never executed: data->crect.y();return data->crect.y();never executed: return data->crect.y(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2202 | } | - | ||||||||||||||||||||||||||||||||||||
| 2203 | QPoint QWidget::pos() const | - | ||||||||||||||||||||||||||||||||||||
| 2204 | { | - | ||||||||||||||||||||||||||||||||||||
| 2205 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2206 | QPoint result = data->crect.topLeft(); | - | ||||||||||||||||||||||||||||||||||||
| 2207 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2208 | if (!d->maybeTopData()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2209 | result -= d->frameStrut().topLeft(); never executed: result -= d->frameStrut().topLeft(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2210 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||||||||||||||||||||||||||
| 2211 | } | - | ||||||||||||||||||||||||||||||||||||
| 2212 | QRect QWidget::normalGeometry() const | - | ||||||||||||||||||||||||||||||||||||
| 2213 | { | - | ||||||||||||||||||||||||||||||||||||
| 2214 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2215 | if (!d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 2216 | return never executed: QRect();return QRect();never executed: return QRect(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2217 | - | |||||||||||||||||||||||||||||||||||||
| 2218 | if (!isMaximized()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2219 | return never executed: geometry();return geometry();never executed: return geometry(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2220 | - | |||||||||||||||||||||||||||||||||||||
| 2221 | return never executed: d->topData()->normalGeometry;return d->topData()->normalGeometry;never executed: return d->topData()->normalGeometry; | 0 | ||||||||||||||||||||||||||||||||||||
| 2222 | } | - | ||||||||||||||||||||||||||||||||||||
| 2223 | QRect QWidget::childrenRect() const | - | ||||||||||||||||||||||||||||||||||||
| 2224 | { | - | ||||||||||||||||||||||||||||||||||||
| 2225 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2226 | QRect r(0, 0, 0, 0); | - | ||||||||||||||||||||||||||||||||||||
| 2227 | for (int i = 0; i < d->children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2228 | QWidget *w = qobject_cast<QWidget *>(d->children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 2229 | if (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 2230 | r |= w->geometry(); never executed: r |= w->geometry(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2231 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2232 | return never executed: r;return r;never executed: return r; | 0 | ||||||||||||||||||||||||||||||||||||
| 2233 | } | - | ||||||||||||||||||||||||||||||||||||
| 2234 | QRegion QWidget::childrenRegion() const | - | ||||||||||||||||||||||||||||||||||||
| 2235 | { | - | ||||||||||||||||||||||||||||||||||||
| 2236 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2237 | QRegion r; | - | ||||||||||||||||||||||||||||||||||||
| 2238 | for (int i = 0; i < d->children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2239 | QWidget *w = qobject_cast<QWidget *>(d->children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 2240 | if (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 2241 | QRegion mask = w->mask(); | - | ||||||||||||||||||||||||||||||||||||
| 2242 | if (mask.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2243 | r |= w->geometry(); never executed: r |= w->geometry(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2244 | else | - | ||||||||||||||||||||||||||||||||||||
| 2245 | r |= mask.translated(w->pos()); never executed: r |= mask.translated(w->pos()); | 0 | ||||||||||||||||||||||||||||||||||||
| 2246 | } | - | ||||||||||||||||||||||||||||||||||||
| 2247 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2248 | return never executed: r;return r;never executed: return r; | 0 | ||||||||||||||||||||||||||||||||||||
| 2249 | } | - | ||||||||||||||||||||||||||||||||||||
| 2250 | QSize QWidget::minimumSize() const | - | ||||||||||||||||||||||||||||||||||||
| 2251 | { | - | ||||||||||||||||||||||||||||||||||||
| 2252 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2253 | return never executed: d->extra ? QSize(d->extra->minw, d->extra->minh) : QSize(0, 0);return d->extra ? QSize(d->extra->minw, d->extra->minh) : QSize(0, 0);never executed: return d->extra ? QSize(d->extra->minw, d->extra->minh) : QSize(0, 0); | 0 | ||||||||||||||||||||||||||||||||||||
| 2254 | } | - | ||||||||||||||||||||||||||||||||||||
| 2255 | QSize QWidget::maximumSize() const | - | ||||||||||||||||||||||||||||||||||||
| 2256 | { | - | ||||||||||||||||||||||||||||||||||||
| 2257 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2258 | return never executed: d->extra ? QSize(d->extra->maxw, d->extra->maxh)return d->extra ? QSize(d->extra->maxw, d->extra->maxh) : QSize(((1<<24)-1), ((1<<24)-1));never executed: return d->extra ? QSize(d->extra->maxw, d->extra->maxh) : QSize(((1<<24)-1), ((1<<24)-1)); | 0 | ||||||||||||||||||||||||||||||||||||
| 2259 | : QSize(((1<<24)-1), ((1<<24)-1)); never executed: return d->extra ? QSize(d->extra->maxw, d->extra->maxh) : QSize(((1<<24)-1), ((1<<24)-1)); | 0 | ||||||||||||||||||||||||||||||||||||
| 2260 | } | - | ||||||||||||||||||||||||||||||||||||
| 2261 | QSize QWidget::sizeIncrement() const | - | ||||||||||||||||||||||||||||||||||||
| 2262 | { | - | ||||||||||||||||||||||||||||||||||||
| 2263 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2264 | return never executed: (d->extra && d->extra->topextra)return (d->extra && d->extra->topextra) ? QSize(d->extra->topextra->incw, d->extra->topextra->inch) : QSize(0, 0);never executed: return (d->extra && d->extra->topextra) ? QSize(d->extra->topextra->incw, d->extra->topextra->inch) : QSize(0, 0); | 0 | ||||||||||||||||||||||||||||||||||||
| 2265 | ? QSize(d->extra->topextra->incw, d->extra->topextra->inch) never executed: return (d->extra && d->extra->topextra) ? QSize(d->extra->topextra->incw, d->extra->topextra->inch) : QSize(0, 0); | 0 | ||||||||||||||||||||||||||||||||||||
| 2266 | : QSize(0, 0); never executed: return (d->extra && d->extra->topextra) ? QSize(d->extra->topextra->incw, d->extra->topextra->inch) : QSize(0, 0); | 0 | ||||||||||||||||||||||||||||||||||||
| 2267 | } | - | ||||||||||||||||||||||||||||||||||||
| 2268 | QSize QWidget::baseSize() const | - | ||||||||||||||||||||||||||||||||||||
| 2269 | { | - | ||||||||||||||||||||||||||||||||||||
| 2270 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2271 | return never executed: (d->extra != 0 && d->extra->topextra != 0)return (d->extra != 0 && d->extra->topextra != 0) ? QSize(d->extra->topextra->basew, d->extra->topextra->baseh) : QSize(0, 0);never executed: return (d->extra != 0 && d->extra->topextra != 0) ? QSize(d->extra->topextra->basew, d->extra->topextra->baseh) : QSize(0, 0); | 0 | ||||||||||||||||||||||||||||||||||||
| 2272 | ? QSize(d->extra->topextra->basew, d->extra->topextra->baseh) never executed: return (d->extra != 0 && d->extra->topextra != 0) ? QSize(d->extra->topextra->basew, d->extra->topextra->baseh) : QSize(0, 0); | 0 | ||||||||||||||||||||||||||||||||||||
| 2273 | : QSize(0, 0); never executed: return (d->extra != 0 && d->extra->topextra != 0) ? QSize(d->extra->topextra->basew, d->extra->topextra->baseh) : QSize(0, 0); | 0 | ||||||||||||||||||||||||||||||||||||
| 2274 | } | - | ||||||||||||||||||||||||||||||||||||
| 2275 | - | |||||||||||||||||||||||||||||||||||||
| 2276 | bool QWidgetPrivate::setMinimumSize_helper(int &minw, int &minh) | - | ||||||||||||||||||||||||||||||||||||
| 2277 | { | - | ||||||||||||||||||||||||||||||||||||
| 2278 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2279 | - | |||||||||||||||||||||||||||||||||||||
| 2280 | int mw = minw, mh = minh; | - | ||||||||||||||||||||||||||||||||||||
| 2281 | if (mw == ((1<<24)-1)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2282 | mw = 0; never executed: mw = 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 2283 | if (mh == ((1<<24)-1)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2284 | mh = 0; never executed: mh = 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 2285 | if (__builtin_expect(!!(minw > ((1<<24)-1) || minh > ((1<<24)-1)), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2286 | QMessageLogger(__FILE__, 3972, __PRETTY_FUNCTION__).warning("QWidget::setMinimumSize: (%s/%s) " | - | ||||||||||||||||||||||||||||||||||||
| 2287 | "The largest allowed size is (%d,%d)", | - | ||||||||||||||||||||||||||||||||||||
| 2288 | q->objectName().toLocal8Bit().data(), q->metaObject()->className(), ((1<<24)-1), | - | ||||||||||||||||||||||||||||||||||||
| 2289 | ((1<<24)-1)); | - | ||||||||||||||||||||||||||||||||||||
| 2290 | minw = mw = qMin<int>(minw, ((1<<24)-1)); | - | ||||||||||||||||||||||||||||||||||||
| 2291 | minh = mh = qMin<int>(minh, ((1<<24)-1)); | - | ||||||||||||||||||||||||||||||||||||
| 2292 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2293 | if (__builtin_expect(!!(minw < 0 || minh < 0), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2294 | QMessageLogger(__FILE__, 3980, __PRETTY_FUNCTION__).warning("QWidget::setMinimumSize: (%s/%s) Negative sizes (%d,%d) " | - | ||||||||||||||||||||||||||||||||||||
| 2295 | "are not possible", | - | ||||||||||||||||||||||||||||||||||||
| 2296 | q->objectName().toLocal8Bit().data(), q->metaObject()->className(), minw, minh); | - | ||||||||||||||||||||||||||||||||||||
| 2297 | minw = mw = qMax(minw, 0); | - | ||||||||||||||||||||||||||||||||||||
| 2298 | minh = mh = qMax(minh, 0); | - | ||||||||||||||||||||||||||||||||||||
| 2299 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2300 | createExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 2301 | if (extra->minw == mw
| 0 | ||||||||||||||||||||||||||||||||||||
| 2302 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 2303 | extra->minw = mw; | - | ||||||||||||||||||||||||||||||||||||
| 2304 | extra->minh = mh; | - | ||||||||||||||||||||||||||||||||||||
| 2305 | extra->explicitMinSize = (mw
| 0 | ||||||||||||||||||||||||||||||||||||
| 2306 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 2307 | } | - | ||||||||||||||||||||||||||||||||||||
| 2308 | - | |||||||||||||||||||||||||||||||||||||
| 2309 | void QWidgetPrivate::setConstraints_sys() | - | ||||||||||||||||||||||||||||||||||||
| 2310 | { | - | ||||||||||||||||||||||||||||||||||||
| 2311 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2312 | if (extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 2313 | QWindow *win = q->windowHandle(); | - | ||||||||||||||||||||||||||||||||||||
| 2314 | QWindowPrivate *winp = qt_window_private(win); | - | ||||||||||||||||||||||||||||||||||||
| 2315 | - | |||||||||||||||||||||||||||||||||||||
| 2316 | winp->minimumSize = QSize(extra->minw, extra->minh); | - | ||||||||||||||||||||||||||||||||||||
| 2317 | winp->maximumSize = QSize(extra->maxw, extra->maxh); | - | ||||||||||||||||||||||||||||||||||||
| 2318 | - | |||||||||||||||||||||||||||||||||||||
| 2319 | if (extra->topextra
| 0 | ||||||||||||||||||||||||||||||||||||
| 2320 | winp->baseSize = QSize(extra->topextra->basew, extra->topextra->baseh); | - | ||||||||||||||||||||||||||||||||||||
| 2321 | winp->sizeIncrement = QSize(extra->topextra->incw, extra->topextra->inch); | - | ||||||||||||||||||||||||||||||||||||
| 2322 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2323 | - | |||||||||||||||||||||||||||||||||||||
| 2324 | if (winp->platformWindow
| 0 | ||||||||||||||||||||||||||||||||||||
| 2325 | fixPosIncludesFrame(); | - | ||||||||||||||||||||||||||||||||||||
| 2326 | winp->platformWindow->propagateSizeHints(); | - | ||||||||||||||||||||||||||||||||||||
| 2327 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2328 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2329 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2330 | void QWidget::setMinimumSize(int minw, int minh) | - | ||||||||||||||||||||||||||||||||||||
| 2331 | { | - | ||||||||||||||||||||||||||||||||||||
| 2332 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2333 | if (!d->setMinimumSize_helper(minw, minh)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2334 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2335 | - | |||||||||||||||||||||||||||||||||||||
| 2336 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2337 | d->setConstraints_sys(); never executed: d->setConstraints_sys(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2338 | if (minw > width()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2339 | bool resized = testAttribute(Qt::WA_Resized); | - | ||||||||||||||||||||||||||||||||||||
| 2340 | bool maximized = isMaximized(); | - | ||||||||||||||||||||||||||||||||||||
| 2341 | resize(qMax(minw,width()), qMax(minh,height())); | - | ||||||||||||||||||||||||||||||||||||
| 2342 | setAttribute(Qt::WA_Resized, resized); | - | ||||||||||||||||||||||||||||||||||||
| 2343 | if (maximized
| 0 | ||||||||||||||||||||||||||||||||||||
| 2344 | data->window_state = data->window_state | Qt::WindowMaximized; never executed: data->window_state = data->window_state | Qt::WindowMaximized; | 0 | ||||||||||||||||||||||||||||||||||||
| 2345 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2346 | - | |||||||||||||||||||||||||||||||||||||
| 2347 | if (d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 2348 | if (d->extra->proxyWidget
| 0 | ||||||||||||||||||||||||||||||||||||
| 2349 | d->extra->proxyWidget->setMinimumSize(minw, minh); never executed: d->extra->proxyWidget->setMinimumSize(minw, minh); | 0 | ||||||||||||||||||||||||||||||||||||
| 2350 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2351 | - | |||||||||||||||||||||||||||||||||||||
| 2352 | d->updateGeometry_helper(d->extra->minw == d->extra->maxw && d->extra->minh == d->extra->maxh); | - | ||||||||||||||||||||||||||||||||||||
| 2353 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2354 | - | |||||||||||||||||||||||||||||||||||||
| 2355 | bool QWidgetPrivate::setMaximumSize_helper(int &maxw, int &maxh) | - | ||||||||||||||||||||||||||||||||||||
| 2356 | { | - | ||||||||||||||||||||||||||||||||||||
| 2357 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2358 | if (__builtin_expect(!!(maxw > ((1<<24)-1) || maxh > ((1<<24)-1)), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2359 | QMessageLogger(__FILE__, 4054, __PRETTY_FUNCTION__).warning("QWidget::setMaximumSize: (%s/%s) " | - | ||||||||||||||||||||||||||||||||||||
| 2360 | "The largest allowed size is (%d,%d)", | - | ||||||||||||||||||||||||||||||||||||
| 2361 | q->objectName().toLocal8Bit().data(), q->metaObject()->className(), ((1<<24)-1), | - | ||||||||||||||||||||||||||||||||||||
| 2362 | ((1<<24)-1)); | - | ||||||||||||||||||||||||||||||||||||
| 2363 | maxw = qMin<int>(maxw, ((1<<24)-1)); | - | ||||||||||||||||||||||||||||||||||||
| 2364 | maxh = qMin<int>(maxh, ((1<<24)-1)); | - | ||||||||||||||||||||||||||||||||||||
| 2365 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2366 | if (__builtin_expect(!!(maxw < 0 || maxh < 0), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2367 | QMessageLogger(__FILE__, 4062, __PRETTY_FUNCTION__).warning("QWidget::setMaximumSize: (%s/%s) Negative sizes (%d,%d) " | - | ||||||||||||||||||||||||||||||||||||
| 2368 | "are not possible", | - | ||||||||||||||||||||||||||||||||||||
| 2369 | q->objectName().toLocal8Bit().data(), q->metaObject()->className(), maxw, maxh); | - | ||||||||||||||||||||||||||||||||||||
| 2370 | maxw = qMax(maxw, 0); | - | ||||||||||||||||||||||||||||||||||||
| 2371 | maxh = qMax(maxh, 0); | - | ||||||||||||||||||||||||||||||||||||
| 2372 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2373 | createExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 2374 | if (extra->maxw == maxw
| 0 | ||||||||||||||||||||||||||||||||||||
| 2375 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 2376 | extra->maxw = maxw; | - | ||||||||||||||||||||||||||||||||||||
| 2377 | extra->maxh = maxh; | - | ||||||||||||||||||||||||||||||||||||
| 2378 | extra->explicitMaxSize = (maxw != ((1<<24)-1)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2379 | (maxh != ((1<<24)-1) ? Qt::Vertical : 0); | - | ||||||||||||||||||||||||||||||||||||
| 2380 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 2381 | } | - | ||||||||||||||||||||||||||||||||||||
| 2382 | void QWidget::setMaximumSize(int maxw, int maxh) | - | ||||||||||||||||||||||||||||||||||||
| 2383 | { | - | ||||||||||||||||||||||||||||||||||||
| 2384 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2385 | if (!d->setMaximumSize_helper(maxw, maxh)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2386 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2387 | - | |||||||||||||||||||||||||||||||||||||
| 2388 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2389 | d->setConstraints_sys(); never executed: d->setConstraints_sys(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2390 | if (maxw < width()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2391 | bool resized = testAttribute(Qt::WA_Resized); | - | ||||||||||||||||||||||||||||||||||||
| 2392 | resize(qMin(maxw,width()), qMin(maxh,height())); | - | ||||||||||||||||||||||||||||||||||||
| 2393 | setAttribute(Qt::WA_Resized, resized); | - | ||||||||||||||||||||||||||||||||||||
| 2394 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2395 | - | |||||||||||||||||||||||||||||||||||||
| 2396 | - | |||||||||||||||||||||||||||||||||||||
| 2397 | if (d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 2398 | if (d->extra->proxyWidget
| 0 | ||||||||||||||||||||||||||||||||||||
| 2399 | d->extra->proxyWidget->setMaximumSize(maxw, maxh); never executed: d->extra->proxyWidget->setMaximumSize(maxw, maxh); | 0 | ||||||||||||||||||||||||||||||||||||
| 2400 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2401 | - | |||||||||||||||||||||||||||||||||||||
| 2402 | - | |||||||||||||||||||||||||||||||||||||
| 2403 | d->updateGeometry_helper(d->extra->minw == d->extra->maxw && d->extra->minh == d->extra->maxh); | - | ||||||||||||||||||||||||||||||||||||
| 2404 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2405 | - | |||||||||||||||||||||||||||||||||||||
| 2406 | - | |||||||||||||||||||||||||||||||||||||
| 2407 | - | |||||||||||||||||||||||||||||||||||||
| 2408 | - | |||||||||||||||||||||||||||||||||||||
| 2409 | - | |||||||||||||||||||||||||||||||||||||
| 2410 | - | |||||||||||||||||||||||||||||||||||||
| 2411 | - | |||||||||||||||||||||||||||||||||||||
| 2412 | void QWidget::setSizeIncrement(int w, int h) | - | ||||||||||||||||||||||||||||||||||||
| 2413 | { | - | ||||||||||||||||||||||||||||||||||||
| 2414 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2415 | d->createTLExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 2416 | QTLWExtra* x = d->topData(); | - | ||||||||||||||||||||||||||||||||||||
| 2417 | if (x->incw == w
| 0 | ||||||||||||||||||||||||||||||||||||
| 2418 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2419 | x->incw = w; | - | ||||||||||||||||||||||||||||||||||||
| 2420 | x->inch = h; | - | ||||||||||||||||||||||||||||||||||||
| 2421 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2422 | d->setConstraints_sys(); never executed: d->setConstraints_sys(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2423 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2424 | - | |||||||||||||||||||||||||||||||||||||
| 2425 | - | |||||||||||||||||||||||||||||||||||||
| 2426 | - | |||||||||||||||||||||||||||||||||||||
| 2427 | - | |||||||||||||||||||||||||||||||||||||
| 2428 | - | |||||||||||||||||||||||||||||||||||||
| 2429 | - | |||||||||||||||||||||||||||||||||||||
| 2430 | - | |||||||||||||||||||||||||||||||||||||
| 2431 | void QWidget::setBaseSize(int basew, int baseh) | - | ||||||||||||||||||||||||||||||||||||
| 2432 | { | - | ||||||||||||||||||||||||||||||||||||
| 2433 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2434 | d->createTLExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 2435 | QTLWExtra* x = d->topData(); | - | ||||||||||||||||||||||||||||||||||||
| 2436 | if (x->basew == basew
| 0 | ||||||||||||||||||||||||||||||||||||
| 2437 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2438 | x->basew = basew; | - | ||||||||||||||||||||||||||||||||||||
| 2439 | x->baseh = baseh; | - | ||||||||||||||||||||||||||||||||||||
| 2440 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2441 | d->setConstraints_sys(); never executed: d->setConstraints_sys(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2442 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2443 | void QWidget::setFixedSize(const QSize & s) | - | ||||||||||||||||||||||||||||||||||||
| 2444 | { | - | ||||||||||||||||||||||||||||||||||||
| 2445 | setFixedSize(s.width(), s.height()); | - | ||||||||||||||||||||||||||||||||||||
| 2446 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2447 | void QWidget::setFixedSize(int w, int h) | - | ||||||||||||||||||||||||||||||||||||
| 2448 | { | - | ||||||||||||||||||||||||||||||||||||
| 2449 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2450 | bool minSizeSet = d->setMinimumSize_helper(w, h); | - | ||||||||||||||||||||||||||||||||||||
| 2451 | bool maxSizeSet = d->setMaximumSize_helper(w, h); | - | ||||||||||||||||||||||||||||||||||||
| 2452 | if (!minSizeSet
| 0 | ||||||||||||||||||||||||||||||||||||
| 2453 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2454 | - | |||||||||||||||||||||||||||||||||||||
| 2455 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2456 | d->setConstraints_sys(); never executed: d->setConstraints_sys(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2457 | else | - | ||||||||||||||||||||||||||||||||||||
| 2458 | d->updateGeometry_helper(true); never executed: d->updateGeometry_helper(true); | 0 | ||||||||||||||||||||||||||||||||||||
| 2459 | - | |||||||||||||||||||||||||||||||||||||
| 2460 | if (w != ((1<<24)-1)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2461 | resize(w, h); never executed: resize(w, h); | 0 | ||||||||||||||||||||||||||||||||||||
| 2462 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2463 | - | |||||||||||||||||||||||||||||||||||||
| 2464 | void QWidget::setMinimumWidth(int w) | - | ||||||||||||||||||||||||||||||||||||
| 2465 | { | - | ||||||||||||||||||||||||||||||||||||
| 2466 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2467 | d->createExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 2468 | uint expl = d->extra->explicitMinSize | (w ? Qt::Horizontal : 0); | - | ||||||||||||||||||||||||||||||||||||
| 2469 | setMinimumSize(w, minimumSize().height()); | - | ||||||||||||||||||||||||||||||||||||
| 2470 | d->extra->explicitMinSize = expl; | - | ||||||||||||||||||||||||||||||||||||
| 2471 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2472 | - | |||||||||||||||||||||||||||||||||||||
| 2473 | void QWidget::setMinimumHeight(int h) | - | ||||||||||||||||||||||||||||||||||||
| 2474 | { | - | ||||||||||||||||||||||||||||||||||||
| 2475 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2476 | d->createExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 2477 | uint expl = d->extra->explicitMinSize | (h ? Qt::Vertical : 0); | - | ||||||||||||||||||||||||||||||||||||
| 2478 | setMinimumSize(minimumSize().width(), h); | - | ||||||||||||||||||||||||||||||||||||
| 2479 | d->extra->explicitMinSize = expl; | - | ||||||||||||||||||||||||||||||||||||
| 2480 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2481 | - | |||||||||||||||||||||||||||||||||||||
| 2482 | void QWidget::setMaximumWidth(int w) | - | ||||||||||||||||||||||||||||||||||||
| 2483 | { | - | ||||||||||||||||||||||||||||||||||||
| 2484 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2485 | d->createExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 2486 | uint expl = d->extra->explicitMaxSize | (w == ((1<<24)-1) ? 0 : Qt::Horizontal); | - | ||||||||||||||||||||||||||||||||||||
| 2487 | setMaximumSize(w, maximumSize().height()); | - | ||||||||||||||||||||||||||||||||||||
| 2488 | d->extra->explicitMaxSize = expl; | - | ||||||||||||||||||||||||||||||||||||
| 2489 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2490 | - | |||||||||||||||||||||||||||||||||||||
| 2491 | void QWidget::setMaximumHeight(int h) | - | ||||||||||||||||||||||||||||||||||||
| 2492 | { | - | ||||||||||||||||||||||||||||||||||||
| 2493 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2494 | d->createExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 2495 | uint expl = d->extra->explicitMaxSize | (h == ((1<<24)-1) ? 0 : Qt::Vertical); | - | ||||||||||||||||||||||||||||||||||||
| 2496 | setMaximumSize(maximumSize().width(), h); | - | ||||||||||||||||||||||||||||||||||||
| 2497 | d->extra->explicitMaxSize = expl; | - | ||||||||||||||||||||||||||||||||||||
| 2498 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2499 | void QWidget::setFixedWidth(int w) | - | ||||||||||||||||||||||||||||||||||||
| 2500 | { | - | ||||||||||||||||||||||||||||||||||||
| 2501 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2502 | d->createExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 2503 | uint explMin = d->extra->explicitMinSize | Qt::Horizontal; | - | ||||||||||||||||||||||||||||||||||||
| 2504 | uint explMax = d->extra->explicitMaxSize | Qt::Horizontal; | - | ||||||||||||||||||||||||||||||||||||
| 2505 | setMinimumSize(w, minimumSize().height()); | - | ||||||||||||||||||||||||||||||||||||
| 2506 | setMaximumSize(w, maximumSize().height()); | - | ||||||||||||||||||||||||||||||||||||
| 2507 | d->extra->explicitMinSize = explMin; | - | ||||||||||||||||||||||||||||||||||||
| 2508 | d->extra->explicitMaxSize = explMax; | - | ||||||||||||||||||||||||||||||||||||
| 2509 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2510 | void QWidget::setFixedHeight(int h) | - | ||||||||||||||||||||||||||||||||||||
| 2511 | { | - | ||||||||||||||||||||||||||||||||||||
| 2512 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2513 | d->createExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 2514 | uint explMin = d->extra->explicitMinSize | Qt::Vertical; | - | ||||||||||||||||||||||||||||||||||||
| 2515 | uint explMax = d->extra->explicitMaxSize | Qt::Vertical; | - | ||||||||||||||||||||||||||||||||||||
| 2516 | setMinimumSize(minimumSize().width(), h); | - | ||||||||||||||||||||||||||||||||||||
| 2517 | setMaximumSize(maximumSize().width(), h); | - | ||||||||||||||||||||||||||||||||||||
| 2518 | d->extra->explicitMinSize = explMin; | - | ||||||||||||||||||||||||||||||||||||
| 2519 | d->extra->explicitMaxSize = explMax; | - | ||||||||||||||||||||||||||||||||||||
| 2520 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2521 | QPoint QWidget::mapTo(const QWidget * parent, const QPoint & pos) const | - | ||||||||||||||||||||||||||||||||||||
| 2522 | { | - | ||||||||||||||||||||||||||||||||||||
| 2523 | QPoint p = pos; | - | ||||||||||||||||||||||||||||||||||||
| 2524 | if (parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 2525 | const QWidget * w = this; | - | ||||||||||||||||||||||||||||||||||||
| 2526 | while (w != parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 2527 | ((!(w)) ? qt_assert_x("QWidget::mapTo(const QWidget *parent, const QPoint &pos)", "parent must be in parent hierarchy", | - | ||||||||||||||||||||||||||||||||||||
| 2528 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||
| 2529 | , | - | ||||||||||||||||||||||||||||||||||||
| 2530 | 4283 | - | ||||||||||||||||||||||||||||||||||||
| 2531 | ) : qt_noop()) | - | ||||||||||||||||||||||||||||||||||||
| 2532 | ; | - | ||||||||||||||||||||||||||||||||||||
| 2533 | p = w->mapToParent(p); | - | ||||||||||||||||||||||||||||||||||||
| 2534 | w = w->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 2535 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2536 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2537 | return never executed: p;return p;never executed: return p; | 0 | ||||||||||||||||||||||||||||||||||||
| 2538 | } | - | ||||||||||||||||||||||||||||||||||||
| 2539 | QPoint QWidget::mapFrom(const QWidget * parent, const QPoint & pos) const | - | ||||||||||||||||||||||||||||||||||||
| 2540 | { | - | ||||||||||||||||||||||||||||||||||||
| 2541 | QPoint p(pos); | - | ||||||||||||||||||||||||||||||||||||
| 2542 | if (parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 2543 | const QWidget * w = this; | - | ||||||||||||||||||||||||||||||||||||
| 2544 | while (w != parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 2545 | ((!(w)) ? qt_assert_x("QWidget::mapFrom(const QWidget *parent, const QPoint &pos)", "parent must be in parent hierarchy", | - | ||||||||||||||||||||||||||||||||||||
| 2546 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||
| 2547 | , | - | ||||||||||||||||||||||||||||||||||||
| 2548 | 4307 | - | ||||||||||||||||||||||||||||||||||||
| 2549 | ) : qt_noop()) | - | ||||||||||||||||||||||||||||||||||||
| 2550 | ; | - | ||||||||||||||||||||||||||||||||||||
| 2551 | - | |||||||||||||||||||||||||||||||||||||
| 2552 | p = w->mapFromParent(p); | - | ||||||||||||||||||||||||||||||||||||
| 2553 | w = w->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 2554 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2555 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2556 | return never executed: p;return p;never executed: return p; | 0 | ||||||||||||||||||||||||||||||||||||
| 2557 | } | - | ||||||||||||||||||||||||||||||||||||
| 2558 | QPoint QWidget::mapToParent(const QPoint &pos) const | - | ||||||||||||||||||||||||||||||||||||
| 2559 | { | - | ||||||||||||||||||||||||||||||||||||
| 2560 | return never executed: pos + data->crect.topLeft();return pos + data->crect.topLeft();never executed: return pos + data->crect.topLeft(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2561 | } | - | ||||||||||||||||||||||||||||||||||||
| 2562 | QPoint QWidget::mapFromParent(const QPoint &pos) const | - | ||||||||||||||||||||||||||||||||||||
| 2563 | { | - | ||||||||||||||||||||||||||||||||||||
| 2564 | return never executed: pos - data->crect.topLeft();return pos - data->crect.topLeft();never executed: return pos - data->crect.topLeft(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2565 | } | - | ||||||||||||||||||||||||||||||||||||
| 2566 | QWidget *QWidget::window() const | - | ||||||||||||||||||||||||||||||||||||
| 2567 | { | - | ||||||||||||||||||||||||||||||||||||
| 2568 | QWidget *w = const_cast<QWidget *>(this); | - | ||||||||||||||||||||||||||||||||||||
| 2569 | QWidget *p = w->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 2570 | while (!w->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2571 | w = p; | - | ||||||||||||||||||||||||||||||||||||
| 2572 | p = p->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 2573 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2574 | return never executed: w;return w;never executed: return w; | 0 | ||||||||||||||||||||||||||||||||||||
| 2575 | } | - | ||||||||||||||||||||||||||||||||||||
| 2576 | QWidget *QWidget::nativeParentWidget() const | - | ||||||||||||||||||||||||||||||||||||
| 2577 | { | - | ||||||||||||||||||||||||||||||||||||
| 2578 | QWidget *parent = parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 2579 | while (parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 2580 | parent = parent->parentWidget(); never executed: parent = parent->parentWidget(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2581 | return never executed: parent;return parent;never executed: return parent; | 0 | ||||||||||||||||||||||||||||||||||||
| 2582 | } | - | ||||||||||||||||||||||||||||||||||||
| 2583 | QPalette::ColorRole QWidget::backgroundRole() const | - | ||||||||||||||||||||||||||||||||||||
| 2584 | { | - | ||||||||||||||||||||||||||||||||||||
| 2585 | - | |||||||||||||||||||||||||||||||||||||
| 2586 | const QWidget *w = this; | - | ||||||||||||||||||||||||||||||||||||
| 2587 | do { | - | ||||||||||||||||||||||||||||||||||||
| 2588 | QPalette::ColorRole role = w->d_func()->bg_role; | - | ||||||||||||||||||||||||||||||||||||
| 2589 | if (role != QPalette::NoRole
| 0 | ||||||||||||||||||||||||||||||||||||
| 2590 | return never executed: role;return role;never executed: return role; | 0 | ||||||||||||||||||||||||||||||||||||
| 2591 | if (w->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2592 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 2593 | w = w->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 2594 | } never executed: while (wend of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 2595 | return never executed: QPalette::Window;return QPalette::Window;never executed: return QPalette::Window; | 0 | ||||||||||||||||||||||||||||||||||||
| 2596 | } | - | ||||||||||||||||||||||||||||||||||||
| 2597 | void QWidget::setBackgroundRole(QPalette::ColorRole role) | - | ||||||||||||||||||||||||||||||||||||
| 2598 | { | - | ||||||||||||||||||||||||||||||||||||
| 2599 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2600 | d->bg_role = role; | - | ||||||||||||||||||||||||||||||||||||
| 2601 | d->updateSystemBackground(); | - | ||||||||||||||||||||||||||||||||||||
| 2602 | d->propagatePaletteChange(); | - | ||||||||||||||||||||||||||||||||||||
| 2603 | d->updateIsOpaque(); | - | ||||||||||||||||||||||||||||||||||||
| 2604 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2605 | QPalette::ColorRole QWidget::foregroundRole() const | - | ||||||||||||||||||||||||||||||||||||
| 2606 | { | - | ||||||||||||||||||||||||||||||||||||
| 2607 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2608 | QPalette::ColorRole rl = QPalette::ColorRole(d->fg_role); | - | ||||||||||||||||||||||||||||||||||||
| 2609 | if (rl != QPalette::NoRole
| 0 | ||||||||||||||||||||||||||||||||||||
| 2610 | return never executed: rl;return rl;never executed: return rl; | 0 | ||||||||||||||||||||||||||||||||||||
| 2611 | QPalette::ColorRole role = QPalette::WindowText; | - | ||||||||||||||||||||||||||||||||||||
| 2612 | switch (backgroundRole()) { | - | ||||||||||||||||||||||||||||||||||||
| 2613 | case never executed: QPalette::Button:case QPalette::Button:never executed: case QPalette::Button: | 0 | ||||||||||||||||||||||||||||||||||||
| 2614 | role = QPalette::ButtonText; | - | ||||||||||||||||||||||||||||||||||||
| 2615 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 2616 | case never executed: QPalette::Base:case QPalette::Base:never executed: case QPalette::Base: | 0 | ||||||||||||||||||||||||||||||||||||
| 2617 | role = QPalette::Text; | - | ||||||||||||||||||||||||||||||||||||
| 2618 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 2619 | case never executed: QPalette::Dark:case QPalette::Dark:never executed: case QPalette::Dark: | 0 | ||||||||||||||||||||||||||||||||||||
| 2620 | case never executed: QPalette::Shadow:case QPalette::Shadow:never executed: case QPalette::Shadow: | 0 | ||||||||||||||||||||||||||||||||||||
| 2621 | role = QPalette::Light; | - | ||||||||||||||||||||||||||||||||||||
| 2622 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 2623 | case never executed: QPalette::Highlight:case QPalette::Highlight:never executed: case QPalette::Highlight: | 0 | ||||||||||||||||||||||||||||||||||||
| 2624 | role = QPalette::HighlightedText; | - | ||||||||||||||||||||||||||||||||||||
| 2625 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 2626 | case never executed: QPalette::ToolTipBase:case QPalette::ToolTipBase:never executed: case QPalette::ToolTipBase: | 0 | ||||||||||||||||||||||||||||||||||||
| 2627 | role = QPalette::ToolTipText; | - | ||||||||||||||||||||||||||||||||||||
| 2628 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 2629 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
| 2630 | ; | - | ||||||||||||||||||||||||||||||||||||
| 2631 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2632 | return never executed: role;return role;never executed: return role; | 0 | ||||||||||||||||||||||||||||||||||||
| 2633 | } | - | ||||||||||||||||||||||||||||||||||||
| 2634 | void QWidget::setForegroundRole(QPalette::ColorRole role) | - | ||||||||||||||||||||||||||||||||||||
| 2635 | { | - | ||||||||||||||||||||||||||||||||||||
| 2636 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2637 | d->fg_role = role; | - | ||||||||||||||||||||||||||||||||||||
| 2638 | d->updateSystemBackground(); | - | ||||||||||||||||||||||||||||||||||||
| 2639 | d->propagatePaletteChange(); | - | ||||||||||||||||||||||||||||||||||||
| 2640 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2641 | const QPalette &QWidget::palette() const | - | ||||||||||||||||||||||||||||||||||||
| 2642 | { | - | ||||||||||||||||||||||||||||||||||||
| 2643 | if (!isEnabled()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2644 | data->pal.setCurrentColorGroup(QPalette::Disabled); | - | ||||||||||||||||||||||||||||||||||||
| 2645 | } never executed: else if ((!isVisible()end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 2646 | - | |||||||||||||||||||||||||||||||||||||
| 2647 | - | |||||||||||||||||||||||||||||||||||||
| 2648 | - | |||||||||||||||||||||||||||||||||||||
| 2649 | ) { | - | ||||||||||||||||||||||||||||||||||||
| 2650 | data->pal.setCurrentColorGroup(QPalette::Active); | - | ||||||||||||||||||||||||||||||||||||
| 2651 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2652 | - | |||||||||||||||||||||||||||||||||||||
| 2653 | - | |||||||||||||||||||||||||||||||||||||
| 2654 | - | |||||||||||||||||||||||||||||||||||||
| 2655 | - | |||||||||||||||||||||||||||||||||||||
| 2656 | - | |||||||||||||||||||||||||||||||||||||
| 2657 | - | |||||||||||||||||||||||||||||||||||||
| 2658 | data->pal.setCurrentColorGroup(QPalette::Inactive); | - | ||||||||||||||||||||||||||||||||||||
| 2659 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2660 | return never executed: data->pal;return data->pal;never executed: return data->pal; | 0 | ||||||||||||||||||||||||||||||||||||
| 2661 | } | - | ||||||||||||||||||||||||||||||||||||
| 2662 | - | |||||||||||||||||||||||||||||||||||||
| 2663 | void QWidget::setPalette(const QPalette &palette) | - | ||||||||||||||||||||||||||||||||||||
| 2664 | { | - | ||||||||||||||||||||||||||||||||||||
| 2665 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2666 | setAttribute(Qt::WA_SetPalette, palette.resolve() != 0); | - | ||||||||||||||||||||||||||||||||||||
| 2667 | - | |||||||||||||||||||||||||||||||||||||
| 2668 | - | |||||||||||||||||||||||||||||||||||||
| 2669 | - | |||||||||||||||||||||||||||||||||||||
| 2670 | - | |||||||||||||||||||||||||||||||||||||
| 2671 | - | |||||||||||||||||||||||||||||||||||||
| 2672 | QPalette naturalPalette = d->naturalWidgetPalette(d->inheritedPaletteResolveMask); | - | ||||||||||||||||||||||||||||||||||||
| 2673 | QPalette resolvedPalette = palette.resolve(naturalPalette); | - | ||||||||||||||||||||||||||||||||||||
| 2674 | d->setPalette_helper(resolvedPalette); | - | ||||||||||||||||||||||||||||||||||||
| 2675 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2676 | QPalette QWidgetPrivate::naturalWidgetPalette(uint inheritedMask) const | - | ||||||||||||||||||||||||||||||||||||
| 2677 | { | - | ||||||||||||||||||||||||||||||||||||
| 2678 | const QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2679 | - | |||||||||||||||||||||||||||||||||||||
| 2680 | const bool useStyleSheetPropagationInWidgetStyles = | - | ||||||||||||||||||||||||||||||||||||
| 2681 | QCoreApplication::testAttribute(Qt::AA_UseStyleSheetPropagationInWidgetStyles); | - | ||||||||||||||||||||||||||||||||||||
| 2682 | - | |||||||||||||||||||||||||||||||||||||
| 2683 | QPalette naturalPalette = QApplication::palette(q); | - | ||||||||||||||||||||||||||||||||||||
| 2684 | if ((!q->testAttribute(Qt::WA_StyleSheet)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2685 | && (!q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2686 | - | |||||||||||||||||||||||||||||||||||||
| 2687 | || (extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 2688 | - | |||||||||||||||||||||||||||||||||||||
| 2689 | )) { | - | ||||||||||||||||||||||||||||||||||||
| 2690 | if (QWidget *p = q->parentWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2691 | if (!p->testAttribute(Qt::WA_StyleSheet)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2692 | if (!naturalPalette.isCopyOf(QApplication::palette())
| 0 | ||||||||||||||||||||||||||||||||||||
| 2693 | QPalette inheritedPalette = p->palette(); | - | ||||||||||||||||||||||||||||||||||||
| 2694 | inheritedPalette.resolve(inheritedMask); | - | ||||||||||||||||||||||||||||||||||||
| 2695 | naturalPalette = inheritedPalette.resolve(naturalPalette); | - | ||||||||||||||||||||||||||||||||||||
| 2696 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2697 | naturalPalette = p->palette(); | - | ||||||||||||||||||||||||||||||||||||
| 2698 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2699 | } | - | ||||||||||||||||||||||||||||||||||||
| 2700 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2701 | - | |||||||||||||||||||||||||||||||||||||
| 2702 | else if (extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 2703 | QPalette inheritedPalette = extra->proxyWidget->palette(); | - | ||||||||||||||||||||||||||||||||||||
| 2704 | inheritedPalette.resolve(inheritedMask); | - | ||||||||||||||||||||||||||||||||||||
| 2705 | naturalPalette = inheritedPalette.resolve(naturalPalette); | - | ||||||||||||||||||||||||||||||||||||
| 2706 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2707 | - | |||||||||||||||||||||||||||||||||||||
| 2708 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2709 | naturalPalette.resolve(0); | - | ||||||||||||||||||||||||||||||||||||
| 2710 | return never executed: naturalPalette;return naturalPalette;never executed: return naturalPalette; | 0 | ||||||||||||||||||||||||||||||||||||
| 2711 | } | - | ||||||||||||||||||||||||||||||||||||
| 2712 | void QWidgetPrivate::resolvePalette() | - | ||||||||||||||||||||||||||||||||||||
| 2713 | { | - | ||||||||||||||||||||||||||||||||||||
| 2714 | QPalette naturalPalette = naturalWidgetPalette(inheritedPaletteResolveMask); | - | ||||||||||||||||||||||||||||||||||||
| 2715 | QPalette resolvedPalette = data.pal.resolve(naturalPalette); | - | ||||||||||||||||||||||||||||||||||||
| 2716 | setPalette_helper(resolvedPalette); | - | ||||||||||||||||||||||||||||||||||||
| 2717 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2718 | - | |||||||||||||||||||||||||||||||||||||
| 2719 | void QWidgetPrivate::setPalette_helper(const QPalette &palette) | - | ||||||||||||||||||||||||||||||||||||
| 2720 | { | - | ||||||||||||||||||||||||||||||||||||
| 2721 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2722 | if (data.pal == palette
| 0 | ||||||||||||||||||||||||||||||||||||
| 2723 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2724 | data.pal = palette; | - | ||||||||||||||||||||||||||||||||||||
| 2725 | updateSystemBackground(); | - | ||||||||||||||||||||||||||||||||||||
| 2726 | propagatePaletteChange(); | - | ||||||||||||||||||||||||||||||||||||
| 2727 | updateIsOpaque(); | - | ||||||||||||||||||||||||||||||||||||
| 2728 | q->update(); | - | ||||||||||||||||||||||||||||||||||||
| 2729 | updateIsOpaque(); | - | ||||||||||||||||||||||||||||||||||||
| 2730 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2731 | - | |||||||||||||||||||||||||||||||||||||
| 2732 | void QWidgetPrivate::updateSystemBackground() | - | ||||||||||||||||||||||||||||||||||||
| 2733 | { | - | ||||||||||||||||||||||||||||||||||||
| 2734 | } | - | ||||||||||||||||||||||||||||||||||||
| 2735 | void QWidget::setFont(const QFont &font) | - | ||||||||||||||||||||||||||||||||||||
| 2736 | { | - | ||||||||||||||||||||||||||||||||||||
| 2737 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2738 | - | |||||||||||||||||||||||||||||||||||||
| 2739 | - | |||||||||||||||||||||||||||||||||||||
| 2740 | const QStyleSheetStyle* style; | - | ||||||||||||||||||||||||||||||||||||
| 2741 | if (d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 2742 | style->saveWidgetFont(this, font); | - | ||||||||||||||||||||||||||||||||||||
| 2743 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2744 | - | |||||||||||||||||||||||||||||||||||||
| 2745 | - | |||||||||||||||||||||||||||||||||||||
| 2746 | setAttribute(Qt::WA_SetFont, font.resolve() != 0); | - | ||||||||||||||||||||||||||||||||||||
| 2747 | - | |||||||||||||||||||||||||||||||||||||
| 2748 | - | |||||||||||||||||||||||||||||||||||||
| 2749 | - | |||||||||||||||||||||||||||||||||||||
| 2750 | - | |||||||||||||||||||||||||||||||||||||
| 2751 | - | |||||||||||||||||||||||||||||||||||||
| 2752 | QFont naturalFont = d->naturalWidgetFont(d->inheritedFontResolveMask); | - | ||||||||||||||||||||||||||||||||||||
| 2753 | QFont resolvedFont = font.resolve(naturalFont); | - | ||||||||||||||||||||||||||||||||||||
| 2754 | d->setFont_helper(resolvedFont); | - | ||||||||||||||||||||||||||||||||||||
| 2755 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2756 | QFont QWidgetPrivate::naturalWidgetFont(uint inheritedMask) const | - | ||||||||||||||||||||||||||||||||||||
| 2757 | { | - | ||||||||||||||||||||||||||||||||||||
| 2758 | const QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2759 | - | |||||||||||||||||||||||||||||||||||||
| 2760 | const bool useStyleSheetPropagationInWidgetStyles = | - | ||||||||||||||||||||||||||||||||||||
| 2761 | QCoreApplication::testAttribute(Qt::AA_UseStyleSheetPropagationInWidgetStyles); | - | ||||||||||||||||||||||||||||||||||||
| 2762 | - | |||||||||||||||||||||||||||||||||||||
| 2763 | QFont naturalFont = QApplication::font(q); | - | ||||||||||||||||||||||||||||||||||||
| 2764 | if ((!q->testAttribute(Qt::WA_StyleSheet)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2765 | && (!q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2766 | - | |||||||||||||||||||||||||||||||||||||
| 2767 | || (extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 2768 | - | |||||||||||||||||||||||||||||||||||||
| 2769 | )) { | - | ||||||||||||||||||||||||||||||||||||
| 2770 | if (QWidget *p = q->parentWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2771 | if (!p->testAttribute(Qt::WA_StyleSheet)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2772 | if (!naturalFont.isCopyOf(QApplication::font())
| 0 | ||||||||||||||||||||||||||||||||||||
| 2773 | if (inheritedMask != 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 2774 | QFont inheritedFont = p->font(); | - | ||||||||||||||||||||||||||||||||||||
| 2775 | inheritedFont.resolve(inheritedMask); | - | ||||||||||||||||||||||||||||||||||||
| 2776 | naturalFont = inheritedFont.resolve(naturalFont); | - | ||||||||||||||||||||||||||||||||||||
| 2777 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2778 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2779 | naturalFont = p->font(); | - | ||||||||||||||||||||||||||||||||||||
| 2780 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2781 | } | - | ||||||||||||||||||||||||||||||||||||
| 2782 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2783 | - | |||||||||||||||||||||||||||||||||||||
| 2784 | else if (extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 2785 | if (inheritedMask != 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 2786 | QFont inheritedFont = extra->proxyWidget->font(); | - | ||||||||||||||||||||||||||||||||||||
| 2787 | inheritedFont.resolve(inheritedMask); | - | ||||||||||||||||||||||||||||||||||||
| 2788 | naturalFont = inheritedFont.resolve(naturalFont); | - | ||||||||||||||||||||||||||||||||||||
| 2789 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2790 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2791 | - | |||||||||||||||||||||||||||||||||||||
| 2792 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2793 | naturalFont.resolve(0); | - | ||||||||||||||||||||||||||||||||||||
| 2794 | return never executed: naturalFont;return naturalFont;never executed: return naturalFont; | 0 | ||||||||||||||||||||||||||||||||||||
| 2795 | } | - | ||||||||||||||||||||||||||||||||||||
| 2796 | void QWidgetPrivate::resolveFont() | - | ||||||||||||||||||||||||||||||||||||
| 2797 | { | - | ||||||||||||||||||||||||||||||||||||
| 2798 | QFont naturalFont = naturalWidgetFont(inheritedFontResolveMask); | - | ||||||||||||||||||||||||||||||||||||
| 2799 | QFont resolvedFont = data.fnt.resolve(naturalFont); | - | ||||||||||||||||||||||||||||||||||||
| 2800 | setFont_helper(resolvedFont); | - | ||||||||||||||||||||||||||||||||||||
| 2801 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2802 | void QWidgetPrivate::updateFont(const QFont &font) | - | ||||||||||||||||||||||||||||||||||||
| 2803 | { | - | ||||||||||||||||||||||||||||||||||||
| 2804 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2805 | - | |||||||||||||||||||||||||||||||||||||
| 2806 | const QStyleSheetStyle* cssStyle; | - | ||||||||||||||||||||||||||||||||||||
| 2807 | cssStyle = extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 2808 | const bool useStyleSheetPropagationInWidgetStyles = | - | ||||||||||||||||||||||||||||||||||||
| 2809 | QCoreApplication::testAttribute(Qt::AA_UseStyleSheetPropagationInWidgetStyles); | - | ||||||||||||||||||||||||||||||||||||
| 2810 | - | |||||||||||||||||||||||||||||||||||||
| 2811 | - | |||||||||||||||||||||||||||||||||||||
| 2812 | data.fnt = QFont(font, q); | - | ||||||||||||||||||||||||||||||||||||
| 2813 | - | |||||||||||||||||||||||||||||||||||||
| 2814 | - | |||||||||||||||||||||||||||||||||||||
| 2815 | - | |||||||||||||||||||||||||||||||||||||
| 2816 | - | |||||||||||||||||||||||||||||||||||||
| 2817 | - | |||||||||||||||||||||||||||||||||||||
| 2818 | - | |||||||||||||||||||||||||||||||||||||
| 2819 | if (!q->parentWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2820 | QGraphicsProxyWidget *p = extra->proxyWidget; | - | ||||||||||||||||||||||||||||||||||||
| 2821 | inheritedFontResolveMask = p->d_func()->inheritedFontResolveMask | p->font().resolve(); | - | ||||||||||||||||||||||||||||||||||||
| 2822 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2823 | - | |||||||||||||||||||||||||||||||||||||
| 2824 | if (q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2825 | inheritedFontResolveMask = 0; | - | ||||||||||||||||||||||||||||||||||||
| 2826 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2827 | uint newMask = data.fnt.resolve() | inheritedFontResolveMask; | - | ||||||||||||||||||||||||||||||||||||
| 2828 | - | |||||||||||||||||||||||||||||||||||||
| 2829 | for (int i = 0; i < children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2830 | QWidget *w = qobject_cast<QWidget*>(children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 2831 | if (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 2832 | if (0) { dead code: { } | - | ||||||||||||||||||||||||||||||||||||
| 2833 | - | |||||||||||||||||||||||||||||||||||||
| 2834 | } dead code: else if (!useStyleSheetPropagationInWidgetStyles{ }
| - | ||||||||||||||||||||||||||||||||||||
| 2835 | - | |||||||||||||||||||||||||||||||||||||
| 2836 | if (cssStyle
| 0 | ||||||||||||||||||||||||||||||||||||
| 2837 | cssStyle->updateStyleSheetFont(w); never executed: cssStyle->updateStyleSheetFont(w); | 0 | ||||||||||||||||||||||||||||||||||||
| 2838 | - | |||||||||||||||||||||||||||||||||||||
| 2839 | } never executed: else if ((!w->isWindow()end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 2840 | - | |||||||||||||||||||||||||||||||||||||
| 2841 | QWidgetPrivate *wd = w->d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2842 | wd->inheritedFontResolveMask = newMask; | - | ||||||||||||||||||||||||||||||||||||
| 2843 | wd->resolveFont(); | - | ||||||||||||||||||||||||||||||||||||
| 2844 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2845 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2846 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2847 | - | |||||||||||||||||||||||||||||||||||||
| 2848 | - | |||||||||||||||||||||||||||||||||||||
| 2849 | if (!useStyleSheetPropagationInWidgetStyles
| 0 | ||||||||||||||||||||||||||||||||||||
| 2850 | cssStyle->updateStyleSheetFont(q); | - | ||||||||||||||||||||||||||||||||||||
| 2851 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2852 | - | |||||||||||||||||||||||||||||||||||||
| 2853 | - | |||||||||||||||||||||||||||||||||||||
| 2854 | QEvent e(QEvent::FontChange); | - | ||||||||||||||||||||||||||||||||||||
| 2855 | QApplication::sendEvent(q, &e); | - | ||||||||||||||||||||||||||||||||||||
| 2856 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2857 | - | |||||||||||||||||||||||||||||||||||||
| 2858 | void QWidgetPrivate::setLayoutDirection_helper(Qt::LayoutDirection direction) | - | ||||||||||||||||||||||||||||||||||||
| 2859 | { | - | ||||||||||||||||||||||||||||||||||||
| 2860 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2861 | - | |||||||||||||||||||||||||||||||||||||
| 2862 | if ( (
| 0 | ||||||||||||||||||||||||||||||||||||
| 2863 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2864 | q->setAttribute(Qt::WA_RightToLeft, (direction == Qt::RightToLeft)); | - | ||||||||||||||||||||||||||||||||||||
| 2865 | if (!children.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2866 | for (int i = 0; i < children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2867 | QWidget *w = qobject_cast<QWidget*>(children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 2868 | if (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 2869 | w->d_func()->setLayoutDirection_helper(direction); never executed: w->d_func()->setLayoutDirection_helper(direction); | 0 | ||||||||||||||||||||||||||||||||||||
| 2870 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2871 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2872 | QEvent e(QEvent::LayoutDirectionChange); | - | ||||||||||||||||||||||||||||||||||||
| 2873 | QApplication::sendEvent(q, &e); | - | ||||||||||||||||||||||||||||||||||||
| 2874 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2875 | - | |||||||||||||||||||||||||||||||||||||
| 2876 | void QWidgetPrivate::resolveLayoutDirection() | - | ||||||||||||||||||||||||||||||||||||
| 2877 | { | - | ||||||||||||||||||||||||||||||||||||
| 2878 | const QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2879 | if (!q->testAttribute(Qt::WA_SetLayoutDirection)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2880 | setLayoutDirection_helper(q->isWindow() ? QApplication::layoutDirection() : q->parentWidget()->layoutDirection()); never executed: setLayoutDirection_helper(q->isWindow() ? QApplication::layoutDirection() : q->parentWidget()->layoutDirection()); | 0 | ||||||||||||||||||||||||||||||||||||
| 2881 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2882 | void QWidget::setLayoutDirection(Qt::LayoutDirection direction) | - | ||||||||||||||||||||||||||||||||||||
| 2883 | { | - | ||||||||||||||||||||||||||||||||||||
| 2884 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2885 | - | |||||||||||||||||||||||||||||||||||||
| 2886 | if (direction == Qt::LayoutDirectionAuto
| 0 | ||||||||||||||||||||||||||||||||||||
| 2887 | unsetLayoutDirection(); | - | ||||||||||||||||||||||||||||||||||||
| 2888 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2889 | } | - | ||||||||||||||||||||||||||||||||||||
| 2890 | - | |||||||||||||||||||||||||||||||||||||
| 2891 | setAttribute(Qt::WA_SetLayoutDirection); | - | ||||||||||||||||||||||||||||||||||||
| 2892 | d->setLayoutDirection_helper(direction); | - | ||||||||||||||||||||||||||||||||||||
| 2893 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2894 | - | |||||||||||||||||||||||||||||||||||||
| 2895 | Qt::LayoutDirection QWidget::layoutDirection() const | - | ||||||||||||||||||||||||||||||||||||
| 2896 | { | - | ||||||||||||||||||||||||||||||||||||
| 2897 | return never executed: testAttribute(Qt::WA_RightToLeft) ? Qt::RightToLeft : Qt::LeftToRight;return testAttribute(Qt::WA_RightToLeft) ? Qt::RightToLeft : Qt::LeftToRight;never executed: return testAttribute(Qt::WA_RightToLeft) ? Qt::RightToLeft : Qt::LeftToRight; | 0 | ||||||||||||||||||||||||||||||||||||
| 2898 | } | - | ||||||||||||||||||||||||||||||||||||
| 2899 | - | |||||||||||||||||||||||||||||||||||||
| 2900 | void QWidget::unsetLayoutDirection() | - | ||||||||||||||||||||||||||||||||||||
| 2901 | { | - | ||||||||||||||||||||||||||||||||||||
| 2902 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2903 | setAttribute(Qt::WA_SetLayoutDirection, false); | - | ||||||||||||||||||||||||||||||||||||
| 2904 | d->resolveLayoutDirection(); | - | ||||||||||||||||||||||||||||||||||||
| 2905 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2906 | QCursor QWidget::cursor() const | - | ||||||||||||||||||||||||||||||||||||
| 2907 | { | - | ||||||||||||||||||||||||||||||||||||
| 2908 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2909 | if (testAttribute(Qt::WA_SetCursor)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2910 | return never executed: (d->extra && d->extra->curs)return (d->extra && d->extra->curs) ? *d->extra->curs : QCursor(Qt::ArrowCursor);never executed: return (d->extra && d->extra->curs) ? *d->extra->curs : QCursor(Qt::ArrowCursor); | 0 | ||||||||||||||||||||||||||||||||||||
| 2911 | ? *d->extra->curs never executed: return (d->extra && d->extra->curs) ? *d->extra->curs : QCursor(Qt::ArrowCursor); | 0 | ||||||||||||||||||||||||||||||||||||
| 2912 | : QCursor(Qt::ArrowCursor); never executed: return (d->extra && d->extra->curs) ? *d->extra->curs : QCursor(Qt::ArrowCursor); | 0 | ||||||||||||||||||||||||||||||||||||
| 2913 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2914 | return never executed: QCursor(Qt::ArrowCursor);return QCursor(Qt::ArrowCursor);never executed: return QCursor(Qt::ArrowCursor); | 0 | ||||||||||||||||||||||||||||||||||||
| 2915 | return never executed: parentWidget()->cursor();return parentWidget()->cursor();never executed: return parentWidget()->cursor(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2916 | } | - | ||||||||||||||||||||||||||||||||||||
| 2917 | - | |||||||||||||||||||||||||||||||||||||
| 2918 | void QWidget::setCursor(const QCursor &cursor) | - | ||||||||||||||||||||||||||||||||||||
| 2919 | { | - | ||||||||||||||||||||||||||||||||||||
| 2920 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2921 | - | |||||||||||||||||||||||||||||||||||||
| 2922 | - | |||||||||||||||||||||||||||||||||||||
| 2923 | if (cursor.shape() != Qt::ArrowCursor
| 0 | ||||||||||||||||||||||||||||||||||||
| 2924 | || (d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 2925 | - | |||||||||||||||||||||||||||||||||||||
| 2926 | { | - | ||||||||||||||||||||||||||||||||||||
| 2927 | d->createExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 2928 | QCursor *newCursor = new QCursor(cursor); | - | ||||||||||||||||||||||||||||||||||||
| 2929 | delete d->extra->curs; | - | ||||||||||||||||||||||||||||||||||||
| 2930 | d->extra->curs = newCursor; | - | ||||||||||||||||||||||||||||||||||||
| 2931 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2932 | setAttribute(Qt::WA_SetCursor); | - | ||||||||||||||||||||||||||||||||||||
| 2933 | d->setCursor_sys(cursor); | - | ||||||||||||||||||||||||||||||||||||
| 2934 | - | |||||||||||||||||||||||||||||||||||||
| 2935 | QEvent event(QEvent::CursorChange); | - | ||||||||||||||||||||||||||||||||||||
| 2936 | QApplication::sendEvent(this, &event); | - | ||||||||||||||||||||||||||||||||||||
| 2937 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2938 | - | |||||||||||||||||||||||||||||||||||||
| 2939 | void QWidgetPrivate::setCursor_sys(const QCursor &cursor) | - | ||||||||||||||||||||||||||||||||||||
| 2940 | { | - | ||||||||||||||||||||||||||||||||||||
| 2941 | (void)cursor;; | - | ||||||||||||||||||||||||||||||||||||
| 2942 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2943 | qt_qpa_set_cursor(q, false); | - | ||||||||||||||||||||||||||||||||||||
| 2944 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2945 | - | |||||||||||||||||||||||||||||||||||||
| 2946 | void QWidget::unsetCursor() | - | ||||||||||||||||||||||||||||||||||||
| 2947 | { | - | ||||||||||||||||||||||||||||||||||||
| 2948 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2949 | if (d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 2950 | delete d->extra->curs; | - | ||||||||||||||||||||||||||||||||||||
| 2951 | d->extra->curs = 0; | - | ||||||||||||||||||||||||||||||||||||
| 2952 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2953 | if (!isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2954 | setAttribute(Qt::WA_SetCursor, false); never executed: setAttribute(Qt::WA_SetCursor, false); | 0 | ||||||||||||||||||||||||||||||||||||
| 2955 | d->unsetCursor_sys(); | - | ||||||||||||||||||||||||||||||||||||
| 2956 | - | |||||||||||||||||||||||||||||||||||||
| 2957 | QEvent event(QEvent::CursorChange); | - | ||||||||||||||||||||||||||||||||||||
| 2958 | QApplication::sendEvent(this, &event); | - | ||||||||||||||||||||||||||||||||||||
| 2959 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2960 | - | |||||||||||||||||||||||||||||||||||||
| 2961 | void QWidgetPrivate::unsetCursor_sys() | - | ||||||||||||||||||||||||||||||||||||
| 2962 | { | - | ||||||||||||||||||||||||||||||||||||
| 2963 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 2964 | qt_qpa_set_cursor(q, false); | - | ||||||||||||||||||||||||||||||||||||
| 2965 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2966 | - | |||||||||||||||||||||||||||||||||||||
| 2967 | static inline void applyCursor(QWidget *w, const QCursor &c) | - | ||||||||||||||||||||||||||||||||||||
| 2968 | { | - | ||||||||||||||||||||||||||||||||||||
| 2969 | if (QWindow *window = w->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2970 | window->setCursor(c); never executed: window->setCursor(c); | 0 | ||||||||||||||||||||||||||||||||||||
| 2971 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2972 | - | |||||||||||||||||||||||||||||||||||||
| 2973 | static inline void unsetCursor(QWidget *w) | - | ||||||||||||||||||||||||||||||||||||
| 2974 | { | - | ||||||||||||||||||||||||||||||||||||
| 2975 | if (QWindow *window = w->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2976 | window->unsetCursor(); never executed: window->unsetCursor(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2977 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 2978 | - | |||||||||||||||||||||||||||||||||||||
| 2979 | void qt_qpa_set_cursor(QWidget *w, bool force) | - | ||||||||||||||||||||||||||||||||||||
| 2980 | { | - | ||||||||||||||||||||||||||||||||||||
| 2981 | if (!w->testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2982 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2983 | - | |||||||||||||||||||||||||||||||||||||
| 2984 | static QPointer<QWidget> lastUnderMouse = 0; | - | ||||||||||||||||||||||||||||||||||||
| 2985 | if (force
| 0 | ||||||||||||||||||||||||||||||||||||
| 2986 | lastUnderMouse = w; | - | ||||||||||||||||||||||||||||||||||||
| 2987 | } never executed: else if (lastUnderMouseend of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 2988 | const WId lastWinId = lastUnderMouse->effectiveWinId(); | - | ||||||||||||||||||||||||||||||||||||
| 2989 | const WId winId = w->effectiveWinId(); | - | ||||||||||||||||||||||||||||||||||||
| 2990 | if (lastWinId
| 0 | ||||||||||||||||||||||||||||||||||||
| 2991 | w = lastUnderMouse; never executed: w = lastUnderMouse; | 0 | ||||||||||||||||||||||||||||||||||||
| 2992 | } never executed: else if (!w->internalWinId()end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 2993 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 2994 | } | - | ||||||||||||||||||||||||||||||||||||
| 2995 | - | |||||||||||||||||||||||||||||||||||||
| 2996 | while (!w->internalWinId()
| 0 | ||||||||||||||||||||||||||||||||||||
| 2997 | && !w->testAttribute(Qt::WA_SetCursor)
| 0 | ||||||||||||||||||||||||||||||||||||
| 2998 | w = w->parentWidget(); never executed: w = w->parentWidget(); | 0 | ||||||||||||||||||||||||||||||||||||
| 2999 | - | |||||||||||||||||||||||||||||||||||||
| 3000 | QWidget *nativeParent = w; | - | ||||||||||||||||||||||||||||||||||||
| 3001 | if (!w->internalWinId()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3002 | nativeParent = w->nativeParentWidget(); never executed: nativeParent = w->nativeParentWidget(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3003 | if (!nativeParent
| 0 | ||||||||||||||||||||||||||||||||||||
| 3004 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3005 | - | |||||||||||||||||||||||||||||||||||||
| 3006 | if (w->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3007 | if (w->isEnabled()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3008 | applyCursor(nativeParent, w->cursor()); never executed: applyCursor(nativeParent, w->cursor()); | 0 | ||||||||||||||||||||||||||||||||||||
| 3009 | else | - | ||||||||||||||||||||||||||||||||||||
| 3010 | - | |||||||||||||||||||||||||||||||||||||
| 3011 | - | |||||||||||||||||||||||||||||||||||||
| 3012 | unsetCursor(nativeParent); never executed: unsetCursor(nativeParent); | 0 | ||||||||||||||||||||||||||||||||||||
| 3013 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 3014 | unsetCursor(nativeParent); | - | ||||||||||||||||||||||||||||||||||||
| 3015 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3016 | } | - | ||||||||||||||||||||||||||||||||||||
| 3017 | void QWidget::render(QPaintDevice *target, const QPoint &targetOffset, | - | ||||||||||||||||||||||||||||||||||||
| 3018 | const QRegion &sourceRegion, RenderFlags renderFlags) | - | ||||||||||||||||||||||||||||||||||||
| 3019 | { | - | ||||||||||||||||||||||||||||||||||||
| 3020 | QPainter p(target); | - | ||||||||||||||||||||||||||||||||||||
| 3021 | render(&p, targetOffset, sourceRegion, renderFlags); | - | ||||||||||||||||||||||||||||||||||||
| 3022 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3023 | void QWidget::render(QPainter *painter, const QPoint &targetOffset, | - | ||||||||||||||||||||||||||||||||||||
| 3024 | const QRegion &sourceRegion, RenderFlags renderFlags) | - | ||||||||||||||||||||||||||||||||||||
| 3025 | { | - | ||||||||||||||||||||||||||||||||||||
| 3026 | if (__builtin_expect(!!(!painter), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3027 | QMessageLogger(__FILE__, 5163, __PRETTY_FUNCTION__).warning("QWidget::render: Null pointer to painter"); | - | ||||||||||||||||||||||||||||||||||||
| 3028 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3029 | } | - | ||||||||||||||||||||||||||||||||||||
| 3030 | - | |||||||||||||||||||||||||||||||||||||
| 3031 | if (__builtin_expect(!!(!painter->isActive()), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3032 | QMessageLogger(__FILE__, 5168, __PRETTY_FUNCTION__).warning("QWidget::render: Cannot render with an inactive painter"); | - | ||||||||||||||||||||||||||||||||||||
| 3033 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3034 | } | - | ||||||||||||||||||||||||||||||||||||
| 3035 | - | |||||||||||||||||||||||||||||||||||||
| 3036 | const qreal opacity = painter->opacity(); | - | ||||||||||||||||||||||||||||||||||||
| 3037 | if (qFuzzyIsNull(opacity)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3038 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3039 | - | |||||||||||||||||||||||||||||||||||||
| 3040 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3041 | const bool inRenderWithPainter = d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 3042 | const QRegion toBePainted = !inRenderWithPainter
| 0 | ||||||||||||||||||||||||||||||||||||
| 3043 | : sourceRegion; | - | ||||||||||||||||||||||||||||||||||||
| 3044 | if (toBePainted.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3045 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3046 | - | |||||||||||||||||||||||||||||||||||||
| 3047 | if (!d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 3048 | d->createExtra(); never executed: d->createExtra(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3049 | d->extra->inRenderWithPainter = true; | - | ||||||||||||||||||||||||||||||||||||
| 3050 | - | |||||||||||||||||||||||||||||||||||||
| 3051 | QPaintEngine *engine = painter->paintEngine(); | - | ||||||||||||||||||||||||||||||||||||
| 3052 | ((!(engine)) ? qt_assert("engine",__FILE__,5188) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 3053 | QPaintEnginePrivate *enginePriv = engine->d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3054 | ((!(enginePriv)) ? qt_assert("enginePriv",__FILE__,5190) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 3055 | QPaintDevice *target = engine->paintDevice(); | - | ||||||||||||||||||||||||||||||||||||
| 3056 | ((!(target)) ? qt_assert("target",__FILE__,5192) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 3057 | - | |||||||||||||||||||||||||||||||||||||
| 3058 | - | |||||||||||||||||||||||||||||||||||||
| 3059 | if (!inRenderWithPainter
| 0 | ||||||||||||||||||||||||||||||||||||
| 3060 | d->render_helper(painter, targetOffset, toBePainted, renderFlags); | - | ||||||||||||||||||||||||||||||||||||
| 3061 | d->extra->inRenderWithPainter = inRenderWithPainter; | - | ||||||||||||||||||||||||||||||||||||
| 3062 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3063 | } | - | ||||||||||||||||||||||||||||||||||||
| 3064 | - | |||||||||||||||||||||||||||||||||||||
| 3065 | - | |||||||||||||||||||||||||||||||||||||
| 3066 | QPainter *oldPainter = d->sharedPainter(); | - | ||||||||||||||||||||||||||||||||||||
| 3067 | d->setSharedPainter(painter); | - | ||||||||||||||||||||||||||||||||||||
| 3068 | - | |||||||||||||||||||||||||||||||||||||
| 3069 | - | |||||||||||||||||||||||||||||||||||||
| 3070 | const QTransform oldTransform = enginePriv->systemTransform; | - | ||||||||||||||||||||||||||||||||||||
| 3071 | const QRegion oldSystemClip = enginePriv->systemClip; | - | ||||||||||||||||||||||||||||||||||||
| 3072 | const QRegion oldSystemViewport = enginePriv->systemViewport; | - | ||||||||||||||||||||||||||||||||||||
| 3073 | - | |||||||||||||||||||||||||||||||||||||
| 3074 | - | |||||||||||||||||||||||||||||||||||||
| 3075 | if (painter->hasClipping()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3076 | const QRegion painterClip = painter->deviceTransform().map(painter->clipRegion()); | - | ||||||||||||||||||||||||||||||||||||
| 3077 | enginePriv->setSystemViewport(oldSystemClip.isEmpty() ? painterClip : oldSystemClip & painterClip); | - | ||||||||||||||||||||||||||||||||||||
| 3078 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3079 | enginePriv->setSystemViewport(oldSystemClip); | - | ||||||||||||||||||||||||||||||||||||
| 3080 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3081 | - | |||||||||||||||||||||||||||||||||||||
| 3082 | d->render(target, targetOffset, toBePainted, renderFlags); | - | ||||||||||||||||||||||||||||||||||||
| 3083 | - | |||||||||||||||||||||||||||||||||||||
| 3084 | - | |||||||||||||||||||||||||||||||||||||
| 3085 | enginePriv->setSystemViewport(oldSystemViewport); | - | ||||||||||||||||||||||||||||||||||||
| 3086 | enginePriv->setSystemTransform(oldTransform); | - | ||||||||||||||||||||||||||||||||||||
| 3087 | enginePriv->systemClip = oldSystemClip; | - | ||||||||||||||||||||||||||||||||||||
| 3088 | - | |||||||||||||||||||||||||||||||||||||
| 3089 | - | |||||||||||||||||||||||||||||||||||||
| 3090 | d->setSharedPainter(oldPainter); | - | ||||||||||||||||||||||||||||||||||||
| 3091 | - | |||||||||||||||||||||||||||||||||||||
| 3092 | d->extra->inRenderWithPainter = inRenderWithPainter; | - | ||||||||||||||||||||||||||||||||||||
| 3093 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3094 | - | |||||||||||||||||||||||||||||||||||||
| 3095 | static void sendResizeEvents(QWidget *target) | - | ||||||||||||||||||||||||||||||||||||
| 3096 | { | - | ||||||||||||||||||||||||||||||||||||
| 3097 | QResizeEvent e(target->size(), QSize()); | - | ||||||||||||||||||||||||||||||||||||
| 3098 | QApplication::sendEvent(target, &e); | - | ||||||||||||||||||||||||||||||||||||
| 3099 | - | |||||||||||||||||||||||||||||||||||||
| 3100 | const QObjectList children = target->children(); | - | ||||||||||||||||||||||||||||||||||||
| 3101 | for (int i = 0; i < children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3102 | if (!children.at(i)->isWidgetType()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3103 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 3104 | QWidget *child = static_cast<QWidget*>(children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 3105 | if (!child->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3106 | sendResizeEvents(child); never executed: sendResizeEvents(child); | 0 | ||||||||||||||||||||||||||||||||||||
| 3107 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3108 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3109 | QPixmap QWidget::grab(const QRect &rectangle) | - | ||||||||||||||||||||||||||||||||||||
| 3110 | { | - | ||||||||||||||||||||||||||||||||||||
| 3111 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3112 | if (testAttribute(Qt::WA_PendingResizeEvent)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3113 | sendResizeEvents(this); never executed: sendResizeEvents(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 3114 | - | |||||||||||||||||||||||||||||||||||||
| 3115 | const QWidget::RenderFlags renderFlags = QWidget::DrawWindowBackground | QWidget::DrawChildren | QWidget::IgnoreMask; | - | ||||||||||||||||||||||||||||||||||||
| 3116 | - | |||||||||||||||||||||||||||||||||||||
| 3117 | const bool oldDirtyOpaqueChildren = d->dirtyOpaqueChildren; | - | ||||||||||||||||||||||||||||||||||||
| 3118 | QRect r(rectangle); | - | ||||||||||||||||||||||||||||||||||||
| 3119 | if (r.width() < 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 3120 | - | |||||||||||||||||||||||||||||||||||||
| 3121 | - | |||||||||||||||||||||||||||||||||||||
| 3122 | r = d->prepareToRender(QRegion(), renderFlags).boundingRect(); | - | ||||||||||||||||||||||||||||||||||||
| 3123 | r.setTopLeft(rectangle.topLeft()); | - | ||||||||||||||||||||||||||||||||||||
| 3124 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3125 | - | |||||||||||||||||||||||||||||||||||||
| 3126 | if (!r.intersects(rect())
| 0 | ||||||||||||||||||||||||||||||||||||
| 3127 | return never executed: QPixmap();return QPixmap();never executed: return QPixmap(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3128 | - | |||||||||||||||||||||||||||||||||||||
| 3129 | const qreal dpr = devicePixelRatioF(); | - | ||||||||||||||||||||||||||||||||||||
| 3130 | QPixmap res((QSizeF(r.size()) * dpr).toSize()); | - | ||||||||||||||||||||||||||||||||||||
| 3131 | res.setDevicePixelRatio(dpr); | - | ||||||||||||||||||||||||||||||||||||
| 3132 | if (!d->isOpaque
| 0 | ||||||||||||||||||||||||||||||||||||
| 3133 | res.fill(Qt::transparent); never executed: res.fill(Qt::transparent); | 0 | ||||||||||||||||||||||||||||||||||||
| 3134 | d->render(&res, QPoint(), QRegion(r), renderFlags); | - | ||||||||||||||||||||||||||||||||||||
| 3135 | - | |||||||||||||||||||||||||||||||||||||
| 3136 | d->dirtyOpaqueChildren = oldDirtyOpaqueChildren; | - | ||||||||||||||||||||||||||||||||||||
| 3137 | return never executed: res;return res;never executed: return res; | 0 | ||||||||||||||||||||||||||||||||||||
| 3138 | } | - | ||||||||||||||||||||||||||||||||||||
| 3139 | QGraphicsEffect *QWidget::graphicsEffect() const | - | ||||||||||||||||||||||||||||||||||||
| 3140 | { | - | ||||||||||||||||||||||||||||||||||||
| 3141 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3142 | return never executed: d->graphicsEffect;return d->graphicsEffect;never executed: return d->graphicsEffect; | 0 | ||||||||||||||||||||||||||||||||||||
| 3143 | } | - | ||||||||||||||||||||||||||||||||||||
| 3144 | void QWidget::setGraphicsEffect(QGraphicsEffect *effect) | - | ||||||||||||||||||||||||||||||||||||
| 3145 | { | - | ||||||||||||||||||||||||||||||||||||
| 3146 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3147 | if (d->graphicsEffect == effect
| 0 | ||||||||||||||||||||||||||||||||||||
| 3148 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3149 | - | |||||||||||||||||||||||||||||||||||||
| 3150 | if (d->graphicsEffect
| 0 | ||||||||||||||||||||||||||||||||||||
| 3151 | d->invalidateBuffer(rect()); | - | ||||||||||||||||||||||||||||||||||||
| 3152 | delete d->graphicsEffect; | - | ||||||||||||||||||||||||||||||||||||
| 3153 | d->graphicsEffect = 0; | - | ||||||||||||||||||||||||||||||||||||
| 3154 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3155 | - | |||||||||||||||||||||||||||||||||||||
| 3156 | if (effect
| 0 | ||||||||||||||||||||||||||||||||||||
| 3157 | - | |||||||||||||||||||||||||||||||||||||
| 3158 | QGraphicsEffectSourcePrivate *sourced = new QWidgetEffectSourcePrivate(this); | - | ||||||||||||||||||||||||||||||||||||
| 3159 | QGraphicsEffectSource *source = new QGraphicsEffectSource(*sourced); | - | ||||||||||||||||||||||||||||||||||||
| 3160 | d->graphicsEffect = effect; | - | ||||||||||||||||||||||||||||||||||||
| 3161 | effect->d_func()->setGraphicsEffectSource(source); | - | ||||||||||||||||||||||||||||||||||||
| 3162 | update(); | - | ||||||||||||||||||||||||||||||||||||
| 3163 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3164 | - | |||||||||||||||||||||||||||||||||||||
| 3165 | d->updateIsOpaque(); | - | ||||||||||||||||||||||||||||||||||||
| 3166 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3167 | - | |||||||||||||||||||||||||||||||||||||
| 3168 | - | |||||||||||||||||||||||||||||||||||||
| 3169 | bool QWidgetPrivate::isAboutToShow() const | - | ||||||||||||||||||||||||||||||||||||
| 3170 | { | - | ||||||||||||||||||||||||||||||||||||
| 3171 | if (data.in_show
| 0 | ||||||||||||||||||||||||||||||||||||
| 3172 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 3173 | - | |||||||||||||||||||||||||||||||||||||
| 3174 | const QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3175 | if (q->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3176 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 3177 | - | |||||||||||||||||||||||||||||||||||||
| 3178 | - | |||||||||||||||||||||||||||||||||||||
| 3179 | QWidget *parent = q->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 3180 | return never executed: parent ? parent->d_func()->isAboutToShow() : false;return parent ? parent->d_func()->isAboutToShow() : false;never executed: return parent ? parent->d_func()->isAboutToShow() : false; | 0 | ||||||||||||||||||||||||||||||||||||
| 3181 | } | - | ||||||||||||||||||||||||||||||||||||
| 3182 | - | |||||||||||||||||||||||||||||||||||||
| 3183 | QRegion QWidgetPrivate::prepareToRender(const QRegion ®ion, QWidget::RenderFlags renderFlags) | - | ||||||||||||||||||||||||||||||||||||
| 3184 | { | - | ||||||||||||||||||||||||||||||||||||
| 3185 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3186 | const bool isVisible = q->isVisible(); | - | ||||||||||||||||||||||||||||||||||||
| 3187 | - | |||||||||||||||||||||||||||||||||||||
| 3188 | - | |||||||||||||||||||||||||||||||||||||
| 3189 | if (!isVisible
| 0 | ||||||||||||||||||||||||||||||||||||
| 3190 | QWidget *topLevel = q->window(); | - | ||||||||||||||||||||||||||||||||||||
| 3191 | (void)topLevel->d_func()->topData(); | - | ||||||||||||||||||||||||||||||||||||
| 3192 | topLevel->ensurePolished(); | - | ||||||||||||||||||||||||||||||||||||
| 3193 | - | |||||||||||||||||||||||||||||||||||||
| 3194 | - | |||||||||||||||||||||||||||||||||||||
| 3195 | - | |||||||||||||||||||||||||||||||||||||
| 3196 | QWidget *widget = q; | - | ||||||||||||||||||||||||||||||||||||
| 3197 | QWidgetList hiddenWidgets; | - | ||||||||||||||||||||||||||||||||||||
| 3198 | while (widget
| 0 | ||||||||||||||||||||||||||||||||||||
| 3199 | if (widget->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3200 | widget->setAttribute(Qt::WA_WState_Hidden, false); | - | ||||||||||||||||||||||||||||||||||||
| 3201 | hiddenWidgets.append(widget); | - | ||||||||||||||||||||||||||||||||||||
| 3202 | if (!widget->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3203 | widget->d_func()->updateGeometry_helper(true); never executed: widget->d_func()->updateGeometry_helper(true); | 0 | ||||||||||||||||||||||||||||||||||||
| 3204 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3205 | widget = widget->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 3206 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3207 | - | |||||||||||||||||||||||||||||||||||||
| 3208 | - | |||||||||||||||||||||||||||||||||||||
| 3209 | if (topLevel->d_func()->layout
| 0 | ||||||||||||||||||||||||||||||||||||
| 3210 | topLevel->d_func()->layout->activate(); never executed: topLevel->d_func()->layout->activate(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3211 | - | |||||||||||||||||||||||||||||||||||||
| 3212 | - | |||||||||||||||||||||||||||||||||||||
| 3213 | QTLWExtra *topLevelExtra = topLevel->d_func()->maybeTopData(); | - | ||||||||||||||||||||||||||||||||||||
| 3214 | if (topLevelExtra
| 0 | ||||||||||||||||||||||||||||||||||||
| 3215 | && !topLevel->testAttribute(Qt::WA_Resized)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3216 | topLevel->adjustSize(); | - | ||||||||||||||||||||||||||||||||||||
| 3217 | topLevel->setAttribute(Qt::WA_Resized, false); | - | ||||||||||||||||||||||||||||||||||||
| 3218 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3219 | - | |||||||||||||||||||||||||||||||||||||
| 3220 | - | |||||||||||||||||||||||||||||||||||||
| 3221 | topLevel->d_func()->activateChildLayoutsRecursively(); | - | ||||||||||||||||||||||||||||||||||||
| 3222 | - | |||||||||||||||||||||||||||||||||||||
| 3223 | - | |||||||||||||||||||||||||||||||||||||
| 3224 | for (int i = 0; i < hiddenWidgets.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3225 | QWidget *widget = hiddenWidgets.at(i); | - | ||||||||||||||||||||||||||||||||||||
| 3226 | widget->setAttribute(Qt::WA_WState_Hidden); | - | ||||||||||||||||||||||||||||||||||||
| 3227 | if (!widget->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3228 | widget->parentWidget()->d_func()->layout->invalidate(); never executed: widget->parentWidget()->d_func()->layout->invalidate(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3229 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3230 | } never executed: else if (isVisibleend of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 3231 | q->window()->d_func()->sendPendingMoveAndResizeEvents(true, true); | - | ||||||||||||||||||||||||||||||||||||
| 3232 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3233 | - | |||||||||||||||||||||||||||||||||||||
| 3234 | - | |||||||||||||||||||||||||||||||||||||
| 3235 | QRegion toBePainted = !region.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3236 | if (!(renderFlags & QWidget::IgnoreMask)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3237 | toBePainted &= extra->mask; never executed: toBePainted &= extra->mask; | 0 | ||||||||||||||||||||||||||||||||||||
| 3238 | return never executed: toBePainted;return toBePainted;never executed: return toBePainted; | 0 | ||||||||||||||||||||||||||||||||||||
| 3239 | } | - | ||||||||||||||||||||||||||||||||||||
| 3240 | - | |||||||||||||||||||||||||||||||||||||
| 3241 | void QWidgetPrivate::render_helper(QPainter *painter, const QPoint &targetOffset, const QRegion &toBePainted, | - | ||||||||||||||||||||||||||||||||||||
| 3242 | QWidget::RenderFlags renderFlags) | - | ||||||||||||||||||||||||||||||||||||
| 3243 | { | - | ||||||||||||||||||||||||||||||||||||
| 3244 | ((!(painter)) ? qt_assert("painter",__FILE__,5432) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 3245 | ((!(!toBePainted.isEmpty())) ? qt_assert("!toBePainted.isEmpty()",__FILE__,5433) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 3246 | - | |||||||||||||||||||||||||||||||||||||
| 3247 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3248 | - | |||||||||||||||||||||||||||||||||||||
| 3249 | const QTransform originalTransform = painter->worldTransform(); | - | ||||||||||||||||||||||||||||||||||||
| 3250 | const bool useDeviceCoordinates = originalTransform.isScaling(); | - | ||||||||||||||||||||||||||||||||||||
| 3251 | if (!useDeviceCoordinates
| 0 | ||||||||||||||||||||||||||||||||||||
| 3252 | - | |||||||||||||||||||||||||||||||||||||
| 3253 | - | |||||||||||||||||||||||||||||||||||||
| 3254 | const QRect rect = toBePainted.boundingRect(); | - | ||||||||||||||||||||||||||||||||||||
| 3255 | const QSize size = rect.size(); | - | ||||||||||||||||||||||||||||||||||||
| 3256 | if (size.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3257 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3258 | - | |||||||||||||||||||||||||||||||||||||
| 3259 | const qreal pixmapDevicePixelRatio = painter->device()->devicePixelRatioF(); | - | ||||||||||||||||||||||||||||||||||||
| 3260 | QPixmap pixmap(size * pixmapDevicePixelRatio); | - | ||||||||||||||||||||||||||||||||||||
| 3261 | pixmap.setDevicePixelRatio(pixmapDevicePixelRatio); | - | ||||||||||||||||||||||||||||||||||||
| 3262 | - | |||||||||||||||||||||||||||||||||||||
| 3263 | if (!(renderFlags & QWidget::DrawWindowBackground)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3264 | pixmap.fill(Qt::transparent); never executed: pixmap.fill(Qt::transparent); | 0 | ||||||||||||||||||||||||||||||||||||
| 3265 | q->render(&pixmap, QPoint(), toBePainted, renderFlags); | - | ||||||||||||||||||||||||||||||||||||
| 3266 | - | |||||||||||||||||||||||||||||||||||||
| 3267 | const bool restore = !(painter->renderHints() & QPainter::SmoothPixmapTransform); | - | ||||||||||||||||||||||||||||||||||||
| 3268 | painter->setRenderHints(QPainter::SmoothPixmapTransform, true); | - | ||||||||||||||||||||||||||||||||||||
| 3269 | - | |||||||||||||||||||||||||||||||||||||
| 3270 | painter->drawPixmap(targetOffset, pixmap); | - | ||||||||||||||||||||||||||||||||||||
| 3271 | - | |||||||||||||||||||||||||||||||||||||
| 3272 | if (restore
| 0 | ||||||||||||||||||||||||||||||||||||
| 3273 | painter->setRenderHints(QPainter::SmoothPixmapTransform, false); never executed: painter->setRenderHints(QPainter::SmoothPixmapTransform, false); | 0 | ||||||||||||||||||||||||||||||||||||
| 3274 | - | |||||||||||||||||||||||||||||||||||||
| 3275 | - | |||||||||||||||||||||||||||||||||||||
| 3276 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3277 | - | |||||||||||||||||||||||||||||||||||||
| 3278 | QTransform transform = originalTransform; | - | ||||||||||||||||||||||||||||||||||||
| 3279 | transform.translate(targetOffset.x(), targetOffset.y()); | - | ||||||||||||||||||||||||||||||||||||
| 3280 | - | |||||||||||||||||||||||||||||||||||||
| 3281 | QPaintDevice *device = painter->device(); | - | ||||||||||||||||||||||||||||||||||||
| 3282 | ((!(device)) ? qt_assert("device",__FILE__,5470) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 3283 | - | |||||||||||||||||||||||||||||||||||||
| 3284 | - | |||||||||||||||||||||||||||||||||||||
| 3285 | const QRectF rect(toBePainted.boundingRect()); | - | ||||||||||||||||||||||||||||||||||||
| 3286 | QRect deviceRect = transform.mapRect(QRectF(0, 0, rect.width(), rect.height())).toAlignedRect(); | - | ||||||||||||||||||||||||||||||||||||
| 3287 | deviceRect &= QRect(0, 0, device->width(), device->height()); | - | ||||||||||||||||||||||||||||||||||||
| 3288 | - | |||||||||||||||||||||||||||||||||||||
| 3289 | QPixmap pixmap(deviceRect.size()); | - | ||||||||||||||||||||||||||||||||||||
| 3290 | pixmap.fill(Qt::transparent); | - | ||||||||||||||||||||||||||||||||||||
| 3291 | - | |||||||||||||||||||||||||||||||||||||
| 3292 | - | |||||||||||||||||||||||||||||||||||||
| 3293 | QPainter pixmapPainter(&pixmap); | - | ||||||||||||||||||||||||||||||||||||
| 3294 | pixmapPainter.setRenderHints(painter->renderHints()); | - | ||||||||||||||||||||||||||||||||||||
| 3295 | transform *= QTransform::fromTranslate(-deviceRect.x(), -deviceRect.y()); | - | ||||||||||||||||||||||||||||||||||||
| 3296 | pixmapPainter.setTransform(transform); | - | ||||||||||||||||||||||||||||||||||||
| 3297 | - | |||||||||||||||||||||||||||||||||||||
| 3298 | q->render(&pixmapPainter, QPoint(), toBePainted, renderFlags); | - | ||||||||||||||||||||||||||||||||||||
| 3299 | pixmapPainter.end(); | - | ||||||||||||||||||||||||||||||||||||
| 3300 | - | |||||||||||||||||||||||||||||||||||||
| 3301 | - | |||||||||||||||||||||||||||||||||||||
| 3302 | painter->setTransform(QTransform()); | - | ||||||||||||||||||||||||||||||||||||
| 3303 | painter->drawPixmap(deviceRect.topLeft(), pixmap); | - | ||||||||||||||||||||||||||||||||||||
| 3304 | painter->setTransform(originalTransform); | - | ||||||||||||||||||||||||||||||||||||
| 3305 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3306 | - | |||||||||||||||||||||||||||||||||||||
| 3307 | } | - | ||||||||||||||||||||||||||||||||||||
| 3308 | - | |||||||||||||||||||||||||||||||||||||
| 3309 | void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, int flags, | - | ||||||||||||||||||||||||||||||||||||
| 3310 | QPainter *sharedPainter, QWidgetBackingStore *backingStore) | - | ||||||||||||||||||||||||||||||||||||
| 3311 | { | - | ||||||||||||||||||||||||||||||||||||
| 3312 | if (rgn.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3313 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3314 | - | |||||||||||||||||||||||||||||||||||||
| 3315 | const bool asRoot = flags & DrawAsRoot; | - | ||||||||||||||||||||||||||||||||||||
| 3316 | bool onScreen = paintOnScreen(); | - | ||||||||||||||||||||||||||||||||||||
| 3317 | - | |||||||||||||||||||||||||||||||||||||
| 3318 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3319 | - | |||||||||||||||||||||||||||||||||||||
| 3320 | if (graphicsEffect
| 0 | ||||||||||||||||||||||||||||||||||||
| 3321 | QGraphicsEffectSource *source = graphicsEffect->d_func()->source; | - | ||||||||||||||||||||||||||||||||||||
| 3322 | QWidgetEffectSourcePrivate *sourced = static_cast<QWidgetEffectSourcePrivate *> | - | ||||||||||||||||||||||||||||||||||||
| 3323 | (source->d_func()); | - | ||||||||||||||||||||||||||||||||||||
| 3324 | if (!sourced->context
| 0 | ||||||||||||||||||||||||||||||||||||
| 3325 | QWidgetPaintContext context(pdev, rgn, offset, flags, sharedPainter, backingStore); | - | ||||||||||||||||||||||||||||||||||||
| 3326 | sourced->context = &context; | - | ||||||||||||||||||||||||||||||||||||
| 3327 | if (!sharedPainter
| 0 | ||||||||||||||||||||||||||||||||||||
| 3328 | setSystemClip(pdev, rgn.translated(offset)); | - | ||||||||||||||||||||||||||||||||||||
| 3329 | QPainter p(pdev); | - | ||||||||||||||||||||||||||||||||||||
| 3330 | p.translate(offset); | - | ||||||||||||||||||||||||||||||||||||
| 3331 | context.painter = &p; | - | ||||||||||||||||||||||||||||||||||||
| 3332 | graphicsEffect->draw(&p); | - | ||||||||||||||||||||||||||||||||||||
| 3333 | setSystemClip(pdev, QRegion()); | - | ||||||||||||||||||||||||||||||||||||
| 3334 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3335 | context.painter = sharedPainter; | - | ||||||||||||||||||||||||||||||||||||
| 3336 | if (sharedPainter->worldTransform() != sourced->lastEffectTransform
| 0 | ||||||||||||||||||||||||||||||||||||
| 3337 | sourced->invalidateCache(); | - | ||||||||||||||||||||||||||||||||||||
| 3338 | sourced->lastEffectTransform = sharedPainter->worldTransform(); | - | ||||||||||||||||||||||||||||||||||||
| 3339 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3340 | sharedPainter->save(); | - | ||||||||||||||||||||||||||||||||||||
| 3341 | sharedPainter->translate(offset); | - | ||||||||||||||||||||||||||||||||||||
| 3342 | graphicsEffect->draw(sharedPainter); | - | ||||||||||||||||||||||||||||||||||||
| 3343 | sharedPainter->restore(); | - | ||||||||||||||||||||||||||||||||||||
| 3344 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3345 | sourced->context = 0; | - | ||||||||||||||||||||||||||||||||||||
| 3346 | - | |||||||||||||||||||||||||||||||||||||
| 3347 | - | |||||||||||||||||||||||||||||||||||||
| 3348 | - | |||||||||||||||||||||||||||||||||||||
| 3349 | if (backingStore
| 0 | ||||||||||||||||||||||||||||||||||||
| 3350 | backingStore->markDirtyOnScreen(rgn, q, offset); never executed: backingStore->markDirtyOnScreen(rgn, q, offset); | 0 | ||||||||||||||||||||||||||||||||||||
| 3351 | - | |||||||||||||||||||||||||||||||||||||
| 3352 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3353 | } | - | ||||||||||||||||||||||||||||||||||||
| 3354 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3355 | - | |||||||||||||||||||||||||||||||||||||
| 3356 | - | |||||||||||||||||||||||||||||||||||||
| 3357 | const bool alsoOnScreen = flags & DrawPaintOnScreen; | - | ||||||||||||||||||||||||||||||||||||
| 3358 | const bool recursive = flags & DrawRecursive; | - | ||||||||||||||||||||||||||||||||||||
| 3359 | const bool alsoInvisible = flags & DrawInvisible; | - | ||||||||||||||||||||||||||||||||||||
| 3360 | - | |||||||||||||||||||||||||||||||||||||
| 3361 | ((!(sharedPainter ? sharedPainter->isActive() : true)) ? qt_assert("sharedPainter ? sharedPainter->isActive() : true",__FILE__,5549) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 3362 | - | |||||||||||||||||||||||||||||||||||||
| 3363 | QRegion toBePainted(rgn); | - | ||||||||||||||||||||||||||||||||||||
| 3364 | if (asRoot
| 0 | ||||||||||||||||||||||||||||||||||||
| 3365 | toBePainted &= clipRect(); never executed: toBePainted &= clipRect(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3366 | if (!(flags & DontSubtractOpaqueChildren)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3367 | subtractOpaqueChildren(toBePainted, q->rect()); never executed: subtractOpaqueChildren(toBePainted, q->rect()); | 0 | ||||||||||||||||||||||||||||||||||||
| 3368 | - | |||||||||||||||||||||||||||||||||||||
| 3369 | if (!toBePainted.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3370 | if (!onScreen
| 0 | ||||||||||||||||||||||||||||||||||||
| 3371 | - | |||||||||||||||||||||||||||||||||||||
| 3372 | if (__builtin_expect(!!(q->testAttribute(Qt::WA_WState_InPaintEvent)), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3373 | QMessageLogger(__FILE__, 5561, __PRETTY_FUNCTION__).warning("QWidget::repaint: Recursive repaint detected"); never executed: QMessageLogger(__FILE__, 5561, __PRETTY_FUNCTION__).warning("QWidget::repaint: Recursive repaint detected"); | 0 | ||||||||||||||||||||||||||||||||||||
| 3374 | q->setAttribute(Qt::WA_WState_InPaintEvent); | - | ||||||||||||||||||||||||||||||||||||
| 3375 | - | |||||||||||||||||||||||||||||||||||||
| 3376 | - | |||||||||||||||||||||||||||||||||||||
| 3377 | - | |||||||||||||||||||||||||||||||||||||
| 3378 | bool flushed = QWidgetBackingStore::flushPaint(q, toBePainted); | - | ||||||||||||||||||||||||||||||||||||
| 3379 | - | |||||||||||||||||||||||||||||||||||||
| 3380 | QPaintEngine *paintEngine = pdev->paintEngine(); | - | ||||||||||||||||||||||||||||||||||||
| 3381 | if (paintEngine
| 0 | ||||||||||||||||||||||||||||||||||||
| 3382 | setRedirected(pdev, -offset); | - | ||||||||||||||||||||||||||||||||||||
| 3383 | if (sharedPainter
| 0 | ||||||||||||||||||||||||||||||||||||
| 3384 | setSystemClip(pdev, toBePainted); never executed: setSystemClip(pdev, toBePainted); | 0 | ||||||||||||||||||||||||||||||||||||
| 3385 | else | - | ||||||||||||||||||||||||||||||||||||
| 3386 | paintEngine->d_func()->systemRect = q->data->crect; never executed: paintEngine->d_func()->systemRect = q->data->crect; | 0 | ||||||||||||||||||||||||||||||||||||
| 3387 | - | |||||||||||||||||||||||||||||||||||||
| 3388 | - | |||||||||||||||||||||||||||||||||||||
| 3389 | if ((asRoot
| 0 | ||||||||||||||||||||||||||||||||||||
| 3390 | && !q->testAttribute(Qt::WA_OpaquePaintEvent)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3391 | - | |||||||||||||||||||||||||||||||||||||
| 3392 | beginBackingStorePainting(); | - | ||||||||||||||||||||||||||||||||||||
| 3393 | - | |||||||||||||||||||||||||||||||||||||
| 3394 | QPainter p(q); | - | ||||||||||||||||||||||||||||||||||||
| 3395 | paintBackground(&p, toBePainted, (asRoot || onScreen) ? flags | DrawAsRoot : 0); | - | ||||||||||||||||||||||||||||||||||||
| 3396 | - | |||||||||||||||||||||||||||||||||||||
| 3397 | endBackingStorePainting(); | - | ||||||||||||||||||||||||||||||||||||
| 3398 | - | |||||||||||||||||||||||||||||||||||||
| 3399 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3400 | - | |||||||||||||||||||||||||||||||||||||
| 3401 | if (!sharedPainter
| 0 | ||||||||||||||||||||||||||||||||||||
| 3402 | setSystemClip(pdev, toBePainted.translated(offset)); never executed: setSystemClip(pdev, toBePainted.translated(offset)); | 0 | ||||||||||||||||||||||||||||||||||||
| 3403 | - | |||||||||||||||||||||||||||||||||||||
| 3404 | if (!onScreen
| 0 | ||||||||||||||||||||||||||||||||||||
| 3405 | - | |||||||||||||||||||||||||||||||||||||
| 3406 | beginBackingStorePainting(); | - | ||||||||||||||||||||||||||||||||||||
| 3407 | - | |||||||||||||||||||||||||||||||||||||
| 3408 | QPainter p(q); | - | ||||||||||||||||||||||||||||||||||||
| 3409 | QColor tint = q->palette().window().color(); | - | ||||||||||||||||||||||||||||||||||||
| 3410 | tint.setAlphaF(qreal(.6)); | - | ||||||||||||||||||||||||||||||||||||
| 3411 | p.fillRect(toBePainted.boundingRect(), tint); | - | ||||||||||||||||||||||||||||||||||||
| 3412 | - | |||||||||||||||||||||||||||||||||||||
| 3413 | endBackingStorePainting(); | - | ||||||||||||||||||||||||||||||||||||
| 3414 | - | |||||||||||||||||||||||||||||||||||||
| 3415 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3416 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3417 | - | |||||||||||||||||||||||||||||||||||||
| 3418 | - | |||||||||||||||||||||||||||||||||||||
| 3419 | - | |||||||||||||||||||||||||||||||||||||
| 3420 | - | |||||||||||||||||||||||||||||||||||||
| 3421 | - | |||||||||||||||||||||||||||||||||||||
| 3422 | - | |||||||||||||||||||||||||||||||||||||
| 3423 | - | |||||||||||||||||||||||||||||||||||||
| 3424 | bool skipPaintEvent = false; | - | ||||||||||||||||||||||||||||||||||||
| 3425 | - | |||||||||||||||||||||||||||||||||||||
| 3426 | if (renderToTexture
| 0 | ||||||||||||||||||||||||||||||||||||
| 3427 | - | |||||||||||||||||||||||||||||||||||||
| 3428 | - | |||||||||||||||||||||||||||||||||||||
| 3429 | if (!q->testAttribute(Qt::WA_AlwaysStackOnTop)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3430 | beginBackingStorePainting(); | - | ||||||||||||||||||||||||||||||||||||
| 3431 | QPainter p(q); | - | ||||||||||||||||||||||||||||||||||||
| 3432 | if (backingStore
| 0 | ||||||||||||||||||||||||||||||||||||
| 3433 | p.setCompositionMode(QPainter::CompositionMode_Source); | - | ||||||||||||||||||||||||||||||||||||
| 3434 | p.fillRect(q->rect(), Qt::transparent); | - | ||||||||||||||||||||||||||||||||||||
| 3435 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3436 | - | |||||||||||||||||||||||||||||||||||||
| 3437 | p.drawImage(q->rect(), grabFramebuffer()); | - | ||||||||||||||||||||||||||||||||||||
| 3438 | skipPaintEvent = true; | - | ||||||||||||||||||||||||||||||||||||
| 3439 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3440 | endBackingStorePainting(); | - | ||||||||||||||||||||||||||||||||||||
| 3441 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3442 | if (renderToTextureReallyDirty
| 0 | ||||||||||||||||||||||||||||||||||||
| 3443 | renderToTextureReallyDirty = 0; never executed: renderToTextureReallyDirty = 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 3444 | else | - | ||||||||||||||||||||||||||||||||||||
| 3445 | skipPaintEvent = true; never executed: skipPaintEvent = true; | 0 | ||||||||||||||||||||||||||||||||||||
| 3446 | } | - | ||||||||||||||||||||||||||||||||||||
| 3447 | - | |||||||||||||||||||||||||||||||||||||
| 3448 | - | |||||||||||||||||||||||||||||||||||||
| 3449 | if (!skipPaintEvent
| 0 | ||||||||||||||||||||||||||||||||||||
| 3450 | - | |||||||||||||||||||||||||||||||||||||
| 3451 | sendPaintEvent(toBePainted); | - | ||||||||||||||||||||||||||||||||||||
| 3452 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3453 | - | |||||||||||||||||||||||||||||||||||||
| 3454 | - | |||||||||||||||||||||||||||||||||||||
| 3455 | if (backingStore
| 0 | ||||||||||||||||||||||||||||||||||||
| 3456 | backingStore->markDirtyOnScreen(toBePainted, q, offset); never executed: backingStore->markDirtyOnScreen(toBePainted, q, offset); | 0 | ||||||||||||||||||||||||||||||||||||
| 3457 | - | |||||||||||||||||||||||||||||||||||||
| 3458 | - | |||||||||||||||||||||||||||||||||||||
| 3459 | if (paintEngine
| 0 | ||||||||||||||||||||||||||||||||||||
| 3460 | - | |||||||||||||||||||||||||||||||||||||
| 3461 | - | |||||||||||||||||||||||||||||||||||||
| 3462 | - | |||||||||||||||||||||||||||||||||||||
| 3463 | - | |||||||||||||||||||||||||||||||||||||
| 3464 | restoreRedirected(); | - | ||||||||||||||||||||||||||||||||||||
| 3465 | if (!sharedPainter
| 0 | ||||||||||||||||||||||||||||||||||||
| 3466 | paintEngine->d_func()->systemRect = QRect(); never executed: paintEngine->d_func()->systemRect = QRect(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3467 | else | - | ||||||||||||||||||||||||||||||||||||
| 3468 | paintEngine->d_func()->currentClipDevice = 0; never executed: paintEngine->d_func()->currentClipDevice = 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 3469 | - | |||||||||||||||||||||||||||||||||||||
| 3470 | setSystemClip(pdev, QRegion()); | - | ||||||||||||||||||||||||||||||||||||
| 3471 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3472 | q->setAttribute(Qt::WA_WState_InPaintEvent, false); | - | ||||||||||||||||||||||||||||||||||||
| 3473 | if (__builtin_expect(!!(q->paintingActive()), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3474 | QMessageLogger(__FILE__, 5672, __PRETTY_FUNCTION__).warning("QWidget::repaint: It is dangerous to leave painters active on a widget outside of the PaintEvent"); never executed: QMessageLogger(__FILE__, 5672, __PRETTY_FUNCTION__).warning("QWidget::repaint: It is dangerous to leave painters active on a widget outside of the PaintEvent"); | 0 | ||||||||||||||||||||||||||||||||||||
| 3475 | - | |||||||||||||||||||||||||||||||||||||
| 3476 | if (paintEngine
| 0 | ||||||||||||||||||||||||||||||||||||
| 3477 | delete paintEngine; | - | ||||||||||||||||||||||||||||||||||||
| 3478 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3479 | - | |||||||||||||||||||||||||||||||||||||
| 3480 | - | |||||||||||||||||||||||||||||||||||||
| 3481 | if (flushed
| 0 | ||||||||||||||||||||||||||||||||||||
| 3482 | QWidgetBackingStore::unflushPaint(q, toBePainted); never executed: QWidgetBackingStore::unflushPaint(q, toBePainted); | 0 | ||||||||||||||||||||||||||||||||||||
| 3483 | - | |||||||||||||||||||||||||||||||||||||
| 3484 | } never executed: else if (q->isWindow()end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 3485 | QPaintEngine *engine = pdev->paintEngine(); | - | ||||||||||||||||||||||||||||||||||||
| 3486 | if (engine
| 0 | ||||||||||||||||||||||||||||||||||||
| 3487 | QPainter p(pdev); | - | ||||||||||||||||||||||||||||||||||||
| 3488 | p.setClipRegion(toBePainted); | - | ||||||||||||||||||||||||||||||||||||
| 3489 | const QBrush bg = q->palette().brush(QPalette::Window); | - | ||||||||||||||||||||||||||||||||||||
| 3490 | if (bg.style() == Qt::TexturePattern
| 0 | ||||||||||||||||||||||||||||||||||||
| 3491 | p.drawTiledPixmap(q->rect(), bg.texture()); never executed: p.drawTiledPixmap(q->rect(), bg.texture()); | 0 | ||||||||||||||||||||||||||||||||||||
| 3492 | else | - | ||||||||||||||||||||||||||||||||||||
| 3493 | p.fillRect(q->rect(), bg); never executed: p.fillRect(q->rect(), bg); | 0 | ||||||||||||||||||||||||||||||||||||
| 3494 | - | |||||||||||||||||||||||||||||||||||||
| 3495 | if (engine->autoDestruct()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3496 | delete engine; never executed: delete engine; | 0 | ||||||||||||||||||||||||||||||||||||
| 3497 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3498 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3499 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3500 | - | |||||||||||||||||||||||||||||||||||||
| 3501 | if (recursive
| 0 | ||||||||||||||||||||||||||||||||||||
| 3502 | paintSiblingsRecursive(pdev, children, children.size() - 1, rgn, offset, flags & ~DrawAsRoot | - | ||||||||||||||||||||||||||||||||||||
| 3503 | , sharedPainter, backingStore); | - | ||||||||||||||||||||||||||||||||||||
| 3504 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3505 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3506 | - | |||||||||||||||||||||||||||||||||||||
| 3507 | void QWidgetPrivate::sendPaintEvent(const QRegion &toBePainted) | - | ||||||||||||||||||||||||||||||||||||
| 3508 | { | - | ||||||||||||||||||||||||||||||||||||
| 3509 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3510 | QPaintEvent e(toBePainted); | - | ||||||||||||||||||||||||||||||||||||
| 3511 | QCoreApplication::sendSpontaneousEvent(q, &e); | - | ||||||||||||||||||||||||||||||||||||
| 3512 | - | |||||||||||||||||||||||||||||||||||||
| 3513 | - | |||||||||||||||||||||||||||||||||||||
| 3514 | if (renderToTexture
| 0 | ||||||||||||||||||||||||||||||||||||
| 3515 | resolveSamples(); never executed: resolveSamples(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3516 | - | |||||||||||||||||||||||||||||||||||||
| 3517 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3518 | - | |||||||||||||||||||||||||||||||||||||
| 3519 | void QWidgetPrivate::render(QPaintDevice *target, const QPoint &targetOffset, | - | ||||||||||||||||||||||||||||||||||||
| 3520 | const QRegion &sourceRegion, QWidget::RenderFlags renderFlags) | - | ||||||||||||||||||||||||||||||||||||
| 3521 | { | - | ||||||||||||||||||||||||||||||||||||
| 3522 | if (__builtin_expect(!!(!target), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3523 | QMessageLogger(__FILE__, 5721, __PRETTY_FUNCTION__).warning("QWidget::render: null pointer to paint device"); | - | ||||||||||||||||||||||||||||||||||||
| 3524 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3525 | } | - | ||||||||||||||||||||||||||||||||||||
| 3526 | - | |||||||||||||||||||||||||||||||||||||
| 3527 | const bool inRenderWithPainter = extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 3528 | QRegion paintRegion = !inRenderWithPainter
| 0 | ||||||||||||||||||||||||||||||||||||
| 3529 | ? prepareToRender(sourceRegion, renderFlags) | - | ||||||||||||||||||||||||||||||||||||
| 3530 | : sourceRegion; | - | ||||||||||||||||||||||||||||||||||||
| 3531 | if (paintRegion.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3532 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3533 | - | |||||||||||||||||||||||||||||||||||||
| 3534 | - | |||||||||||||||||||||||||||||||||||||
| 3535 | QPainter *oldSharedPainter = inRenderWithPainter
| 0 | ||||||||||||||||||||||||||||||||||||
| 3536 | - | |||||||||||||||||||||||||||||||||||||
| 3537 | - | |||||||||||||||||||||||||||||||||||||
| 3538 | - | |||||||||||||||||||||||||||||||||||||
| 3539 | if (target->devType() == QInternal::Widget
| 0 | ||||||||||||||||||||||||||||||||||||
| 3540 | QWidgetPrivate *targetPrivate = static_cast<QWidget *>(target)->d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3541 | if (targetPrivate->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 3542 | QPainter *targetPainter = targetPrivate->sharedPainter(); | - | ||||||||||||||||||||||||||||||||||||
| 3543 | if (targetPainter
| 0 | ||||||||||||||||||||||||||||||||||||
| 3544 | setSharedPainter(targetPainter); never executed: setSharedPainter(targetPainter); | 0 | ||||||||||||||||||||||||||||||||||||
| 3545 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3546 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3547 | - | |||||||||||||||||||||||||||||||||||||
| 3548 | - | |||||||||||||||||||||||||||||||||||||
| 3549 | - | |||||||||||||||||||||||||||||||||||||
| 3550 | - | |||||||||||||||||||||||||||||||||||||
| 3551 | - | |||||||||||||||||||||||||||||||||||||
| 3552 | QPoint offset = targetOffset; | - | ||||||||||||||||||||||||||||||||||||
| 3553 | offset -= paintRegion.boundingRect().topLeft(); | - | ||||||||||||||||||||||||||||||||||||
| 3554 | QPoint redirectionOffset; | - | ||||||||||||||||||||||||||||||||||||
| 3555 | QPaintDevice *redirected = 0; | - | ||||||||||||||||||||||||||||||||||||
| 3556 | - | |||||||||||||||||||||||||||||||||||||
| 3557 | if (target->devType() == QInternal::Widget
| 0 | ||||||||||||||||||||||||||||||||||||
| 3558 | redirected = static_cast<QWidget *>(target)->d_func()->redirected(&redirectionOffset); never executed: redirected = static_cast<QWidget *>(target)->d_func()->redirected(&redirectionOffset); | 0 | ||||||||||||||||||||||||||||||||||||
| 3559 | if (!redirected
| 0 | ||||||||||||||||||||||||||||||||||||
| 3560 | redirected = QPainter::redirected(target, &redirectionOffset); never executed: redirected = QPainter::redirected(target, &redirectionOffset); | 0 | ||||||||||||||||||||||||||||||||||||
| 3561 | - | |||||||||||||||||||||||||||||||||||||
| 3562 | if (redirected
| 0 | ||||||||||||||||||||||||||||||||||||
| 3563 | target = redirected; | - | ||||||||||||||||||||||||||||||||||||
| 3564 | offset -= redirectionOffset; | - | ||||||||||||||||||||||||||||||||||||
| 3565 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3566 | - | |||||||||||||||||||||||||||||||||||||
| 3567 | if (!inRenderWithPainter
| 0 | ||||||||||||||||||||||||||||||||||||
| 3568 | if (QPaintEngine *targetEngine = target->paintEngine()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3569 | const QRegion targetSystemClip = targetEngine->systemClip(); | - | ||||||||||||||||||||||||||||||||||||
| 3570 | if (!targetSystemClip.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3571 | paintRegion &= targetSystemClip.translated(-offset); never executed: paintRegion &= targetSystemClip.translated(-offset); | 0 | ||||||||||||||||||||||||||||||||||||
| 3572 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3573 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3574 | - | |||||||||||||||||||||||||||||||||||||
| 3575 | - | |||||||||||||||||||||||||||||||||||||
| 3576 | int flags = DrawPaintOnScreen | DrawInvisible; | - | ||||||||||||||||||||||||||||||||||||
| 3577 | if (renderFlags & QWidget::DrawWindowBackground
| 0 | ||||||||||||||||||||||||||||||||||||
| 3578 | flags |= DrawAsRoot; never executed: flags |= DrawAsRoot; | 0 | ||||||||||||||||||||||||||||||||||||
| 3579 | - | |||||||||||||||||||||||||||||||||||||
| 3580 | if (renderFlags & QWidget::DrawChildren
| 0 | ||||||||||||||||||||||||||||||||||||
| 3581 | flags |= DrawRecursive; never executed: flags |= DrawRecursive; | 0 | ||||||||||||||||||||||||||||||||||||
| 3582 | else | - | ||||||||||||||||||||||||||||||||||||
| 3583 | flags |= DontSubtractOpaqueChildren; never executed: flags |= DontSubtractOpaqueChildren; | 0 | ||||||||||||||||||||||||||||||||||||
| 3584 | - | |||||||||||||||||||||||||||||||||||||
| 3585 | flags |= DontSetCompositionMode; | - | ||||||||||||||||||||||||||||||||||||
| 3586 | - | |||||||||||||||||||||||||||||||||||||
| 3587 | - | |||||||||||||||||||||||||||||||||||||
| 3588 | drawWidget(target, paintRegion, offset, flags, sharedPainter()); | - | ||||||||||||||||||||||||||||||||||||
| 3589 | - | |||||||||||||||||||||||||||||||||||||
| 3590 | - | |||||||||||||||||||||||||||||||||||||
| 3591 | if (oldSharedPainter
| 0 | ||||||||||||||||||||||||||||||||||||
| 3592 | setSharedPainter(oldSharedPainter); never executed: setSharedPainter(oldSharedPainter); | 0 | ||||||||||||||||||||||||||||||||||||
| 3593 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3594 | - | |||||||||||||||||||||||||||||||||||||
| 3595 | void QWidgetPrivate::paintSiblingsRecursive(QPaintDevice *pdev, const QObjectList& siblings, int index, const QRegion &rgn, | - | ||||||||||||||||||||||||||||||||||||
| 3596 | const QPoint &offset, int flags | - | ||||||||||||||||||||||||||||||||||||
| 3597 | , QPainter *sharedPainter, QWidgetBackingStore *backingStore) | - | ||||||||||||||||||||||||||||||||||||
| 3598 | { | - | ||||||||||||||||||||||||||||||||||||
| 3599 | QWidget *w = 0; | - | ||||||||||||||||||||||||||||||||||||
| 3600 | QRect boundingRect; | - | ||||||||||||||||||||||||||||||||||||
| 3601 | bool dirtyBoundingRect = true; | - | ||||||||||||||||||||||||||||||||||||
| 3602 | const bool exludeOpaqueChildren = (flags & DontDrawOpaqueChildren); | - | ||||||||||||||||||||||||||||||||||||
| 3603 | const bool excludeNativeChildren = (flags & DontDrawNativeChildren); | - | ||||||||||||||||||||||||||||||||||||
| 3604 | - | |||||||||||||||||||||||||||||||||||||
| 3605 | do { | - | ||||||||||||||||||||||||||||||||||||
| 3606 | QWidget *x = qobject_cast<QWidget*>(siblings.at(index)); | - | ||||||||||||||||||||||||||||||||||||
| 3607 | if (x
| 0 | ||||||||||||||||||||||||||||||||||||
| 3608 | && !(excludeNativeChildren
| 0 | ||||||||||||||||||||||||||||||||||||
| 3609 | if (dirtyBoundingRect
| 0 | ||||||||||||||||||||||||||||||||||||
| 3610 | boundingRect = rgn.boundingRect(); | - | ||||||||||||||||||||||||||||||||||||
| 3611 | dirtyBoundingRect = false; | - | ||||||||||||||||||||||||||||||||||||
| 3612 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3613 | - | |||||||||||||||||||||||||||||||||||||
| 3614 | if (qRectIntersects(boundingRect, x->d_func()->effectiveRectFor(x->data->crect))
| 0 | ||||||||||||||||||||||||||||||||||||
| 3615 | w = x; | - | ||||||||||||||||||||||||||||||||||||
| 3616 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 3617 | } | - | ||||||||||||||||||||||||||||||||||||
| 3618 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3619 | --index; | - | ||||||||||||||||||||||||||||||||||||
| 3620 | } never executed: while (index >= 0end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 3621 | - | |||||||||||||||||||||||||||||||||||||
| 3622 | if (!w
| 0 | ||||||||||||||||||||||||||||||||||||
| 3623 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3624 | - | |||||||||||||||||||||||||||||||||||||
| 3625 | QWidgetPrivate *wd = w->d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3626 | const QPoint widgetPos(w->data->crect.topLeft()); | - | ||||||||||||||||||||||||||||||||||||
| 3627 | const bool hasMask = wd->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 3628 | if (index > 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 3629 | QRegion wr(rgn); | - | ||||||||||||||||||||||||||||||||||||
| 3630 | if (wd->isOpaque
| 0 | ||||||||||||||||||||||||||||||||||||
| 3631 | wr -= hasMask
never executed: wr -= hasMask ? wd->extra->mask.translated(widgetPos) : w->data->crect; | 0 | ||||||||||||||||||||||||||||||||||||
| 3632 | paintSiblingsRecursive(pdev, siblings, --index, wr, offset, flags | - | ||||||||||||||||||||||||||||||||||||
| 3633 | , sharedPainter, backingStore); | - | ||||||||||||||||||||||||||||||||||||
| 3634 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3635 | - | |||||||||||||||||||||||||||||||||||||
| 3636 | if (w->updatesEnabled()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3637 | - | |||||||||||||||||||||||||||||||||||||
| 3638 | && (!w->d_func()->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 3639 | - | |||||||||||||||||||||||||||||||||||||
| 3640 | ) { | - | ||||||||||||||||||||||||||||||||||||
| 3641 | QRegion wRegion(rgn); | - | ||||||||||||||||||||||||||||||||||||
| 3642 | wRegion &= wd->effectiveRectFor(w->data->crect); | - | ||||||||||||||||||||||||||||||||||||
| 3643 | wRegion.translate(-widgetPos); | - | ||||||||||||||||||||||||||||||||||||
| 3644 | if (hasMask
| 0 | ||||||||||||||||||||||||||||||||||||
| 3645 | wRegion &= wd->extra->mask; never executed: wRegion &= wd->extra->mask; | 0 | ||||||||||||||||||||||||||||||||||||
| 3646 | wd->drawWidget(pdev, wRegion, offset + widgetPos, flags, sharedPainter, backingStore); | - | ||||||||||||||||||||||||||||||||||||
| 3647 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3648 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3649 | - | |||||||||||||||||||||||||||||||||||||
| 3650 | - | |||||||||||||||||||||||||||||||||||||
| 3651 | QRectF QWidgetEffectSourcePrivate::boundingRect(Qt::CoordinateSystem system) const | - | ||||||||||||||||||||||||||||||||||||
| 3652 | { | - | ||||||||||||||||||||||||||||||||||||
| 3653 | if (system != Qt::DeviceCoordinates
| 0 | ||||||||||||||||||||||||||||||||||||
| 3654 | return never executed: m_widget->rect();return m_widget->rect();never executed: return m_widget->rect(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3655 | - | |||||||||||||||||||||||||||||||||||||
| 3656 | if (__builtin_expect(!!(!context), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3657 | - | |||||||||||||||||||||||||||||||||||||
| 3658 | QMessageLogger(__FILE__, 5856, __PRETTY_FUNCTION__).warning("QGraphicsEffectSource::boundingRect: Not yet implemented, lacking device context"); | - | ||||||||||||||||||||||||||||||||||||
| 3659 | return never executed: QRectF();return QRectF();never executed: return QRectF(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3660 | } | - | ||||||||||||||||||||||||||||||||||||
| 3661 | - | |||||||||||||||||||||||||||||||||||||
| 3662 | return never executed: context->painter->worldTransform().mapRect(m_widget->rect());return context->painter->worldTransform().mapRect(m_widget->rect());never executed: return context->painter->worldTransform().mapRect(m_widget->rect()); | 0 | ||||||||||||||||||||||||||||||||||||
| 3663 | } | - | ||||||||||||||||||||||||||||||||||||
| 3664 | - | |||||||||||||||||||||||||||||||||||||
| 3665 | void QWidgetEffectSourcePrivate::draw(QPainter *painter) | - | ||||||||||||||||||||||||||||||||||||
| 3666 | { | - | ||||||||||||||||||||||||||||||||||||
| 3667 | if (!context
| 0 | ||||||||||||||||||||||||||||||||||||
| 3668 | m_widget->render(painter); | - | ||||||||||||||||||||||||||||||||||||
| 3669 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3670 | } | - | ||||||||||||||||||||||||||||||||||||
| 3671 | - | |||||||||||||||||||||||||||||||||||||
| 3672 | - | |||||||||||||||||||||||||||||||||||||
| 3673 | - | |||||||||||||||||||||||||||||||||||||
| 3674 | QRegion toBePainted = context->rgn; | - | ||||||||||||||||||||||||||||||||||||
| 3675 | toBePainted &= m_widget->rect(); | - | ||||||||||||||||||||||||||||||||||||
| 3676 | QWidgetPrivate *wd = qt_widget_private(m_widget); | - | ||||||||||||||||||||||||||||||||||||
| 3677 | if (wd->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 3678 | toBePainted &= wd->extra->mask; never executed: toBePainted &= wd->extra->mask; | 0 | ||||||||||||||||||||||||||||||||||||
| 3679 | - | |||||||||||||||||||||||||||||||||||||
| 3680 | wd->drawWidget(context->pdev, toBePainted, context->offset, context->flags, | - | ||||||||||||||||||||||||||||||||||||
| 3681 | context->sharedPainter, context->backingStore); | - | ||||||||||||||||||||||||||||||||||||
| 3682 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3683 | - | |||||||||||||||||||||||||||||||||||||
| 3684 | QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint *offset, | - | ||||||||||||||||||||||||||||||||||||
| 3685 | QGraphicsEffect::PixmapPadMode mode) const | - | ||||||||||||||||||||||||||||||||||||
| 3686 | { | - | ||||||||||||||||||||||||||||||||||||
| 3687 | const bool deviceCoordinates = (system == Qt::DeviceCoordinates); | - | ||||||||||||||||||||||||||||||||||||
| 3688 | if (__builtin_expect(!!(!context && deviceCoordinates), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3689 | - | |||||||||||||||||||||||||||||||||||||
| 3690 | QMessageLogger(__FILE__, 5888, __PRETTY_FUNCTION__).warning("QGraphicsEffectSource::pixmap: Not yet implemented, lacking device context"); | - | ||||||||||||||||||||||||||||||||||||
| 3691 | return never executed: QPixmap();return QPixmap();never executed: return QPixmap(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3692 | } | - | ||||||||||||||||||||||||||||||||||||
| 3693 | - | |||||||||||||||||||||||||||||||||||||
| 3694 | QPoint pixmapOffset; | - | ||||||||||||||||||||||||||||||||||||
| 3695 | QRectF sourceRect = m_widget->rect(); | - | ||||||||||||||||||||||||||||||||||||
| 3696 | - | |||||||||||||||||||||||||||||||||||||
| 3697 | if (deviceCoordinates
| 0 | ||||||||||||||||||||||||||||||||||||
| 3698 | const QTransform &painterTransform = context->painter->worldTransform(); | - | ||||||||||||||||||||||||||||||||||||
| 3699 | sourceRect = painterTransform.mapRect(sourceRect); | - | ||||||||||||||||||||||||||||||||||||
| 3700 | pixmapOffset = painterTransform.map(pixmapOffset); | - | ||||||||||||||||||||||||||||||||||||
| 3701 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3702 | - | |||||||||||||||||||||||||||||||||||||
| 3703 | QRect effectRect; | - | ||||||||||||||||||||||||||||||||||||
| 3704 | - | |||||||||||||||||||||||||||||||||||||
| 3705 | if (mode == QGraphicsEffect::PadToEffectiveBoundingRect
| 0 | ||||||||||||||||||||||||||||||||||||
| 3706 | effectRect = m_widget->graphicsEffect()->boundingRectFor(sourceRect).toAlignedRect(); never executed: effectRect = m_widget->graphicsEffect()->boundingRectFor(sourceRect).toAlignedRect(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3707 | else if (mode == QGraphicsEffect::PadToTransparentBorder
| 0 | ||||||||||||||||||||||||||||||||||||
| 3708 | effectRect = sourceRect.adjusted(-1, -1, 1, 1).toAlignedRect(); never executed: effectRect = sourceRect.adjusted(-1, -1, 1, 1).toAlignedRect(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3709 | else | - | ||||||||||||||||||||||||||||||||||||
| 3710 | effectRect = sourceRect.toAlignedRect(); never executed: effectRect = sourceRect.toAlignedRect(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3711 | - | |||||||||||||||||||||||||||||||||||||
| 3712 | if (offset
| 0 | ||||||||||||||||||||||||||||||||||||
| 3713 | * never executed: offset = effectRect.topLeft();*offset = effectRect.topLeft();never executed: *offset = effectRect.topLeft(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3714 | - | |||||||||||||||||||||||||||||||||||||
| 3715 | pixmapOffset -= effectRect.topLeft(); | - | ||||||||||||||||||||||||||||||||||||
| 3716 | - | |||||||||||||||||||||||||||||||||||||
| 3717 | const qreal dpr = context->painter->device()->devicePixelRatio(); | - | ||||||||||||||||||||||||||||||||||||
| 3718 | QPixmap pixmap(effectRect.size() * dpr); | - | ||||||||||||||||||||||||||||||||||||
| 3719 | pixmap.setDevicePixelRatio(dpr); | - | ||||||||||||||||||||||||||||||||||||
| 3720 | - | |||||||||||||||||||||||||||||||||||||
| 3721 | pixmap.fill(Qt::transparent); | - | ||||||||||||||||||||||||||||||||||||
| 3722 | m_widget->render(&pixmap, pixmapOffset, QRegion(), QWidget::DrawChildren); | - | ||||||||||||||||||||||||||||||||||||
| 3723 | return never executed: pixmap;return pixmap;never executed: return pixmap; | 0 | ||||||||||||||||||||||||||||||||||||
| 3724 | } | - | ||||||||||||||||||||||||||||||||||||
| 3725 | QGraphicsProxyWidget * QWidgetPrivate::nearestGraphicsProxyWidget(const QWidget *origin) | - | ||||||||||||||||||||||||||||||||||||
| 3726 | { | - | ||||||||||||||||||||||||||||||||||||
| 3727 | if (origin
| 0 | ||||||||||||||||||||||||||||||||||||
| 3728 | QWExtra *extra = origin->d_func()->extra; | - | ||||||||||||||||||||||||||||||||||||
| 3729 | if (extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 3730 | return never executed: extra->proxyWidget;return extra->proxyWidget;never executed: return extra->proxyWidget; | 0 | ||||||||||||||||||||||||||||||||||||
| 3731 | return never executed: nearestGraphicsProxyWidget(origin->parentWidget());return nearestGraphicsProxyWidget(origin->parentWidget());never executed: return nearestGraphicsProxyWidget(origin->parentWidget()); | 0 | ||||||||||||||||||||||||||||||||||||
| 3732 | } | - | ||||||||||||||||||||||||||||||||||||
| 3733 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 3734 | } | - | ||||||||||||||||||||||||||||||||||||
| 3735 | void QWidgetPrivate::setLocale_helper(const QLocale &loc, bool forceUpdate) | - | ||||||||||||||||||||||||||||||||||||
| 3736 | { | - | ||||||||||||||||||||||||||||||||||||
| 3737 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3738 | if (locale == loc
| 0 | ||||||||||||||||||||||||||||||||||||
| 3739 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3740 | - | |||||||||||||||||||||||||||||||||||||
| 3741 | locale = loc; | - | ||||||||||||||||||||||||||||||||||||
| 3742 | - | |||||||||||||||||||||||||||||||||||||
| 3743 | if (!children.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3744 | for (int i = 0; i < children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3745 | QWidget *w = qobject_cast<QWidget*>(children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 3746 | if (!w
| 0 | ||||||||||||||||||||||||||||||||||||
| 3747 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 3748 | if (w->testAttribute(Qt::WA_SetLocale)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3749 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 3750 | if (w->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3751 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 3752 | w->d_func()->setLocale_helper(loc, forceUpdate); | - | ||||||||||||||||||||||||||||||||||||
| 3753 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3754 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3755 | QEvent e(QEvent::LocaleChange); | - | ||||||||||||||||||||||||||||||||||||
| 3756 | QApplication::sendEvent(q, &e); | - | ||||||||||||||||||||||||||||||||||||
| 3757 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3758 | - | |||||||||||||||||||||||||||||||||||||
| 3759 | void QWidget::setLocale(const QLocale &locale) | - | ||||||||||||||||||||||||||||||||||||
| 3760 | { | - | ||||||||||||||||||||||||||||||||||||
| 3761 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3762 | - | |||||||||||||||||||||||||||||||||||||
| 3763 | setAttribute(Qt::WA_SetLocale); | - | ||||||||||||||||||||||||||||||||||||
| 3764 | d->setLocale_helper(locale); | - | ||||||||||||||||||||||||||||||||||||
| 3765 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3766 | - | |||||||||||||||||||||||||||||||||||||
| 3767 | QLocale QWidget::locale() const | - | ||||||||||||||||||||||||||||||||||||
| 3768 | { | - | ||||||||||||||||||||||||||||||||||||
| 3769 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3770 | - | |||||||||||||||||||||||||||||||||||||
| 3771 | return never executed: d->locale;return d->locale;never executed: return d->locale; | 0 | ||||||||||||||||||||||||||||||||||||
| 3772 | } | - | ||||||||||||||||||||||||||||||||||||
| 3773 | - | |||||||||||||||||||||||||||||||||||||
| 3774 | void QWidgetPrivate::resolveLocale() | - | ||||||||||||||||||||||||||||||||||||
| 3775 | { | - | ||||||||||||||||||||||||||||||||||||
| 3776 | const QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3777 | - | |||||||||||||||||||||||||||||||||||||
| 3778 | if (!q->testAttribute(Qt::WA_SetLocale)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3779 | setLocale_helper(q->isWindow() | - | ||||||||||||||||||||||||||||||||||||
| 3780 | ? QLocale() | - | ||||||||||||||||||||||||||||||||||||
| 3781 | : q->parentWidget()->locale()); | - | ||||||||||||||||||||||||||||||||||||
| 3782 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3783 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3784 | - | |||||||||||||||||||||||||||||||||||||
| 3785 | void QWidget::unsetLocale() | - | ||||||||||||||||||||||||||||||||||||
| 3786 | { | - | ||||||||||||||||||||||||||||||||||||
| 3787 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3788 | setAttribute(Qt::WA_SetLocale, false); | - | ||||||||||||||||||||||||||||||||||||
| 3789 | d->resolveLocale(); | - | ||||||||||||||||||||||||||||||||||||
| 3790 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3791 | QString QWidget::windowTitle() const | - | ||||||||||||||||||||||||||||||||||||
| 3792 | { | - | ||||||||||||||||||||||||||||||||||||
| 3793 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3794 | if (d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 3795 | if (!d->extra->topextra->caption.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3796 | return never executed: d->extra->topextra->caption;return d->extra->topextra->caption;never executed: return d->extra->topextra->caption; | 0 | ||||||||||||||||||||||||||||||||||||
| 3797 | if (!d->extra->topextra->filePath.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3798 | return never executed: QFileInfo(d->extra->topextra->filePath).fileName() + QLatin1String("[*]");return QFileInfo(d->extra->topextra->filePath).fileName() + QLatin1String("[*]");never executed: return QFileInfo(d->extra->topextra->filePath).fileName() + QLatin1String("[*]"); | 0 | ||||||||||||||||||||||||||||||||||||
| 3799 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3800 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3801 | } | - | ||||||||||||||||||||||||||||||||||||
| 3802 | QString qt_setWindowTitle_helperHelper(const QString &title, const QWidget *widget) | - | ||||||||||||||||||||||||||||||||||||
| 3803 | { | - | ||||||||||||||||||||||||||||||||||||
| 3804 | ((!(widget)) ? qt_assert("widget",__FILE__,6066) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 3805 | - | |||||||||||||||||||||||||||||||||||||
| 3806 | - | |||||||||||||||||||||||||||||||||||||
| 3807 | - | |||||||||||||||||||||||||||||||||||||
| 3808 | - | |||||||||||||||||||||||||||||||||||||
| 3809 | - | |||||||||||||||||||||||||||||||||||||
| 3810 | QString cap = title; | - | ||||||||||||||||||||||||||||||||||||
| 3811 | - | |||||||||||||||||||||||||||||||||||||
| 3812 | - | |||||||||||||||||||||||||||||||||||||
| 3813 | if (cap.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3814 | return never executed: cap;return cap;never executed: return cap; | 0 | ||||||||||||||||||||||||||||||||||||
| 3815 | - | |||||||||||||||||||||||||||||||||||||
| 3816 | QLatin1String placeHolder("[*]"); | - | ||||||||||||||||||||||||||||||||||||
| 3817 | int index = cap.indexOf(placeHolder); | - | ||||||||||||||||||||||||||||||||||||
| 3818 | - | |||||||||||||||||||||||||||||||||||||
| 3819 | - | |||||||||||||||||||||||||||||||||||||
| 3820 | while (index != -1
| 0 | ||||||||||||||||||||||||||||||||||||
| 3821 | index += placeHolder.size(); | - | ||||||||||||||||||||||||||||||||||||
| 3822 | int count = 1; | - | ||||||||||||||||||||||||||||||||||||
| 3823 | while (cap.indexOf(placeHolder, index) == index
| 0 | ||||||||||||||||||||||||||||||||||||
| 3824 | ++count; | - | ||||||||||||||||||||||||||||||||||||
| 3825 | index += placeHolder.size(); | - | ||||||||||||||||||||||||||||||||||||
| 3826 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3827 | - | |||||||||||||||||||||||||||||||||||||
| 3828 | if (count%2
| 0 | ||||||||||||||||||||||||||||||||||||
| 3829 | int lastIndex = cap.lastIndexOf(placeHolder, index - 1); | - | ||||||||||||||||||||||||||||||||||||
| 3830 | if (widget->isWindowModified()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3831 | && widget->style()->styleHint(QStyle::SH_TitleBar_ModifyNotification, 0, widget)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3832 | cap.replace(lastIndex, 3, QWidget::tr("*")); never executed: cap.replace(lastIndex, 3, QWidget::tr("*")); | 0 | ||||||||||||||||||||||||||||||||||||
| 3833 | else | - | ||||||||||||||||||||||||||||||||||||
| 3834 | cap.remove(lastIndex, 3); never executed: cap.remove(lastIndex, 3); | 0 | ||||||||||||||||||||||||||||||||||||
| 3835 | } | - | ||||||||||||||||||||||||||||||||||||
| 3836 | - | |||||||||||||||||||||||||||||||||||||
| 3837 | index = cap.indexOf(placeHolder, index); | - | ||||||||||||||||||||||||||||||||||||
| 3838 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3839 | - | |||||||||||||||||||||||||||||||||||||
| 3840 | cap.replace(QLatin1String("[*][*]"), placeHolder); | - | ||||||||||||||||||||||||||||||||||||
| 3841 | - | |||||||||||||||||||||||||||||||||||||
| 3842 | return never executed: cap;return cap;never executed: return cap; | 0 | ||||||||||||||||||||||||||||||||||||
| 3843 | } | - | ||||||||||||||||||||||||||||||||||||
| 3844 | - | |||||||||||||||||||||||||||||||||||||
| 3845 | void QWidgetPrivate::setWindowTitle_helper(const QString &title) | - | ||||||||||||||||||||||||||||||||||||
| 3846 | { | - | ||||||||||||||||||||||||||||||||||||
| 3847 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3848 | if (q->testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3849 | setWindowTitle_sys(qt_setWindowTitle_helperHelper(title, q)); never executed: setWindowTitle_sys(qt_setWindowTitle_helperHelper(title, q)); | 0 | ||||||||||||||||||||||||||||||||||||
| 3850 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3851 | - | |||||||||||||||||||||||||||||||||||||
| 3852 | void QWidgetPrivate::setWindowTitle_sys(const QString &caption) | - | ||||||||||||||||||||||||||||||||||||
| 3853 | { | - | ||||||||||||||||||||||||||||||||||||
| 3854 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3855 | if (!q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3856 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3857 | - | |||||||||||||||||||||||||||||||||||||
| 3858 | if (QWindow *window = q->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3859 | window->setTitle(caption); never executed: window->setTitle(caption); | 0 | ||||||||||||||||||||||||||||||||||||
| 3860 | - | |||||||||||||||||||||||||||||||||||||
| 3861 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3862 | - | |||||||||||||||||||||||||||||||||||||
| 3863 | void QWidgetPrivate::setWindowIconText_helper(const QString &title) | - | ||||||||||||||||||||||||||||||||||||
| 3864 | { | - | ||||||||||||||||||||||||||||||||||||
| 3865 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3866 | if (q->testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 3867 | setWindowIconText_sys(qt_setWindowTitle_helperHelper(title, q)); never executed: setWindowIconText_sys(qt_setWindowTitle_helperHelper(title, q)); | 0 | ||||||||||||||||||||||||||||||||||||
| 3868 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3869 | - | |||||||||||||||||||||||||||||||||||||
| 3870 | void QWidgetPrivate::setWindowIconText_sys(const QString &iconText) | - | ||||||||||||||||||||||||||||||||||||
| 3871 | { | - | ||||||||||||||||||||||||||||||||||||
| 3872 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3873 | - | |||||||||||||||||||||||||||||||||||||
| 3874 | - | |||||||||||||||||||||||||||||||||||||
| 3875 | if (QWindow *window = q->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3876 | QXcbWindowFunctions::setWmWindowIconText(window, iconText); never executed: QXcbWindowFunctions::setWmWindowIconText(window, iconText); | 0 | ||||||||||||||||||||||||||||||||||||
| 3877 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3878 | void QWidget::setWindowIconText(const QString &iconText) | - | ||||||||||||||||||||||||||||||||||||
| 3879 | { | - | ||||||||||||||||||||||||||||||||||||
| 3880 | if (QWidget::windowIconText() == iconText
| 0 | ||||||||||||||||||||||||||||||||||||
| 3881 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3882 | - | |||||||||||||||||||||||||||||||||||||
| 3883 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3884 | d->topData()->iconText = iconText; | - | ||||||||||||||||||||||||||||||||||||
| 3885 | d->setWindowIconText_helper(iconText); | - | ||||||||||||||||||||||||||||||||||||
| 3886 | - | |||||||||||||||||||||||||||||||||||||
| 3887 | QEvent e(QEvent::IconTextChange); | - | ||||||||||||||||||||||||||||||||||||
| 3888 | QApplication::sendEvent(this, &e); | - | ||||||||||||||||||||||||||||||||||||
| 3889 | - | |||||||||||||||||||||||||||||||||||||
| 3890 | windowIconTextChanged(iconText); | - | ||||||||||||||||||||||||||||||||||||
| 3891 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3892 | void QWidget::setWindowTitle(const QString &title) | - | ||||||||||||||||||||||||||||||||||||
| 3893 | { | - | ||||||||||||||||||||||||||||||||||||
| 3894 | if (QWidget::windowTitle() == title
| 0 | ||||||||||||||||||||||||||||||||||||
| 3895 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3896 | - | |||||||||||||||||||||||||||||||||||||
| 3897 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3898 | d->topData()->caption = title; | - | ||||||||||||||||||||||||||||||||||||
| 3899 | d->setWindowTitle_helper(title); | - | ||||||||||||||||||||||||||||||||||||
| 3900 | - | |||||||||||||||||||||||||||||||||||||
| 3901 | QEvent e(QEvent::WindowTitleChange); | - | ||||||||||||||||||||||||||||||||||||
| 3902 | QApplication::sendEvent(this, &e); | - | ||||||||||||||||||||||||||||||||||||
| 3903 | - | |||||||||||||||||||||||||||||||||||||
| 3904 | windowTitleChanged(title); | - | ||||||||||||||||||||||||||||||||||||
| 3905 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3906 | QIcon QWidget::windowIcon() const | - | ||||||||||||||||||||||||||||||||||||
| 3907 | { | - | ||||||||||||||||||||||||||||||||||||
| 3908 | const QWidget *w = this; | - | ||||||||||||||||||||||||||||||||||||
| 3909 | while (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 3910 | const QWidgetPrivate *d = w->d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3911 | if (d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 3912 | return never executed: *d->extra->topextra->icon;return *d->extra->topextra->icon;never executed: return *d->extra->topextra->icon; | 0 | ||||||||||||||||||||||||||||||||||||
| 3913 | w = w->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 3914 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3915 | return never executed: QApplication::windowIcon();return QApplication::windowIcon();never executed: return QApplication::windowIcon(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3916 | } | - | ||||||||||||||||||||||||||||||||||||
| 3917 | - | |||||||||||||||||||||||||||||||||||||
| 3918 | void QWidgetPrivate::setWindowIcon_helper() | - | ||||||||||||||||||||||||||||||||||||
| 3919 | { | - | ||||||||||||||||||||||||||||||||||||
| 3920 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3921 | QEvent e(QEvent::WindowIconChange); | - | ||||||||||||||||||||||||||||||||||||
| 3922 | - | |||||||||||||||||||||||||||||||||||||
| 3923 | - | |||||||||||||||||||||||||||||||||||||
| 3924 | - | |||||||||||||||||||||||||||||||||||||
| 3925 | - | |||||||||||||||||||||||||||||||||||||
| 3926 | - | |||||||||||||||||||||||||||||||||||||
| 3927 | if (!q->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3928 | QApplication::sendEvent(q, &e); never executed: QApplication::sendEvent(q, &e); | 0 | ||||||||||||||||||||||||||||||||||||
| 3929 | for (int i = 0; i < children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3930 | QWidget *w = qobject_cast<QWidget *>(children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 3931 | if (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 3932 | QApplication::sendEvent(w, &e); never executed: QApplication::sendEvent(w, &e); | 0 | ||||||||||||||||||||||||||||||||||||
| 3933 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3934 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3935 | void QWidget::setWindowIcon(const QIcon &icon) | - | ||||||||||||||||||||||||||||||||||||
| 3936 | { | - | ||||||||||||||||||||||||||||||||||||
| 3937 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3938 | - | |||||||||||||||||||||||||||||||||||||
| 3939 | setAttribute(Qt::WA_SetWindowIcon, !icon.isNull()); | - | ||||||||||||||||||||||||||||||||||||
| 3940 | d->createTLExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 3941 | - | |||||||||||||||||||||||||||||||||||||
| 3942 | if (!d->extra->topextra->icon
| 0 | ||||||||||||||||||||||||||||||||||||
| 3943 | d->extra->topextra->icon = new QIcon(); never executed: d->extra->topextra->icon = new QIcon(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3944 | *d->extra->topextra->icon = icon; | - | ||||||||||||||||||||||||||||||||||||
| 3945 | - | |||||||||||||||||||||||||||||||||||||
| 3946 | d->setWindowIcon_sys(); | - | ||||||||||||||||||||||||||||||||||||
| 3947 | d->setWindowIcon_helper(); | - | ||||||||||||||||||||||||||||||||||||
| 3948 | - | |||||||||||||||||||||||||||||||||||||
| 3949 | windowIconChanged(icon); | - | ||||||||||||||||||||||||||||||||||||
| 3950 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3951 | - | |||||||||||||||||||||||||||||||||||||
| 3952 | void QWidgetPrivate::setWindowIcon_sys() | - | ||||||||||||||||||||||||||||||||||||
| 3953 | { | - | ||||||||||||||||||||||||||||||||||||
| 3954 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3955 | if (QWindow *window = q->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3956 | window->setIcon(q->windowIcon()); never executed: window->setIcon(q->windowIcon()); | 0 | ||||||||||||||||||||||||||||||||||||
| 3957 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3958 | QString QWidget::windowIconText() const | - | ||||||||||||||||||||||||||||||||||||
| 3959 | { | - | ||||||||||||||||||||||||||||||||||||
| 3960 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3961 | return never executed: (d->extra && d->extra->topextra) ? d->extra->topextra->iconText : QString();return (d->extra && d->extra->topextra) ? d->extra->topextra->iconText : QString();never executed: return (d->extra && d->extra->topextra) ? d->extra->topextra->iconText : QString(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3962 | } | - | ||||||||||||||||||||||||||||||||||||
| 3963 | QString QWidget::windowFilePath() const | - | ||||||||||||||||||||||||||||||||||||
| 3964 | { | - | ||||||||||||||||||||||||||||||||||||
| 3965 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3966 | return never executed: (d->extra && d->extra->topextra) ? d->extra->topextra->filePath : QString();return (d->extra && d->extra->topextra) ? d->extra->topextra->filePath : QString();never executed: return (d->extra && d->extra->topextra) ? d->extra->topextra->filePath : QString(); | 0 | ||||||||||||||||||||||||||||||||||||
| 3967 | } | - | ||||||||||||||||||||||||||||||||||||
| 3968 | - | |||||||||||||||||||||||||||||||||||||
| 3969 | void QWidget::setWindowFilePath(const QString &filePath) | - | ||||||||||||||||||||||||||||||||||||
| 3970 | { | - | ||||||||||||||||||||||||||||||||||||
| 3971 | if (filePath == windowFilePath()
| 0 | ||||||||||||||||||||||||||||||||||||
| 3972 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 3973 | - | |||||||||||||||||||||||||||||||||||||
| 3974 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3975 | - | |||||||||||||||||||||||||||||||||||||
| 3976 | d->createTLExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 3977 | d->extra->topextra->filePath = filePath; | - | ||||||||||||||||||||||||||||||||||||
| 3978 | d->setWindowFilePath_helper(filePath); | - | ||||||||||||||||||||||||||||||||||||
| 3979 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3980 | - | |||||||||||||||||||||||||||||||||||||
| 3981 | void QWidgetPrivate::setWindowFilePath_helper(const QString &filePath) | - | ||||||||||||||||||||||||||||||||||||
| 3982 | { | - | ||||||||||||||||||||||||||||||||||||
| 3983 | if (extra->topextra
| 0 | ||||||||||||||||||||||||||||||||||||
| 3984 | - | |||||||||||||||||||||||||||||||||||||
| 3985 | - | |||||||||||||||||||||||||||||||||||||
| 3986 | - | |||||||||||||||||||||||||||||||||||||
| 3987 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 3988 | (void)filePath;; | - | ||||||||||||||||||||||||||||||||||||
| 3989 | setWindowTitle_helper(q->windowTitle()); | - | ||||||||||||||||||||||||||||||||||||
| 3990 | - | |||||||||||||||||||||||||||||||||||||
| 3991 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3992 | - | |||||||||||||||||||||||||||||||||||||
| 3993 | - | |||||||||||||||||||||||||||||||||||||
| 3994 | - | |||||||||||||||||||||||||||||||||||||
| 3995 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 3996 | - | |||||||||||||||||||||||||||||||||||||
| 3997 | void QWidgetPrivate::setWindowFilePath_sys(const QString &filePath) | - | ||||||||||||||||||||||||||||||||||||
| 3998 | { | - | ||||||||||||||||||||||||||||||||||||
| 3999 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4000 | if (!q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4001 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 4002 | - | |||||||||||||||||||||||||||||||||||||
| 4003 | if (QWindow *window = q->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4004 | window->setFilePath(filePath); never executed: window->setFilePath(filePath); | 0 | ||||||||||||||||||||||||||||||||||||
| 4005 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4006 | - | |||||||||||||||||||||||||||||||||||||
| 4007 | - | |||||||||||||||||||||||||||||||||||||
| 4008 | - | |||||||||||||||||||||||||||||||||||||
| 4009 | - | |||||||||||||||||||||||||||||||||||||
| 4010 | - | |||||||||||||||||||||||||||||||||||||
| 4011 | - | |||||||||||||||||||||||||||||||||||||
| 4012 | - | |||||||||||||||||||||||||||||||||||||
| 4013 | QString QWidget::windowRole() const | - | ||||||||||||||||||||||||||||||||||||
| 4014 | { | - | ||||||||||||||||||||||||||||||||||||
| 4015 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4016 | return never executed: (d->extra && d->extra->topextra) ? d->extra->topextra->role : QString();return (d->extra && d->extra->topextra) ? d->extra->topextra->role : QString();never executed: return (d->extra && d->extra->topextra) ? d->extra->topextra->role : QString(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4017 | } | - | ||||||||||||||||||||||||||||||||||||
| 4018 | - | |||||||||||||||||||||||||||||||||||||
| 4019 | - | |||||||||||||||||||||||||||||||||||||
| 4020 | - | |||||||||||||||||||||||||||||||||||||
| 4021 | - | |||||||||||||||||||||||||||||||||||||
| 4022 | - | |||||||||||||||||||||||||||||||||||||
| 4023 | void QWidget::setWindowRole(const QString &role) | - | ||||||||||||||||||||||||||||||||||||
| 4024 | { | - | ||||||||||||||||||||||||||||||||||||
| 4025 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4026 | d->createTLExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 4027 | d->topData()->role = role; | - | ||||||||||||||||||||||||||||||||||||
| 4028 | if (windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4029 | QXcbWindowFunctions::setWmWindowRole(windowHandle(), role.toLatin1()); never executed: QXcbWindowFunctions::setWmWindowRole(windowHandle(), role.toLatin1()); | 0 | ||||||||||||||||||||||||||||||||||||
| 4030 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4031 | void QWidget::setFocusProxy(QWidget * w) | - | ||||||||||||||||||||||||||||||||||||
| 4032 | { | - | ||||||||||||||||||||||||||||||||||||
| 4033 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4034 | if (!w
| 0 | ||||||||||||||||||||||||||||||||||||
| 4035 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 4036 | - | |||||||||||||||||||||||||||||||||||||
| 4037 | for (QWidget* fp = w; fp
| 0 | ||||||||||||||||||||||||||||||||||||
| 4038 | if (__builtin_expect(!!(fp == this), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 4039 | QMessageLogger(__FILE__, 6418, __PRETTY_FUNCTION__).warning("QWidget: %s (%s) already in focus proxy chain", metaObject()->className(), objectName().toLocal8Bit().constData()); | - | ||||||||||||||||||||||||||||||||||||
| 4040 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 4041 | } | - | ||||||||||||||||||||||||||||||||||||
| 4042 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4043 | - | |||||||||||||||||||||||||||||||||||||
| 4044 | d->createExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 4045 | d->extra->focus_proxy = w; | - | ||||||||||||||||||||||||||||||||||||
| 4046 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4047 | QWidget * QWidget::focusProxy() const | - | ||||||||||||||||||||||||||||||||||||
| 4048 | { | - | ||||||||||||||||||||||||||||||||||||
| 4049 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4050 | return never executed: d->extra ? (QWidget *)d->extra->focus_proxy : 0;return d->extra ? (QWidget *)d->extra->focus_proxy : 0;never executed: return d->extra ? (QWidget *)d->extra->focus_proxy : 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 4051 | } | - | ||||||||||||||||||||||||||||||||||||
| 4052 | bool QWidget::hasFocus() const | - | ||||||||||||||||||||||||||||||||||||
| 4053 | { | - | ||||||||||||||||||||||||||||||||||||
| 4054 | const QWidget* w = this; | - | ||||||||||||||||||||||||||||||||||||
| 4055 | while (w->d_func()->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 4056 | w = w->d_func()->extra->focus_proxy; never executed: w = w->d_func()->extra->focus_proxy; | 0 | ||||||||||||||||||||||||||||||||||||
| 4057 | - | |||||||||||||||||||||||||||||||||||||
| 4058 | if (QWidget *window = w->window()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4059 | QWExtra *e = window->d_func()->extra; | - | ||||||||||||||||||||||||||||||||||||
| 4060 | if (e
| 0 | ||||||||||||||||||||||||||||||||||||
| 4061 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 4062 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4063 | - | |||||||||||||||||||||||||||||||||||||
| 4064 | return never executed: (QApplication::focusWidget() == w);return (QApplication::focusWidget() == w);never executed: return (QApplication::focusWidget() == w); | 0 | ||||||||||||||||||||||||||||||||||||
| 4065 | } | - | ||||||||||||||||||||||||||||||||||||
| 4066 | void QWidget::setFocus(Qt::FocusReason reason) | - | ||||||||||||||||||||||||||||||||||||
| 4067 | { | - | ||||||||||||||||||||||||||||||||||||
| 4068 | if (!isEnabled()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4069 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 4070 | - | |||||||||||||||||||||||||||||||||||||
| 4071 | QWidget *f = this; | - | ||||||||||||||||||||||||||||||||||||
| 4072 | while (f->d_func()->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 4073 | f = f->d_func()->extra->focus_proxy; never executed: f = f->d_func()->extra->focus_proxy; | 0 | ||||||||||||||||||||||||||||||||||||
| 4074 | - | |||||||||||||||||||||||||||||||||||||
| 4075 | if (QApplication::focusWidget() == f
| 0 | ||||||||||||||||||||||||||||||||||||
| 4076 | - | |||||||||||||||||||||||||||||||||||||
| 4077 | - | |||||||||||||||||||||||||||||||||||||
| 4078 | - | |||||||||||||||||||||||||||||||||||||
| 4079 | ) | - | ||||||||||||||||||||||||||||||||||||
| 4080 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 4081 | - | |||||||||||||||||||||||||||||||||||||
| 4082 | - | |||||||||||||||||||||||||||||||||||||
| 4083 | QWidget *previousProxyFocus = 0; | - | ||||||||||||||||||||||||||||||||||||
| 4084 | if (QWExtra *topData = window()->d_func()->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 4085 | if (topData->proxyWidget
| 0 | ||||||||||||||||||||||||||||||||||||
| 4086 | previousProxyFocus = topData->proxyWidget->widget()->focusWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 4087 | if (previousProxyFocus
| 0 | ||||||||||||||||||||||||||||||||||||
| 4088 | previousProxyFocus = previousProxyFocus->focusProxy(); never executed: previousProxyFocus = previousProxyFocus->focusProxy(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4089 | if (previousProxyFocus == this
| 0 | ||||||||||||||||||||||||||||||||||||
| 4090 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 4091 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4092 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4093 | - | |||||||||||||||||||||||||||||||||||||
| 4094 | - | |||||||||||||||||||||||||||||||||||||
| 4095 | - | |||||||||||||||||||||||||||||||||||||
| 4096 | - | |||||||||||||||||||||||||||||||||||||
| 4097 | if (QWExtra *topData = window()->d_func()->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 4098 | if (topData->proxyWidget
| 0 | ||||||||||||||||||||||||||||||||||||
| 4099 | f->d_func()->updateFocusChild(); | - | ||||||||||||||||||||||||||||||||||||
| 4100 | topData->proxyWidget->d_func()->focusFromWidgetToProxy = 1; | - | ||||||||||||||||||||||||||||||||||||
| 4101 | topData->proxyWidget->setFocus(reason); | - | ||||||||||||||||||||||||||||||||||||
| 4102 | topData->proxyWidget->d_func()->focusFromWidgetToProxy = 0; | - | ||||||||||||||||||||||||||||||||||||
| 4103 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4104 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4105 | - | |||||||||||||||||||||||||||||||||||||
| 4106 | - | |||||||||||||||||||||||||||||||||||||
| 4107 | if (f->isActiveWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4108 | QWidget *prev = QApplicationPrivate::focus_widget; | - | ||||||||||||||||||||||||||||||||||||
| 4109 | if (prev
| 0 | ||||||||||||||||||||||||||||||||||||
| 4110 | if (reason != Qt::PopupFocusReason
| 0 | ||||||||||||||||||||||||||||||||||||
| 4111 | && prev->testAttribute(Qt::WA_InputMethodEnabled)
| 0 | ||||||||||||||||||||||||||||||||||||
| 4112 | QGuiApplication::inputMethod()->commit(); | - | ||||||||||||||||||||||||||||||||||||
| 4113 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4114 | - | |||||||||||||||||||||||||||||||||||||
| 4115 | if (reason != Qt::NoFocusReason
| 0 | ||||||||||||||||||||||||||||||||||||
| 4116 | QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange, reason); | - | ||||||||||||||||||||||||||||||||||||
| 4117 | QApplication::sendEvent(prev, &focusAboutToChange); | - | ||||||||||||||||||||||||||||||||||||
| 4118 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4119 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4120 | - | |||||||||||||||||||||||||||||||||||||
| 4121 | f->d_func()->updateFocusChild(); | - | ||||||||||||||||||||||||||||||||||||
| 4122 | - | |||||||||||||||||||||||||||||||||||||
| 4123 | QApplicationPrivate::setFocusWidget(f, reason); | - | ||||||||||||||||||||||||||||||||||||
| 4124 | - | |||||||||||||||||||||||||||||||||||||
| 4125 | - | |||||||||||||||||||||||||||||||||||||
| 4126 | - | |||||||||||||||||||||||||||||||||||||
| 4127 | - | |||||||||||||||||||||||||||||||||||||
| 4128 | - | |||||||||||||||||||||||||||||||||||||
| 4129 | - | |||||||||||||||||||||||||||||||||||||
| 4130 | - | |||||||||||||||||||||||||||||||||||||
| 4131 | if (!(f->inherits("QMenuBar")
| 0 | ||||||||||||||||||||||||||||||||||||
| 4132 | { | - | ||||||||||||||||||||||||||||||||||||
| 4133 | QAccessibleEvent event(f, QAccessible::Focus); | - | ||||||||||||||||||||||||||||||||||||
| 4134 | QAccessible::updateAccessibility(&event); | - | ||||||||||||||||||||||||||||||||||||
| 4135 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4136 | - | |||||||||||||||||||||||||||||||||||||
| 4137 | - | |||||||||||||||||||||||||||||||||||||
| 4138 | if (QWExtra *topData = window()->d_func()->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 4139 | if (topData->proxyWidget
| 0 | ||||||||||||||||||||||||||||||||||||
| 4140 | if (previousProxyFocus
| 0 | ||||||||||||||||||||||||||||||||||||
| 4141 | - | |||||||||||||||||||||||||||||||||||||
| 4142 | QFocusEvent event(QEvent::FocusOut, reason); | - | ||||||||||||||||||||||||||||||||||||
| 4143 | QPointer<QWidget> that = previousProxyFocus; | - | ||||||||||||||||||||||||||||||||||||
| 4144 | QApplication::sendEvent(previousProxyFocus, &event); | - | ||||||||||||||||||||||||||||||||||||
| 4145 | if (that
| 0 | ||||||||||||||||||||||||||||||||||||
| 4146 | QApplication::sendEvent(that->style(), &event); never executed: QApplication::sendEvent(that->style(), &event); | 0 | ||||||||||||||||||||||||||||||||||||
| 4147 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4148 | if (!isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4149 | - | |||||||||||||||||||||||||||||||||||||
| 4150 | - | |||||||||||||||||||||||||||||||||||||
| 4151 | if (QWExtra *topData = window()->d_func()->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 4152 | if (topData->proxyWidget
| 0 | ||||||||||||||||||||||||||||||||||||
| 4153 | topData->proxyWidget->d_func()->updateProxyInputMethodAcceptanceFromWidget(); never executed: topData->proxyWidget->d_func()->updateProxyInputMethodAcceptanceFromWidget(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4154 | - | |||||||||||||||||||||||||||||||||||||
| 4155 | - | |||||||||||||||||||||||||||||||||||||
| 4156 | QFocusEvent event(QEvent::FocusIn, reason); | - | ||||||||||||||||||||||||||||||||||||
| 4157 | QPointer<QWidget> that = f; | - | ||||||||||||||||||||||||||||||||||||
| 4158 | QApplication::sendEvent(f, &event); | - | ||||||||||||||||||||||||||||||||||||
| 4159 | if (that
| 0 | ||||||||||||||||||||||||||||||||||||
| 4160 | QApplication::sendEvent(that->style(), &event); never executed: QApplication::sendEvent(that->style(), &event); | 0 | ||||||||||||||||||||||||||||||||||||
| 4161 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4162 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4163 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4164 | - | |||||||||||||||||||||||||||||||||||||
| 4165 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4166 | f->d_func()->updateFocusChild(); | - | ||||||||||||||||||||||||||||||||||||
| 4167 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4168 | - | |||||||||||||||||||||||||||||||||||||
| 4169 | if (QTLWExtra *extra = f->window()->d_func()->maybeTopData()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4170 | if (extra->window
| 0 | ||||||||||||||||||||||||||||||||||||
| 4171 | extra->window->focusObjectChanged(f); never executed: extra->window->focusObjectChanged(f); | 0 | ||||||||||||||||||||||||||||||||||||
| 4172 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4173 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4174 | - | |||||||||||||||||||||||||||||||||||||
| 4175 | void QWidgetPrivate::setFocus_sys() | - | ||||||||||||||||||||||||||||||||||||
| 4176 | { | - | ||||||||||||||||||||||||||||||||||||
| 4177 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4178 | - | |||||||||||||||||||||||||||||||||||||
| 4179 | const QWidget *topLevel = q->window(); | - | ||||||||||||||||||||||||||||||||||||
| 4180 | if (topLevel->windowType() != Qt::Popup
| 0 | ||||||||||||||||||||||||||||||||||||
| 4181 | if (QWindow *nativeWindow = q->window()->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4182 | if (nativeWindow != QGuiApplication::focusWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4183 | && q->testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 4184 | nativeWindow->requestActivate(); | - | ||||||||||||||||||||||||||||||||||||
| 4185 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4186 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4187 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4188 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4189 | - | |||||||||||||||||||||||||||||||||||||
| 4190 | - | |||||||||||||||||||||||||||||||||||||
| 4191 | void QWidgetPrivate::updateFocusChild() | - | ||||||||||||||||||||||||||||||||||||
| 4192 | { | - | ||||||||||||||||||||||||||||||||||||
| 4193 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4194 | - | |||||||||||||||||||||||||||||||||||||
| 4195 | QWidget *w = q; | - | ||||||||||||||||||||||||||||||||||||
| 4196 | if (q->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4197 | while (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 4198 | w->d_func()->focus_child = q; | - | ||||||||||||||||||||||||||||||||||||
| 4199 | w = w->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4200 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4201 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4202 | while (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 4203 | w->d_func()->focus_child = q; | - | ||||||||||||||||||||||||||||||||||||
| 4204 | w = w->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4205 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4206 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4207 | } | - | ||||||||||||||||||||||||||||||||||||
| 4208 | void QWidget::clearFocus() | - | ||||||||||||||||||||||||||||||||||||
| 4209 | { | - | ||||||||||||||||||||||||||||||||||||
| 4210 | if (hasFocus()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4211 | if (testAttribute(Qt::WA_InputMethodEnabled)
| 0 | ||||||||||||||||||||||||||||||||||||
| 4212 | QGuiApplication::inputMethod()->commit(); never executed: QGuiApplication::inputMethod()->commit(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4213 | - | |||||||||||||||||||||||||||||||||||||
| 4214 | QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange); | - | ||||||||||||||||||||||||||||||||||||
| 4215 | QApplication::sendEvent(this, &focusAboutToChange); | - | ||||||||||||||||||||||||||||||||||||
| 4216 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4217 | - | |||||||||||||||||||||||||||||||||||||
| 4218 | QWidget *w = this; | - | ||||||||||||||||||||||||||||||||||||
| 4219 | while (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 4220 | - | |||||||||||||||||||||||||||||||||||||
| 4221 | if (w->d_func()->focus_child == this
| 0 | ||||||||||||||||||||||||||||||||||||
| 4222 | w->d_func()->focus_child = 0; never executed: w->d_func()->focus_child = 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 4223 | w = w->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 4224 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4225 | - | |||||||||||||||||||||||||||||||||||||
| 4226 | - | |||||||||||||||||||||||||||||||||||||
| 4227 | - | |||||||||||||||||||||||||||||||||||||
| 4228 | - | |||||||||||||||||||||||||||||||||||||
| 4229 | - | |||||||||||||||||||||||||||||||||||||
| 4230 | QWExtra *topData = d_func()->extra; | - | ||||||||||||||||||||||||||||||||||||
| 4231 | if (topData
| 0 | ||||||||||||||||||||||||||||||||||||
| 4232 | topData->proxyWidget->clearFocus(); never executed: topData->proxyWidget->clearFocus(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4233 | - | |||||||||||||||||||||||||||||||||||||
| 4234 | - | |||||||||||||||||||||||||||||||||||||
| 4235 | if (hasFocus()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4236 | - | |||||||||||||||||||||||||||||||||||||
| 4237 | QApplicationPrivate::setFocusWidget(0, Qt::OtherFocusReason); | - | ||||||||||||||||||||||||||||||||||||
| 4238 | - | |||||||||||||||||||||||||||||||||||||
| 4239 | - | |||||||||||||||||||||||||||||||||||||
| 4240 | - | |||||||||||||||||||||||||||||||||||||
| 4241 | - | |||||||||||||||||||||||||||||||||||||
| 4242 | - | |||||||||||||||||||||||||||||||||||||
| 4243 | { | - | ||||||||||||||||||||||||||||||||||||
| 4244 | - | |||||||||||||||||||||||||||||||||||||
| 4245 | QAccessibleEvent event(this, QAccessible::Focus); | - | ||||||||||||||||||||||||||||||||||||
| 4246 | QAccessible::updateAccessibility(&event); | - | ||||||||||||||||||||||||||||||||||||
| 4247 | - | |||||||||||||||||||||||||||||||||||||
| 4248 | } | - | ||||||||||||||||||||||||||||||||||||
| 4249 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4250 | - | |||||||||||||||||||||||||||||||||||||
| 4251 | - | |||||||||||||||||||||||||||||||||||||
| 4252 | - | |||||||||||||||||||||||||||||||||||||
| 4253 | - | |||||||||||||||||||||||||||||||||||||
| 4254 | - | |||||||||||||||||||||||||||||||||||||
| 4255 | if (QTLWExtra *extra = window()->d_func()->maybeTopData()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4256 | if (extra->window
| 0 | ||||||||||||||||||||||||||||||||||||
| 4257 | extra->window->focusObjectChanged(extra->window->focusObject()); never executed: extra->window->focusObjectChanged(extra->window->focusObject()); | 0 | ||||||||||||||||||||||||||||||||||||
| 4258 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4259 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4260 | bool QWidget::focusNextPrevChild(bool next) | - | ||||||||||||||||||||||||||||||||||||
| 4261 | { | - | ||||||||||||||||||||||||||||||||||||
| 4262 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4263 | QWidget* p = parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 4264 | bool isSubWindow = (windowType() == Qt::SubWindow); | - | ||||||||||||||||||||||||||||||||||||
| 4265 | if (!isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4266 | return never executed: p->focusNextPrevChild(next);return p->focusNextPrevChild(next);never executed: return p->focusNextPrevChild(next); | 0 | ||||||||||||||||||||||||||||||||||||
| 4267 | - | |||||||||||||||||||||||||||||||||||||
| 4268 | if (d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 4269 | return never executed: d->extra->proxyWidget->focusNextPrevChild(next);return d->extra->proxyWidget->focusNextPrevChild(next);never executed: return d->extra->proxyWidget->focusNextPrevChild(next); | 0 | ||||||||||||||||||||||||||||||||||||
| 4270 | - | |||||||||||||||||||||||||||||||||||||
| 4271 | - | |||||||||||||||||||||||||||||||||||||
| 4272 | bool wrappingOccurred = false; | - | ||||||||||||||||||||||||||||||||||||
| 4273 | QWidget *w = QApplicationPrivate::focusNextPrevChild_helper(this, next, | - | ||||||||||||||||||||||||||||||||||||
| 4274 | &wrappingOccurred); | - | ||||||||||||||||||||||||||||||||||||
| 4275 | if (!w
never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 4276 | - | |||||||||||||||||||||||||||||||||||||
| 4277 | Qt::FocusReason reason = next
| 0 | ||||||||||||||||||||||||||||||||||||
| 4278 | - | |||||||||||||||||||||||||||||||||||||
| 4279 | - | |||||||||||||||||||||||||||||||||||||
| 4280 | - | |||||||||||||||||||||||||||||||||||||
| 4281 | - | |||||||||||||||||||||||||||||||||||||
| 4282 | - | |||||||||||||||||||||||||||||||||||||
| 4283 | - | |||||||||||||||||||||||||||||||||||||
| 4284 | if (wrappingOccurred
| 0 | ||||||||||||||||||||||||||||||||||||
| 4285 | QWindow *window = windowHandle(); | - | ||||||||||||||||||||||||||||||||||||
| 4286 | if (window != 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 4287 | QWindowPrivate *winp = qt_window_private(window); | - | ||||||||||||||||||||||||||||||||||||
| 4288 | - | |||||||||||||||||||||||||||||||||||||
| 4289 | if (winp->platformWindow != 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 4290 | QFocusEvent event(QEvent::FocusIn, reason); | - | ||||||||||||||||||||||||||||||||||||
| 4291 | event.ignore(); | - | ||||||||||||||||||||||||||||||||||||
| 4292 | winp->platformWindow->windowEvent(&event); | - | ||||||||||||||||||||||||||||||||||||
| 4293 | if (event.isAccepted()
never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 4294 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4295 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4296 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4297 | - | |||||||||||||||||||||||||||||||||||||
| 4298 | w->setFocus(reason); | - | ||||||||||||||||||||||||||||||||||||
| 4299 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 4300 | } | - | ||||||||||||||||||||||||||||||||||||
| 4301 | QWidget *QWidget::focusWidget() const | - | ||||||||||||||||||||||||||||||||||||
| 4302 | { | - | ||||||||||||||||||||||||||||||||||||
| 4303 | return never executed: const_cast<QWidget *>(d_func()->focus_child);return const_cast<QWidget *>(d_func()->focus_child);never executed: return const_cast<QWidget *>(d_func()->focus_child); | 0 | ||||||||||||||||||||||||||||||||||||
| 4304 | } | - | ||||||||||||||||||||||||||||||||||||
| 4305 | - | |||||||||||||||||||||||||||||||||||||
| 4306 | - | |||||||||||||||||||||||||||||||||||||
| 4307 | - | |||||||||||||||||||||||||||||||||||||
| 4308 | - | |||||||||||||||||||||||||||||||||||||
| 4309 | - | |||||||||||||||||||||||||||||||||||||
| 4310 | - | |||||||||||||||||||||||||||||||||||||
| 4311 | QWidget *QWidget::nextInFocusChain() const | - | ||||||||||||||||||||||||||||||||||||
| 4312 | { | - | ||||||||||||||||||||||||||||||||||||
| 4313 | return never executed: const_cast<QWidget *>(d_func()->focus_next);return const_cast<QWidget *>(d_func()->focus_next);never executed: return const_cast<QWidget *>(d_func()->focus_next); | 0 | ||||||||||||||||||||||||||||||||||||
| 4314 | } | - | ||||||||||||||||||||||||||||||||||||
| 4315 | QWidget *QWidget::previousInFocusChain() const | - | ||||||||||||||||||||||||||||||||||||
| 4316 | { | - | ||||||||||||||||||||||||||||||||||||
| 4317 | return never executed: const_cast<QWidget *>(d_func()->focus_prev);return const_cast<QWidget *>(d_func()->focus_prev);never executed: return const_cast<QWidget *>(d_func()->focus_prev); | 0 | ||||||||||||||||||||||||||||||||||||
| 4318 | } | - | ||||||||||||||||||||||||||||||||||||
| 4319 | bool QWidget::isActiveWindow() const | - | ||||||||||||||||||||||||||||||||||||
| 4320 | { | - | ||||||||||||||||||||||||||||||||||||
| 4321 | QWidget *tlw = window(); | - | ||||||||||||||||||||||||||||||||||||
| 4322 | if(tlw == QApplication::activeWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4323 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 4324 | - | |||||||||||||||||||||||||||||||||||||
| 4325 | - | |||||||||||||||||||||||||||||||||||||
| 4326 | if (QWExtra *tlwExtra = tlw->d_func()->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 4327 | if (isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4328 | return never executed: tlwExtra->proxyWidget->isActiveWindow();return tlwExtra->proxyWidget->isActiveWindow();never executed: return tlwExtra->proxyWidget->isActiveWindow(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4329 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4330 | - | |||||||||||||||||||||||||||||||||||||
| 4331 | - | |||||||||||||||||||||||||||||||||||||
| 4332 | if(style()->styleHint(QStyle::SH_Widget_ShareActivation, 0, this)
| 0 | ||||||||||||||||||||||||||||||||||||
| 4333 | if(tlw->windowType() == Qt::Tool
| 0 | ||||||||||||||||||||||||||||||||||||
| 4334 | !tlw->isModal()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4335 | (!tlw->parentWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4336 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 4337 | QWidget *w = QApplication::activeWindow(); | - | ||||||||||||||||||||||||||||||||||||
| 4338 | while(w
| 0 | ||||||||||||||||||||||||||||||||||||
| 4339 | !w->isModal()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4340 | w = w->parentWidget()->window(); | - | ||||||||||||||||||||||||||||||||||||
| 4341 | if(w == tlw
| 0 | ||||||||||||||||||||||||||||||||||||
| 4342 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 4343 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4344 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4345 | - | |||||||||||||||||||||||||||||||||||||
| 4346 | - | |||||||||||||||||||||||||||||||||||||
| 4347 | if (QWindow *ww = QGuiApplication::focusWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4348 | while (ww
| 0 | ||||||||||||||||||||||||||||||||||||
| 4349 | QWidgetWindow *qww = qobject_cast<QWidgetWindow *>(ww); | - | ||||||||||||||||||||||||||||||||||||
| 4350 | QWindowContainer *qwc = qww
| 0 | ||||||||||||||||||||||||||||||||||||
| 4351 | if (qwc
| 0 | ||||||||||||||||||||||||||||||||||||
| 4352 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 4353 | ww = ww->parent(); | - | ||||||||||||||||||||||||||||||||||||
| 4354 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4355 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4356 | - | |||||||||||||||||||||||||||||||||||||
| 4357 | - | |||||||||||||||||||||||||||||||||||||
| 4358 | - | |||||||||||||||||||||||||||||||||||||
| 4359 | - | |||||||||||||||||||||||||||||||||||||
| 4360 | - | |||||||||||||||||||||||||||||||||||||
| 4361 | - | |||||||||||||||||||||||||||||||||||||
| 4362 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||
| 4363 | if (w->handle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4364 | return never executed: w->handle()->isActive();return w->handle()->isActive();never executed: return w->handle()->isActive(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4365 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4366 | - | |||||||||||||||||||||||||||||||||||||
| 4367 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 4368 | } | - | ||||||||||||||||||||||||||||||||||||
| 4369 | void QWidget::setTabOrder(QWidget* first, QWidget *second) | - | ||||||||||||||||||||||||||||||||||||
| 4370 | { | - | ||||||||||||||||||||||||||||||||||||
| 4371 | if (!first
| 0 | ||||||||||||||||||||||||||||||||||||
| 4372 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 4373 | - | |||||||||||||||||||||||||||||||||||||
| 4374 | if (__builtin_expect(!!(first->window() != second->window()), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 4375 | QMessageLogger(__FILE__, 6932, __PRETTY_FUNCTION__).warning("QWidget::setTabOrder: 'first' and 'second' must be in the same window"); | - | ||||||||||||||||||||||||||||||||||||
| 4376 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 4377 | } | - | ||||||||||||||||||||||||||||||||||||
| 4378 | - | |||||||||||||||||||||||||||||||||||||
| 4379 | QWidget *fp = first->focusProxy(); | - | ||||||||||||||||||||||||||||||||||||
| 4380 | if (fp
| 0 | ||||||||||||||||||||||||||||||||||||
| 4381 | - | |||||||||||||||||||||||||||||||||||||
| 4382 | - | |||||||||||||||||||||||||||||||||||||
| 4383 | - | |||||||||||||||||||||||||||||||||||||
| 4384 | - | |||||||||||||||||||||||||||||||||||||
| 4385 | QList<QWidget *> l = first->findChildren<QWidget *>(); | - | ||||||||||||||||||||||||||||||||||||
| 4386 | for (int i = l.size()-1; i >= 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 4387 | QWidget * next = l.at(i); | - | ||||||||||||||||||||||||||||||||||||
| 4388 | if (next->window() == fp->window()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4389 | fp = next; | - | ||||||||||||||||||||||||||||||||||||
| 4390 | if (fp->focusPolicy() != Qt::NoFocus
| 0 | ||||||||||||||||||||||||||||||||||||
| 4391 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 4392 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4393 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4394 | first = fp; | - | ||||||||||||||||||||||||||||||||||||
| 4395 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4396 | - | |||||||||||||||||||||||||||||||||||||
| 4397 | if (fp == second
| 0 | ||||||||||||||||||||||||||||||||||||
| 4398 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 4399 | - | |||||||||||||||||||||||||||||||||||||
| 4400 | if (QWidget *sp = second->focusProxy()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4401 | second = sp; never executed: second = sp; | 0 | ||||||||||||||||||||||||||||||||||||
| 4402 | - | |||||||||||||||||||||||||||||||||||||
| 4403 | - | |||||||||||||||||||||||||||||||||||||
| 4404 | QWidget *fn = first->d_func()->focus_next; | - | ||||||||||||||||||||||||||||||||||||
| 4405 | - | |||||||||||||||||||||||||||||||||||||
| 4406 | if (fn == second
| 0 | ||||||||||||||||||||||||||||||||||||
| 4407 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 4408 | - | |||||||||||||||||||||||||||||||||||||
| 4409 | QWidget *sp = second->d_func()->focus_prev; | - | ||||||||||||||||||||||||||||||||||||
| 4410 | QWidget *sn = second->d_func()->focus_next; | - | ||||||||||||||||||||||||||||||||||||
| 4411 | - | |||||||||||||||||||||||||||||||||||||
| 4412 | fn->d_func()->focus_prev = second; | - | ||||||||||||||||||||||||||||||||||||
| 4413 | first->d_func()->focus_next = second; | - | ||||||||||||||||||||||||||||||||||||
| 4414 | - | |||||||||||||||||||||||||||||||||||||
| 4415 | second->d_func()->focus_next = fn; | - | ||||||||||||||||||||||||||||||||||||
| 4416 | second->d_func()->focus_prev = first; | - | ||||||||||||||||||||||||||||||||||||
| 4417 | - | |||||||||||||||||||||||||||||||||||||
| 4418 | sp->d_func()->focus_next = sn; | - | ||||||||||||||||||||||||||||||||||||
| 4419 | sn->d_func()->focus_prev = sp; | - | ||||||||||||||||||||||||||||||||||||
| 4420 | - | |||||||||||||||||||||||||||||||||||||
| 4421 | - | |||||||||||||||||||||||||||||||||||||
| 4422 | ((!(first->d_func()->focus_next->d_func()->focus_prev == first)) ? qt_assert("first->d_func()->focus_next->d_func()->focus_prev == first",__FILE__,6979) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 4423 | ((!(first->d_func()->focus_prev->d_func()->focus_next == first)) ? qt_assert("first->d_func()->focus_prev->d_func()->focus_next == first",__FILE__,6980) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 4424 | - | |||||||||||||||||||||||||||||||||||||
| 4425 | ((!(second->d_func()->focus_next->d_func()->focus_prev == second)) ? qt_assert("second->d_func()->focus_next->d_func()->focus_prev == second",__FILE__,6982) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 4426 | ((!(second->d_func()->focus_prev->d_func()->focus_next == second)) ? qt_assert("second->d_func()->focus_prev->d_func()->focus_next == second",__FILE__,6983) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 4427 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4428 | void QWidgetPrivate::reparentFocusWidgets(QWidget * oldtlw) | - | ||||||||||||||||||||||||||||||||||||
| 4429 | { | - | ||||||||||||||||||||||||||||||||||||
| 4430 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4431 | if (oldtlw == q->window()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4432 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 4433 | - | |||||||||||||||||||||||||||||||||||||
| 4434 | if(focus_child
| 0 | ||||||||||||||||||||||||||||||||||||
| 4435 | focus_child->clearFocus(); never executed: focus_child->clearFocus(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4436 | - | |||||||||||||||||||||||||||||||||||||
| 4437 | - | |||||||||||||||||||||||||||||||||||||
| 4438 | QWidget *firstOld = 0; | - | ||||||||||||||||||||||||||||||||||||
| 4439 | - | |||||||||||||||||||||||||||||||||||||
| 4440 | QWidget *o = 0; | - | ||||||||||||||||||||||||||||||||||||
| 4441 | QWidget *n = q; | - | ||||||||||||||||||||||||||||||||||||
| 4442 | - | |||||||||||||||||||||||||||||||||||||
| 4443 | bool prevWasNew = true; | - | ||||||||||||||||||||||||||||||||||||
| 4444 | QWidget *w = focus_next; | - | ||||||||||||||||||||||||||||||||||||
| 4445 | - | |||||||||||||||||||||||||||||||||||||
| 4446 | - | |||||||||||||||||||||||||||||||||||||
| 4447 | - | |||||||||||||||||||||||||||||||||||||
| 4448 | - | |||||||||||||||||||||||||||||||||||||
| 4449 | while (w != q
| 0 | ||||||||||||||||||||||||||||||||||||
| 4450 | bool currentIsNew = q->isAncestorOf(w); | - | ||||||||||||||||||||||||||||||||||||
| 4451 | if (currentIsNew
| 0 | ||||||||||||||||||||||||||||||||||||
| 4452 | if (!prevWasNew
| 0 | ||||||||||||||||||||||||||||||||||||
| 4453 | - | |||||||||||||||||||||||||||||||||||||
| 4454 | n->d_func()->focus_next = w; | - | ||||||||||||||||||||||||||||||||||||
| 4455 | w->d_func()->focus_prev = n; | - | ||||||||||||||||||||||||||||||||||||
| 4456 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4457 | n = w; | - | ||||||||||||||||||||||||||||||||||||
| 4458 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4459 | if (prevWasNew
| 0 | ||||||||||||||||||||||||||||||||||||
| 4460 | - | |||||||||||||||||||||||||||||||||||||
| 4461 | if (o
| 0 | ||||||||||||||||||||||||||||||||||||
| 4462 | o->d_func()->focus_next = w; | - | ||||||||||||||||||||||||||||||||||||
| 4463 | w->d_func()->focus_prev = o; | - | ||||||||||||||||||||||||||||||||||||
| 4464 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4465 | - | |||||||||||||||||||||||||||||||||||||
| 4466 | firstOld = w; | - | ||||||||||||||||||||||||||||||||||||
| 4467 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4468 | } | - | ||||||||||||||||||||||||||||||||||||
| 4469 | o = w; | - | ||||||||||||||||||||||||||||||||||||
| 4470 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4471 | w = w->d_func()->focus_next; | - | ||||||||||||||||||||||||||||||||||||
| 4472 | prevWasNew = currentIsNew; | - | ||||||||||||||||||||||||||||||||||||
| 4473 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4474 | - | |||||||||||||||||||||||||||||||||||||
| 4475 | - | |||||||||||||||||||||||||||||||||||||
| 4476 | if (firstOld
| 0 | ||||||||||||||||||||||||||||||||||||
| 4477 | o->d_func()->focus_next = firstOld; | - | ||||||||||||||||||||||||||||||||||||
| 4478 | firstOld->d_func()->focus_prev = o; | - | ||||||||||||||||||||||||||||||||||||
| 4479 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4480 | - | |||||||||||||||||||||||||||||||||||||
| 4481 | if (!q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4482 | QWidget *topLevel = q->window(); | - | ||||||||||||||||||||||||||||||||||||
| 4483 | - | |||||||||||||||||||||||||||||||||||||
| 4484 | - | |||||||||||||||||||||||||||||||||||||
| 4485 | QWidget *prev = topLevel->d_func()->focus_prev; | - | ||||||||||||||||||||||||||||||||||||
| 4486 | - | |||||||||||||||||||||||||||||||||||||
| 4487 | topLevel->d_func()->focus_prev = n; | - | ||||||||||||||||||||||||||||||||||||
| 4488 | prev->d_func()->focus_next = q; | - | ||||||||||||||||||||||||||||||||||||
| 4489 | - | |||||||||||||||||||||||||||||||||||||
| 4490 | focus_prev = prev; | - | ||||||||||||||||||||||||||||||||||||
| 4491 | n->d_func()->focus_next = topLevel; | - | ||||||||||||||||||||||||||||||||||||
| 4492 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4493 | - | |||||||||||||||||||||||||||||||||||||
| 4494 | n->d_func()->focus_next = q; | - | ||||||||||||||||||||||||||||||||||||
| 4495 | focus_prev = n; | - | ||||||||||||||||||||||||||||||||||||
| 4496 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4497 | - | |||||||||||||||||||||||||||||||||||||
| 4498 | } | - | ||||||||||||||||||||||||||||||||||||
| 4499 | int QWidgetPrivate::pointToRect(const QPoint &p, const QRect &r) | - | ||||||||||||||||||||||||||||||||||||
| 4500 | { | - | ||||||||||||||||||||||||||||||||||||
| 4501 | int dx = 0; | - | ||||||||||||||||||||||||||||||||||||
| 4502 | int dy = 0; | - | ||||||||||||||||||||||||||||||||||||
| 4503 | if (p.x() < r.left()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4504 | dx = r.left() - p.x(); never executed: dx = r.left() - p.x(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4505 | else if (p.x() > r.right()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4506 | dx = p.x() - r.right(); never executed: dx = p.x() - r.right(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4507 | if (p.y() < r.top()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4508 | dy = r.top() - p.y(); never executed: dy = r.top() - p.y(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4509 | else if (p.y() > r.bottom()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4510 | dy = p.y() - r.bottom(); never executed: dy = p.y() - r.bottom(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4511 | return never executed: dx + dy;return dx + dy;never executed: return dx + dy; | 0 | ||||||||||||||||||||||||||||||||||||
| 4512 | } | - | ||||||||||||||||||||||||||||||||||||
| 4513 | QSize QWidget::frameSize() const | - | ||||||||||||||||||||||||||||||||||||
| 4514 | { | - | ||||||||||||||||||||||||||||||||||||
| 4515 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4516 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4517 | QRect fs = d->frameStrut(); | - | ||||||||||||||||||||||||||||||||||||
| 4518 | return never executed: QSize(data->crect.width() + fs.left() + fs.right(),return QSize(data->crect.width() + fs.left() + fs.right(), data->crect.height() + fs.top() + fs.bottom());never executed: return QSize(data->crect.width() + fs.left() + fs.right(), data->crect.height() + fs.top() + fs.bottom()); | 0 | ||||||||||||||||||||||||||||||||||||
| 4519 | data->crect.height() + fs.top() + fs.bottom()); never executed: return QSize(data->crect.width() + fs.left() + fs.right(), data->crect.height() + fs.top() + fs.bottom()); | 0 | ||||||||||||||||||||||||||||||||||||
| 4520 | } | - | ||||||||||||||||||||||||||||||||||||
| 4521 | return never executed: data->crect.size();return data->crect.size();never executed: return data->crect.size(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4522 | } | - | ||||||||||||||||||||||||||||||||||||
| 4523 | void QWidget::move(const QPoint &p) | - | ||||||||||||||||||||||||||||||||||||
| 4524 | { | - | ||||||||||||||||||||||||||||||||||||
| 4525 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4526 | setAttribute(Qt::WA_Moved); | - | ||||||||||||||||||||||||||||||||||||
| 4527 | if (testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 4528 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4529 | d->topData()->posIncludesFrame = false; never executed: d->topData()->posIncludesFrame = false; | 0 | ||||||||||||||||||||||||||||||||||||
| 4530 | d->setGeometry_sys(p.x() + geometry().x() - QWidget::x(), | - | ||||||||||||||||||||||||||||||||||||
| 4531 | p.y() + geometry().y() - QWidget::y(), | - | ||||||||||||||||||||||||||||||||||||
| 4532 | width(), height(), true); | - | ||||||||||||||||||||||||||||||||||||
| 4533 | d->setDirtyOpaqueRegion(); | - | ||||||||||||||||||||||||||||||||||||
| 4534 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4535 | - | |||||||||||||||||||||||||||||||||||||
| 4536 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4537 | d->topData()->posIncludesFrame = true; never executed: d->topData()->posIncludesFrame = true; | 0 | ||||||||||||||||||||||||||||||||||||
| 4538 | data->crect.moveTopLeft(p); | - | ||||||||||||||||||||||||||||||||||||
| 4539 | setAttribute(Qt::WA_PendingMoveEvent); | - | ||||||||||||||||||||||||||||||||||||
| 4540 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4541 | - | |||||||||||||||||||||||||||||||||||||
| 4542 | if (d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 4543 | QWindowContainer::parentWasMoved(this); never executed: QWindowContainer::parentWasMoved(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 4544 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4545 | - | |||||||||||||||||||||||||||||||||||||
| 4546 | - | |||||||||||||||||||||||||||||||||||||
| 4547 | - | |||||||||||||||||||||||||||||||||||||
| 4548 | - | |||||||||||||||||||||||||||||||||||||
| 4549 | void QWidgetPrivate::fixPosIncludesFrame() | - | ||||||||||||||||||||||||||||||||||||
| 4550 | { | - | ||||||||||||||||||||||||||||||||||||
| 4551 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4552 | if (QTLWExtra *te = maybeTopData()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4553 | if (te->posIncludesFrame
| 0 | ||||||||||||||||||||||||||||||||||||
| 4554 | - | |||||||||||||||||||||||||||||||||||||
| 4555 | - | |||||||||||||||||||||||||||||||||||||
| 4556 | if (q->testAttribute(Qt::WA_DontShowOnScreen)
| 0 | ||||||||||||||||||||||||||||||||||||
| 4557 | te->posIncludesFrame = 0; | - | ||||||||||||||||||||||||||||||||||||
| 4558 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4559 | if (q->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4560 | updateFrameStrut(); | - | ||||||||||||||||||||||||||||||||||||
| 4561 | if (!q->data->fstrut_dirty
| 0 | ||||||||||||||||||||||||||||||||||||
| 4562 | data.crect.translate(te->frameStrut.x(), te->frameStrut.y()); | - | ||||||||||||||||||||||||||||||||||||
| 4563 | te->posIncludesFrame = 0; | - | ||||||||||||||||||||||||||||||||||||
| 4564 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4565 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4566 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4567 | } | - | ||||||||||||||||||||||||||||||||||||
| 4568 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4569 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4570 | - | |||||||||||||||||||||||||||||||||||||
| 4571 | - | |||||||||||||||||||||||||||||||||||||
| 4572 | - | |||||||||||||||||||||||||||||||||||||
| 4573 | - | |||||||||||||||||||||||||||||||||||||
| 4574 | - | |||||||||||||||||||||||||||||||||||||
| 4575 | - | |||||||||||||||||||||||||||||||||||||
| 4576 | - | |||||||||||||||||||||||||||||||||||||
| 4577 | void QWidget::resize(const QSize &s) | - | ||||||||||||||||||||||||||||||||||||
| 4578 | { | - | ||||||||||||||||||||||||||||||||||||
| 4579 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4580 | setAttribute(Qt::WA_Resized); | - | ||||||||||||||||||||||||||||||||||||
| 4581 | if (testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 4582 | d->fixPosIncludesFrame(); | - | ||||||||||||||||||||||||||||||||||||
| 4583 | d->setGeometry_sys(geometry().x(), geometry().y(), s.width(), s.height(), false); | - | ||||||||||||||||||||||||||||||||||||
| 4584 | d->setDirtyOpaqueRegion(); | - | ||||||||||||||||||||||||||||||||||||
| 4585 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4586 | data->crect.setSize(s.boundedTo(maximumSize()).expandedTo(minimumSize())); | - | ||||||||||||||||||||||||||||||||||||
| 4587 | setAttribute(Qt::WA_PendingResizeEvent); | - | ||||||||||||||||||||||||||||||||||||
| 4588 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4589 | } | - | ||||||||||||||||||||||||||||||||||||
| 4590 | - | |||||||||||||||||||||||||||||||||||||
| 4591 | void QWidget::setGeometry(const QRect &r) | - | ||||||||||||||||||||||||||||||||||||
| 4592 | { | - | ||||||||||||||||||||||||||||||||||||
| 4593 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4594 | setAttribute(Qt::WA_Resized); | - | ||||||||||||||||||||||||||||||||||||
| 4595 | setAttribute(Qt::WA_Moved); | - | ||||||||||||||||||||||||||||||||||||
| 4596 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4597 | d->topData()->posIncludesFrame = 0; never executed: d->topData()->posIncludesFrame = 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 4598 | if (testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 4599 | d->setGeometry_sys(r.x(), r.y(), r.width(), r.height(), true); | - | ||||||||||||||||||||||||||||||||||||
| 4600 | d->setDirtyOpaqueRegion(); | - | ||||||||||||||||||||||||||||||||||||
| 4601 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4602 | data->crect.setTopLeft(r.topLeft()); | - | ||||||||||||||||||||||||||||||||||||
| 4603 | data->crect.setSize(r.size().boundedTo(maximumSize()).expandedTo(minimumSize())); | - | ||||||||||||||||||||||||||||||||||||
| 4604 | setAttribute(Qt::WA_PendingMoveEvent); | - | ||||||||||||||||||||||||||||||||||||
| 4605 | setAttribute(Qt::WA_PendingResizeEvent); | - | ||||||||||||||||||||||||||||||||||||
| 4606 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4607 | - | |||||||||||||||||||||||||||||||||||||
| 4608 | if (d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 4609 | QWindowContainer::parentWasMoved(this); never executed: QWindowContainer::parentWasMoved(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 4610 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4611 | - | |||||||||||||||||||||||||||||||||||||
| 4612 | void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) | - | ||||||||||||||||||||||||||||||||||||
| 4613 | { | - | ||||||||||||||||||||||||||||||||||||
| 4614 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4615 | if (extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 4616 | w = qMin(w,extra->maxw); | - | ||||||||||||||||||||||||||||||||||||
| 4617 | h = qMin(h,extra->maxh); | - | ||||||||||||||||||||||||||||||||||||
| 4618 | w = qMax(w,extra->minw); | - | ||||||||||||||||||||||||||||||||||||
| 4619 | h = qMax(h,extra->minh); | - | ||||||||||||||||||||||||||||||||||||
| 4620 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4621 | - | |||||||||||||||||||||||||||||||||||||
| 4622 | if (q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4623 | QPlatformIntegration *integration = QGuiApplicationPrivate::platformIntegration(); | - | ||||||||||||||||||||||||||||||||||||
| 4624 | if (!integration->hasCapability(QPlatformIntegration::NonFullScreenWindows)
| 0 | ||||||||||||||||||||||||||||||||||||
| 4625 | x = 0; | - | ||||||||||||||||||||||||||||||||||||
| 4626 | y = 0; | - | ||||||||||||||||||||||||||||||||||||
| 4627 | w = q->windowHandle()->width(); | - | ||||||||||||||||||||||||||||||||||||
| 4628 | h = q->windowHandle()->height(); | - | ||||||||||||||||||||||||||||||||||||
| 4629 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4630 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4631 | - | |||||||||||||||||||||||||||||||||||||
| 4632 | QPoint oldp = q->geometry().topLeft(); | - | ||||||||||||||||||||||||||||||||||||
| 4633 | QSize olds = q->size(); | - | ||||||||||||||||||||||||||||||||||||
| 4634 | QRect r(x, y, w, h); | - | ||||||||||||||||||||||||||||||||||||
| 4635 | - | |||||||||||||||||||||||||||||||||||||
| 4636 | bool isResize = olds != r.size(); | - | ||||||||||||||||||||||||||||||||||||
| 4637 | isMove = oldp != r.topLeft(); | - | ||||||||||||||||||||||||||||||||||||
| 4638 | - | |||||||||||||||||||||||||||||||||||||
| 4639 | - | |||||||||||||||||||||||||||||||||||||
| 4640 | - | |||||||||||||||||||||||||||||||||||||
| 4641 | - | |||||||||||||||||||||||||||||||||||||
| 4642 | if (r.size() == olds
| 0 | ||||||||||||||||||||||||||||||||||||
| 4643 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 4644 | - | |||||||||||||||||||||||||||||||||||||
| 4645 | if (!data.in_set_window_state
| 0 | ||||||||||||||||||||||||||||||||||||
| 4646 | q->data->window_state &= ~Qt::WindowMaximized; | - | ||||||||||||||||||||||||||||||||||||
| 4647 | q->data->window_state &= ~Qt::WindowFullScreen; | - | ||||||||||||||||||||||||||||||||||||
| 4648 | if (q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4649 | topData()->normalGeometry = QRect(0, 0, -1, -1); never executed: topData()->normalGeometry = QRect(0, 0, -1, -1); | 0 | ||||||||||||||||||||||||||||||||||||
| 4650 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4651 | - | |||||||||||||||||||||||||||||||||||||
| 4652 | QPoint oldPos = q->pos(); | - | ||||||||||||||||||||||||||||||||||||
| 4653 | data.crect = r; | - | ||||||||||||||||||||||||||||||||||||
| 4654 | - | |||||||||||||||||||||||||||||||||||||
| 4655 | bool needsShow = false; | - | ||||||||||||||||||||||||||||||||||||
| 4656 | - | |||||||||||||||||||||||||||||||||||||
| 4657 | if (q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4658 | if (!(data.window_state & Qt::WindowFullScreen)
| 0 | ||||||||||||||||||||||||||||||||||||
| 4659 | q->setAttribute(Qt::WA_OutsideWSRange, true); | - | ||||||||||||||||||||||||||||||||||||
| 4660 | if (q->isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4661 | hide_sys(); never executed: hide_sys(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4662 | data.crect = QRect(x, y, w, h); | - | ||||||||||||||||||||||||||||||||||||
| 4663 | } never executed: else if (q->testAttribute(Qt::WA_OutsideWSRange)end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 4664 | q->setAttribute(Qt::WA_OutsideWSRange, false); | - | ||||||||||||||||||||||||||||||||||||
| 4665 | needsShow = true; | - | ||||||||||||||||||||||||||||||||||||
| 4666 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4667 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4668 | - | |||||||||||||||||||||||||||||||||||||
| 4669 | if (q->isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4670 | if (!q->testAttribute(Qt::WA_DontShowOnScreen)
| 0 | ||||||||||||||||||||||||||||||||||||
| 4671 | if (q->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4672 | if (q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4673 | q->windowHandle()->setGeometry(q->geometry()); | - | ||||||||||||||||||||||||||||||||||||
| 4674 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4675 | QPoint posInNativeParent = q->mapTo(q->nativeParentWidget(),QPoint()); | - | ||||||||||||||||||||||||||||||||||||
| 4676 | q->windowHandle()->setGeometry(QRect(posInNativeParent,r.size())); | - | ||||||||||||||||||||||||||||||||||||
| 4677 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4678 | - | |||||||||||||||||||||||||||||||||||||
| 4679 | if (needsShow
| 0 | ||||||||||||||||||||||||||||||||||||
| 4680 | show_sys(); never executed: show_sys(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4681 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4682 | - | |||||||||||||||||||||||||||||||||||||
| 4683 | if (!q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4684 | if (renderToTexture
| 0 | ||||||||||||||||||||||||||||||||||||
| 4685 | QRegion updateRegion(q->geometry()); | - | ||||||||||||||||||||||||||||||||||||
| 4686 | updateRegion += QRect(oldPos, olds); | - | ||||||||||||||||||||||||||||||||||||
| 4687 | q->parentWidget()->d_func()->invalidateBuffer(updateRegion); | - | ||||||||||||||||||||||||||||||||||||
| 4688 | } never executed: else if (isMoveend of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 4689 | moveRect(QRect(oldPos, olds), x - oldPos.x(), y - oldPos.y()); | - | ||||||||||||||||||||||||||||||||||||
| 4690 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4691 | invalidateBuffer_resizeHelper(oldPos, olds); | - | ||||||||||||||||||||||||||||||||||||
| 4692 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4693 | } | - | ||||||||||||||||||||||||||||||||||||
| 4694 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4695 | - | |||||||||||||||||||||||||||||||||||||
| 4696 | if (isMove
| 0 | ||||||||||||||||||||||||||||||||||||
| 4697 | QMoveEvent e(q->pos(), oldPos); | - | ||||||||||||||||||||||||||||||||||||
| 4698 | QApplication::sendEvent(q, &e); | - | ||||||||||||||||||||||||||||||||||||
| 4699 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4700 | if (isResize
| 0 | ||||||||||||||||||||||||||||||||||||
| 4701 | QResizeEvent e(r.size(), olds); | - | ||||||||||||||||||||||||||||||||||||
| 4702 | QApplication::sendEvent(q, &e); | - | ||||||||||||||||||||||||||||||||||||
| 4703 | if (q->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4704 | q->update(); never executed: q->update(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4705 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4706 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4707 | if (isMove
| 0 | ||||||||||||||||||||||||||||||||||||
| 4708 | q->setAttribute(Qt::WA_PendingMoveEvent, true); never executed: q->setAttribute(Qt::WA_PendingMoveEvent, true); | 0 | ||||||||||||||||||||||||||||||||||||
| 4709 | if (isResize
| 0 | ||||||||||||||||||||||||||||||||||||
| 4710 | q->setAttribute(Qt::WA_PendingResizeEvent, true); never executed: q->setAttribute(Qt::WA_PendingResizeEvent, true); | 0 | ||||||||||||||||||||||||||||||||||||
| 4711 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4712 | - | |||||||||||||||||||||||||||||||||||||
| 4713 | } | - | ||||||||||||||||||||||||||||||||||||
| 4714 | QByteArray QWidget::saveGeometry() const | - | ||||||||||||||||||||||||||||||||||||
| 4715 | { | - | ||||||||||||||||||||||||||||||||||||
| 4716 | QByteArray array; | - | ||||||||||||||||||||||||||||||||||||
| 4717 | QDataStream stream(&array, QIODevice::WriteOnly); | - | ||||||||||||||||||||||||||||||||||||
| 4718 | stream.setVersion(QDataStream::Qt_4_0); | - | ||||||||||||||||||||||||||||||||||||
| 4719 | const quint32 magicNumber = 0x1D9D0CB; | - | ||||||||||||||||||||||||||||||||||||
| 4720 | - | |||||||||||||||||||||||||||||||||||||
| 4721 | - | |||||||||||||||||||||||||||||||||||||
| 4722 | - | |||||||||||||||||||||||||||||||||||||
| 4723 | quint16 majorVersion = 2; | - | ||||||||||||||||||||||||||||||||||||
| 4724 | quint16 minorVersion = 0; | - | ||||||||||||||||||||||||||||||||||||
| 4725 | const int screenNumber = QApplication::desktop()->screenNumber(this); | - | ||||||||||||||||||||||||||||||||||||
| 4726 | stream << magicNumber | - | ||||||||||||||||||||||||||||||||||||
| 4727 | << majorVersion | - | ||||||||||||||||||||||||||||||||||||
| 4728 | << minorVersion | - | ||||||||||||||||||||||||||||||||||||
| 4729 | - | |||||||||||||||||||||||||||||||||||||
| 4730 | - | |||||||||||||||||||||||||||||||||||||
| 4731 | - | |||||||||||||||||||||||||||||||||||||
| 4732 | - | |||||||||||||||||||||||||||||||||||||
| 4733 | << frameGeometry() | - | ||||||||||||||||||||||||||||||||||||
| 4734 | << normalGeometry() | - | ||||||||||||||||||||||||||||||||||||
| 4735 | - | |||||||||||||||||||||||||||||||||||||
| 4736 | << qint32(screenNumber) | - | ||||||||||||||||||||||||||||||||||||
| 4737 | << quint8(windowState() & Qt::WindowMaximized) | - | ||||||||||||||||||||||||||||||||||||
| 4738 | << quint8(windowState() & Qt::WindowFullScreen) | - | ||||||||||||||||||||||||||||||||||||
| 4739 | << qint32(QApplication::desktop()->screenGeometry(screenNumber).width()); | - | ||||||||||||||||||||||||||||||||||||
| 4740 | return never executed: array;return array;never executed: return array; | 0 | ||||||||||||||||||||||||||||||||||||
| 4741 | } | - | ||||||||||||||||||||||||||||||||||||
| 4742 | bool QWidget::restoreGeometry(const QByteArray &geometry) | - | ||||||||||||||||||||||||||||||||||||
| 4743 | { | - | ||||||||||||||||||||||||||||||||||||
| 4744 | if (geometry.size() < 4
| 0 | ||||||||||||||||||||||||||||||||||||
| 4745 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 4746 | QDataStream stream(geometry); | - | ||||||||||||||||||||||||||||||||||||
| 4747 | stream.setVersion(QDataStream::Qt_4_0); | - | ||||||||||||||||||||||||||||||||||||
| 4748 | - | |||||||||||||||||||||||||||||||||||||
| 4749 | const quint32 magicNumber = 0x1D9D0CB; | - | ||||||||||||||||||||||||||||||||||||
| 4750 | quint32 storedMagicNumber; | - | ||||||||||||||||||||||||||||||||||||
| 4751 | stream >> storedMagicNumber; | - | ||||||||||||||||||||||||||||||||||||
| 4752 | if (storedMagicNumber != magicNumber
| 0 | ||||||||||||||||||||||||||||||||||||
| 4753 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 4754 | - | |||||||||||||||||||||||||||||||||||||
| 4755 | const quint16 currentMajorVersion = 2; | - | ||||||||||||||||||||||||||||||||||||
| 4756 | quint16 majorVersion = 0; | - | ||||||||||||||||||||||||||||||||||||
| 4757 | quint16 minorVersion = 0; | - | ||||||||||||||||||||||||||||||||||||
| 4758 | - | |||||||||||||||||||||||||||||||||||||
| 4759 | stream >> majorVersion >> minorVersion; | - | ||||||||||||||||||||||||||||||||||||
| 4760 | - | |||||||||||||||||||||||||||||||||||||
| 4761 | if (majorVersion > currentMajorVersion
| 0 | ||||||||||||||||||||||||||||||||||||
| 4762 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 4763 | - | |||||||||||||||||||||||||||||||||||||
| 4764 | - | |||||||||||||||||||||||||||||||||||||
| 4765 | QRect restoredFrameGeometry; | - | ||||||||||||||||||||||||||||||||||||
| 4766 | QRect restoredNormalGeometry; | - | ||||||||||||||||||||||||||||||||||||
| 4767 | qint32 restoredScreenNumber; | - | ||||||||||||||||||||||||||||||||||||
| 4768 | quint8 maximized; | - | ||||||||||||||||||||||||||||||||||||
| 4769 | quint8 fullScreen; | - | ||||||||||||||||||||||||||||||||||||
| 4770 | qint32 restoredScreenWidth = 0; | - | ||||||||||||||||||||||||||||||||||||
| 4771 | - | |||||||||||||||||||||||||||||||||||||
| 4772 | stream >> restoredFrameGeometry | - | ||||||||||||||||||||||||||||||||||||
| 4773 | >> restoredNormalGeometry | - | ||||||||||||||||||||||||||||||||||||
| 4774 | >> restoredScreenNumber | - | ||||||||||||||||||||||||||||||||||||
| 4775 | >> maximized | - | ||||||||||||||||||||||||||||||||||||
| 4776 | >> fullScreen; | - | ||||||||||||||||||||||||||||||||||||
| 4777 | - | |||||||||||||||||||||||||||||||||||||
| 4778 | if (majorVersion > 1
| 0 | ||||||||||||||||||||||||||||||||||||
| 4779 | stream >> restoredScreenWidth; never executed: stream >> restoredScreenWidth; | 0 | ||||||||||||||||||||||||||||||||||||
| 4780 | - | |||||||||||||||||||||||||||||||||||||
| 4781 | const QDesktopWidget * const desktop = QApplication::desktop(); | - | ||||||||||||||||||||||||||||||||||||
| 4782 | if (restoredScreenNumber >= desktop->numScreens()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4783 | restoredScreenNumber = desktop->primaryScreen(); never executed: restoredScreenNumber = desktop->primaryScreen(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4784 | const qreal screenWidthF = qreal(desktop->screenGeometry(restoredScreenNumber).width()); | - | ||||||||||||||||||||||||||||||||||||
| 4785 | - | |||||||||||||||||||||||||||||||||||||
| 4786 | - | |||||||||||||||||||||||||||||||||||||
| 4787 | if (restoredScreenWidth
| 0 | ||||||||||||||||||||||||||||||||||||
| 4788 | const qreal factor = qreal(restoredScreenWidth) / screenWidthF; | - | ||||||||||||||||||||||||||||||||||||
| 4789 | if (factor < 0.8
| 0 | ||||||||||||||||||||||||||||||||||||
| 4790 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 4791 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4792 | - | |||||||||||||||||||||||||||||||||||||
| 4793 | - | |||||||||||||||||||||||||||||||||||||
| 4794 | if (!maximized
| 0 | ||||||||||||||||||||||||||||||||||||
| 4795 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 4796 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4797 | - | |||||||||||||||||||||||||||||||||||||
| 4798 | const int frameHeight = 20; | - | ||||||||||||||||||||||||||||||||||||
| 4799 | if (!restoredFrameGeometry.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4800 | restoredFrameGeometry = QRect(QPoint(0,0), sizeHint()); never executed: restoredFrameGeometry = QRect(QPoint(0,0), sizeHint()); | 0 | ||||||||||||||||||||||||||||||||||||
| 4801 | - | |||||||||||||||||||||||||||||||||||||
| 4802 | if (!restoredNormalGeometry.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4803 | restoredNormalGeometry = QRect(QPoint(0, frameHeight), sizeHint()); never executed: restoredNormalGeometry = QRect(QPoint(0, frameHeight), sizeHint()); | 0 | ||||||||||||||||||||||||||||||||||||
| 4804 | if (!restoredNormalGeometry.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4805 | - | |||||||||||||||||||||||||||||||||||||
| 4806 | restoredNormalGeometry.setSize(restoredNormalGeometry | - | ||||||||||||||||||||||||||||||||||||
| 4807 | .size() | - | ||||||||||||||||||||||||||||||||||||
| 4808 | .expandedTo(d_func()->adjustedSize())); | - | ||||||||||||||||||||||||||||||||||||
| 4809 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4810 | - | |||||||||||||||||||||||||||||||||||||
| 4811 | const QRect availableGeometry = desktop->availableGeometry(restoredScreenNumber); | - | ||||||||||||||||||||||||||||||||||||
| 4812 | if (!restoredFrameGeometry.intersects(availableGeometry)
| 0 | ||||||||||||||||||||||||||||||||||||
| 4813 | restoredFrameGeometry.moveBottom(qMin(restoredFrameGeometry.bottom(), availableGeometry.bottom())); | - | ||||||||||||||||||||||||||||||||||||
| 4814 | restoredFrameGeometry.moveLeft(qMax(restoredFrameGeometry.left(), availableGeometry.left())); | - | ||||||||||||||||||||||||||||||||||||
| 4815 | restoredFrameGeometry.moveRight(qMin(restoredFrameGeometry.right(), availableGeometry.right())); | - | ||||||||||||||||||||||||||||||||||||
| 4816 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4817 | restoredFrameGeometry.moveTop(qMax(restoredFrameGeometry.top(), availableGeometry.top())); | - | ||||||||||||||||||||||||||||||||||||
| 4818 | - | |||||||||||||||||||||||||||||||||||||
| 4819 | if (!restoredNormalGeometry.intersects(availableGeometry)
| 0 | ||||||||||||||||||||||||||||||||||||
| 4820 | restoredNormalGeometry.moveBottom(qMin(restoredNormalGeometry.bottom(), availableGeometry.bottom())); | - | ||||||||||||||||||||||||||||||||||||
| 4821 | restoredNormalGeometry.moveLeft(qMax(restoredNormalGeometry.left(), availableGeometry.left())); | - | ||||||||||||||||||||||||||||||||||||
| 4822 | restoredNormalGeometry.moveRight(qMin(restoredNormalGeometry.right(), availableGeometry.right())); | - | ||||||||||||||||||||||||||||||||||||
| 4823 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4824 | restoredNormalGeometry.moveTop(qMax(restoredNormalGeometry.top(), availableGeometry.top() + frameHeight)); | - | ||||||||||||||||||||||||||||||||||||
| 4825 | - | |||||||||||||||||||||||||||||||||||||
| 4826 | if (maximized
| 0 | ||||||||||||||||||||||||||||||||||||
| 4827 | - | |||||||||||||||||||||||||||||||||||||
| 4828 | - | |||||||||||||||||||||||||||||||||||||
| 4829 | Qt::WindowStates ws = windowState(); | - | ||||||||||||||||||||||||||||||||||||
| 4830 | - | |||||||||||||||||||||||||||||||||||||
| 4831 | setGeometry(restoredNormalGeometry); | - | ||||||||||||||||||||||||||||||||||||
| 4832 | if (maximized
| 0 | ||||||||||||||||||||||||||||||||||||
| 4833 | ws |= Qt::WindowMaximized; never executed: ws |= Qt::WindowMaximized; | 0 | ||||||||||||||||||||||||||||||||||||
| 4834 | if (fullScreen
| 0 | ||||||||||||||||||||||||||||||||||||
| 4835 | ws |= Qt::WindowFullScreen; never executed: ws |= Qt::WindowFullScreen; | 0 | ||||||||||||||||||||||||||||||||||||
| 4836 | setWindowState(ws); | - | ||||||||||||||||||||||||||||||||||||
| 4837 | d_func()->topData()->normalGeometry = restoredNormalGeometry; | - | ||||||||||||||||||||||||||||||||||||
| 4838 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4839 | QPoint offset; | - | ||||||||||||||||||||||||||||||||||||
| 4840 | - | |||||||||||||||||||||||||||||||||||||
| 4841 | - | |||||||||||||||||||||||||||||||||||||
| 4842 | - | |||||||||||||||||||||||||||||||||||||
| 4843 | - | |||||||||||||||||||||||||||||||||||||
| 4844 | setWindowState(windowState() & ~(Qt::WindowMaximized | Qt::WindowFullScreen)); | - | ||||||||||||||||||||||||||||||||||||
| 4845 | move(restoredFrameGeometry.topLeft() + offset); | - | ||||||||||||||||||||||||||||||||||||
| 4846 | resize(restoredNormalGeometry.size()); | - | ||||||||||||||||||||||||||||||||||||
| 4847 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4848 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 4849 | } | - | ||||||||||||||||||||||||||||||||||||
| 4850 | void QWidget::setContentsMargins(int left, int top, int right, int bottom) | - | ||||||||||||||||||||||||||||||||||||
| 4851 | { | - | ||||||||||||||||||||||||||||||||||||
| 4852 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4853 | if (left == d->leftmargin
| 0 | ||||||||||||||||||||||||||||||||||||
| 4854 | && right == d->rightmargin
| 0 | ||||||||||||||||||||||||||||||||||||
| 4855 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 4856 | d->leftmargin = left; | - | ||||||||||||||||||||||||||||||||||||
| 4857 | d->topmargin = top; | - | ||||||||||||||||||||||||||||||||||||
| 4858 | d->rightmargin = right; | - | ||||||||||||||||||||||||||||||||||||
| 4859 | d->bottommargin = bottom; | - | ||||||||||||||||||||||||||||||||||||
| 4860 | - | |||||||||||||||||||||||||||||||||||||
| 4861 | if (QLayout *l=d->layout
| 0 | ||||||||||||||||||||||||||||||||||||
| 4862 | l->update(); never executed: l->update(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4863 | else | - | ||||||||||||||||||||||||||||||||||||
| 4864 | updateGeometry(); never executed: updateGeometry(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4865 | - | |||||||||||||||||||||||||||||||||||||
| 4866 | if (isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4867 | update(); | - | ||||||||||||||||||||||||||||||||||||
| 4868 | QResizeEvent e(data->crect.size(), data->crect.size()); | - | ||||||||||||||||||||||||||||||||||||
| 4869 | QApplication::sendEvent(this, &e); | - | ||||||||||||||||||||||||||||||||||||
| 4870 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4871 | setAttribute(Qt::WA_PendingResizeEvent, true); | - | ||||||||||||||||||||||||||||||||||||
| 4872 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4873 | - | |||||||||||||||||||||||||||||||||||||
| 4874 | QEvent e(QEvent::ContentsRectChange); | - | ||||||||||||||||||||||||||||||||||||
| 4875 | QApplication::sendEvent(this, &e); | - | ||||||||||||||||||||||||||||||||||||
| 4876 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4877 | void QWidget::setContentsMargins(const QMargins &margins) | - | ||||||||||||||||||||||||||||||||||||
| 4878 | { | - | ||||||||||||||||||||||||||||||||||||
| 4879 | setContentsMargins(margins.left(), margins.top(), | - | ||||||||||||||||||||||||||||||||||||
| 4880 | margins.right(), margins.bottom()); | - | ||||||||||||||||||||||||||||||||||||
| 4881 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4882 | - | |||||||||||||||||||||||||||||||||||||
| 4883 | - | |||||||||||||||||||||||||||||||||||||
| 4884 | - | |||||||||||||||||||||||||||||||||||||
| 4885 | - | |||||||||||||||||||||||||||||||||||||
| 4886 | - | |||||||||||||||||||||||||||||||||||||
| 4887 | - | |||||||||||||||||||||||||||||||||||||
| 4888 | - | |||||||||||||||||||||||||||||||||||||
| 4889 | void QWidget::getContentsMargins(int *left, int *top, int *right, int *bottom) const | - | ||||||||||||||||||||||||||||||||||||
| 4890 | { | - | ||||||||||||||||||||||||||||||||||||
| 4891 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4892 | if (left
| 0 | ||||||||||||||||||||||||||||||||||||
| 4893 | * never executed: left = d->leftmargin;*left = d->leftmargin;never executed: *left = d->leftmargin; | 0 | ||||||||||||||||||||||||||||||||||||
| 4894 | if (top
| 0 | ||||||||||||||||||||||||||||||||||||
| 4895 | * never executed: top = d->topmargin;*top = d->topmargin;never executed: *top = d->topmargin; | 0 | ||||||||||||||||||||||||||||||||||||
| 4896 | if (right
| 0 | ||||||||||||||||||||||||||||||||||||
| 4897 | * never executed: right = d->rightmargin;*right = d->rightmargin;never executed: *right = d->rightmargin; | 0 | ||||||||||||||||||||||||||||||||||||
| 4898 | if (bottom
| 0 | ||||||||||||||||||||||||||||||||||||
| 4899 | * never executed: bottom = d->bottommargin;*bottom = d->bottommargin;never executed: *bottom = d->bottommargin; | 0 | ||||||||||||||||||||||||||||||||||||
| 4900 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4901 | QMargins QWidget::contentsMargins() const | - | ||||||||||||||||||||||||||||||||||||
| 4902 | { | - | ||||||||||||||||||||||||||||||||||||
| 4903 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4904 | return never executed: QMargins(d->leftmargin, d->topmargin, d->rightmargin, d->bottommargin);return QMargins(d->leftmargin, d->topmargin, d->rightmargin, d->bottommargin);never executed: return QMargins(d->leftmargin, d->topmargin, d->rightmargin, d->bottommargin); | 0 | ||||||||||||||||||||||||||||||||||||
| 4905 | } | - | ||||||||||||||||||||||||||||||||||||
| 4906 | - | |||||||||||||||||||||||||||||||||||||
| 4907 | - | |||||||||||||||||||||||||||||||||||||
| 4908 | - | |||||||||||||||||||||||||||||||||||||
| 4909 | - | |||||||||||||||||||||||||||||||||||||
| 4910 | - | |||||||||||||||||||||||||||||||||||||
| 4911 | - | |||||||||||||||||||||||||||||||||||||
| 4912 | - | |||||||||||||||||||||||||||||||||||||
| 4913 | QRect QWidget::contentsRect() const | - | ||||||||||||||||||||||||||||||||||||
| 4914 | { | - | ||||||||||||||||||||||||||||||||||||
| 4915 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4916 | return never executed: QRect(QPoint(d->leftmargin, d->topmargin),return QRect(QPoint(d->leftmargin, d->topmargin), QPoint(data->crect.width() - 1 - d->rightmargin, data->crect.height() - 1 - d->bottommargin));never executed: return QRect(QPoint(d->leftmargin, d->topmargin), QPoint(data->crect.width() - 1 - d->rightmargin, data->crect.height() - 1 - d->bottommargin)); | 0 | ||||||||||||||||||||||||||||||||||||
| 4917 | QPoint(data->crect.width() - 1 - d->rightmargin, never executed: return QRect(QPoint(d->leftmargin, d->topmargin), QPoint(data->crect.width() - 1 - d->rightmargin, data->crect.height() - 1 - d->bottommargin)); | 0 | ||||||||||||||||||||||||||||||||||||
| 4918 | data->crect.height() - 1 - d->bottommargin)); never executed: return QRect(QPoint(d->leftmargin, d->topmargin), QPoint(data->crect.width() - 1 - d->rightmargin, data->crect.height() - 1 - d->bottommargin)); | 0 | ||||||||||||||||||||||||||||||||||||
| 4919 | - | |||||||||||||||||||||||||||||||||||||
| 4920 | } | - | ||||||||||||||||||||||||||||||||||||
| 4921 | Qt::ContextMenuPolicy QWidget::contextMenuPolicy() const | - | ||||||||||||||||||||||||||||||||||||
| 4922 | { | - | ||||||||||||||||||||||||||||||||||||
| 4923 | return never executed: (Qt::ContextMenuPolicy)data->context_menu_policy;return (Qt::ContextMenuPolicy)data->context_menu_policy;never executed: return (Qt::ContextMenuPolicy)data->context_menu_policy; | 0 | ||||||||||||||||||||||||||||||||||||
| 4924 | } | - | ||||||||||||||||||||||||||||||||||||
| 4925 | - | |||||||||||||||||||||||||||||||||||||
| 4926 | void QWidget::setContextMenuPolicy(Qt::ContextMenuPolicy policy) | - | ||||||||||||||||||||||||||||||||||||
| 4927 | { | - | ||||||||||||||||||||||||||||||||||||
| 4928 | data->context_menu_policy = (uint) policy; | - | ||||||||||||||||||||||||||||||||||||
| 4929 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4930 | Qt::FocusPolicy QWidget::focusPolicy() const | - | ||||||||||||||||||||||||||||||||||||
| 4931 | { | - | ||||||||||||||||||||||||||||||||||||
| 4932 | return never executed: (Qt::FocusPolicy)data->focus_policy;return (Qt::FocusPolicy)data->focus_policy;never executed: return (Qt::FocusPolicy)data->focus_policy; | 0 | ||||||||||||||||||||||||||||||||||||
| 4933 | } | - | ||||||||||||||||||||||||||||||||||||
| 4934 | - | |||||||||||||||||||||||||||||||||||||
| 4935 | void QWidget::setFocusPolicy(Qt::FocusPolicy policy) | - | ||||||||||||||||||||||||||||||||||||
| 4936 | { | - | ||||||||||||||||||||||||||||||||||||
| 4937 | data->focus_policy = (uint) policy; | - | ||||||||||||||||||||||||||||||||||||
| 4938 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4939 | if (d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 4940 | d->extra->focus_proxy->setFocusPolicy(policy); never executed: d->extra->focus_proxy->setFocusPolicy(policy); | 0 | ||||||||||||||||||||||||||||||||||||
| 4941 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4942 | void QWidget::setUpdatesEnabled(bool enable) | - | ||||||||||||||||||||||||||||||||||||
| 4943 | { | - | ||||||||||||||||||||||||||||||||||||
| 4944 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4945 | setAttribute(Qt::WA_ForceUpdatesDisabled, !enable); | - | ||||||||||||||||||||||||||||||||||||
| 4946 | d->setUpdatesEnabled_helper(enable); | - | ||||||||||||||||||||||||||||||||||||
| 4947 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4948 | void QWidget::show() | - | ||||||||||||||||||||||||||||||||||||
| 4949 | { | - | ||||||||||||||||||||||||||||||||||||
| 4950 | Qt::WindowState defaultState = QGuiApplicationPrivate::platformIntegration()->defaultWindowState(data->window_flags); | - | ||||||||||||||||||||||||||||||||||||
| 4951 | if (defaultState == Qt::WindowFullScreen
| 0 | ||||||||||||||||||||||||||||||||||||
| 4952 | showFullScreen(); never executed: showFullScreen(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4953 | else if (defaultState == Qt::WindowMaximized
| 0 | ||||||||||||||||||||||||||||||||||||
| 4954 | showMaximized(); never executed: showMaximized(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4955 | else | - | ||||||||||||||||||||||||||||||||||||
| 4956 | setVisible(true); never executed: setVisible(true); | 0 | ||||||||||||||||||||||||||||||||||||
| 4957 | } | - | ||||||||||||||||||||||||||||||||||||
| 4958 | - | |||||||||||||||||||||||||||||||||||||
| 4959 | - | |||||||||||||||||||||||||||||||||||||
| 4960 | - | |||||||||||||||||||||||||||||||||||||
| 4961 | - | |||||||||||||||||||||||||||||||||||||
| 4962 | - | |||||||||||||||||||||||||||||||||||||
| 4963 | - | |||||||||||||||||||||||||||||||||||||
| 4964 | void QWidgetPrivate::show_recursive() | - | ||||||||||||||||||||||||||||||||||||
| 4965 | { | - | ||||||||||||||||||||||||||||||||||||
| 4966 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4967 | - | |||||||||||||||||||||||||||||||||||||
| 4968 | - | |||||||||||||||||||||||||||||||||||||
| 4969 | if (!q->testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 4970 | createRecursively(); never executed: createRecursively(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4971 | q->ensurePolished(); | - | ||||||||||||||||||||||||||||||||||||
| 4972 | - | |||||||||||||||||||||||||||||||||||||
| 4973 | if (!q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 4974 | q->parentWidget()->d_func()->layout->activate(); never executed: q->parentWidget()->d_func()->layout->activate(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4975 | - | |||||||||||||||||||||||||||||||||||||
| 4976 | if (layout
| 0 | ||||||||||||||||||||||||||||||||||||
| 4977 | layout->activate(); never executed: layout->activate(); | 0 | ||||||||||||||||||||||||||||||||||||
| 4978 | - | |||||||||||||||||||||||||||||||||||||
| 4979 | show_helper(); | - | ||||||||||||||||||||||||||||||||||||
| 4980 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4981 | - | |||||||||||||||||||||||||||||||||||||
| 4982 | void QWidgetPrivate::sendPendingMoveAndResizeEvents(bool recursive, bool disableUpdates) | - | ||||||||||||||||||||||||||||||||||||
| 4983 | { | - | ||||||||||||||||||||||||||||||||||||
| 4984 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 4985 | - | |||||||||||||||||||||||||||||||||||||
| 4986 | disableUpdates = disableUpdates
| 0 | ||||||||||||||||||||||||||||||||||||
| 4987 | if (disableUpdates
| 0 | ||||||||||||||||||||||||||||||||||||
| 4988 | q->setAttribute(Qt::WA_UpdatesDisabled); never executed: q->setAttribute(Qt::WA_UpdatesDisabled); | 0 | ||||||||||||||||||||||||||||||||||||
| 4989 | - | |||||||||||||||||||||||||||||||||||||
| 4990 | if (q->testAttribute(Qt::WA_PendingMoveEvent)
| 0 | ||||||||||||||||||||||||||||||||||||
| 4991 | QMoveEvent e(data.crect.topLeft(), data.crect.topLeft()); | - | ||||||||||||||||||||||||||||||||||||
| 4992 | QApplication::sendEvent(q, &e); | - | ||||||||||||||||||||||||||||||||||||
| 4993 | q->setAttribute(Qt::WA_PendingMoveEvent, false); | - | ||||||||||||||||||||||||||||||||||||
| 4994 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 4995 | - | |||||||||||||||||||||||||||||||||||||
| 4996 | if (q->testAttribute(Qt::WA_PendingResizeEvent)
| 0 | ||||||||||||||||||||||||||||||||||||
| 4997 | QResizeEvent e(data.crect.size(), QSize()); | - | ||||||||||||||||||||||||||||||||||||
| 4998 | QApplication::sendEvent(q, &e); | - | ||||||||||||||||||||||||||||||||||||
| 4999 | q->setAttribute(Qt::WA_PendingResizeEvent, false); | - | ||||||||||||||||||||||||||||||||||||
| 5000 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5001 | - | |||||||||||||||||||||||||||||||||||||
| 5002 | if (disableUpdates
| 0 | ||||||||||||||||||||||||||||||||||||
| 5003 | q->setAttribute(Qt::WA_UpdatesDisabled, false); never executed: q->setAttribute(Qt::WA_UpdatesDisabled, false); | 0 | ||||||||||||||||||||||||||||||||||||
| 5004 | - | |||||||||||||||||||||||||||||||||||||
| 5005 | if (!recursive
| 0 | ||||||||||||||||||||||||||||||||||||
| 5006 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 5007 | - | |||||||||||||||||||||||||||||||||||||
| 5008 | for (int i = 0; i < children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5009 | if (QWidget *child = qobject_cast<QWidget *>(children.at(i))
| 0 | ||||||||||||||||||||||||||||||||||||
| 5010 | child->d_func()->sendPendingMoveAndResizeEvents(recursive, disableUpdates); never executed: child->d_func()->sendPendingMoveAndResizeEvents(recursive, disableUpdates); | 0 | ||||||||||||||||||||||||||||||||||||
| 5011 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5012 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5013 | - | |||||||||||||||||||||||||||||||||||||
| 5014 | void QWidgetPrivate::activateChildLayoutsRecursively() | - | ||||||||||||||||||||||||||||||||||||
| 5015 | { | - | ||||||||||||||||||||||||||||||||||||
| 5016 | sendPendingMoveAndResizeEvents(false, true); | - | ||||||||||||||||||||||||||||||||||||
| 5017 | - | |||||||||||||||||||||||||||||||||||||
| 5018 | for (int i = 0; i < children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5019 | QWidget *child = qobject_cast<QWidget *>(children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 5020 | if (!child
| 0 | ||||||||||||||||||||||||||||||||||||
| 5021 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 5022 | - | |||||||||||||||||||||||||||||||||||||
| 5023 | child->ensurePolished(); | - | ||||||||||||||||||||||||||||||||||||
| 5024 | - | |||||||||||||||||||||||||||||||||||||
| 5025 | - | |||||||||||||||||||||||||||||||||||||
| 5026 | QWidgetPrivate *childPrivate = child->d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 5027 | if (childPrivate->layout
| 0 | ||||||||||||||||||||||||||||||||||||
| 5028 | childPrivate->layout->activate(); never executed: childPrivate->layout->activate(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5029 | - | |||||||||||||||||||||||||||||||||||||
| 5030 | - | |||||||||||||||||||||||||||||||||||||
| 5031 | const bool wasVisible = child->isVisible(); | - | ||||||||||||||||||||||||||||||||||||
| 5032 | if (!wasVisible
| 0 | ||||||||||||||||||||||||||||||||||||
| 5033 | child->setAttribute(Qt::WA_WState_Visible); never executed: child->setAttribute(Qt::WA_WState_Visible); | 0 | ||||||||||||||||||||||||||||||||||||
| 5034 | - | |||||||||||||||||||||||||||||||||||||
| 5035 | - | |||||||||||||||||||||||||||||||||||||
| 5036 | childPrivate->activateChildLayoutsRecursively(); | - | ||||||||||||||||||||||||||||||||||||
| 5037 | - | |||||||||||||||||||||||||||||||||||||
| 5038 | - | |||||||||||||||||||||||||||||||||||||
| 5039 | if (!wasVisible
| 0 | ||||||||||||||||||||||||||||||||||||
| 5040 | child->setAttribute(Qt::WA_WState_Visible, false); never executed: child->setAttribute(Qt::WA_WState_Visible, false); | 0 | ||||||||||||||||||||||||||||||||||||
| 5041 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5042 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5043 | - | |||||||||||||||||||||||||||||||||||||
| 5044 | void QWidgetPrivate::show_helper() | - | ||||||||||||||||||||||||||||||||||||
| 5045 | { | - | ||||||||||||||||||||||||||||||||||||
| 5046 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 5047 | data.in_show = true; | - | ||||||||||||||||||||||||||||||||||||
| 5048 | - | |||||||||||||||||||||||||||||||||||||
| 5049 | sendPendingMoveAndResizeEvents(); | - | ||||||||||||||||||||||||||||||||||||
| 5050 | - | |||||||||||||||||||||||||||||||||||||
| 5051 | - | |||||||||||||||||||||||||||||||||||||
| 5052 | q->setAttribute(Qt::WA_WState_Visible); | - | ||||||||||||||||||||||||||||||||||||
| 5053 | - | |||||||||||||||||||||||||||||||||||||
| 5054 | - | |||||||||||||||||||||||||||||||||||||
| 5055 | showChildren(false); | - | ||||||||||||||||||||||||||||||||||||
| 5056 | - | |||||||||||||||||||||||||||||||||||||
| 5057 | - | |||||||||||||||||||||||||||||||||||||
| 5058 | - | |||||||||||||||||||||||||||||||||||||
| 5059 | const bool isWindow = q->isWindow(); | - | ||||||||||||||||||||||||||||||||||||
| 5060 | - | |||||||||||||||||||||||||||||||||||||
| 5061 | bool isEmbedded = isWindow
| 0 | ||||||||||||||||||||||||||||||||||||
| 5062 | - | |||||||||||||||||||||||||||||||||||||
| 5063 | - | |||||||||||||||||||||||||||||||||||||
| 5064 | - | |||||||||||||||||||||||||||||||||||||
| 5065 | - | |||||||||||||||||||||||||||||||||||||
| 5066 | - | |||||||||||||||||||||||||||||||||||||
| 5067 | - | |||||||||||||||||||||||||||||||||||||
| 5068 | - | |||||||||||||||||||||||||||||||||||||
| 5069 | if (isWindow
| 0 | ||||||||||||||||||||||||||||||||||||
| 5070 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 5071 | q->raise(); | - | ||||||||||||||||||||||||||||||||||||
| 5072 | if (q->parentWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5073 | q->setAttribute(Qt::WA_KeyboardFocusChange); never executed: q->setAttribute(Qt::WA_KeyboardFocusChange); | 0 | ||||||||||||||||||||||||||||||||||||
| 5074 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5075 | while (QApplication::activePopupWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5076 | if (!QApplication::activePopupWidget()->close()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5077 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5078 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5079 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5080 | } | - | ||||||||||||||||||||||||||||||||||||
| 5081 | - | |||||||||||||||||||||||||||||||||||||
| 5082 | - | |||||||||||||||||||||||||||||||||||||
| 5083 | - | |||||||||||||||||||||||||||||||||||||
| 5084 | - | |||||||||||||||||||||||||||||||||||||
| 5085 | if (isWindow
| 0 | ||||||||||||||||||||||||||||||||||||
| 5086 | if (!isEmbedded
| 0 | ||||||||||||||||||||||||||||||||||||
| 5087 | QGraphicsProxyWidget *ancestorProxy = nearestGraphicsProxyWidget(q->parentWidget()); | - | ||||||||||||||||||||||||||||||||||||
| 5088 | if (ancestorProxy
| 0 | ||||||||||||||||||||||||||||||||||||
| 5089 | isEmbedded = true; | - | ||||||||||||||||||||||||||||||||||||
| 5090 | ancestorProxy->d_func()->embedSubWindow(q); | - | ||||||||||||||||||||||||||||||||||||
| 5091 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5092 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5093 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5094 | QShowEvent showEvent; | - | ||||||||||||||||||||||||||||||||||||
| 5095 | QApplication::sendEvent(q, &showEvent); | - | ||||||||||||||||||||||||||||||||||||
| 5096 | - | |||||||||||||||||||||||||||||||||||||
| 5097 | show_sys(); | - | ||||||||||||||||||||||||||||||||||||
| 5098 | - | |||||||||||||||||||||||||||||||||||||
| 5099 | if (!isEmbedded
| 0 | ||||||||||||||||||||||||||||||||||||
| 5100 | (static_cast< never executed: QApplication *>(QCoreApplication::instance()))->d_func()->openPopup(q);(static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->openPopup(q);never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->openPopup(q); | 0 | ||||||||||||||||||||||||||||||||||||
| 5101 | - | |||||||||||||||||||||||||||||||||||||
| 5102 | - | |||||||||||||||||||||||||||||||||||||
| 5103 | if (q->windowType() != Qt::ToolTip
| 0 | ||||||||||||||||||||||||||||||||||||
| 5104 | QAccessibleEvent event(q, QAccessible::ObjectShow); | - | ||||||||||||||||||||||||||||||||||||
| 5105 | QAccessible::updateAccessibility(&event); | - | ||||||||||||||||||||||||||||||||||||
| 5106 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5107 | - | |||||||||||||||||||||||||||||||||||||
| 5108 | - | |||||||||||||||||||||||||||||||||||||
| 5109 | if (QApplicationPrivate::hidden_focus_widget == q
| 0 | ||||||||||||||||||||||||||||||||||||
| 5110 | QApplicationPrivate::hidden_focus_widget = 0; | - | ||||||||||||||||||||||||||||||||||||
| 5111 | q->setFocus(Qt::OtherFocusReason); | - | ||||||||||||||||||||||||||||||||||||
| 5112 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5113 | - | |||||||||||||||||||||||||||||||||||||
| 5114 | - | |||||||||||||||||||||||||||||||||||||
| 5115 | - | |||||||||||||||||||||||||||||||||||||
| 5116 | - | |||||||||||||||||||||||||||||||||||||
| 5117 | if (!(static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->in_exec
| 0 | ||||||||||||||||||||||||||||||||||||
| 5118 | QApplication::processEvents(); never executed: QApplication::processEvents(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5119 | - | |||||||||||||||||||||||||||||||||||||
| 5120 | data.in_show = false; | - | ||||||||||||||||||||||||||||||||||||
| 5121 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5122 | - | |||||||||||||||||||||||||||||||||||||
| 5123 | void QWidgetPrivate::show_sys() | - | ||||||||||||||||||||||||||||||||||||
| 5124 | { | - | ||||||||||||||||||||||||||||||||||||
| 5125 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 5126 | - | |||||||||||||||||||||||||||||||||||||
| 5127 | QWindow *window = q->windowHandle(); | - | ||||||||||||||||||||||||||||||||||||
| 5128 | - | |||||||||||||||||||||||||||||||||||||
| 5129 | if (q->testAttribute(Qt::WA_DontShowOnScreen)
| 0 | ||||||||||||||||||||||||||||||||||||
| 5130 | invalidateBuffer(q->rect()); | - | ||||||||||||||||||||||||||||||||||||
| 5131 | q->setAttribute(Qt::WA_Mapped); | - | ||||||||||||||||||||||||||||||||||||
| 5132 | - | |||||||||||||||||||||||||||||||||||||
| 5133 | if (window
| 0 | ||||||||||||||||||||||||||||||||||||
| 5134 | - | |||||||||||||||||||||||||||||||||||||
| 5135 | && (!extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 5136 | - | |||||||||||||||||||||||||||||||||||||
| 5137 | && q->windowModality() != Qt::NonModal
| 0 | ||||||||||||||||||||||||||||||||||||
| 5138 | QGuiApplicationPrivate::showModalWindow(window); | - | ||||||||||||||||||||||||||||||||||||
| 5139 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5140 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 5141 | } | - | ||||||||||||||||||||||||||||||||||||
| 5142 | - | |||||||||||||||||||||||||||||||||||||
| 5143 | if (renderToTexture
| 0 | ||||||||||||||||||||||||||||||||||||
| 5144 | QApplication::postEvent(q->parentWidget(), new QUpdateLaterEvent(q->geometry())); never executed: QApplication::postEvent(q->parentWidget(), new QUpdateLaterEvent(q->geometry())); | 0 | ||||||||||||||||||||||||||||||||||||
| 5145 | else | - | ||||||||||||||||||||||||||||||||||||
| 5146 | QApplication::postEvent(q, new QUpdateLaterEvent(q->rect())); never executed: QApplication::postEvent(q, new QUpdateLaterEvent(q->rect())); | 0 | ||||||||||||||||||||||||||||||||||||
| 5147 | - | |||||||||||||||||||||||||||||||||||||
| 5148 | if ((!q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5149 | || q->testAttribute(Qt::WA_OutsideWSRange)
| 0 | ||||||||||||||||||||||||||||||||||||
| 5150 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 5151 | } | - | ||||||||||||||||||||||||||||||||||||
| 5152 | - | |||||||||||||||||||||||||||||||||||||
| 5153 | if (window
| 0 | ||||||||||||||||||||||||||||||||||||
| 5154 | if (q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5155 | fixPosIncludesFrame(); never executed: fixPosIncludesFrame(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5156 | QRect geomRect = q->geometry(); | - | ||||||||||||||||||||||||||||||||||||
| 5157 | if (!q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5158 | QPoint topLeftOfWindow = q->mapTo(q->nativeParentWidget(),QPoint()); | - | ||||||||||||||||||||||||||||||||||||
| 5159 | geomRect.moveTopLeft(topLeftOfWindow); | - | ||||||||||||||||||||||||||||||||||||
| 5160 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5161 | const QRect windowRect = window->geometry(); | - | ||||||||||||||||||||||||||||||||||||
| 5162 | if (windowRect != geomRect
| 0 | ||||||||||||||||||||||||||||||||||||
| 5163 | if (q->testAttribute(Qt::WA_Moved)
| 0 | ||||||||||||||||||||||||||||||||||||
| 5164 | || !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowManagement)
| 0 | ||||||||||||||||||||||||||||||||||||
| 5165 | window->setGeometry(geomRect); never executed: window->setGeometry(geomRect); | 0 | ||||||||||||||||||||||||||||||||||||
| 5166 | else | - | ||||||||||||||||||||||||||||||||||||
| 5167 | window->resize(geomRect.size()); never executed: window->resize(geomRect.size()); | 0 | ||||||||||||||||||||||||||||||||||||
| 5168 | } | - | ||||||||||||||||||||||||||||||||||||
| 5169 | - | |||||||||||||||||||||||||||||||||||||
| 5170 | - | |||||||||||||||||||||||||||||||||||||
| 5171 | qt_qpa_set_cursor(q, false); | - | ||||||||||||||||||||||||||||||||||||
| 5172 | - | |||||||||||||||||||||||||||||||||||||
| 5173 | invalidateBuffer(q->rect()); | - | ||||||||||||||||||||||||||||||||||||
| 5174 | window->setVisible(true); | - | ||||||||||||||||||||||||||||||||||||
| 5175 | - | |||||||||||||||||||||||||||||||||||||
| 5176 | if (window->isTopLevel()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5177 | const QPoint crectTopLeft = q->data->crect.topLeft(); | - | ||||||||||||||||||||||||||||||||||||
| 5178 | const QPoint windowTopLeft = window->geometry().topLeft(); | - | ||||||||||||||||||||||||||||||||||||
| 5179 | if (crectTopLeft == QPoint(0, 0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 5180 | q->data->crect.moveTopLeft(windowTopLeft); never executed: q->data->crect.moveTopLeft(windowTopLeft); | 0 | ||||||||||||||||||||||||||||||||||||
| 5181 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5182 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5183 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5184 | void QWidget::hide() | - | ||||||||||||||||||||||||||||||||||||
| 5185 | { | - | ||||||||||||||||||||||||||||||||||||
| 5186 | setVisible(false); | - | ||||||||||||||||||||||||||||||||||||
| 5187 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5188 | - | |||||||||||||||||||||||||||||||||||||
| 5189 | - | |||||||||||||||||||||||||||||||||||||
| 5190 | - | |||||||||||||||||||||||||||||||||||||
| 5191 | void QWidgetPrivate::hide_helper() | - | ||||||||||||||||||||||||||||||||||||
| 5192 | { | - | ||||||||||||||||||||||||||||||||||||
| 5193 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 5194 | - | |||||||||||||||||||||||||||||||||||||
| 5195 | bool isEmbedded = false; | - | ||||||||||||||||||||||||||||||||||||
| 5196 | - | |||||||||||||||||||||||||||||||||||||
| 5197 | isEmbedded = q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5198 | - | |||||||||||||||||||||||||||||||||||||
| 5199 | - | |||||||||||||||||||||||||||||||||||||
| 5200 | - | |||||||||||||||||||||||||||||||||||||
| 5201 | - | |||||||||||||||||||||||||||||||||||||
| 5202 | if (!isEmbedded
| 0 | ||||||||||||||||||||||||||||||||||||
| 5203 | (static_cast< never executed: QApplication *>(QCoreApplication::instance()))->d_func()->closePopup(q);(static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->closePopup(q);never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->closePopup(q); | 0 | ||||||||||||||||||||||||||||||||||||
| 5204 | - | |||||||||||||||||||||||||||||||||||||
| 5205 | - | |||||||||||||||||||||||||||||||||||||
| 5206 | - | |||||||||||||||||||||||||||||||||||||
| 5207 | - | |||||||||||||||||||||||||||||||||||||
| 5208 | - | |||||||||||||||||||||||||||||||||||||
| 5209 | - | |||||||||||||||||||||||||||||||||||||
| 5210 | - | |||||||||||||||||||||||||||||||||||||
| 5211 | q->setAttribute(Qt::WA_Mapped, false); | - | ||||||||||||||||||||||||||||||||||||
| 5212 | hide_sys(); | - | ||||||||||||||||||||||||||||||||||||
| 5213 | - | |||||||||||||||||||||||||||||||||||||
| 5214 | bool wasVisible = q->testAttribute(Qt::WA_WState_Visible); | - | ||||||||||||||||||||||||||||||||||||
| 5215 | - | |||||||||||||||||||||||||||||||||||||
| 5216 | if (wasVisible
| 0 | ||||||||||||||||||||||||||||||||||||
| 5217 | q->setAttribute(Qt::WA_WState_Visible, false); | - | ||||||||||||||||||||||||||||||||||||
| 5218 | - | |||||||||||||||||||||||||||||||||||||
| 5219 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5220 | - | |||||||||||||||||||||||||||||||||||||
| 5221 | QHideEvent hideEvent; | - | ||||||||||||||||||||||||||||||||||||
| 5222 | QApplication::sendEvent(q, &hideEvent); | - | ||||||||||||||||||||||||||||||||||||
| 5223 | hideChildren(false); | - | ||||||||||||||||||||||||||||||||||||
| 5224 | - | |||||||||||||||||||||||||||||||||||||
| 5225 | - | |||||||||||||||||||||||||||||||||||||
| 5226 | - | |||||||||||||||||||||||||||||||||||||
| 5227 | if (wasVisible
| 0 | ||||||||||||||||||||||||||||||||||||
| 5228 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->sendSyntheticEnterLeave(q); | - | ||||||||||||||||||||||||||||||||||||
| 5229 | QWidget *fw = QApplication::focusWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 5230 | while (fw
| 0 | ||||||||||||||||||||||||||||||||||||
| 5231 | if (fw == q
| 0 | ||||||||||||||||||||||||||||||||||||
| 5232 | q->focusNextPrevChild(true); | - | ||||||||||||||||||||||||||||||||||||
| 5233 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5234 | } | - | ||||||||||||||||||||||||||||||||||||
| 5235 | fw = fw->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 5236 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5237 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5238 | - | |||||||||||||||||||||||||||||||||||||
| 5239 | if (QWidgetBackingStore *bs = maybeBackingStore()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5240 | bs->removeDirtyWidget(q); never executed: bs->removeDirtyWidget(q); | 0 | ||||||||||||||||||||||||||||||||||||
| 5241 | - | |||||||||||||||||||||||||||||||||||||
| 5242 | - | |||||||||||||||||||||||||||||||||||||
| 5243 | if (wasVisible
| 0 | ||||||||||||||||||||||||||||||||||||
| 5244 | QAccessibleEvent event(q, QAccessible::ObjectHide); | - | ||||||||||||||||||||||||||||||||||||
| 5245 | QAccessible::updateAccessibility(&event); | - | ||||||||||||||||||||||||||||||||||||
| 5246 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5247 | - | |||||||||||||||||||||||||||||||||||||
| 5248 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5249 | - | |||||||||||||||||||||||||||||||||||||
| 5250 | void QWidgetPrivate::hide_sys() | - | ||||||||||||||||||||||||||||||||||||
| 5251 | { | - | ||||||||||||||||||||||||||||||||||||
| 5252 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 5253 | - | |||||||||||||||||||||||||||||||||||||
| 5254 | QWindow *window = q->windowHandle(); | - | ||||||||||||||||||||||||||||||||||||
| 5255 | - | |||||||||||||||||||||||||||||||||||||
| 5256 | if (q->testAttribute(Qt::WA_DontShowOnScreen)
| 0 | ||||||||||||||||||||||||||||||||||||
| 5257 | q->setAttribute(Qt::WA_Mapped, false); | - | ||||||||||||||||||||||||||||||||||||
| 5258 | - | |||||||||||||||||||||||||||||||||||||
| 5259 | if (window
| 0 | ||||||||||||||||||||||||||||||||||||
| 5260 | - | |||||||||||||||||||||||||||||||||||||
| 5261 | && (!extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 5262 | - | |||||||||||||||||||||||||||||||||||||
| 5263 | && q->windowModality() != Qt::NonModal
| 0 | ||||||||||||||||||||||||||||||||||||
| 5264 | QGuiApplicationPrivate::hideModalWindow(window); | - | ||||||||||||||||||||||||||||||||||||
| 5265 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5266 | - | |||||||||||||||||||||||||||||||||||||
| 5267 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5268 | - | |||||||||||||||||||||||||||||||||||||
| 5269 | deactivateWidgetCleanup(); | - | ||||||||||||||||||||||||||||||||||||
| 5270 | - | |||||||||||||||||||||||||||||||||||||
| 5271 | if (!q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5272 | QWidget *p = q->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 5273 | if (p
| 0 | ||||||||||||||||||||||||||||||||||||
| 5274 | if (renderToTexture
| 0 | ||||||||||||||||||||||||||||||||||||
| 5275 | p->d_func()->invalidateBuffer(q->geometry()); never executed: p->d_func()->invalidateBuffer(q->geometry()); | 0 | ||||||||||||||||||||||||||||||||||||
| 5276 | else | - | ||||||||||||||||||||||||||||||||||||
| 5277 | invalidateBuffer(q->rect()); never executed: invalidateBuffer(q->rect()); | 0 | ||||||||||||||||||||||||||||||||||||
| 5278 | } | - | ||||||||||||||||||||||||||||||||||||
| 5279 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5280 | invalidateBuffer(q->rect()); | - | ||||||||||||||||||||||||||||||||||||
| 5281 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5282 | - | |||||||||||||||||||||||||||||||||||||
| 5283 | if (window
| 0 | ||||||||||||||||||||||||||||||||||||
| 5284 | window->setVisible(false); never executed: window->setVisible(false); | 0 | ||||||||||||||||||||||||||||||||||||
| 5285 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5286 | void QWidget::setVisible(bool visible) | - | ||||||||||||||||||||||||||||||||||||
| 5287 | { | - | ||||||||||||||||||||||||||||||||||||
| 5288 | if (visible
| 0 | ||||||||||||||||||||||||||||||||||||
| 5289 | if (testAttribute(Qt::WA_WState_ExplicitShowHide)
| 0 | ||||||||||||||||||||||||||||||||||||
| 5290 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 5291 | - | |||||||||||||||||||||||||||||||||||||
| 5292 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 5293 | - | |||||||||||||||||||||||||||||||||||||
| 5294 | - | |||||||||||||||||||||||||||||||||||||
| 5295 | if (!isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5296 | && !parentWidget()->testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 5297 | parentWidget()->window()->d_func()->createRecursively(); never executed: parentWidget()->window()->d_func()->createRecursively(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5298 | - | |||||||||||||||||||||||||||||||||||||
| 5299 | - | |||||||||||||||||||||||||||||||||||||
| 5300 | QWidget *pw = parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 5301 | if (!testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 5302 | && (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5303 | create(); | - | ||||||||||||||||||||||||||||||||||||
| 5304 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5305 | - | |||||||||||||||||||||||||||||||||||||
| 5306 | bool wasResized = testAttribute(Qt::WA_Resized); | - | ||||||||||||||||||||||||||||||||||||
| 5307 | Qt::WindowStates initialWindowState = windowState(); | - | ||||||||||||||||||||||||||||||||||||
| 5308 | - | |||||||||||||||||||||||||||||||||||||
| 5309 | - | |||||||||||||||||||||||||||||||||||||
| 5310 | ensurePolished(); | - | ||||||||||||||||||||||||||||||||||||
| 5311 | - | |||||||||||||||||||||||||||||||||||||
| 5312 | - | |||||||||||||||||||||||||||||||||||||
| 5313 | setAttribute(Qt::WA_WState_ExplicitShowHide); | - | ||||||||||||||||||||||||||||||||||||
| 5314 | - | |||||||||||||||||||||||||||||||||||||
| 5315 | bool needUpdateGeometry = !isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5316 | - | |||||||||||||||||||||||||||||||||||||
| 5317 | setAttribute(Qt::WA_WState_Hidden, false); | - | ||||||||||||||||||||||||||||||||||||
| 5318 | - | |||||||||||||||||||||||||||||||||||||
| 5319 | if (needUpdateGeometry
| 0 | ||||||||||||||||||||||||||||||||||||
| 5320 | d->updateGeometry_helper(true); never executed: d->updateGeometry_helper(true); | 0 | ||||||||||||||||||||||||||||||||||||
| 5321 | - | |||||||||||||||||||||||||||||||||||||
| 5322 | - | |||||||||||||||||||||||||||||||||||||
| 5323 | if (d->layout
| 0 | ||||||||||||||||||||||||||||||||||||
| 5324 | d->layout->activate(); never executed: d->layout->activate(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5325 | - | |||||||||||||||||||||||||||||||||||||
| 5326 | if (!isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5327 | QWidget *parent = parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 5328 | while (parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 5329 | parent->d_func()->layout->activate(); | - | ||||||||||||||||||||||||||||||||||||
| 5330 | if (parent->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5331 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5332 | parent = parent->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 5333 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5334 | if (parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 5335 | parent->d_func()->setDirtyOpaqueRegion(); never executed: parent->d_func()->setDirtyOpaqueRegion(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5336 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5337 | - | |||||||||||||||||||||||||||||||||||||
| 5338 | - | |||||||||||||||||||||||||||||||||||||
| 5339 | if (!wasResized
| 0 | ||||||||||||||||||||||||||||||||||||
| 5340 | && (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5341 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5342 | adjustSize(); | - | ||||||||||||||||||||||||||||||||||||
| 5343 | if (windowState() != initialWindowState
| 0 | ||||||||||||||||||||||||||||||||||||
| 5344 | setWindowState(initialWindowState); never executed: setWindowState(initialWindowState); | 0 | ||||||||||||||||||||||||||||||||||||
| 5345 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5346 | adjustSize(); | - | ||||||||||||||||||||||||||||||||||||
| 5347 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5348 | setAttribute(Qt::WA_Resized, false); | - | ||||||||||||||||||||||||||||||||||||
| 5349 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5350 | - | |||||||||||||||||||||||||||||||||||||
| 5351 | setAttribute(Qt::WA_KeyboardFocusChange, false); | - | ||||||||||||||||||||||||||||||||||||
| 5352 | - | |||||||||||||||||||||||||||||||||||||
| 5353 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5354 | d->show_helper(); | - | ||||||||||||||||||||||||||||||||||||
| 5355 | - | |||||||||||||||||||||||||||||||||||||
| 5356 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->sendSyntheticEnterLeave(this); | - | ||||||||||||||||||||||||||||||||||||
| 5357 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5358 | - | |||||||||||||||||||||||||||||||||||||
| 5359 | QEvent showToParentEvent(QEvent::ShowToParent); | - | ||||||||||||||||||||||||||||||||||||
| 5360 | QApplication::sendEvent(this, &showToParentEvent); | - | ||||||||||||||||||||||||||||||||||||
| 5361 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5362 | if (testAttribute(Qt::WA_WState_ExplicitShowHide)
| 0 | ||||||||||||||||||||||||||||||||||||
| 5363 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 5364 | if (QApplicationPrivate::hidden_focus_widget == this
| 0 | ||||||||||||||||||||||||||||||||||||
| 5365 | QApplicationPrivate::hidden_focus_widget = 0; never executed: QApplicationPrivate::hidden_focus_widget = 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 5366 | - | |||||||||||||||||||||||||||||||||||||
| 5367 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 5368 | - | |||||||||||||||||||||||||||||||||||||
| 5369 | - | |||||||||||||||||||||||||||||||||||||
| 5370 | - | |||||||||||||||||||||||||||||||||||||
| 5371 | - | |||||||||||||||||||||||||||||||||||||
| 5372 | - | |||||||||||||||||||||||||||||||||||||
| 5373 | if (!isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5374 | parentWidget()->d_func()->setDirtyOpaqueRegion(); never executed: parentWidget()->d_func()->setDirtyOpaqueRegion(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5375 | - | |||||||||||||||||||||||||||||||||||||
| 5376 | setAttribute(Qt::WA_WState_Hidden); | - | ||||||||||||||||||||||||||||||||||||
| 5377 | setAttribute(Qt::WA_WState_ExplicitShowHide); | - | ||||||||||||||||||||||||||||||||||||
| 5378 | if (testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 5379 | d->hide_helper(); never executed: d->hide_helper(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5380 | - | |||||||||||||||||||||||||||||||||||||
| 5381 | - | |||||||||||||||||||||||||||||||||||||
| 5382 | if (!isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5383 | if (parentWidget()->d_func()->layout
| 0 | ||||||||||||||||||||||||||||||||||||
| 5384 | parentWidget()->d_func()->layout->invalidate(); never executed: parentWidget()->d_func()->layout->invalidate(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5385 | else if (parentWidget()->isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5386 | QApplication::postEvent(parentWidget(), new QEvent(QEvent::LayoutRequest)); never executed: QApplication::postEvent(parentWidget(), new QEvent(QEvent::LayoutRequest)); | 0 | ||||||||||||||||||||||||||||||||||||
| 5387 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5388 | - | |||||||||||||||||||||||||||||||||||||
| 5389 | QEvent hideToParentEvent(QEvent::HideToParent); | - | ||||||||||||||||||||||||||||||||||||
| 5390 | QApplication::sendEvent(this, &hideToParentEvent); | - | ||||||||||||||||||||||||||||||||||||
| 5391 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5392 | } | - | ||||||||||||||||||||||||||||||||||||
| 5393 | - | |||||||||||||||||||||||||||||||||||||
| 5394 | - | |||||||||||||||||||||||||||||||||||||
| 5395 | - | |||||||||||||||||||||||||||||||||||||
| 5396 | - | |||||||||||||||||||||||||||||||||||||
| 5397 | void QWidget::setHidden(bool hidden) | - | ||||||||||||||||||||||||||||||||||||
| 5398 | { | - | ||||||||||||||||||||||||||||||||||||
| 5399 | setVisible(!hidden); | - | ||||||||||||||||||||||||||||||||||||
| 5400 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5401 | - | |||||||||||||||||||||||||||||||||||||
| 5402 | void QWidgetPrivate::_q_showIfNotHidden() | - | ||||||||||||||||||||||||||||||||||||
| 5403 | { | - | ||||||||||||||||||||||||||||||||||||
| 5404 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 5405 | if ( !(q->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5406 | q->setVisible(true); never executed: q->setVisible(true); | 0 | ||||||||||||||||||||||||||||||||||||
| 5407 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5408 | - | |||||||||||||||||||||||||||||||||||||
| 5409 | void QWidgetPrivate::showChildren(bool spontaneous) | - | ||||||||||||||||||||||||||||||||||||
| 5410 | { | - | ||||||||||||||||||||||||||||||||||||
| 5411 | QList<QObject*> childList = children; | - | ||||||||||||||||||||||||||||||||||||
| 5412 | for (int i = 0; i < childList.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5413 | QWidget *widget = qobject_cast<QWidget*>(childList.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 5414 | if (!widget
| 0 | ||||||||||||||||||||||||||||||||||||
| 5415 | || widget->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5416 | || widget->testAttribute(Qt::WA_WState_Hidden)
| 0 | ||||||||||||||||||||||||||||||||||||
| 5417 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 5418 | if (spontaneous
| 0 | ||||||||||||||||||||||||||||||||||||
| 5419 | widget->setAttribute(Qt::WA_Mapped); | - | ||||||||||||||||||||||||||||||||||||
| 5420 | widget->d_func()->showChildren(true); | - | ||||||||||||||||||||||||||||||||||||
| 5421 | QShowEvent e; | - | ||||||||||||||||||||||||||||||||||||
| 5422 | QApplication::sendSpontaneousEvent(widget, &e); | - | ||||||||||||||||||||||||||||||||||||
| 5423 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5424 | if (widget->testAttribute(Qt::WA_WState_ExplicitShowHide)
| 0 | ||||||||||||||||||||||||||||||||||||
| 5425 | widget->d_func()->show_recursive(); never executed: widget->d_func()->show_recursive(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5426 | else | - | ||||||||||||||||||||||||||||||||||||
| 5427 | widget->show(); never executed: widget->show(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5428 | } | - | ||||||||||||||||||||||||||||||||||||
| 5429 | } | - | ||||||||||||||||||||||||||||||||||||
| 5430 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5431 | - | |||||||||||||||||||||||||||||||||||||
| 5432 | void QWidgetPrivate::hideChildren(bool spontaneous) | - | ||||||||||||||||||||||||||||||||||||
| 5433 | { | - | ||||||||||||||||||||||||||||||||||||
| 5434 | QList<QObject*> childList = children; | - | ||||||||||||||||||||||||||||||||||||
| 5435 | for (int i = 0; i < childList.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5436 | QWidget *widget = qobject_cast<QWidget*>(childList.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 5437 | if (!widget
| 0 | ||||||||||||||||||||||||||||||||||||
| 5438 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 5439 | if (spontaneous
| 0 | ||||||||||||||||||||||||||||||||||||
| 5440 | widget->setAttribute(Qt::WA_Mapped, false); never executed: widget->setAttribute(Qt::WA_Mapped, false); | 0 | ||||||||||||||||||||||||||||||||||||
| 5441 | else | - | ||||||||||||||||||||||||||||||||||||
| 5442 | widget->setAttribute(Qt::WA_WState_Visible, false); never executed: widget->setAttribute(Qt::WA_WState_Visible, false); | 0 | ||||||||||||||||||||||||||||||||||||
| 5443 | widget->d_func()->hideChildren(spontaneous); | - | ||||||||||||||||||||||||||||||||||||
| 5444 | QHideEvent e; | - | ||||||||||||||||||||||||||||||||||||
| 5445 | if (spontaneous
| 0 | ||||||||||||||||||||||||||||||||||||
| 5446 | QApplication::sendSpontaneousEvent(widget, &e); | - | ||||||||||||||||||||||||||||||||||||
| 5447 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5448 | QApplication::sendEvent(widget, &e); | - | ||||||||||||||||||||||||||||||||||||
| 5449 | if (widget->internalWinId()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5450 | && widget->testAttribute(Qt::WA_DontCreateNativeAncestors)
| 0 | ||||||||||||||||||||||||||||||||||||
| 5451 | - | |||||||||||||||||||||||||||||||||||||
| 5452 | - | |||||||||||||||||||||||||||||||||||||
| 5453 | widget->d_func()->hide_sys(); | - | ||||||||||||||||||||||||||||||||||||
| 5454 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5455 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5456 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->sendSyntheticEnterLeave(widget); | - | ||||||||||||||||||||||||||||||||||||
| 5457 | - | |||||||||||||||||||||||||||||||||||||
| 5458 | if (!spontaneous
| 0 | ||||||||||||||||||||||||||||||||||||
| 5459 | QAccessibleEvent event(widget, QAccessible::ObjectHide); | - | ||||||||||||||||||||||||||||||||||||
| 5460 | QAccessible::updateAccessibility(&event); | - | ||||||||||||||||||||||||||||||||||||
| 5461 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5462 | - | |||||||||||||||||||||||||||||||||||||
| 5463 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5464 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5465 | - | |||||||||||||||||||||||||||||||||||||
| 5466 | bool QWidgetPrivate::close_helper(CloseMode mode) | - | ||||||||||||||||||||||||||||||||||||
| 5467 | { | - | ||||||||||||||||||||||||||||||||||||
| 5468 | if (data.is_closing
| 0 | ||||||||||||||||||||||||||||||||||||
| 5469 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 5470 | - | |||||||||||||||||||||||||||||||||||||
| 5471 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 5472 | data.is_closing = 1; | - | ||||||||||||||||||||||||||||||||||||
| 5473 | - | |||||||||||||||||||||||||||||||||||||
| 5474 | QPointer<QWidget> that = q; | - | ||||||||||||||||||||||||||||||||||||
| 5475 | QPointer<QWidget> parentWidget = q->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 5476 | - | |||||||||||||||||||||||||||||||||||||
| 5477 | bool quitOnClose = q->testAttribute(Qt::WA_QuitOnClose); | - | ||||||||||||||||||||||||||||||||||||
| 5478 | if (mode != CloseNoEvent
| 0 | ||||||||||||||||||||||||||||||||||||
| 5479 | QCloseEvent e; | - | ||||||||||||||||||||||||||||||||||||
| 5480 | if (mode == CloseWithSpontaneousEvent
| 0 | ||||||||||||||||||||||||||||||||||||
| 5481 | QApplication::sendSpontaneousEvent(q, &e); never executed: QApplication::sendSpontaneousEvent(q, &e); | 0 | ||||||||||||||||||||||||||||||||||||
| 5482 | else | - | ||||||||||||||||||||||||||||||||||||
| 5483 | QApplication::sendEvent(q, &e); never executed: QApplication::sendEvent(q, &e); | 0 | ||||||||||||||||||||||||||||||||||||
| 5484 | if (!that.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5485 | data.is_closing = 0; | - | ||||||||||||||||||||||||||||||||||||
| 5486 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 5487 | } | - | ||||||||||||||||||||||||||||||||||||
| 5488 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5489 | - | |||||||||||||||||||||||||||||||||||||
| 5490 | if (!that.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5491 | q->hide(); never executed: q->hide(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5492 | - | |||||||||||||||||||||||||||||||||||||
| 5493 | - | |||||||||||||||||||||||||||||||||||||
| 5494 | quitOnClose = quitOnClose
| 0 | ||||||||||||||||||||||||||||||||||||
| 5495 | - | |||||||||||||||||||||||||||||||||||||
| 5496 | if (quitOnClose
| 0 | ||||||||||||||||||||||||||||||||||||
| 5497 | - | |||||||||||||||||||||||||||||||||||||
| 5498 | - | |||||||||||||||||||||||||||||||||||||
| 5499 | - | |||||||||||||||||||||||||||||||||||||
| 5500 | QWidgetList list = QApplication::topLevelWidgets(); | - | ||||||||||||||||||||||||||||||||||||
| 5501 | bool lastWindowClosed = true; | - | ||||||||||||||||||||||||||||||||||||
| 5502 | for (int i = 0; i < list.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5503 | QWidget *w = list.at(i); | - | ||||||||||||||||||||||||||||||||||||
| 5504 | if (!w->isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5505 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 5506 | lastWindowClosed = false; | - | ||||||||||||||||||||||||||||||||||||
| 5507 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5508 | } | - | ||||||||||||||||||||||||||||||||||||
| 5509 | if (lastWindowClosed
| 0 | ||||||||||||||||||||||||||||||||||||
| 5510 | QGuiApplicationPrivate::emitLastWindowClosed(); | - | ||||||||||||||||||||||||||||||||||||
| 5511 | QCoreApplicationPrivate *applicationPrivate = static_cast<QCoreApplicationPrivate*>(QObjectPrivate::get(QCoreApplication::instance())); | - | ||||||||||||||||||||||||||||||||||||
| 5512 | applicationPrivate->maybeQuit(); | - | ||||||||||||||||||||||||||||||||||||
| 5513 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5514 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5515 | - | |||||||||||||||||||||||||||||||||||||
| 5516 | - | |||||||||||||||||||||||||||||||||||||
| 5517 | if (!that.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5518 | data.is_closing = 0; | - | ||||||||||||||||||||||||||||||||||||
| 5519 | if (q->testAttribute(Qt::WA_DeleteOnClose)
| 0 | ||||||||||||||||||||||||||||||||||||
| 5520 | q->setAttribute(Qt::WA_DeleteOnClose, false); | - | ||||||||||||||||||||||||||||||||||||
| 5521 | q->deleteLater(); | - | ||||||||||||||||||||||||||||||||||||
| 5522 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5523 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5524 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 5525 | } | - | ||||||||||||||||||||||||||||||||||||
| 5526 | bool QWidget::close() | - | ||||||||||||||||||||||||||||||||||||
| 5527 | { | - | ||||||||||||||||||||||||||||||||||||
| 5528 | return never executed: d_func()->close_helper(QWidgetPrivate::CloseWithEvent);return d_func()->close_helper(QWidgetPrivate::CloseWithEvent);never executed: return d_func()->close_helper(QWidgetPrivate::CloseWithEvent); | 0 | ||||||||||||||||||||||||||||||||||||
| 5529 | } | - | ||||||||||||||||||||||||||||||||||||
| 5530 | bool QWidget::isVisibleTo(const QWidget *ancestor) const | - | ||||||||||||||||||||||||||||||||||||
| 5531 | { | - | ||||||||||||||||||||||||||||||||||||
| 5532 | if (!ancestor
| 0 | ||||||||||||||||||||||||||||||||||||
| 5533 | return never executed: isVisible();return isVisible();never executed: return isVisible(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5534 | const QWidget * w = this; | - | ||||||||||||||||||||||||||||||||||||
| 5535 | while (!w->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5536 | && !w->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5537 | && w->parentWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5538 | && w->parentWidget() != ancestor
| 0 | ||||||||||||||||||||||||||||||||||||
| 5539 | w = w->parentWidget(); never executed: w = w->parentWidget(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5540 | return never executed: !w->isHidden();return !w->isHidden();never executed: return !w->isHidden(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5541 | } | - | ||||||||||||||||||||||||||||||||||||
| 5542 | QRegion QWidget::visibleRegion() const | - | ||||||||||||||||||||||||||||||||||||
| 5543 | { | - | ||||||||||||||||||||||||||||||||||||
| 5544 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 5545 | - | |||||||||||||||||||||||||||||||||||||
| 5546 | QRect clipRect = d->clipRect(); | - | ||||||||||||||||||||||||||||||||||||
| 5547 | if (clipRect.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5548 | return never executed: QRegion();return QRegion();never executed: return QRegion(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5549 | QRegion r(clipRect); | - | ||||||||||||||||||||||||||||||||||||
| 5550 | d->subtractOpaqueChildren(r, clipRect); | - | ||||||||||||||||||||||||||||||||||||
| 5551 | d->subtractOpaqueSiblings(r); | - | ||||||||||||||||||||||||||||||||||||
| 5552 | return never executed: r;return r;never executed: return r; | 0 | ||||||||||||||||||||||||||||||||||||
| 5553 | } | - | ||||||||||||||||||||||||||||||||||||
| 5554 | - | |||||||||||||||||||||||||||||||||||||
| 5555 | - | |||||||||||||||||||||||||||||||||||||
| 5556 | QSize QWidgetPrivate::adjustedSize() const | - | ||||||||||||||||||||||||||||||||||||
| 5557 | { | - | ||||||||||||||||||||||||||||||||||||
| 5558 | const QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 5559 | - | |||||||||||||||||||||||||||||||||||||
| 5560 | QSize s = q->sizeHint(); | - | ||||||||||||||||||||||||||||||||||||
| 5561 | - | |||||||||||||||||||||||||||||||||||||
| 5562 | if (q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5563 | Qt::Orientations exp; | - | ||||||||||||||||||||||||||||||||||||
| 5564 | if (layout
| 0 | ||||||||||||||||||||||||||||||||||||
| 5565 | if (layout->hasHeightForWidth()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5566 | s.setHeight(layout->totalHeightForWidth(s.width())); never executed: s.setHeight(layout->totalHeightForWidth(s.width())); | 0 | ||||||||||||||||||||||||||||||||||||
| 5567 | exp = layout->expandingDirections(); | - | ||||||||||||||||||||||||||||||||||||
| 5568 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5569 | { | - | ||||||||||||||||||||||||||||||||||||
| 5570 | if (q->sizePolicy().hasHeightForWidth()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5571 | s.setHeight(q->heightForWidth(s.width())); never executed: s.setHeight(q->heightForWidth(s.width())); | 0 | ||||||||||||||||||||||||||||||||||||
| 5572 | exp = q->sizePolicy().expandingDirections(); | - | ||||||||||||||||||||||||||||||||||||
| 5573 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5574 | if (exp & Qt::Horizontal
| 0 | ||||||||||||||||||||||||||||||||||||
| 5575 | s.setWidth(qMax(s.width(), 200)); never executed: s.setWidth(qMax(s.width(), 200)); | 0 | ||||||||||||||||||||||||||||||||||||
| 5576 | if (exp & Qt::Vertical
| 0 | ||||||||||||||||||||||||||||||||||||
| 5577 | s.setHeight(qMax(s.height(), 100)); never executed: s.setHeight(qMax(s.height(), 100)); | 0 | ||||||||||||||||||||||||||||||||||||
| 5578 | - | |||||||||||||||||||||||||||||||||||||
| 5579 | - | |||||||||||||||||||||||||||||||||||||
| 5580 | - | |||||||||||||||||||||||||||||||||||||
| 5581 | QRect screen = QApplication::desktop()->screenGeometry(q->pos()); | - | ||||||||||||||||||||||||||||||||||||
| 5582 | - | |||||||||||||||||||||||||||||||||||||
| 5583 | - | |||||||||||||||||||||||||||||||||||||
| 5584 | - | |||||||||||||||||||||||||||||||||||||
| 5585 | - | |||||||||||||||||||||||||||||||||||||
| 5586 | - | |||||||||||||||||||||||||||||||||||||
| 5587 | s.setWidth(qMin(s.width(), screen.width()*2/3)); | - | ||||||||||||||||||||||||||||||||||||
| 5588 | s.setHeight(qMin(s.height(), screen.height()*2/3)); | - | ||||||||||||||||||||||||||||||||||||
| 5589 | - | |||||||||||||||||||||||||||||||||||||
| 5590 | if (QTLWExtra *extra = maybeTopData()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5591 | extra->sizeAdjusted = true; never executed: extra->sizeAdjusted = true; | 0 | ||||||||||||||||||||||||||||||||||||
| 5592 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5593 | - | |||||||||||||||||||||||||||||||||||||
| 5594 | if (!s.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5595 | QRect r = q->childrenRect(); | - | ||||||||||||||||||||||||||||||||||||
| 5596 | if (r.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5597 | return never executed: s;return s;never executed: return s; | 0 | ||||||||||||||||||||||||||||||||||||
| 5598 | s = r.size() + QSize(2 * r.x(), 2 * r.y()); | - | ||||||||||||||||||||||||||||||||||||
| 5599 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5600 | - | |||||||||||||||||||||||||||||||||||||
| 5601 | return never executed: s;return s;never executed: return s; | 0 | ||||||||||||||||||||||||||||||||||||
| 5602 | } | - | ||||||||||||||||||||||||||||||||||||
| 5603 | void QWidget::adjustSize() | - | ||||||||||||||||||||||||||||||||||||
| 5604 | { | - | ||||||||||||||||||||||||||||||||||||
| 5605 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 5606 | ensurePolished(); | - | ||||||||||||||||||||||||||||||||||||
| 5607 | QSize s = d->adjustedSize(); | - | ||||||||||||||||||||||||||||||||||||
| 5608 | - | |||||||||||||||||||||||||||||||||||||
| 5609 | if (d->layout
| 0 | ||||||||||||||||||||||||||||||||||||
| 5610 | d->layout->activate(); never executed: d->layout->activate(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5611 | - | |||||||||||||||||||||||||||||||||||||
| 5612 | if (s.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5613 | resize(s); never executed: resize(s); | 0 | ||||||||||||||||||||||||||||||||||||
| 5614 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5615 | QSize QWidget::sizeHint() const | - | ||||||||||||||||||||||||||||||||||||
| 5616 | { | - | ||||||||||||||||||||||||||||||||||||
| 5617 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 5618 | if (d->layout
| 0 | ||||||||||||||||||||||||||||||||||||
| 5619 | return never executed: d->layout->totalSizeHint();return d->layout->totalSizeHint();never executed: return d->layout->totalSizeHint(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5620 | return never executed: QSize(-1, -1);return QSize(-1, -1);never executed: return QSize(-1, -1); | 0 | ||||||||||||||||||||||||||||||||||||
| 5621 | } | - | ||||||||||||||||||||||||||||||||||||
| 5622 | QSize QWidget::minimumSizeHint() const | - | ||||||||||||||||||||||||||||||||||||
| 5623 | { | - | ||||||||||||||||||||||||||||||||||||
| 5624 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 5625 | if (d->layout
| 0 | ||||||||||||||||||||||||||||||||||||
| 5626 | return never executed: d->layout->totalMinimumSize();return d->layout->totalMinimumSize();never executed: return d->layout->totalMinimumSize(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5627 | return never executed: QSize(-1, -1);return QSize(-1, -1);never executed: return QSize(-1, -1); | 0 | ||||||||||||||||||||||||||||||||||||
| 5628 | } | - | ||||||||||||||||||||||||||||||||||||
| 5629 | bool QWidget::isAncestorOf(const QWidget *child) const | - | ||||||||||||||||||||||||||||||||||||
| 5630 | { | - | ||||||||||||||||||||||||||||||||||||
| 5631 | while (child
| 0 | ||||||||||||||||||||||||||||||||||||
| 5632 | if (child == this
| 0 | ||||||||||||||||||||||||||||||||||||
| 5633 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 5634 | if (child->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5635 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 5636 | child = child->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 5637 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5638 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 5639 | } | - | ||||||||||||||||||||||||||||||||||||
| 5640 | bool QWidget::event(QEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 5641 | { | - | ||||||||||||||||||||||||||||||||||||
| 5642 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 5643 | - | |||||||||||||||||||||||||||||||||||||
| 5644 | - | |||||||||||||||||||||||||||||||||||||
| 5645 | if (!isEnabled()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5646 | switch(event->type()) { | - | ||||||||||||||||||||||||||||||||||||
| 5647 | case never executed: QEvent::TabletPress:case QEvent::TabletPress:never executed: case QEvent::TabletPress: | 0 | ||||||||||||||||||||||||||||||||||||
| 5648 | case never executed: QEvent::TabletRelease:case QEvent::TabletRelease:never executed: case QEvent::TabletRelease: | 0 | ||||||||||||||||||||||||||||||||||||
| 5649 | case never executed: QEvent::TabletMove:case QEvent::TabletMove:never executed: case QEvent::TabletMove: | 0 | ||||||||||||||||||||||||||||||||||||
| 5650 | case never executed: QEvent::MouseButtonPress:case QEvent::MouseButtonPress:never executed: case QEvent::MouseButtonPress: | 0 | ||||||||||||||||||||||||||||||||||||
| 5651 | case never executed: QEvent::MouseButtonRelease:case QEvent::MouseButtonRelease:never executed: case QEvent::MouseButtonRelease: | 0 | ||||||||||||||||||||||||||||||||||||
| 5652 | case never executed: QEvent::MouseButtonDblClick:case QEvent::MouseButtonDblClick:never executed: case QEvent::MouseButtonDblClick: | 0 | ||||||||||||||||||||||||||||||||||||
| 5653 | case never executed: QEvent::MouseMove:case QEvent::MouseMove:never executed: case QEvent::MouseMove: | 0 | ||||||||||||||||||||||||||||||||||||
| 5654 | case never executed: QEvent::TouchBegin:case QEvent::TouchBegin:never executed: case QEvent::TouchBegin: | 0 | ||||||||||||||||||||||||||||||||||||
| 5655 | case never executed: QEvent::TouchUpdate:case QEvent::TouchUpdate:never executed: case QEvent::TouchUpdate: | 0 | ||||||||||||||||||||||||||||||||||||
| 5656 | case never executed: QEvent::TouchEnd:case QEvent::TouchEnd:never executed: case QEvent::TouchEnd: | 0 | ||||||||||||||||||||||||||||||||||||
| 5657 | case never executed: QEvent::TouchCancel:case QEvent::TouchCancel:never executed: case QEvent::TouchCancel: | 0 | ||||||||||||||||||||||||||||||||||||
| 5658 | case never executed: QEvent::ContextMenu:case QEvent::ContextMenu:never executed: case QEvent::ContextMenu: | 0 | ||||||||||||||||||||||||||||||||||||
| 5659 | case never executed: QEvent::KeyPress:case QEvent::KeyPress:never executed: case QEvent::KeyPress: | 0 | ||||||||||||||||||||||||||||||||||||
| 5660 | case never executed: QEvent::KeyRelease:case QEvent::KeyRelease:never executed: case QEvent::KeyRelease: | 0 | ||||||||||||||||||||||||||||||||||||
| 5661 | - | |||||||||||||||||||||||||||||||||||||
| 5662 | case never executed: QEvent::Wheel:case QEvent::Wheel:never executed: case QEvent::Wheel: | 0 | ||||||||||||||||||||||||||||||||||||
| 5663 | - | |||||||||||||||||||||||||||||||||||||
| 5664 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 5665 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
| 5666 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5667 | } | - | ||||||||||||||||||||||||||||||||||||
| 5668 | } | - | ||||||||||||||||||||||||||||||||||||
| 5669 | switch (event->type()) { | - | ||||||||||||||||||||||||||||||||||||
| 5670 | case never executed: QEvent::MouseMove:case QEvent::MouseMove:never executed: case QEvent::MouseMove: | 0 | ||||||||||||||||||||||||||||||||||||
| 5671 | mouseMoveEvent((QMouseEvent*)event); | - | ||||||||||||||||||||||||||||||||||||
| 5672 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5673 | - | |||||||||||||||||||||||||||||||||||||
| 5674 | case never executed: QEvent::MouseButtonPress:case QEvent::MouseButtonPress:never executed: case QEvent::MouseButtonPress: | 0 | ||||||||||||||||||||||||||||||||||||
| 5675 | mousePressEvent((QMouseEvent*)event); | - | ||||||||||||||||||||||||||||||||||||
| 5676 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5677 | - | |||||||||||||||||||||||||||||||||||||
| 5678 | case never executed: QEvent::MouseButtonRelease:case QEvent::MouseButtonRelease:never executed: case QEvent::MouseButtonRelease: | 0 | ||||||||||||||||||||||||||||||||||||
| 5679 | mouseReleaseEvent((QMouseEvent*)event); | - | ||||||||||||||||||||||||||||||||||||
| 5680 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5681 | - | |||||||||||||||||||||||||||||||||||||
| 5682 | case never executed: QEvent::MouseButtonDblClick:case QEvent::MouseButtonDblClick:never executed: case QEvent::MouseButtonDblClick: | 0 | ||||||||||||||||||||||||||||||||||||
| 5683 | mouseDoubleClickEvent((QMouseEvent*)event); | - | ||||||||||||||||||||||||||||||||||||
| 5684 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5685 | - | |||||||||||||||||||||||||||||||||||||
| 5686 | case never executed: QEvent::Wheel:case QEvent::Wheel:never executed: case QEvent::Wheel: | 0 | ||||||||||||||||||||||||||||||||||||
| 5687 | wheelEvent((QWheelEvent*)event); | - | ||||||||||||||||||||||||||||||||||||
| 5688 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5689 | - | |||||||||||||||||||||||||||||||||||||
| 5690 | - | |||||||||||||||||||||||||||||||||||||
| 5691 | case never executed: QEvent::TabletMove:case QEvent::TabletMove:never executed: case QEvent::TabletMove: | 0 | ||||||||||||||||||||||||||||||||||||
| 5692 | case never executed: QEvent::TabletPress:case QEvent::TabletPress:never executed: case QEvent::TabletPress: | 0 | ||||||||||||||||||||||||||||||||||||
| 5693 | case never executed: QEvent::TabletRelease:case QEvent::TabletRelease:never executed: case QEvent::TabletRelease: | 0 | ||||||||||||||||||||||||||||||||||||
| 5694 | tabletEvent((QTabletEvent*)event); | - | ||||||||||||||||||||||||||||||||||||
| 5695 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5696 | - | |||||||||||||||||||||||||||||||||||||
| 5697 | case never executed: QEvent::KeyPress:case QEvent::KeyPress:never executed: {case QEvent::KeyPress: | 0 | ||||||||||||||||||||||||||||||||||||
| 5698 | QKeyEvent *k = (QKeyEvent *)event; | - | ||||||||||||||||||||||||||||||||||||
| 5699 | bool res = false; | - | ||||||||||||||||||||||||||||||||||||
| 5700 | if (!(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier))
| 0 | ||||||||||||||||||||||||||||||||||||
| 5701 | if (k->key() == Qt::Key_Backtab
| 0 | ||||||||||||||||||||||||||||||||||||
| 5702 | || (k->key() == Qt::Key_Tab
| 0 | ||||||||||||||||||||||||||||||||||||
| 5703 | res = focusNextPrevChild(false); never executed: res = focusNextPrevChild(false); | 0 | ||||||||||||||||||||||||||||||||||||
| 5704 | else if (k->key() == Qt::Key_Tab
| 0 | ||||||||||||||||||||||||||||||||||||
| 5705 | res = focusNextPrevChild(true); never executed: res = focusNextPrevChild(true); | 0 | ||||||||||||||||||||||||||||||||||||
| 5706 | if (res
| 0 | ||||||||||||||||||||||||||||||||||||
| 5707 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5708 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5709 | keyPressEvent(k); | - | ||||||||||||||||||||||||||||||||||||
| 5710 | if (!k->isAccepted()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5711 | && k->modifiers() & Qt::ShiftModifier
| 0 | ||||||||||||||||||||||||||||||||||||
| 5712 | && d->whatsThis.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5713 | QWhatsThis::showText(mapToGlobal(inputMethodQuery(Qt::ImCursorRectangle).toRect().center()), d->whatsThis, this); | - | ||||||||||||||||||||||||||||||||||||
| 5714 | k->accept(); | - | ||||||||||||||||||||||||||||||||||||
| 5715 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5716 | - | |||||||||||||||||||||||||||||||||||||
| 5717 | } | - | ||||||||||||||||||||||||||||||||||||
| 5718 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5719 | - | |||||||||||||||||||||||||||||||||||||
| 5720 | case never executed: QEvent::KeyRelease:case QEvent::KeyRelease:never executed: case QEvent::KeyRelease: | 0 | ||||||||||||||||||||||||||||||||||||
| 5721 | keyReleaseEvent((QKeyEvent*)event); | - | ||||||||||||||||||||||||||||||||||||
| 5722 | - | |||||||||||||||||||||||||||||||||||||
| 5723 | case never executed: QEvent::ShortcutOverride:case QEvent::ShortcutOverride:never executed: case QEvent::ShortcutOverride:code before this statement never executed: case QEvent::ShortcutOverride: | 0 | ||||||||||||||||||||||||||||||||||||
| 5724 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5725 | - | |||||||||||||||||||||||||||||||||||||
| 5726 | case never executed: QEvent::InputMethod:case QEvent::InputMethod:never executed: case QEvent::InputMethod: | 0 | ||||||||||||||||||||||||||||||||||||
| 5727 | inputMethodEvent((QInputMethodEvent *) event); | - | ||||||||||||||||||||||||||||||||||||
| 5728 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5729 | - | |||||||||||||||||||||||||||||||||||||
| 5730 | case never executed: QEvent::InputMethodQuery:case QEvent::InputMethodQuery:never executed: case QEvent::InputMethodQuery: | 0 | ||||||||||||||||||||||||||||||||||||
| 5731 | if (testAttribute(Qt::WA_InputMethodEnabled)
| 0 | ||||||||||||||||||||||||||||||||||||
| 5732 | QInputMethodQueryEvent *query = static_cast<QInputMethodQueryEvent *>(event); | - | ||||||||||||||||||||||||||||||||||||
| 5733 | Qt::InputMethodQueries queries = query->queries(); | - | ||||||||||||||||||||||||||||||||||||
| 5734 | for (uint i = 0; i < 32
| 0 | ||||||||||||||||||||||||||||||||||||
| 5735 | Qt::InputMethodQuery q = (Qt::InputMethodQuery)(int)(queries & (1<<i)); | - | ||||||||||||||||||||||||||||||||||||
| 5736 | if (q
| 0 | ||||||||||||||||||||||||||||||||||||
| 5737 | QVariant v = inputMethodQuery(q); | - | ||||||||||||||||||||||||||||||||||||
| 5738 | if (q == Qt::ImEnabled
| 0 | ||||||||||||||||||||||||||||||||||||
| 5739 | v = QVariant(true); never executed: v = QVariant(true); | 0 | ||||||||||||||||||||||||||||||||||||
| 5740 | query->setValue(q, v); | - | ||||||||||||||||||||||||||||||||||||
| 5741 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5742 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5743 | query->accept(); | - | ||||||||||||||||||||||||||||||||||||
| 5744 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5745 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5746 | - | |||||||||||||||||||||||||||||||||||||
| 5747 | case never executed: QEvent::PolishRequest:case QEvent::PolishRequest:never executed: case QEvent::PolishRequest: | 0 | ||||||||||||||||||||||||||||||||||||
| 5748 | ensurePolished(); | - | ||||||||||||||||||||||||||||||||||||
| 5749 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5750 | - | |||||||||||||||||||||||||||||||||||||
| 5751 | case never executed: QEvent::Polish:case QEvent::Polish:never executed: {case QEvent::Polish: | 0 | ||||||||||||||||||||||||||||||||||||
| 5752 | style()->polish(this); | - | ||||||||||||||||||||||||||||||||||||
| 5753 | setAttribute(Qt::WA_WState_Polished); | - | ||||||||||||||||||||||||||||||||||||
| 5754 | if (!QApplication::font(this).isCopyOf(QApplication::font())
| 0 | ||||||||||||||||||||||||||||||||||||
| 5755 | d->resolveFont(); never executed: d->resolveFont(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5756 | if (!QApplication::palette(this).isCopyOf(QApplication::palette())
| 0 | ||||||||||||||||||||||||||||||||||||
| 5757 | d->resolvePalette(); never executed: d->resolvePalette(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5758 | } | - | ||||||||||||||||||||||||||||||||||||
| 5759 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5760 | - | |||||||||||||||||||||||||||||||||||||
| 5761 | case never executed: QEvent::ApplicationWindowIconChange:case QEvent::ApplicationWindowIconChange:never executed: case QEvent::ApplicationWindowIconChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5762 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5763 | d->setWindowIcon_sys(); | - | ||||||||||||||||||||||||||||||||||||
| 5764 | d->setWindowIcon_helper(); | - | ||||||||||||||||||||||||||||||||||||
| 5765 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5766 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5767 | case never executed: QEvent::FocusIn:case QEvent::FocusIn:never executed: case QEvent::FocusIn: | 0 | ||||||||||||||||||||||||||||||||||||
| 5768 | focusInEvent((QFocusEvent*)event); | - | ||||||||||||||||||||||||||||||||||||
| 5769 | d->updateWidgetTransform(event); | - | ||||||||||||||||||||||||||||||||||||
| 5770 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5771 | - | |||||||||||||||||||||||||||||||||||||
| 5772 | case never executed: QEvent::FocusOut:case QEvent::FocusOut:never executed: case QEvent::FocusOut: | 0 | ||||||||||||||||||||||||||||||||||||
| 5773 | focusOutEvent((QFocusEvent*)event); | - | ||||||||||||||||||||||||||||||||||||
| 5774 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5775 | - | |||||||||||||||||||||||||||||||||||||
| 5776 | case never executed: QEvent::Enter:case QEvent::Enter:never executed: case QEvent::Enter: | 0 | ||||||||||||||||||||||||||||||||||||
| 5777 | - | |||||||||||||||||||||||||||||||||||||
| 5778 | if (d->statusTip.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5779 | QStatusTipEvent tip(d->statusTip); | - | ||||||||||||||||||||||||||||||||||||
| 5780 | QApplication::sendEvent(const_cast<QWidget *>(this), &tip); | - | ||||||||||||||||||||||||||||||||||||
| 5781 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5782 | - | |||||||||||||||||||||||||||||||||||||
| 5783 | enterEvent(event); | - | ||||||||||||||||||||||||||||||||||||
| 5784 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5785 | - | |||||||||||||||||||||||||||||||||||||
| 5786 | case never executed: QEvent::Leave:case QEvent::Leave:never executed: case QEvent::Leave: | 0 | ||||||||||||||||||||||||||||||||||||
| 5787 | - | |||||||||||||||||||||||||||||||||||||
| 5788 | if (d->statusTip.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5789 | QString empty; | - | ||||||||||||||||||||||||||||||||||||
| 5790 | QStatusTipEvent tip(empty); | - | ||||||||||||||||||||||||||||||||||||
| 5791 | QApplication::sendEvent(const_cast<QWidget *>(this), &tip); | - | ||||||||||||||||||||||||||||||||||||
| 5792 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5793 | - | |||||||||||||||||||||||||||||||||||||
| 5794 | leaveEvent(event); | - | ||||||||||||||||||||||||||||||||||||
| 5795 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5796 | - | |||||||||||||||||||||||||||||||||||||
| 5797 | case never executed: QEvent::HoverEnter:case QEvent::HoverEnter:never executed: case QEvent::HoverEnter: | 0 | ||||||||||||||||||||||||||||||||||||
| 5798 | case never executed: QEvent::HoverLeave:case QEvent::HoverLeave:never executed: case QEvent::HoverLeave: | 0 | ||||||||||||||||||||||||||||||||||||
| 5799 | update(); | - | ||||||||||||||||||||||||||||||||||||
| 5800 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5801 | - | |||||||||||||||||||||||||||||||||||||
| 5802 | case never executed: QEvent::Paint:case QEvent::Paint:never executed: case QEvent::Paint: | 0 | ||||||||||||||||||||||||||||||||||||
| 5803 | - | |||||||||||||||||||||||||||||||||||||
| 5804 | - | |||||||||||||||||||||||||||||||||||||
| 5805 | - | |||||||||||||||||||||||||||||||||||||
| 5806 | paintEvent((QPaintEvent*)event); | - | ||||||||||||||||||||||||||||||||||||
| 5807 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5808 | - | |||||||||||||||||||||||||||||||||||||
| 5809 | case never executed: QEvent::Move:case QEvent::Move:never executed: case QEvent::Move: | 0 | ||||||||||||||||||||||||||||||||||||
| 5810 | moveEvent((QMoveEvent*)event); | - | ||||||||||||||||||||||||||||||||||||
| 5811 | d->updateWidgetTransform(event); | - | ||||||||||||||||||||||||||||||||||||
| 5812 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5813 | - | |||||||||||||||||||||||||||||||||||||
| 5814 | case never executed: QEvent::Resize:case QEvent::Resize:never executed: case QEvent::Resize: | 0 | ||||||||||||||||||||||||||||||||||||
| 5815 | resizeEvent((QResizeEvent*)event); | - | ||||||||||||||||||||||||||||||||||||
| 5816 | d->updateWidgetTransform(event); | - | ||||||||||||||||||||||||||||||||||||
| 5817 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5818 | - | |||||||||||||||||||||||||||||||||||||
| 5819 | case never executed: QEvent::Close:case QEvent::Close:never executed: case QEvent::Close: | 0 | ||||||||||||||||||||||||||||||||||||
| 5820 | closeEvent((QCloseEvent *)event); | - | ||||||||||||||||||||||||||||||||||||
| 5821 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5822 | - | |||||||||||||||||||||||||||||||||||||
| 5823 | - | |||||||||||||||||||||||||||||||||||||
| 5824 | case never executed: QEvent::ContextMenu:case QEvent::ContextMenu:never executed: case QEvent::ContextMenu: | 0 | ||||||||||||||||||||||||||||||||||||
| 5825 | switch (data->context_menu_policy) { | - | ||||||||||||||||||||||||||||||||||||
| 5826 | case never executed: Qt::PreventContextMenu:case Qt::PreventContextMenu:never executed: case Qt::PreventContextMenu: | 0 | ||||||||||||||||||||||||||||||||||||
| 5827 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5828 | case never executed: Qt::DefaultContextMenu:case Qt::DefaultContextMenu:never executed: case Qt::DefaultContextMenu: | 0 | ||||||||||||||||||||||||||||||||||||
| 5829 | contextMenuEvent(static_cast<QContextMenuEvent *>(event)); | - | ||||||||||||||||||||||||||||||||||||
| 5830 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5831 | case never executed: Qt::CustomContextMenu:case Qt::CustomContextMenu:never executed: case Qt::CustomContextMenu: | 0 | ||||||||||||||||||||||||||||||||||||
| 5832 | customContextMenuRequested(static_cast<QContextMenuEvent *>(event)->pos()); | - | ||||||||||||||||||||||||||||||||||||
| 5833 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5834 | - | |||||||||||||||||||||||||||||||||||||
| 5835 | case never executed: Qt::ActionsContextMenu:case Qt::ActionsContextMenu:never executed: case Qt::ActionsContextMenu: | 0 | ||||||||||||||||||||||||||||||||||||
| 5836 | if (d->actions.count()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5837 | QMenu::exec(d->actions, static_cast<QContextMenuEvent *>(event)->globalPos(), | - | ||||||||||||||||||||||||||||||||||||
| 5838 | 0, this); | - | ||||||||||||||||||||||||||||||||||||
| 5839 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5840 | } | - | ||||||||||||||||||||||||||||||||||||
| 5841 | - | |||||||||||||||||||||||||||||||||||||
| 5842 | - | |||||||||||||||||||||||||||||||||||||
| 5843 | default never executed: :default:never executed: default:code before this statement never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
| 5844 | event->ignore(); | - | ||||||||||||||||||||||||||||||||||||
| 5845 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5846 | } | - | ||||||||||||||||||||||||||||||||||||
| 5847 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5848 | - | |||||||||||||||||||||||||||||||||||||
| 5849 | - | |||||||||||||||||||||||||||||||||||||
| 5850 | - | |||||||||||||||||||||||||||||||||||||
| 5851 | case never executed: QEvent::Drop:case QEvent::Drop:never executed: case QEvent::Drop: | 0 | ||||||||||||||||||||||||||||||||||||
| 5852 | dropEvent((QDropEvent*) event); | - | ||||||||||||||||||||||||||||||||||||
| 5853 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5854 | - | |||||||||||||||||||||||||||||||||||||
| 5855 | case never executed: QEvent::DragEnter:case QEvent::DragEnter:never executed: case QEvent::DragEnter: | 0 | ||||||||||||||||||||||||||||||||||||
| 5856 | dragEnterEvent((QDragEnterEvent*) event); | - | ||||||||||||||||||||||||||||||||||||
| 5857 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5858 | - | |||||||||||||||||||||||||||||||||||||
| 5859 | case never executed: QEvent::DragMove:case QEvent::DragMove:never executed: case QEvent::DragMove: | 0 | ||||||||||||||||||||||||||||||||||||
| 5860 | dragMoveEvent((QDragMoveEvent*) event); | - | ||||||||||||||||||||||||||||||||||||
| 5861 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5862 | - | |||||||||||||||||||||||||||||||||||||
| 5863 | case never executed: QEvent::DragLeave:case QEvent::DragLeave:never executed: case QEvent::DragLeave: | 0 | ||||||||||||||||||||||||||||||||||||
| 5864 | dragLeaveEvent((QDragLeaveEvent*) event); | - | ||||||||||||||||||||||||||||||||||||
| 5865 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5866 | - | |||||||||||||||||||||||||||||||||||||
| 5867 | - | |||||||||||||||||||||||||||||||||||||
| 5868 | case never executed: QEvent::Show:case QEvent::Show:never executed: case QEvent::Show: | 0 | ||||||||||||||||||||||||||||||||||||
| 5869 | showEvent((QShowEvent*) event); | - | ||||||||||||||||||||||||||||||||||||
| 5870 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5871 | - | |||||||||||||||||||||||||||||||||||||
| 5872 | case never executed: QEvent::Hide:case QEvent::Hide:never executed: case QEvent::Hide: | 0 | ||||||||||||||||||||||||||||||||||||
| 5873 | hideEvent((QHideEvent*) event); | - | ||||||||||||||||||||||||||||||||||||
| 5874 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5875 | - | |||||||||||||||||||||||||||||||||||||
| 5876 | case never executed: QEvent::ShowWindowRequest:case QEvent::ShowWindowRequest:never executed: case QEvent::ShowWindowRequest: | 0 | ||||||||||||||||||||||||||||||||||||
| 5877 | if (!isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5878 | d->show_sys(); never executed: d->show_sys(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5879 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5880 | - | |||||||||||||||||||||||||||||||||||||
| 5881 | case never executed: QEvent::ApplicationFontChange:case QEvent::ApplicationFontChange:never executed: case QEvent::ApplicationFontChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5882 | d->resolveFont(); | - | ||||||||||||||||||||||||||||||||||||
| 5883 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5884 | case never executed: QEvent::ApplicationPaletteChange:case QEvent::ApplicationPaletteChange:never executed: case QEvent::ApplicationPaletteChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5885 | if (!(windowType() == Qt::Desktop)
| 0 | ||||||||||||||||||||||||||||||||||||
| 5886 | d->resolvePalette(); never executed: d->resolvePalette(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5887 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5888 | - | |||||||||||||||||||||||||||||||||||||
| 5889 | case never executed: QEvent::ToolBarChange:case QEvent::ToolBarChange:never executed: case QEvent::ToolBarChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5890 | case never executed: QEvent::ActivationChange:case QEvent::ActivationChange:never executed: case QEvent::ActivationChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5891 | case never executed: QEvent::EnabledChange:case QEvent::EnabledChange:never executed: case QEvent::EnabledChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5892 | case never executed: QEvent::FontChange:case QEvent::FontChange:never executed: case QEvent::FontChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5893 | case never executed: QEvent::StyleChange:case QEvent::StyleChange:never executed: case QEvent::StyleChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5894 | case never executed: QEvent::PaletteChange:case QEvent::PaletteChange:never executed: case QEvent::PaletteChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5895 | case never executed: QEvent::WindowTitleChange:case QEvent::WindowTitleChange:never executed: case QEvent::WindowTitleChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5896 | case never executed: QEvent::IconTextChange:case QEvent::IconTextChange:never executed: case QEvent::IconTextChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5897 | case never executed: QEvent::ModifiedChange:case QEvent::ModifiedChange:never executed: case QEvent::ModifiedChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5898 | case never executed: QEvent::MouseTrackingChange:case QEvent::MouseTrackingChange:never executed: case QEvent::MouseTrackingChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5899 | case never executed: QEvent::ParentChange:case QEvent::ParentChange:never executed: case QEvent::ParentChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5900 | case never executed: QEvent::LocaleChange:case QEvent::LocaleChange:never executed: case QEvent::LocaleChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5901 | case never executed: QEvent::MacSizeChange:case QEvent::MacSizeChange:never executed: case QEvent::MacSizeChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5902 | case never executed: QEvent::ContentsRectChange:case QEvent::ContentsRectChange:never executed: case QEvent::ContentsRectChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5903 | case never executed: QEvent::ThemeChange:case QEvent::ThemeChange:never executed: case QEvent::ThemeChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5904 | case never executed: QEvent::ReadOnlyChange:case QEvent::ReadOnlyChange:never executed: case QEvent::ReadOnlyChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5905 | changeEvent(event); | - | ||||||||||||||||||||||||||||||||||||
| 5906 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5907 | - | |||||||||||||||||||||||||||||||||||||
| 5908 | case never executed: QEvent::WindowStateChange:case QEvent::WindowStateChange:never executed: {case QEvent::WindowStateChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5909 | const bool wasMinimized = static_cast<const QWindowStateChangeEvent *>(event)->oldState() & Qt::WindowMinimized; | - | ||||||||||||||||||||||||||||||||||||
| 5910 | if (wasMinimized != isMinimized()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5911 | QWidget *widget = const_cast<QWidget *>(this); | - | ||||||||||||||||||||||||||||||||||||
| 5912 | if (wasMinimized
| 0 | ||||||||||||||||||||||||||||||||||||
| 5913 | - | |||||||||||||||||||||||||||||||||||||
| 5914 | if (!d->childrenShownByExpose
| 0 | ||||||||||||||||||||||||||||||||||||
| 5915 | - | |||||||||||||||||||||||||||||||||||||
| 5916 | d->showChildren(true); | - | ||||||||||||||||||||||||||||||||||||
| 5917 | QShowEvent showEvent; | - | ||||||||||||||||||||||||||||||||||||
| 5918 | QCoreApplication::sendSpontaneousEvent(widget, &showEvent); | - | ||||||||||||||||||||||||||||||||||||
| 5919 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5920 | d->childrenHiddenByWState = false; | - | ||||||||||||||||||||||||||||||||||||
| 5921 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5922 | QHideEvent hideEvent; | - | ||||||||||||||||||||||||||||||||||||
| 5923 | QCoreApplication::sendSpontaneousEvent(widget, &hideEvent); | - | ||||||||||||||||||||||||||||||||||||
| 5924 | d->hideChildren(true); | - | ||||||||||||||||||||||||||||||||||||
| 5925 | d->childrenHiddenByWState = true; | - | ||||||||||||||||||||||||||||||||||||
| 5926 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5927 | d->childrenShownByExpose = false; | - | ||||||||||||||||||||||||||||||||||||
| 5928 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5929 | changeEvent(event); | - | ||||||||||||||||||||||||||||||||||||
| 5930 | } | - | ||||||||||||||||||||||||||||||||||||
| 5931 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5932 | - | |||||||||||||||||||||||||||||||||||||
| 5933 | case never executed: QEvent::WindowActivate:case QEvent::WindowActivate:never executed: case QEvent::WindowActivate: | 0 | ||||||||||||||||||||||||||||||||||||
| 5934 | case never executed: QEvent::WindowDeactivate:case QEvent::WindowDeactivate:never executed: {case QEvent::WindowDeactivate: | 0 | ||||||||||||||||||||||||||||||||||||
| 5935 | if (isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5936 | update(); never executed: update(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5937 | QList<QObject*> childList = d->children; | - | ||||||||||||||||||||||||||||||||||||
| 5938 | for (int i = 0; i < childList.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5939 | QWidget *w = qobject_cast<QWidget *>(childList.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 5940 | if (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 5941 | QApplication::sendEvent(w, event); never executed: QApplication::sendEvent(w, event); | 0 | ||||||||||||||||||||||||||||||||||||
| 5942 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5943 | break; never executed: }break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5944 | - | |||||||||||||||||||||||||||||||||||||
| 5945 | case never executed: QEvent::LanguageChange:case QEvent::LanguageChange:never executed: case QEvent::LanguageChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5946 | changeEvent(event); | - | ||||||||||||||||||||||||||||||||||||
| 5947 | { | - | ||||||||||||||||||||||||||||||||||||
| 5948 | QList<QObject*> childList = d->children; | - | ||||||||||||||||||||||||||||||||||||
| 5949 | for (int i = 0; i < childList.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5950 | QObject *o = childList.at(i); | - | ||||||||||||||||||||||||||||||||||||
| 5951 | if (o
| 0 | ||||||||||||||||||||||||||||||||||||
| 5952 | QApplication::sendEvent(o, event); never executed: QApplication::sendEvent(o, event); | 0 | ||||||||||||||||||||||||||||||||||||
| 5953 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5954 | } | - | ||||||||||||||||||||||||||||||||||||
| 5955 | update(); | - | ||||||||||||||||||||||||||||||||||||
| 5956 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5957 | - | |||||||||||||||||||||||||||||||||||||
| 5958 | case never executed: QEvent::ApplicationLayoutDirectionChange:case QEvent::ApplicationLayoutDirectionChange:never executed: case QEvent::ApplicationLayoutDirectionChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5959 | d->resolveLayoutDirection(); | - | ||||||||||||||||||||||||||||||||||||
| 5960 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5961 | - | |||||||||||||||||||||||||||||||||||||
| 5962 | case never executed: QEvent::LayoutDirectionChange:case QEvent::LayoutDirectionChange:never executed: case QEvent::LayoutDirectionChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 5963 | if (d->layout
| 0 | ||||||||||||||||||||||||||||||||||||
| 5964 | d->layout->invalidate(); never executed: d->layout->invalidate(); | 0 | ||||||||||||||||||||||||||||||||||||
| 5965 | update(); | - | ||||||||||||||||||||||||||||||||||||
| 5966 | changeEvent(event); | - | ||||||||||||||||||||||||||||||||||||
| 5967 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5968 | case never executed: QEvent::UpdateRequest:case QEvent::UpdateRequest:never executed: case QEvent::UpdateRequest: | 0 | ||||||||||||||||||||||||||||||||||||
| 5969 | d->syncBackingStore(); | - | ||||||||||||||||||||||||||||||||||||
| 5970 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5971 | case never executed: QEvent::UpdateLater:case QEvent::UpdateLater:never executed: case QEvent::UpdateLater: | 0 | ||||||||||||||||||||||||||||||||||||
| 5972 | update(static_cast<QUpdateLaterEvent*>(event)->region()); | - | ||||||||||||||||||||||||||||||||||||
| 5973 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5974 | case never executed: QEvent::StyleAnimationUpdate:case QEvent::StyleAnimationUpdate:never executed: case QEvent::StyleAnimationUpdate: | 0 | ||||||||||||||||||||||||||||||||||||
| 5975 | if (isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5976 | event->accept(); | - | ||||||||||||||||||||||||||||||||||||
| 5977 | update(); | - | ||||||||||||||||||||||||||||||||||||
| 5978 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5979 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5980 | - | |||||||||||||||||||||||||||||||||||||
| 5981 | case never executed: QEvent::WindowBlocked:case QEvent::WindowBlocked:never executed: case QEvent::WindowBlocked: | 0 | ||||||||||||||||||||||||||||||||||||
| 5982 | case never executed: QEvent::WindowUnblocked:case QEvent::WindowUnblocked:never executed: case QEvent::WindowUnblocked: | 0 | ||||||||||||||||||||||||||||||||||||
| 5983 | if (!d->children.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5984 | QWidget *modalWidget = QApplication::activeModalWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 5985 | for (int i = 0; i < d->children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5986 | QObject *o = d->children.at(i); | - | ||||||||||||||||||||||||||||||||||||
| 5987 | if (o
| 0 | ||||||||||||||||||||||||||||||||||||
| 5988 | QWidget *w = static_cast<QWidget *>(o); | - | ||||||||||||||||||||||||||||||||||||
| 5989 | - | |||||||||||||||||||||||||||||||||||||
| 5990 | if (!w->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 5991 | QApplication::sendEvent(w, event); never executed: QApplication::sendEvent(w, event); | 0 | ||||||||||||||||||||||||||||||||||||
| 5992 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5993 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5994 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 5995 | - | |||||||||||||||||||||||||||||||||||||
| 5996 | - | |||||||||||||||||||||||||||||||||||||
| 5997 | - | |||||||||||||||||||||||||||||||||||||
| 5998 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 5999 | - | |||||||||||||||||||||||||||||||||||||
| 6000 | case never executed: QEvent::ToolTip:case QEvent::ToolTip:never executed: case QEvent::ToolTip: | 0 | ||||||||||||||||||||||||||||||||||||
| 6001 | if (!d->toolTip.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6002 | QToolTip::showText(static_cast<QHelpEvent*>(event)->globalPos(), d->toolTip, this, QRect(), d->toolTipDuration); never executed: QToolTip::showText(static_cast<QHelpEvent*>(event)->globalPos(), d->toolTip, this, QRect(), d->toolTipDuration); | 0 | ||||||||||||||||||||||||||||||||||||
| 6003 | else | - | ||||||||||||||||||||||||||||||||||||
| 6004 | event->ignore(); never executed: event->ignore(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6005 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 6006 | - | |||||||||||||||||||||||||||||||||||||
| 6007 | - | |||||||||||||||||||||||||||||||||||||
| 6008 | case never executed: QEvent::WhatsThis:case QEvent::WhatsThis:never executed: case QEvent::WhatsThis: | 0 | ||||||||||||||||||||||||||||||||||||
| 6009 | if (d->whatsThis.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6010 | QWhatsThis::showText(static_cast<QHelpEvent *>(event)->globalPos(), d->whatsThis, this); never executed: QWhatsThis::showText(static_cast<QHelpEvent *>(event)->globalPos(), d->whatsThis, this); | 0 | ||||||||||||||||||||||||||||||||||||
| 6011 | else | - | ||||||||||||||||||||||||||||||||||||
| 6012 | event->ignore(); never executed: event->ignore(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6013 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 6014 | case never executed: QEvent::QueryWhatsThis:case QEvent::QueryWhatsThis:never executed: case QEvent::QueryWhatsThis: | 0 | ||||||||||||||||||||||||||||||||||||
| 6015 | if (d->whatsThis.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6016 | event->ignore(); never executed: event->ignore(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6017 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 6018 | - | |||||||||||||||||||||||||||||||||||||
| 6019 | case never executed: QEvent::EmbeddingControl:case QEvent::EmbeddingControl:never executed: case QEvent::EmbeddingControl: | 0 | ||||||||||||||||||||||||||||||||||||
| 6020 | d->topData()->frameStrut.setCoords(0 ,0, 0, 0); | - | ||||||||||||||||||||||||||||||||||||
| 6021 | data->fstrut_dirty = false; | - | ||||||||||||||||||||||||||||||||||||
| 6022 | - | |||||||||||||||||||||||||||||||||||||
| 6023 | - | |||||||||||||||||||||||||||||||||||||
| 6024 | - | |||||||||||||||||||||||||||||||||||||
| 6025 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 6026 | - | |||||||||||||||||||||||||||||||||||||
| 6027 | case never executed: QEvent::ActionAdded:case QEvent::ActionAdded:never executed: case QEvent::ActionAdded: | 0 | ||||||||||||||||||||||||||||||||||||
| 6028 | case never executed: QEvent::ActionRemoved:case QEvent::ActionRemoved:never executed: case QEvent::ActionRemoved: | 0 | ||||||||||||||||||||||||||||||||||||
| 6029 | case never executed: QEvent::ActionChanged:case QEvent::ActionChanged:never executed: case QEvent::ActionChanged: | 0 | ||||||||||||||||||||||||||||||||||||
| 6030 | actionEvent((QActionEvent*)event); | - | ||||||||||||||||||||||||||||||||||||
| 6031 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 6032 | - | |||||||||||||||||||||||||||||||||||||
| 6033 | - | |||||||||||||||||||||||||||||||||||||
| 6034 | case never executed: QEvent::KeyboardLayoutChange:case QEvent::KeyboardLayoutChange:never executed: case QEvent::KeyboardLayoutChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 6035 | { | - | ||||||||||||||||||||||||||||||||||||
| 6036 | changeEvent(event); | - | ||||||||||||||||||||||||||||||||||||
| 6037 | - | |||||||||||||||||||||||||||||||||||||
| 6038 | - | |||||||||||||||||||||||||||||||||||||
| 6039 | QList<QObject*> childList = d->children; | - | ||||||||||||||||||||||||||||||||||||
| 6040 | for (int i = 0; i < childList.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6041 | QWidget *w = qobject_cast<QWidget *>(childList.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 6042 | if (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 6043 | QApplication::sendEvent(w, event); never executed: QApplication::sendEvent(w, event); | 0 | ||||||||||||||||||||||||||||||||||||
| 6044 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6045 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 6046 | } | - | ||||||||||||||||||||||||||||||||||||
| 6047 | - | |||||||||||||||||||||||||||||||||||||
| 6048 | - | |||||||||||||||||||||||||||||||||||||
| 6049 | - | |||||||||||||||||||||||||||||||||||||
| 6050 | - | |||||||||||||||||||||||||||||||||||||
| 6051 | - | |||||||||||||||||||||||||||||||||||||
| 6052 | case never executed: QEvent::TouchBegin:case QEvent::TouchBegin:never executed: case QEvent::TouchBegin: | 0 | ||||||||||||||||||||||||||||||||||||
| 6053 | case never executed: QEvent::TouchUpdate:case QEvent::TouchUpdate:never executed: case QEvent::TouchUpdate: | 0 | ||||||||||||||||||||||||||||||||||||
| 6054 | case never executed: QEvent::TouchEnd:case QEvent::TouchEnd:never executed: case QEvent::TouchEnd: | 0 | ||||||||||||||||||||||||||||||||||||
| 6055 | case never executed: QEvent::TouchCancel:case QEvent::TouchCancel:never executed: case QEvent::TouchCancel: | 0 | ||||||||||||||||||||||||||||||||||||
| 6056 | { | - | ||||||||||||||||||||||||||||||||||||
| 6057 | event->ignore(); | - | ||||||||||||||||||||||||||||||||||||
| 6058 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 6059 | } | - | ||||||||||||||||||||||||||||||||||||
| 6060 | - | |||||||||||||||||||||||||||||||||||||
| 6061 | case never executed: QEvent::Gesture:case QEvent::Gesture:never executed: case QEvent::Gesture: | 0 | ||||||||||||||||||||||||||||||||||||
| 6062 | event->ignore(); | - | ||||||||||||||||||||||||||||||||||||
| 6063 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 6064 | - | |||||||||||||||||||||||||||||||||||||
| 6065 | case never executed: QEvent::ScreenChangeInternal:case QEvent::ScreenChangeInternal:never executed: case QEvent::ScreenChangeInternal: | 0 | ||||||||||||||||||||||||||||||||||||
| 6066 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||
| 6067 | const QWindow *win = te->window; | - | ||||||||||||||||||||||||||||||||||||
| 6068 | d->setWinId((win && win->handle()) ? win->handle()->winId() : 0); | - | ||||||||||||||||||||||||||||||||||||
| 6069 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6070 | - | |||||||||||||||||||||||||||||||||||||
| 6071 | d->renderToTextureReallyDirty = 1; | - | ||||||||||||||||||||||||||||||||||||
| 6072 | - | |||||||||||||||||||||||||||||||||||||
| 6073 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 6074 | - | |||||||||||||||||||||||||||||||||||||
| 6075 | case never executed: QEvent::DynamicPropertyChange:case QEvent::DynamicPropertyChange:never executed: {case QEvent::DynamicPropertyChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 6076 | const QByteArray &propName = static_cast<QDynamicPropertyChangeEvent *>(event)->propertyName(); | - | ||||||||||||||||||||||||||||||||||||
| 6077 | if (propName.length() == 13
| 0 | ||||||||||||||||||||||||||||||||||||
| 6078 | uint value = property(propName.constData()).toUInt(); | - | ||||||||||||||||||||||||||||||||||||
| 6079 | if (!d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 6080 | d->createExtra(); never executed: d->createExtra(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6081 | const char axis = propName.at(12); | - | ||||||||||||||||||||||||||||||||||||
| 6082 | if (axis == 'X'
| 0 | ||||||||||||||||||||||||||||||||||||
| 6083 | d->extra->customDpiX = value; never executed: d->extra->customDpiX = value; | 0 | ||||||||||||||||||||||||||||||||||||
| 6084 | else if (axis == 'Y'
| 0 | ||||||||||||||||||||||||||||||||||||
| 6085 | d->extra->customDpiY = value; never executed: d->extra->customDpiY = value; | 0 | ||||||||||||||||||||||||||||||||||||
| 6086 | d->updateFont(d->data.fnt); | - | ||||||||||||||||||||||||||||||||||||
| 6087 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6088 | if (windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6089 | windowHandle()->setProperty(propName, property(propName)); never executed: windowHandle()->setProperty(propName, property(propName)); | 0 | ||||||||||||||||||||||||||||||||||||
| 6090 | - | |||||||||||||||||||||||||||||||||||||
| 6091 | } | - | ||||||||||||||||||||||||||||||||||||
| 6092 | - | |||||||||||||||||||||||||||||||||||||
| 6093 | default never executed: :default:never executed: default:code before this statement never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
| 6094 | return never executed: QObject::event(event);return QObject::event(event);never executed: return QObject::event(event); | 0 | ||||||||||||||||||||||||||||||||||||
| 6095 | } | - | ||||||||||||||||||||||||||||||||||||
| 6096 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||
| 6097 | } | - | ||||||||||||||||||||||||||||||||||||
| 6098 | void QWidget::changeEvent(QEvent * event) | - | ||||||||||||||||||||||||||||||||||||
| 6099 | { | - | ||||||||||||||||||||||||||||||||||||
| 6100 | switch(event->type()) { | - | ||||||||||||||||||||||||||||||||||||
| 6101 | case never executed: QEvent::EnabledChange:case QEvent::EnabledChange:never executed: {case QEvent::EnabledChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 6102 | update(); | - | ||||||||||||||||||||||||||||||||||||
| 6103 | - | |||||||||||||||||||||||||||||||||||||
| 6104 | QAccessible::State s; | - | ||||||||||||||||||||||||||||||||||||
| 6105 | s.disabled = true; | - | ||||||||||||||||||||||||||||||||||||
| 6106 | QAccessibleStateChangeEvent event(this, s); | - | ||||||||||||||||||||||||||||||||||||
| 6107 | QAccessible::updateAccessibility(&event); | - | ||||||||||||||||||||||||||||||||||||
| 6108 | - | |||||||||||||||||||||||||||||||||||||
| 6109 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 6110 | } | - | ||||||||||||||||||||||||||||||||||||
| 6111 | - | |||||||||||||||||||||||||||||||||||||
| 6112 | case never executed: QEvent::FontChange:case QEvent::FontChange:never executed: case QEvent::FontChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 6113 | case never executed: QEvent::StyleChange:case QEvent::StyleChange:never executed: {case QEvent::StyleChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 6114 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6115 | update(); | - | ||||||||||||||||||||||||||||||||||||
| 6116 | updateGeometry(); | - | ||||||||||||||||||||||||||||||||||||
| 6117 | if (d->layout
| 0 | ||||||||||||||||||||||||||||||||||||
| 6118 | d->layout->invalidate(); never executed: d->layout->invalidate(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6119 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 6120 | } | - | ||||||||||||||||||||||||||||||||||||
| 6121 | - | |||||||||||||||||||||||||||||||||||||
| 6122 | case never executed: QEvent::PaletteChange:case QEvent::PaletteChange:never executed: case QEvent::PaletteChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 6123 | update(); | - | ||||||||||||||||||||||||||||||||||||
| 6124 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 6125 | - | |||||||||||||||||||||||||||||||||||||
| 6126 | case never executed: QEvent::ThemeChange:case QEvent::ThemeChange:never executed: case QEvent::ThemeChange: | 0 | ||||||||||||||||||||||||||||||||||||
| 6127 | if (QApplication::desktopSettingsAware()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6128 | && (static_cast<
| 0 | ||||||||||||||||||||||||||||||||||||
| 6129 | if (testAttribute(Qt::WA_WState_Polished)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6130 | QApplication::style()->unpolish(this); never executed: QApplication::style()->unpolish(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 6131 | if (testAttribute(Qt::WA_WState_Polished)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6132 | QApplication::style()->polish(this); never executed: QApplication::style()->polish(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 6133 | QEvent styleChangedEvent(QEvent::StyleChange); | - | ||||||||||||||||||||||||||||||||||||
| 6134 | QCoreApplication::sendEvent(this, &styleChangedEvent); | - | ||||||||||||||||||||||||||||||||||||
| 6135 | if (isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6136 | update(); never executed: update(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6137 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6138 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 6139 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
| 6140 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 6141 | } | - | ||||||||||||||||||||||||||||||||||||
| 6142 | } | - | ||||||||||||||||||||||||||||||||||||
| 6143 | void QWidget::mouseMoveEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 6144 | { | - | ||||||||||||||||||||||||||||||||||||
| 6145 | event->ignore(); | - | ||||||||||||||||||||||||||||||||||||
| 6146 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6147 | void QWidget::mousePressEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 6148 | { | - | ||||||||||||||||||||||||||||||||||||
| 6149 | event->ignore(); | - | ||||||||||||||||||||||||||||||||||||
| 6150 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 6151 | event->accept(); | - | ||||||||||||||||||||||||||||||||||||
| 6152 | QWidget* w; | - | ||||||||||||||||||||||||||||||||||||
| 6153 | while ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 6154 | w->close(); | - | ||||||||||||||||||||||||||||||||||||
| 6155 | if (QApplication::activePopupWidget() == w
| 0 | ||||||||||||||||||||||||||||||||||||
| 6156 | w->hide(); never executed: w->hide(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6157 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6158 | if (!rect().contains(event->pos())
| 0 | ||||||||||||||||||||||||||||||||||||
| 6159 | close(); | - | ||||||||||||||||||||||||||||||||||||
| 6160 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6161 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6162 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6163 | void QWidget::mouseReleaseEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 6164 | { | - | ||||||||||||||||||||||||||||||||||||
| 6165 | event->ignore(); | - | ||||||||||||||||||||||||||||||||||||
| 6166 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6167 | void QWidget::mouseDoubleClickEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 6168 | { | - | ||||||||||||||||||||||||||||||||||||
| 6169 | mousePressEvent(event); | - | ||||||||||||||||||||||||||||||||||||
| 6170 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6171 | void QWidget::wheelEvent(QWheelEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 6172 | { | - | ||||||||||||||||||||||||||||||||||||
| 6173 | event->ignore(); | - | ||||||||||||||||||||||||||||||||||||
| 6174 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6175 | void QWidget::tabletEvent(QTabletEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 6176 | { | - | ||||||||||||||||||||||||||||||||||||
| 6177 | event->ignore(); | - | ||||||||||||||||||||||||||||||||||||
| 6178 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6179 | void QWidget::keyPressEvent(QKeyEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 6180 | { | - | ||||||||||||||||||||||||||||||||||||
| 6181 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 6182 | event->accept(); | - | ||||||||||||||||||||||||||||||||||||
| 6183 | close(); | - | ||||||||||||||||||||||||||||||||||||
| 6184 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6185 | event->ignore(); | - | ||||||||||||||||||||||||||||||||||||
| 6186 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6187 | } | - | ||||||||||||||||||||||||||||||||||||
| 6188 | void QWidget::keyReleaseEvent(QKeyEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 6189 | { | - | ||||||||||||||||||||||||||||||||||||
| 6190 | event->ignore(); | - | ||||||||||||||||||||||||||||||||||||
| 6191 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6192 | void QWidget::focusInEvent(QFocusEvent *) | - | ||||||||||||||||||||||||||||||||||||
| 6193 | { | - | ||||||||||||||||||||||||||||||||||||
| 6194 | if (focusPolicy() != Qt::NoFocus
| 0 | ||||||||||||||||||||||||||||||||||||
| 6195 | update(); | - | ||||||||||||||||||||||||||||||||||||
| 6196 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6197 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6198 | void QWidget::focusOutEvent(QFocusEvent *) | - | ||||||||||||||||||||||||||||||||||||
| 6199 | { | - | ||||||||||||||||||||||||||||||||||||
| 6200 | if (focusPolicy() != Qt::NoFocus
| 0 | ||||||||||||||||||||||||||||||||||||
| 6201 | update(); never executed: update(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6202 | - | |||||||||||||||||||||||||||||||||||||
| 6203 | - | |||||||||||||||||||||||||||||||||||||
| 6204 | - | |||||||||||||||||||||||||||||||||||||
| 6205 | if ((static_cast<
| 0 | ||||||||||||||||||||||||||||||||||||
| 6206 | QGuiApplication::inputMethod()->hide(); never executed: QGuiApplication::inputMethod()->hide(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6207 | - | |||||||||||||||||||||||||||||||||||||
| 6208 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6209 | void QWidget::enterEvent(QEvent *) | - | ||||||||||||||||||||||||||||||||||||
| 6210 | { | - | ||||||||||||||||||||||||||||||||||||
| 6211 | } | - | ||||||||||||||||||||||||||||||||||||
| 6212 | void QWidget::leaveEvent(QEvent *) | - | ||||||||||||||||||||||||||||||||||||
| 6213 | { | - | ||||||||||||||||||||||||||||||||||||
| 6214 | } | - | ||||||||||||||||||||||||||||||||||||
| 6215 | void QWidget::paintEvent(QPaintEvent *) | - | ||||||||||||||||||||||||||||||||||||
| 6216 | { | - | ||||||||||||||||||||||||||||||||||||
| 6217 | } | - | ||||||||||||||||||||||||||||||||||||
| 6218 | void QWidget::moveEvent(QMoveEvent *) | - | ||||||||||||||||||||||||||||||||||||
| 6219 | { | - | ||||||||||||||||||||||||||||||||||||
| 6220 | } | - | ||||||||||||||||||||||||||||||||||||
| 6221 | void QWidget::resizeEvent(QResizeEvent * ) | - | ||||||||||||||||||||||||||||||||||||
| 6222 | { | - | ||||||||||||||||||||||||||||||||||||
| 6223 | } | - | ||||||||||||||||||||||||||||||||||||
| 6224 | void QWidget::actionEvent(QActionEvent *) | - | ||||||||||||||||||||||||||||||||||||
| 6225 | { | - | ||||||||||||||||||||||||||||||||||||
| 6226 | - | |||||||||||||||||||||||||||||||||||||
| 6227 | } | - | ||||||||||||||||||||||||||||||||||||
| 6228 | void QWidget::closeEvent(QCloseEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 6229 | { | - | ||||||||||||||||||||||||||||||||||||
| 6230 | event->accept(); | - | ||||||||||||||||||||||||||||||||||||
| 6231 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6232 | void QWidget::contextMenuEvent(QContextMenuEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 6233 | { | - | ||||||||||||||||||||||||||||||||||||
| 6234 | event->ignore(); | - | ||||||||||||||||||||||||||||||||||||
| 6235 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6236 | void QWidget::inputMethodEvent(QInputMethodEvent *event) | - | ||||||||||||||||||||||||||||||||||||
| 6237 | { | - | ||||||||||||||||||||||||||||||||||||
| 6238 | event->ignore(); | - | ||||||||||||||||||||||||||||||||||||
| 6239 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6240 | QVariant QWidget::inputMethodQuery(Qt::InputMethodQuery query) const | - | ||||||||||||||||||||||||||||||||||||
| 6241 | { | - | ||||||||||||||||||||||||||||||||||||
| 6242 | switch(query) { | - | ||||||||||||||||||||||||||||||||||||
| 6243 | case never executed: Qt::ImCursorRectangle:case Qt::ImCursorRectangle:never executed: case Qt::ImCursorRectangle: | 0 | ||||||||||||||||||||||||||||||||||||
| 6244 | return never executed: QRect(width()/2, 0, 1, height());return QRect(width()/2, 0, 1, height());never executed: return QRect(width()/2, 0, 1, height()); | 0 | ||||||||||||||||||||||||||||||||||||
| 6245 | case never executed: Qt::ImFont:case Qt::ImFont:never executed: case Qt::ImFont: | 0 | ||||||||||||||||||||||||||||||||||||
| 6246 | return never executed: font();return font();never executed: return font(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6247 | case never executed: Qt::ImAnchorPosition:case Qt::ImAnchorPosition:never executed: case Qt::ImAnchorPosition: | 0 | ||||||||||||||||||||||||||||||||||||
| 6248 | - | |||||||||||||||||||||||||||||||||||||
| 6249 | return never executed: inputMethodQuery(Qt::ImCursorPosition);return inputMethodQuery(Qt::ImCursorPosition);never executed: return inputMethodQuery(Qt::ImCursorPosition); | 0 | ||||||||||||||||||||||||||||||||||||
| 6250 | case never executed: Qt::ImHints:case Qt::ImHints:never executed: case Qt::ImHints: | 0 | ||||||||||||||||||||||||||||||||||||
| 6251 | return never executed: (int)inputMethodHints();return (int)inputMethodHints();never executed: return (int)inputMethodHints(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6252 | case never executed: Qt::ImInputItemClipRectangle:case Qt::ImInputItemClipRectangle:never executed: case Qt::ImInputItemClipRectangle: | 0 | ||||||||||||||||||||||||||||||||||||
| 6253 | return never executed: d_func()->clipRect();return d_func()->clipRect();never executed: return d_func()->clipRect(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6254 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
| 6255 | return never executed: QVariant();return QVariant();never executed: return QVariant(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6256 | } | - | ||||||||||||||||||||||||||||||||||||
| 6257 | } | - | ||||||||||||||||||||||||||||||||||||
| 6258 | Qt::InputMethodHints QWidget::inputMethodHints() const | - | ||||||||||||||||||||||||||||||||||||
| 6259 | { | - | ||||||||||||||||||||||||||||||||||||
| 6260 | - | |||||||||||||||||||||||||||||||||||||
| 6261 | const QWidgetPrivate *priv = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6262 | while (priv->inheritsInputMethodHints
| 0 | ||||||||||||||||||||||||||||||||||||
| 6263 | priv = priv->q_func()->parentWidget()->d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6264 | ((!(priv)) ? qt_assert("priv",__FILE__,9832) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 6265 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6266 | return never executed: priv->imHints;return priv->imHints;never executed: return priv->imHints; | 0 | ||||||||||||||||||||||||||||||||||||
| 6267 | - | |||||||||||||||||||||||||||||||||||||
| 6268 | - | |||||||||||||||||||||||||||||||||||||
| 6269 | - | |||||||||||||||||||||||||||||||||||||
| 6270 | } | - | ||||||||||||||||||||||||||||||||||||
| 6271 | - | |||||||||||||||||||||||||||||||||||||
| 6272 | void QWidget::setInputMethodHints(Qt::InputMethodHints hints) | - | ||||||||||||||||||||||||||||||||||||
| 6273 | { | - | ||||||||||||||||||||||||||||||||||||
| 6274 | - | |||||||||||||||||||||||||||||||||||||
| 6275 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6276 | if (d->imHints == hints
| 0 | ||||||||||||||||||||||||||||||||||||
| 6277 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6278 | d->imHints = hints; | - | ||||||||||||||||||||||||||||||||||||
| 6279 | if (this == QGuiApplication::focusObject()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6280 | QGuiApplication::inputMethod()->update(Qt::ImHints); never executed: QGuiApplication::inputMethod()->update(Qt::ImHints); | 0 | ||||||||||||||||||||||||||||||||||||
| 6281 | - | |||||||||||||||||||||||||||||||||||||
| 6282 | - | |||||||||||||||||||||||||||||||||||||
| 6283 | - | |||||||||||||||||||||||||||||||||||||
| 6284 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6285 | void QWidget::dragEnterEvent(QDragEnterEvent *) | - | ||||||||||||||||||||||||||||||||||||
| 6286 | { | - | ||||||||||||||||||||||||||||||||||||
| 6287 | } | - | ||||||||||||||||||||||||||||||||||||
| 6288 | void QWidget::dragMoveEvent(QDragMoveEvent *) | - | ||||||||||||||||||||||||||||||||||||
| 6289 | { | - | ||||||||||||||||||||||||||||||||||||
| 6290 | } | - | ||||||||||||||||||||||||||||||||||||
| 6291 | void QWidget::dragLeaveEvent(QDragLeaveEvent *) | - | ||||||||||||||||||||||||||||||||||||
| 6292 | { | - | ||||||||||||||||||||||||||||||||||||
| 6293 | } | - | ||||||||||||||||||||||||||||||||||||
| 6294 | void QWidget::dropEvent(QDropEvent *) | - | ||||||||||||||||||||||||||||||||||||
| 6295 | { | - | ||||||||||||||||||||||||||||||||||||
| 6296 | } | - | ||||||||||||||||||||||||||||||||||||
| 6297 | void QWidget::showEvent(QShowEvent *) | - | ||||||||||||||||||||||||||||||||||||
| 6298 | { | - | ||||||||||||||||||||||||||||||||||||
| 6299 | } | - | ||||||||||||||||||||||||||||||||||||
| 6300 | void QWidget::hideEvent(QHideEvent *) | - | ||||||||||||||||||||||||||||||||||||
| 6301 | { | - | ||||||||||||||||||||||||||||||||||||
| 6302 | } | - | ||||||||||||||||||||||||||||||||||||
| 6303 | bool QWidget::nativeEvent(const QByteArray &eventType, void *message, long *result) | - | ||||||||||||||||||||||||||||||||||||
| 6304 | { | - | ||||||||||||||||||||||||||||||||||||
| 6305 | (void)eventType;; | - | ||||||||||||||||||||||||||||||||||||
| 6306 | (void)message;; | - | ||||||||||||||||||||||||||||||||||||
| 6307 | (void)result;; | - | ||||||||||||||||||||||||||||||||||||
| 6308 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||
| 6309 | } | - | ||||||||||||||||||||||||||||||||||||
| 6310 | void QWidget::ensurePolished() const | - | ||||||||||||||||||||||||||||||||||||
| 6311 | { | - | ||||||||||||||||||||||||||||||||||||
| 6312 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6313 | - | |||||||||||||||||||||||||||||||||||||
| 6314 | const QMetaObject *m = metaObject(); | - | ||||||||||||||||||||||||||||||||||||
| 6315 | if (m == d->polished
| 0 | ||||||||||||||||||||||||||||||||||||
| 6316 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6317 | d->polished = m; | - | ||||||||||||||||||||||||||||||||||||
| 6318 | - | |||||||||||||||||||||||||||||||||||||
| 6319 | QEvent e(QEvent::Polish); | - | ||||||||||||||||||||||||||||||||||||
| 6320 | QCoreApplication::sendEvent(const_cast<QWidget *>(this), &e); | - | ||||||||||||||||||||||||||||||||||||
| 6321 | - | |||||||||||||||||||||||||||||||||||||
| 6322 | - | |||||||||||||||||||||||||||||||||||||
| 6323 | QList<QObject*> children = d->children; | - | ||||||||||||||||||||||||||||||||||||
| 6324 | for (int i = 0; i < children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6325 | QObject *o = children.at(i); | - | ||||||||||||||||||||||||||||||||||||
| 6326 | if(!o->isWidgetType()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6327 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 6328 | if (QWidget *w = qobject_cast<QWidget *>(o)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6329 | w->ensurePolished(); never executed: w->ensurePolished(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6330 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6331 | - | |||||||||||||||||||||||||||||||||||||
| 6332 | if (d->parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 6333 | QChildEvent e(QEvent::ChildPolished, const_cast<QWidget *>(this)); | - | ||||||||||||||||||||||||||||||||||||
| 6334 | QCoreApplication::sendEvent(d->parent, &e); | - | ||||||||||||||||||||||||||||||||||||
| 6335 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6336 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6337 | - | |||||||||||||||||||||||||||||||||||||
| 6338 | - | |||||||||||||||||||||||||||||||||||||
| 6339 | - | |||||||||||||||||||||||||||||||||||||
| 6340 | - | |||||||||||||||||||||||||||||||||||||
| 6341 | - | |||||||||||||||||||||||||||||||||||||
| 6342 | - | |||||||||||||||||||||||||||||||||||||
| 6343 | - | |||||||||||||||||||||||||||||||||||||
| 6344 | QRegion QWidget::mask() const | - | ||||||||||||||||||||||||||||||||||||
| 6345 | { | - | ||||||||||||||||||||||||||||||||||||
| 6346 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6347 | return never executed: d->extra ? d->extra->mask : QRegion();return d->extra ? d->extra->mask : QRegion();never executed: return d->extra ? d->extra->mask : QRegion(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6348 | } | - | ||||||||||||||||||||||||||||||||||||
| 6349 | QLayout *QWidget::layout() const | - | ||||||||||||||||||||||||||||||||||||
| 6350 | { | - | ||||||||||||||||||||||||||||||||||||
| 6351 | return never executed: d_func()->layout;return d_func()->layout;never executed: return d_func()->layout; | 0 | ||||||||||||||||||||||||||||||||||||
| 6352 | } | - | ||||||||||||||||||||||||||||||||||||
| 6353 | void QWidget::setLayout(QLayout *l) | - | ||||||||||||||||||||||||||||||||||||
| 6354 | { | - | ||||||||||||||||||||||||||||||||||||
| 6355 | if (__builtin_expect(!!(!l), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6356 | QMessageLogger(__FILE__, 10107, __PRETTY_FUNCTION__).warning("QWidget::setLayout: Cannot set layout to 0"); | - | ||||||||||||||||||||||||||||||||||||
| 6357 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6358 | } | - | ||||||||||||||||||||||||||||||||||||
| 6359 | if (layout()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6360 | if (__builtin_expect(!!(layout() != l), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6361 | QMessageLogger(__FILE__, 10112, __PRETTY_FUNCTION__).warning("QWidget::setLayout: Attempting to set QLayout \"%s\" on %s \"%s\", which already has a" never executed: QMessageLogger(__FILE__, 10112, __PRETTY_FUNCTION__).warning("QWidget::setLayout: Attempting to set QLayout \"%s\" on %s \"%s\", which already has a" " layout", l->objectName().toLocal8Bit().data(), metaObject()->className(), objectName().toLocal8Bit().data()); | 0 | ||||||||||||||||||||||||||||||||||||
| 6362 | " layout", l->objectName().toLocal8Bit().data(), metaObject()->className(), never executed: QMessageLogger(__FILE__, 10112, __PRETTY_FUNCTION__).warning("QWidget::setLayout: Attempting to set QLayout \"%s\" on %s \"%s\", which already has a" " layout", l->objectName().toLocal8Bit().data(), metaObject()->className(), objectName().toLocal8Bit().data()); | 0 | ||||||||||||||||||||||||||||||||||||
| 6363 | objectName().toLocal8Bit().data()); never executed: QMessageLogger(__FILE__, 10112, __PRETTY_FUNCTION__).warning("QWidget::setLayout: Attempting to set QLayout \"%s\" on %s \"%s\", which already has a" " layout", l->objectName().toLocal8Bit().data(), metaObject()->className(), objectName().toLocal8Bit().data()); | 0 | ||||||||||||||||||||||||||||||||||||
| 6364 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6365 | } | - | ||||||||||||||||||||||||||||||||||||
| 6366 | - | |||||||||||||||||||||||||||||||||||||
| 6367 | QObject *oldParent = l->parent(); | - | ||||||||||||||||||||||||||||||||||||
| 6368 | if (oldParent
| 0 | ||||||||||||||||||||||||||||||||||||
| 6369 | if (oldParent->isWidgetType()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6370 | - | |||||||||||||||||||||||||||||||||||||
| 6371 | - | |||||||||||||||||||||||||||||||||||||
| 6372 | QWidget *oldParentWidget = static_cast<QWidget *>(oldParent); | - | ||||||||||||||||||||||||||||||||||||
| 6373 | oldParentWidget->takeLayout(); | - | ||||||||||||||||||||||||||||||||||||
| 6374 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6375 | QMessageLogger(__FILE__, 10126, __PRETTY_FUNCTION__).warning("QWidget::setLayout: Attempting to set QLayout \"%s\" on %s \"%s\", when the QLayout already has a parent", | - | ||||||||||||||||||||||||||||||||||||
| 6376 | l->objectName().toLocal8Bit().data(), metaObject()->className(), | - | ||||||||||||||||||||||||||||||||||||
| 6377 | objectName().toLocal8Bit().data()); | - | ||||||||||||||||||||||||||||||||||||
| 6378 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6379 | } | - | ||||||||||||||||||||||||||||||||||||
| 6380 | } | - | ||||||||||||||||||||||||||||||||||||
| 6381 | - | |||||||||||||||||||||||||||||||||||||
| 6382 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6383 | l->d_func()->topLevel = true; | - | ||||||||||||||||||||||||||||||||||||
| 6384 | d->layout = l; | - | ||||||||||||||||||||||||||||||||||||
| 6385 | if (oldParent != this
| 0 | ||||||||||||||||||||||||||||||||||||
| 6386 | l->setParent(this); | - | ||||||||||||||||||||||||||||||||||||
| 6387 | l->d_func()->reparentChildWidgets(this); | - | ||||||||||||||||||||||||||||||||||||
| 6388 | l->invalidate(); | - | ||||||||||||||||||||||||||||||||||||
| 6389 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6390 | - | |||||||||||||||||||||||||||||||||||||
| 6391 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6392 | d->topData()->sizeAdjusted = false; never executed: d->topData()->sizeAdjusted = false; | 0 | ||||||||||||||||||||||||||||||||||||
| 6393 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6394 | QLayout *QWidget::takeLayout() | - | ||||||||||||||||||||||||||||||||||||
| 6395 | { | - | ||||||||||||||||||||||||||||||||||||
| 6396 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6397 | QLayout *l = layout(); | - | ||||||||||||||||||||||||||||||||||||
| 6398 | if (!l
| 0 | ||||||||||||||||||||||||||||||||||||
| 6399 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 6400 | d->layout = 0; | - | ||||||||||||||||||||||||||||||||||||
| 6401 | l->setParent(0); | - | ||||||||||||||||||||||||||||||||||||
| 6402 | return never executed: l;return l;never executed: return l; | 0 | ||||||||||||||||||||||||||||||||||||
| 6403 | } | - | ||||||||||||||||||||||||||||||||||||
| 6404 | QSizePolicy QWidget::sizePolicy() const | - | ||||||||||||||||||||||||||||||||||||
| 6405 | { | - | ||||||||||||||||||||||||||||||||||||
| 6406 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6407 | return never executed: d->size_policy;return d->size_policy;never executed: return d->size_policy; | 0 | ||||||||||||||||||||||||||||||||||||
| 6408 | } | - | ||||||||||||||||||||||||||||||||||||
| 6409 | - | |||||||||||||||||||||||||||||||||||||
| 6410 | void QWidget::setSizePolicy(QSizePolicy policy) | - | ||||||||||||||||||||||||||||||||||||
| 6411 | { | - | ||||||||||||||||||||||||||||||||||||
| 6412 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6413 | setAttribute(Qt::WA_WState_OwnSizePolicy); | - | ||||||||||||||||||||||||||||||||||||
| 6414 | if (policy == d->size_policy
| 0 | ||||||||||||||||||||||||||||||||||||
| 6415 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6416 | - | |||||||||||||||||||||||||||||||||||||
| 6417 | if (d->size_policy.retainSizeWhenHidden() != policy.retainSizeWhenHidden()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6418 | d->retainSizeWhenHiddenChanged = 1; never executed: d->retainSizeWhenHiddenChanged = 1; | 0 | ||||||||||||||||||||||||||||||||||||
| 6419 | - | |||||||||||||||||||||||||||||||||||||
| 6420 | d->size_policy = policy; | - | ||||||||||||||||||||||||||||||||||||
| 6421 | - | |||||||||||||||||||||||||||||||||||||
| 6422 | - | |||||||||||||||||||||||||||||||||||||
| 6423 | if (QWExtra *extra = d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 6424 | if (extra->proxyWidget
| 0 | ||||||||||||||||||||||||||||||||||||
| 6425 | extra->proxyWidget->setSizePolicy(policy); never executed: extra->proxyWidget->setSizePolicy(policy); | 0 | ||||||||||||||||||||||||||||||||||||
| 6426 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6427 | - | |||||||||||||||||||||||||||||||||||||
| 6428 | - | |||||||||||||||||||||||||||||||||||||
| 6429 | updateGeometry(); | - | ||||||||||||||||||||||||||||||||||||
| 6430 | d->retainSizeWhenHiddenChanged = 0; | - | ||||||||||||||||||||||||||||||||||||
| 6431 | - | |||||||||||||||||||||||||||||||||||||
| 6432 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6433 | d->topData()->sizeAdjusted = false; never executed: d->topData()->sizeAdjusted = false; | 0 | ||||||||||||||||||||||||||||||||||||
| 6434 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6435 | int QWidget::heightForWidth(int w) const | - | ||||||||||||||||||||||||||||||||||||
| 6436 | { | - | ||||||||||||||||||||||||||||||||||||
| 6437 | if (layout()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6438 | return never executed: layout()->totalHeightForWidth(w);return layout()->totalHeightForWidth(w);never executed: return layout()->totalHeightForWidth(w); | 0 | ||||||||||||||||||||||||||||||||||||
| 6439 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||||||||||||||
| 6440 | } | - | ||||||||||||||||||||||||||||||||||||
| 6441 | - | |||||||||||||||||||||||||||||||||||||
| 6442 | - | |||||||||||||||||||||||||||||||||||||
| 6443 | - | |||||||||||||||||||||||||||||||||||||
| 6444 | - | |||||||||||||||||||||||||||||||||||||
| 6445 | - | |||||||||||||||||||||||||||||||||||||
| 6446 | - | |||||||||||||||||||||||||||||||||||||
| 6447 | - | |||||||||||||||||||||||||||||||||||||
| 6448 | bool QWidget::hasHeightForWidth() const | - | ||||||||||||||||||||||||||||||||||||
| 6449 | { | - | ||||||||||||||||||||||||||||||||||||
| 6450 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6451 | return never executed: d->layout ? d->layout->hasHeightForWidth() : d->size_policy.hasHeightForWidth();return d->layout ? d->layout->hasHeightForWidth() : d->size_policy.hasHeightForWidth();never executed: return d->layout ? d->layout->hasHeightForWidth() : d->size_policy.hasHeightForWidth(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6452 | } | - | ||||||||||||||||||||||||||||||||||||
| 6453 | QWidget *QWidget::childAt(const QPoint &p) const | - | ||||||||||||||||||||||||||||||||||||
| 6454 | { | - | ||||||||||||||||||||||||||||||||||||
| 6455 | return never executed: d_func()->childAt_helper(p, false);return d_func()->childAt_helper(p, false);never executed: return d_func()->childAt_helper(p, false); | 0 | ||||||||||||||||||||||||||||||||||||
| 6456 | } | - | ||||||||||||||||||||||||||||||||||||
| 6457 | - | |||||||||||||||||||||||||||||||||||||
| 6458 | QWidget *QWidgetPrivate::childAt_helper(const QPoint &p, bool ignoreChildrenInDestructor) const | - | ||||||||||||||||||||||||||||||||||||
| 6459 | { | - | ||||||||||||||||||||||||||||||||||||
| 6460 | if (children.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6461 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 6462 | - | |||||||||||||||||||||||||||||||||||||
| 6463 | if (!pointInsideRectAndMask(p)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6464 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 6465 | return never executed: childAtRecursiveHelper(p, ignoreChildrenInDestructor);return childAtRecursiveHelper(p, ignoreChildrenInDestructor);never executed: return childAtRecursiveHelper(p, ignoreChildrenInDestructor); | 0 | ||||||||||||||||||||||||||||||||||||
| 6466 | } | - | ||||||||||||||||||||||||||||||||||||
| 6467 | - | |||||||||||||||||||||||||||||||||||||
| 6468 | QWidget *QWidgetPrivate::childAtRecursiveHelper(const QPoint &p, bool ignoreChildrenInDestructor) const | - | ||||||||||||||||||||||||||||||||||||
| 6469 | { | - | ||||||||||||||||||||||||||||||||||||
| 6470 | for (int i = children.size() - 1; i >= 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 6471 | QWidget *child = qobject_cast<QWidget *>(children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 6472 | if (!child
| 0 | ||||||||||||||||||||||||||||||||||||
| 6473 | || (ignoreChildrenInDestructor
| 0 | ||||||||||||||||||||||||||||||||||||
| 6474 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 6475 | } | - | ||||||||||||||||||||||||||||||||||||
| 6476 | - | |||||||||||||||||||||||||||||||||||||
| 6477 | - | |||||||||||||||||||||||||||||||||||||
| 6478 | QPoint childPoint = p; | - | ||||||||||||||||||||||||||||||||||||
| 6479 | childPoint -= child->data->crect.topLeft(); | - | ||||||||||||||||||||||||||||||||||||
| 6480 | - | |||||||||||||||||||||||||||||||||||||
| 6481 | - | |||||||||||||||||||||||||||||||||||||
| 6482 | if (!child->d_func()->pointInsideRectAndMask(childPoint)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6483 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 6484 | - | |||||||||||||||||||||||||||||||||||||
| 6485 | - | |||||||||||||||||||||||||||||||||||||
| 6486 | if (QWidget *w = child->d_func()->childAtRecursiveHelper(childPoint, ignoreChildrenInDestructor)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6487 | return never executed: w;return w;never executed: return w; | 0 | ||||||||||||||||||||||||||||||||||||
| 6488 | - | |||||||||||||||||||||||||||||||||||||
| 6489 | - | |||||||||||||||||||||||||||||||||||||
| 6490 | return never executed: child;return child;never executed: return child; | 0 | ||||||||||||||||||||||||||||||||||||
| 6491 | } | - | ||||||||||||||||||||||||||||||||||||
| 6492 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 6493 | } | - | ||||||||||||||||||||||||||||||||||||
| 6494 | - | |||||||||||||||||||||||||||||||||||||
| 6495 | void QWidgetPrivate::updateGeometry_helper(bool forceUpdate) | - | ||||||||||||||||||||||||||||||||||||
| 6496 | { | - | ||||||||||||||||||||||||||||||||||||
| 6497 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6498 | if (widgetItem
| 0 | ||||||||||||||||||||||||||||||||||||
| 6499 | widgetItem->invalidateSizeCache(); never executed: widgetItem->invalidateSizeCache(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6500 | QWidget *parent; | - | ||||||||||||||||||||||||||||||||||||
| 6501 | if (forceUpdate
| 0 | ||||||||||||||||||||||||||||||||||||
| 6502 | const int isHidden = q->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6503 | - | |||||||||||||||||||||||||||||||||||||
| 6504 | if (!q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6505 | if (parent->d_func()->layout
| 0 | ||||||||||||||||||||||||||||||||||||
| 6506 | parent->d_func()->layout->invalidate(); never executed: parent->d_func()->layout->invalidate(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6507 | else if (parent->isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6508 | QApplication::postEvent(parent, new QEvent(QEvent::LayoutRequest)); never executed: QApplication::postEvent(parent, new QEvent(QEvent::LayoutRequest)); | 0 | ||||||||||||||||||||||||||||||||||||
| 6509 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6510 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6511 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6512 | void QWidget::updateGeometry() | - | ||||||||||||||||||||||||||||||||||||
| 6513 | { | - | ||||||||||||||||||||||||||||||||||||
| 6514 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6515 | d->updateGeometry_helper(false); | - | ||||||||||||||||||||||||||||||||||||
| 6516 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6517 | void QWidget::setWindowFlags(Qt::WindowFlags flags) | - | ||||||||||||||||||||||||||||||||||||
| 6518 | { | - | ||||||||||||||||||||||||||||||||||||
| 6519 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6520 | d->setWindowFlags(flags); | - | ||||||||||||||||||||||||||||||||||||
| 6521 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6522 | - | |||||||||||||||||||||||||||||||||||||
| 6523 | - | |||||||||||||||||||||||||||||||||||||
| 6524 | - | |||||||||||||||||||||||||||||||||||||
| 6525 | - | |||||||||||||||||||||||||||||||||||||
| 6526 | - | |||||||||||||||||||||||||||||||||||||
| 6527 | void QWidgetPrivate::setWindowFlags(Qt::WindowFlags flags) | - | ||||||||||||||||||||||||||||||||||||
| 6528 | { | - | ||||||||||||||||||||||||||||||||||||
| 6529 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6530 | if (q->data->window_flags == flags
| 0 | ||||||||||||||||||||||||||||||||||||
| 6531 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6532 | - | |||||||||||||||||||||||||||||||||||||
| 6533 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 6534 | - | |||||||||||||||||||||||||||||||||||||
| 6535 | QPoint oldPos = q->pos(); | - | ||||||||||||||||||||||||||||||||||||
| 6536 | bool visible = q->isVisible(); | - | ||||||||||||||||||||||||||||||||||||
| 6537 | const bool windowFlagChanged = (q->data->window_flags ^ flags) & Qt::Window; | - | ||||||||||||||||||||||||||||||||||||
| 6538 | q->setParent(q->parentWidget(), flags); | - | ||||||||||||||||||||||||||||||||||||
| 6539 | - | |||||||||||||||||||||||||||||||||||||
| 6540 | - | |||||||||||||||||||||||||||||||||||||
| 6541 | - | |||||||||||||||||||||||||||||||||||||
| 6542 | if (!windowFlagChanged
| 0 | ||||||||||||||||||||||||||||||||||||
| 6543 | q->move(oldPos); never executed: q->move(oldPos); | 0 | ||||||||||||||||||||||||||||||||||||
| 6544 | - | |||||||||||||||||||||||||||||||||||||
| 6545 | adjustQuitOnCloseAttribute(); | - | ||||||||||||||||||||||||||||||||||||
| 6546 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6547 | q->data->window_flags = flags; | - | ||||||||||||||||||||||||||||||||||||
| 6548 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6549 | } | - | ||||||||||||||||||||||||||||||||||||
| 6550 | void QWidget::overrideWindowFlags(Qt::WindowFlags flags) | - | ||||||||||||||||||||||||||||||||||||
| 6551 | { | - | ||||||||||||||||||||||||||||||||||||
| 6552 | data->window_flags = flags; | - | ||||||||||||||||||||||||||||||||||||
| 6553 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6554 | void QWidget::setParent(QWidget *parent) | - | ||||||||||||||||||||||||||||||||||||
| 6555 | { | - | ||||||||||||||||||||||||||||||||||||
| 6556 | if (parent == parentWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6557 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6558 | setParent((QWidget*)parent, windowFlags() & ~Qt::WindowType_Mask); | - | ||||||||||||||||||||||||||||||||||||
| 6559 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6560 | - | |||||||||||||||||||||||||||||||||||||
| 6561 | - | |||||||||||||||||||||||||||||||||||||
| 6562 | static void sendWindowChangeToTextureChildrenRecursively(QWidget *widget) | - | ||||||||||||||||||||||||||||||||||||
| 6563 | { | - | ||||||||||||||||||||||||||||||||||||
| 6564 | QWidgetPrivate *d = QWidgetPrivate::get(widget); | - | ||||||||||||||||||||||||||||||||||||
| 6565 | if (d->renderToTexture
| 0 | ||||||||||||||||||||||||||||||||||||
| 6566 | QEvent e(QEvent::WindowChangeInternal); | - | ||||||||||||||||||||||||||||||||||||
| 6567 | QApplication::sendEvent(widget, &e); | - | ||||||||||||||||||||||||||||||||||||
| 6568 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6569 | - | |||||||||||||||||||||||||||||||||||||
| 6570 | for (int i = 0; i < d->children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6571 | QWidget *w = qobject_cast<QWidget *>(d->children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 6572 | if (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 6573 | sendWindowChangeToTextureChildrenRecursively(w); never executed: sendWindowChangeToTextureChildrenRecursively(w); | 0 | ||||||||||||||||||||||||||||||||||||
| 6574 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6575 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6576 | void QWidget::setParent(QWidget *parent, Qt::WindowFlags f) | - | ||||||||||||||||||||||||||||||||||||
| 6577 | { | - | ||||||||||||||||||||||||||||||||||||
| 6578 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6579 | bool resized = testAttribute(Qt::WA_Resized); | - | ||||||||||||||||||||||||||||||||||||
| 6580 | bool wasCreated = testAttribute(Qt::WA_WState_Created); | - | ||||||||||||||||||||||||||||||||||||
| 6581 | QWidget *oldtlw = window(); | - | ||||||||||||||||||||||||||||||||||||
| 6582 | - | |||||||||||||||||||||||||||||||||||||
| 6583 | if (f & Qt::Window
| 0 | ||||||||||||||||||||||||||||||||||||
| 6584 | d->data.fstrut_dirty = true; never executed: d->data.fstrut_dirty = true; | 0 | ||||||||||||||||||||||||||||||||||||
| 6585 | - | |||||||||||||||||||||||||||||||||||||
| 6586 | QWidget *desktopWidget = 0; | - | ||||||||||||||||||||||||||||||||||||
| 6587 | if (parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 6588 | desktopWidget = parent; never executed: desktopWidget = parent; | 0 | ||||||||||||||||||||||||||||||||||||
| 6589 | bool newParent = (
| 0 | ||||||||||||||||||||||||||||||||||||
| 6590 | - | |||||||||||||||||||||||||||||||||||||
| 6591 | if (newParent
| 0 | ||||||||||||||||||||||||||||||||||||
| 6592 | if (testAttribute(Qt::WA_NativeWindow)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6593 | parent->d_func()->enforceNativeChildren(); never executed: parent->d_func()->enforceNativeChildren(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6594 | else if (parent->d_func()->nativeChildrenForced()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6595 | setAttribute(Qt::WA_NativeWindow); never executed: setAttribute(Qt::WA_NativeWindow); | 0 | ||||||||||||||||||||||||||||||||||||
| 6596 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6597 | - | |||||||||||||||||||||||||||||||||||||
| 6598 | if (wasCreated
| 0 | ||||||||||||||||||||||||||||||||||||
| 6599 | if (!testAttribute(Qt::WA_WState_Hidden)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6600 | hide(); | - | ||||||||||||||||||||||||||||||||||||
| 6601 | setAttribute(Qt::WA_WState_ExplicitShowHide, false); | - | ||||||||||||||||||||||||||||||||||||
| 6602 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6603 | if (newParent
| 0 | ||||||||||||||||||||||||||||||||||||
| 6604 | QEvent e(QEvent::ParentAboutToChange); | - | ||||||||||||||||||||||||||||||||||||
| 6605 | QApplication::sendEvent(this, &e); | - | ||||||||||||||||||||||||||||||||||||
| 6606 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6607 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6608 | if (newParent
| 0 | ||||||||||||||||||||||||||||||||||||
| 6609 | focusWidget()->clearFocus(); never executed: focusWidget()->clearFocus(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6610 | - | |||||||||||||||||||||||||||||||||||||
| 6611 | QTLWExtra *oldTopExtra = window()->d_func()->maybeTopData(); | - | ||||||||||||||||||||||||||||||||||||
| 6612 | QWidgetBackingStoreTracker *oldBsTracker = oldTopExtra
| 0 | ||||||||||||||||||||||||||||||||||||
| 6613 | - | |||||||||||||||||||||||||||||||||||||
| 6614 | d->setParent_sys(parent, f); | - | ||||||||||||||||||||||||||||||||||||
| 6615 | - | |||||||||||||||||||||||||||||||||||||
| 6616 | QTLWExtra *topExtra = window()->d_func()->maybeTopData(); | - | ||||||||||||||||||||||||||||||||||||
| 6617 | QWidgetBackingStoreTracker *bsTracker = topExtra
| 0 | ||||||||||||||||||||||||||||||||||||
| 6618 | if (oldBsTracker
| 0 | ||||||||||||||||||||||||||||||||||||
| 6619 | oldBsTracker->unregisterWidgetSubtree(this); never executed: oldBsTracker->unregisterWidgetSubtree(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 6620 | - | |||||||||||||||||||||||||||||||||||||
| 6621 | if (desktopWidget
| 0 | ||||||||||||||||||||||||||||||||||||
| 6622 | parent = 0; never executed: parent = 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 6623 | - | |||||||||||||||||||||||||||||||||||||
| 6624 | - | |||||||||||||||||||||||||||||||||||||
| 6625 | if (d->textureChildSeen
| 0 | ||||||||||||||||||||||||||||||||||||
| 6626 | - | |||||||||||||||||||||||||||||||||||||
| 6627 | QWidgetPrivate::get(parent)->setTextureChildSeen(); | - | ||||||||||||||||||||||||||||||||||||
| 6628 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6629 | - | |||||||||||||||||||||||||||||||||||||
| 6630 | - | |||||||||||||||||||||||||||||||||||||
| 6631 | if (QWidgetBackingStore *oldBs = oldtlw->d_func()->maybeBackingStore()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6632 | if (newParent
| 0 | ||||||||||||||||||||||||||||||||||||
| 6633 | oldBs->removeDirtyWidget(this); never executed: oldBs->removeDirtyWidget(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 6634 | - | |||||||||||||||||||||||||||||||||||||
| 6635 | - | |||||||||||||||||||||||||||||||||||||
| 6636 | oldBs->moveStaticWidgets(this); | - | ||||||||||||||||||||||||||||||||||||
| 6637 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6638 | - | |||||||||||||||||||||||||||||||||||||
| 6639 | - | |||||||||||||||||||||||||||||||||||||
| 6640 | if (QApplicationPrivate::testAttribute(Qt::AA_ImmediateWidgetCreation)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6641 | create(); never executed: create(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6642 | - | |||||||||||||||||||||||||||||||||||||
| 6643 | d->reparentFocusWidgets(oldtlw); | - | ||||||||||||||||||||||||||||||||||||
| 6644 | setAttribute(Qt::WA_Resized, resized); | - | ||||||||||||||||||||||||||||||||||||
| 6645 | - | |||||||||||||||||||||||||||||||||||||
| 6646 | const bool useStyleSheetPropagationInWidgetStyles = | - | ||||||||||||||||||||||||||||||||||||
| 6647 | QCoreApplication::testAttribute(Qt::AA_UseStyleSheetPropagationInWidgetStyles); | - | ||||||||||||||||||||||||||||||||||||
| 6648 | - | |||||||||||||||||||||||||||||||||||||
| 6649 | if (!useStyleSheetPropagationInWidgetStyles
| 0 | ||||||||||||||||||||||||||||||||||||
| 6650 | && (!parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 6651 | d->resolveFont(); | - | ||||||||||||||||||||||||||||||||||||
| 6652 | d->resolvePalette(); | - | ||||||||||||||||||||||||||||||||||||
| 6653 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6654 | d->resolveLayoutDirection(); | - | ||||||||||||||||||||||||||||||||||||
| 6655 | d->resolveLocale(); | - | ||||||||||||||||||||||||||||||||||||
| 6656 | - | |||||||||||||||||||||||||||||||||||||
| 6657 | - | |||||||||||||||||||||||||||||||||||||
| 6658 | - | |||||||||||||||||||||||||||||||||||||
| 6659 | - | |||||||||||||||||||||||||||||||||||||
| 6660 | - | |||||||||||||||||||||||||||||||||||||
| 6661 | if (newParent
| 0 | ||||||||||||||||||||||||||||||||||||
| 6662 | - | |||||||||||||||||||||||||||||||||||||
| 6663 | - | |||||||||||||||||||||||||||||||||||||
| 6664 | - | |||||||||||||||||||||||||||||||||||||
| 6665 | ) { | - | ||||||||||||||||||||||||||||||||||||
| 6666 | - | |||||||||||||||||||||||||||||||||||||
| 6667 | if (!isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6668 | if (!testAttribute(Qt::WA_ForceDisabled)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6669 | d->setEnabled_helper(parent ? parent->isEnabled() : true); never executed: d->setEnabled_helper(parent ? parent->isEnabled() : true); | 0 | ||||||||||||||||||||||||||||||||||||
| 6670 | if (!testAttribute(Qt::WA_ForceUpdatesDisabled)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6671 | d->setUpdatesEnabled_helper(parent ? parent->updatesEnabled() : true); never executed: d->setUpdatesEnabled_helper(parent ? parent->updatesEnabled() : true); | 0 | ||||||||||||||||||||||||||||||||||||
| 6672 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6673 | d->inheritStyle(); | - | ||||||||||||||||||||||||||||||||||||
| 6674 | - | |||||||||||||||||||||||||||||||||||||
| 6675 | - | |||||||||||||||||||||||||||||||||||||
| 6676 | if (parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 6677 | QChildEvent e(QEvent::ChildAdded, this); | - | ||||||||||||||||||||||||||||||||||||
| 6678 | QApplication::sendEvent(parent, &e); | - | ||||||||||||||||||||||||||||||||||||
| 6679 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6680 | if (parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 6681 | QChildEvent e(QEvent::ChildPolished, this); | - | ||||||||||||||||||||||||||||||||||||
| 6682 | QCoreApplication::sendEvent(parent, &e); | - | ||||||||||||||||||||||||||||||||||||
| 6683 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6684 | - | |||||||||||||||||||||||||||||||||||||
| 6685 | QEvent e(QEvent::ParentChange); | - | ||||||||||||||||||||||||||||||||||||
| 6686 | QApplication::sendEvent(this, &e); | - | ||||||||||||||||||||||||||||||||||||
| 6687 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6688 | - | |||||||||||||||||||||||||||||||||||||
| 6689 | - | |||||||||||||||||||||||||||||||||||||
| 6690 | if (d->textureChildSeen
| 0 | ||||||||||||||||||||||||||||||||||||
| 6691 | sendWindowChangeToTextureChildrenRecursively(this); | - | ||||||||||||||||||||||||||||||||||||
| 6692 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6693 | - | |||||||||||||||||||||||||||||||||||||
| 6694 | - | |||||||||||||||||||||||||||||||||||||
| 6695 | if (!wasCreated
| 0 | ||||||||||||||||||||||||||||||||||||
| 6696 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6697 | setAttribute(Qt::WA_WState_Hidden, true); never executed: setAttribute(Qt::WA_WState_Hidden, true); | 0 | ||||||||||||||||||||||||||||||||||||
| 6698 | else if (!testAttribute(Qt::WA_WState_ExplicitShowHide)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6699 | setAttribute(Qt::WA_WState_Hidden, false); never executed: setAttribute(Qt::WA_WState_Hidden, false); | 0 | ||||||||||||||||||||||||||||||||||||
| 6700 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6701 | - | |||||||||||||||||||||||||||||||||||||
| 6702 | d->updateIsOpaque(); | - | ||||||||||||||||||||||||||||||||||||
| 6703 | - | |||||||||||||||||||||||||||||||||||||
| 6704 | - | |||||||||||||||||||||||||||||||||||||
| 6705 | - | |||||||||||||||||||||||||||||||||||||
| 6706 | - | |||||||||||||||||||||||||||||||||||||
| 6707 | if (oldtlw->graphicsProxyWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6708 | if (QGraphicsProxyWidget *ancestorProxy = d->nearestGraphicsProxyWidget(oldtlw)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6709 | ancestorProxy->d_func()->unembedSubWindow(this); never executed: ancestorProxy->d_func()->unembedSubWindow(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 6710 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6711 | if (isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6712 | if (QGraphicsProxyWidget *ancestorProxy = d->nearestGraphicsProxyWidget(parent)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6713 | ancestorProxy->d_func()->embedSubWindow(this); never executed: ancestorProxy->d_func()->embedSubWindow(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 6714 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6715 | - | |||||||||||||||||||||||||||||||||||||
| 6716 | - | |||||||||||||||||||||||||||||||||||||
| 6717 | if (d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 6718 | QWindowContainer::parentWasChanged(this); never executed: QWindowContainer::parentWasChanged(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 6719 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6720 | - | |||||||||||||||||||||||||||||||||||||
| 6721 | void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f) | - | ||||||||||||||||||||||||||||||||||||
| 6722 | { | - | ||||||||||||||||||||||||||||||||||||
| 6723 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6724 | - | |||||||||||||||||||||||||||||||||||||
| 6725 | Qt::WindowFlags oldFlags = data.window_flags; | - | ||||||||||||||||||||||||||||||||||||
| 6726 | bool wasCreated = q->testAttribute(Qt::WA_WState_Created); | - | ||||||||||||||||||||||||||||||||||||
| 6727 | - | |||||||||||||||||||||||||||||||||||||
| 6728 | int targetScreen = -1; | - | ||||||||||||||||||||||||||||||||||||
| 6729 | - | |||||||||||||||||||||||||||||||||||||
| 6730 | if (newparent
| 0 | ||||||||||||||||||||||||||||||||||||
| 6731 | - | |||||||||||||||||||||||||||||||||||||
| 6732 | - | |||||||||||||||||||||||||||||||||||||
| 6733 | const QDesktopScreenWidget *sw = qobject_cast<const QDesktopScreenWidget *>(newparent); | - | ||||||||||||||||||||||||||||||||||||
| 6734 | targetScreen = sw
| 0 | ||||||||||||||||||||||||||||||||||||
| 6735 | newparent = 0; | - | ||||||||||||||||||||||||||||||||||||
| 6736 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6737 | - | |||||||||||||||||||||||||||||||||||||
| 6738 | setWinId(0); | - | ||||||||||||||||||||||||||||||||||||
| 6739 | - | |||||||||||||||||||||||||||||||||||||
| 6740 | if (parent != newparent
| 0 | ||||||||||||||||||||||||||||||||||||
| 6741 | QObjectPrivate::setParent_helper(newparent); | - | ||||||||||||||||||||||||||||||||||||
| 6742 | if (q->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6743 | q->windowHandle()->setFlags(f); | - | ||||||||||||||||||||||||||||||||||||
| 6744 | QWidget *parentWithWindow = | - | ||||||||||||||||||||||||||||||||||||
| 6745 | newparent
| 0 | ||||||||||||||||||||||||||||||||||||
| 6746 | if (parentWithWindow
| 0 | ||||||||||||||||||||||||||||||||||||
| 6747 | QWidget *topLevel = parentWithWindow->window(); | - | ||||||||||||||||||||||||||||||||||||
| 6748 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 6749 | q->windowHandle()->setTransientParent(topLevel->windowHandle()); | - | ||||||||||||||||||||||||||||||||||||
| 6750 | q->windowHandle()->setParent(0); | - | ||||||||||||||||||||||||||||||||||||
| 6751 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6752 | q->windowHandle()->setTransientParent(0); | - | ||||||||||||||||||||||||||||||||||||
| 6753 | q->windowHandle()->setParent(parentWithWindow->windowHandle()); | - | ||||||||||||||||||||||||||||||||||||
| 6754 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6755 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 6756 | q->windowHandle()->setTransientParent(0); | - | ||||||||||||||||||||||||||||||||||||
| 6757 | q->windowHandle()->setParent(0); | - | ||||||||||||||||||||||||||||||||||||
| 6758 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6759 | } | - | ||||||||||||||||||||||||||||||||||||
| 6760 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6761 | - | |||||||||||||||||||||||||||||||||||||
| 6762 | if (!newparent
| 0 | ||||||||||||||||||||||||||||||||||||
| 6763 | f |= Qt::Window; | - | ||||||||||||||||||||||||||||||||||||
| 6764 | if (targetScreen == -1
| 0 | ||||||||||||||||||||||||||||||||||||
| 6765 | if (parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 6766 | targetScreen = QApplication::desktop()->screenNumber(q->parentWidget()->window()); never executed: targetScreen = QApplication::desktop()->screenNumber(q->parentWidget()->window()); | 0 | ||||||||||||||||||||||||||||||||||||
| 6767 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6768 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6769 | - | |||||||||||||||||||||||||||||||||||||
| 6770 | bool explicitlyHidden = q->testAttribute(Qt::WA_WState_Hidden)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6771 | - | |||||||||||||||||||||||||||||||||||||
| 6772 | - | |||||||||||||||||||||||||||||||||||||
| 6773 | if (wasCreated
| 0 | ||||||||||||||||||||||||||||||||||||
| 6774 | if (extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 6775 | QWindowContainer::toplevelAboutToBeDestroyed(q); never executed: QWindowContainer::toplevelAboutToBeDestroyed(q); | 0 | ||||||||||||||||||||||||||||||||||||
| 6776 | - | |||||||||||||||||||||||||||||||||||||
| 6777 | QWindow *newParentWindow = newparent->windowHandle(); | - | ||||||||||||||||||||||||||||||||||||
| 6778 | if (!newParentWindow
| 0 | ||||||||||||||||||||||||||||||||||||
| 6779 | if (QWidget *npw = newparent->nativeParentWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6780 | newParentWindow = npw->windowHandle(); never executed: newParentWindow = npw->windowHandle(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6781 | - | |||||||||||||||||||||||||||||||||||||
| 6782 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(q->windowHandle()->children())>::type> _container_((q->windowHandle()->children())); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QObject *child = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||||||||||||||||||||
| 6783 | QWindow *childWindow = qobject_cast<QWindow *>(child); | - | ||||||||||||||||||||||||||||||||||||
| 6784 | if (!childWindow
| 0 | ||||||||||||||||||||||||||||||||||||
| 6785 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||
| 6786 | - | |||||||||||||||||||||||||||||||||||||
| 6787 | QWidgetWindow *childWW = qobject_cast<QWidgetWindow *>(childWindow); | - | ||||||||||||||||||||||||||||||||||||
| 6788 | QWidget *childWidget = childWW
| 0 | ||||||||||||||||||||||||||||||||||||
| 6789 | if (!childWW
| 0 | ||||||||||||||||||||||||||||||||||||
| 6790 | childWindow->setParent(newParentWindow); never executed: childWindow->setParent(newParentWindow); | 0 | ||||||||||||||||||||||||||||||||||||
| 6791 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6792 | q->destroy(); | - | ||||||||||||||||||||||||||||||||||||
| 6793 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6794 | - | |||||||||||||||||||||||||||||||||||||
| 6795 | adjustFlags(f, q); | - | ||||||||||||||||||||||||||||||||||||
| 6796 | data.window_flags = f; | - | ||||||||||||||||||||||||||||||||||||
| 6797 | q->setAttribute(Qt::WA_WState_Created, false); | - | ||||||||||||||||||||||||||||||||||||
| 6798 | q->setAttribute(Qt::WA_WState_Visible, false); | - | ||||||||||||||||||||||||||||||||||||
| 6799 | q->setAttribute(Qt::WA_WState_Hidden, false); | - | ||||||||||||||||||||||||||||||||||||
| 6800 | - | |||||||||||||||||||||||||||||||||||||
| 6801 | if (newparent
| 0 | ||||||||||||||||||||||||||||||||||||
| 6802 | q->createWinId(); never executed: q->createWinId(); | 0 | ||||||||||||||||||||||||||||||||||||
| 6803 | - | |||||||||||||||||||||||||||||||||||||
| 6804 | if (q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6805 | q->setAttribute(Qt::WA_WState_Hidden); never executed: q->setAttribute(Qt::WA_WState_Hidden); | 0 | ||||||||||||||||||||||||||||||||||||
| 6806 | q->setAttribute(Qt::WA_WState_ExplicitShowHide, explicitlyHidden); | - | ||||||||||||||||||||||||||||||||||||
| 6807 | - | |||||||||||||||||||||||||||||||||||||
| 6808 | - | |||||||||||||||||||||||||||||||||||||
| 6809 | if (!newparent
| 0 | ||||||||||||||||||||||||||||||||||||
| 6810 | - | |||||||||||||||||||||||||||||||||||||
| 6811 | if (q->testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6812 | q->windowHandle()->setScreen(QGuiApplication::screens().value(targetScreen, 0)); never executed: q->windowHandle()->setScreen(QGuiApplication::screens().value(targetScreen, 0)); | 0 | ||||||||||||||||||||||||||||||||||||
| 6813 | else | - | ||||||||||||||||||||||||||||||||||||
| 6814 | topData()->initialScreenIndex = targetScreen; never executed: topData()->initialScreenIndex = targetScreen; | 0 | ||||||||||||||||||||||||||||||||||||
| 6815 | } | - | ||||||||||||||||||||||||||||||||||||
| 6816 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6817 | void QWidget::scroll(int dx, int dy) | - | ||||||||||||||||||||||||||||||||||||
| 6818 | { | - | ||||||||||||||||||||||||||||||||||||
| 6819 | if ((!updatesEnabled()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6820 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6821 | if (dx == 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 6822 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6823 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6824 | - | |||||||||||||||||||||||||||||||||||||
| 6825 | if (QGraphicsProxyWidget *proxy = QWidgetPrivate::nearestGraphicsProxyWidget(this)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6826 | - | |||||||||||||||||||||||||||||||||||||
| 6827 | - | |||||||||||||||||||||||||||||||||||||
| 6828 | - | |||||||||||||||||||||||||||||||||||||
| 6829 | if (!d->dirty.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6830 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype((d->dirty.translated(dx, dy)).rects())>::type> _container_(((d->dirty.translated(dx, dy)).rects())); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (const QRect &rect = *_container_.i; _container_.control; _container_.control = 0) | - | ||||||||||||||||||||||||||||||||||||
| 6831 | proxy->update(rect); never executed: proxy->update(rect); | 0 | ||||||||||||||||||||||||||||||||||||
| 6832 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6833 | proxy->scroll(dx, dy, proxy->subWidgetRect(this)); | - | ||||||||||||||||||||||||||||||||||||
| 6834 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6835 | } | - | ||||||||||||||||||||||||||||||||||||
| 6836 | - | |||||||||||||||||||||||||||||||||||||
| 6837 | d->setDirtyOpaqueRegion(); | - | ||||||||||||||||||||||||||||||||||||
| 6838 | d->scroll_sys(dx, dy); | - | ||||||||||||||||||||||||||||||||||||
| 6839 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6840 | - | |||||||||||||||||||||||||||||||||||||
| 6841 | void QWidgetPrivate::scroll_sys(int dx, int dy) | - | ||||||||||||||||||||||||||||||||||||
| 6842 | { | - | ||||||||||||||||||||||||||||||||||||
| 6843 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6844 | scrollChildren(dx, dy); | - | ||||||||||||||||||||||||||||||||||||
| 6845 | scrollRect(q->rect(), dx, dy); | - | ||||||||||||||||||||||||||||||||||||
| 6846 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6847 | void QWidget::scroll(int dx, int dy, const QRect &r) | - | ||||||||||||||||||||||||||||||||||||
| 6848 | { | - | ||||||||||||||||||||||||||||||||||||
| 6849 | - | |||||||||||||||||||||||||||||||||||||
| 6850 | if ((!updatesEnabled()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6851 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6852 | if (dx == 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 6853 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6854 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6855 | - | |||||||||||||||||||||||||||||||||||||
| 6856 | if (QGraphicsProxyWidget *proxy = QWidgetPrivate::nearestGraphicsProxyWidget(this)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6857 | - | |||||||||||||||||||||||||||||||||||||
| 6858 | - | |||||||||||||||||||||||||||||||||||||
| 6859 | - | |||||||||||||||||||||||||||||||||||||
| 6860 | if (!d->dirty.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6861 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype((d->dirty.translated(dx, dy) & r).rects())>::type> _container_(((d->dirty.translated(dx, dy) & r).rects())); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (const QRect &rect = *_container_.i; _container_.control; _container_.control = 0) | - | ||||||||||||||||||||||||||||||||||||
| 6862 | proxy->update(rect); never executed: proxy->update(rect); | 0 | ||||||||||||||||||||||||||||||||||||
| 6863 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6864 | proxy->scroll(dx, dy, r.translated(proxy->subWidgetRect(this).topLeft().toPoint())); | - | ||||||||||||||||||||||||||||||||||||
| 6865 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6866 | } | - | ||||||||||||||||||||||||||||||||||||
| 6867 | - | |||||||||||||||||||||||||||||||||||||
| 6868 | d->scroll_sys(dx, dy, r); | - | ||||||||||||||||||||||||||||||||||||
| 6869 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6870 | - | |||||||||||||||||||||||||||||||||||||
| 6871 | void QWidgetPrivate::scroll_sys(int dx, int dy, const QRect &r) | - | ||||||||||||||||||||||||||||||||||||
| 6872 | { | - | ||||||||||||||||||||||||||||||||||||
| 6873 | scrollRect(r, dx, dy); | - | ||||||||||||||||||||||||||||||||||||
| 6874 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6875 | void QWidget::repaint() | - | ||||||||||||||||||||||||||||||||||||
| 6876 | { | - | ||||||||||||||||||||||||||||||||||||
| 6877 | repaint(rect()); | - | ||||||||||||||||||||||||||||||||||||
| 6878 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6879 | void QWidget::repaint(int x, int y, int w, int h) | - | ||||||||||||||||||||||||||||||||||||
| 6880 | { | - | ||||||||||||||||||||||||||||||||||||
| 6881 | if (x > data->crect.width()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6882 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6883 | - | |||||||||||||||||||||||||||||||||||||
| 6884 | if (w < 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 6885 | w = data->crect.width() - x; never executed: w = data->crect.width() - x; | 0 | ||||||||||||||||||||||||||||||||||||
| 6886 | if (h < 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 6887 | h = data->crect.height() - y; never executed: h = data->crect.height() - y; | 0 | ||||||||||||||||||||||||||||||||||||
| 6888 | - | |||||||||||||||||||||||||||||||||||||
| 6889 | repaint(QRect(x, y, w, h)); | - | ||||||||||||||||||||||||||||||||||||
| 6890 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6891 | - | |||||||||||||||||||||||||||||||||||||
| 6892 | - | |||||||||||||||||||||||||||||||||||||
| 6893 | - | |||||||||||||||||||||||||||||||||||||
| 6894 | - | |||||||||||||||||||||||||||||||||||||
| 6895 | - | |||||||||||||||||||||||||||||||||||||
| 6896 | void QWidget::repaint(const QRect &rect) | - | ||||||||||||||||||||||||||||||||||||
| 6897 | { | - | ||||||||||||||||||||||||||||||||||||
| 6898 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6899 | - | |||||||||||||||||||||||||||||||||||||
| 6900 | if (testAttribute(Qt::WA_WState_ConfigPending)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6901 | update(rect); | - | ||||||||||||||||||||||||||||||||||||
| 6902 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6903 | } | - | ||||||||||||||||||||||||||||||||||||
| 6904 | - | |||||||||||||||||||||||||||||||||||||
| 6905 | if (!isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6906 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6907 | - | |||||||||||||||||||||||||||||||||||||
| 6908 | if (hasBackingStoreSupport()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6909 | QTLWExtra *tlwExtra = window()->d_func()->maybeTopData(); | - | ||||||||||||||||||||||||||||||||||||
| 6910 | if (tlwExtra
| 0 | ||||||||||||||||||||||||||||||||||||
| 6911 | tlwExtra->inRepaint = true; | - | ||||||||||||||||||||||||||||||||||||
| 6912 | tlwExtra->backingStoreTracker->markDirty(rect, this, QWidgetBackingStore::UpdateNow); | - | ||||||||||||||||||||||||||||||||||||
| 6913 | tlwExtra->inRepaint = false; | - | ||||||||||||||||||||||||||||||||||||
| 6914 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6915 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6916 | d->repaint_sys(rect); | - | ||||||||||||||||||||||||||||||||||||
| 6917 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6918 | } | - | ||||||||||||||||||||||||||||||||||||
| 6919 | - | |||||||||||||||||||||||||||||||||||||
| 6920 | - | |||||||||||||||||||||||||||||||||||||
| 6921 | - | |||||||||||||||||||||||||||||||||||||
| 6922 | - | |||||||||||||||||||||||||||||||||||||
| 6923 | - | |||||||||||||||||||||||||||||||||||||
| 6924 | - | |||||||||||||||||||||||||||||||||||||
| 6925 | void QWidget::repaint(const QRegion &rgn) | - | ||||||||||||||||||||||||||||||||||||
| 6926 | { | - | ||||||||||||||||||||||||||||||||||||
| 6927 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 6928 | - | |||||||||||||||||||||||||||||||||||||
| 6929 | if (testAttribute(Qt::WA_WState_ConfigPending)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6930 | update(rgn); | - | ||||||||||||||||||||||||||||||||||||
| 6931 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6932 | } | - | ||||||||||||||||||||||||||||||||||||
| 6933 | - | |||||||||||||||||||||||||||||||||||||
| 6934 | if (!isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6935 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6936 | - | |||||||||||||||||||||||||||||||||||||
| 6937 | if (hasBackingStoreSupport()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6938 | QTLWExtra *tlwExtra = window()->d_func()->maybeTopData(); | - | ||||||||||||||||||||||||||||||||||||
| 6939 | if (tlwExtra
| 0 | ||||||||||||||||||||||||||||||||||||
| 6940 | tlwExtra->inRepaint = true; | - | ||||||||||||||||||||||||||||||||||||
| 6941 | tlwExtra->backingStoreTracker->markDirty(rgn, this, QWidgetBackingStore::UpdateNow); | - | ||||||||||||||||||||||||||||||||||||
| 6942 | tlwExtra->inRepaint = false; | - | ||||||||||||||||||||||||||||||||||||
| 6943 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6944 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6945 | d->repaint_sys(rgn); | - | ||||||||||||||||||||||||||||||||||||
| 6946 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6947 | } | - | ||||||||||||||||||||||||||||||||||||
| 6948 | void QWidget::update() | - | ||||||||||||||||||||||||||||||||||||
| 6949 | { | - | ||||||||||||||||||||||||||||||||||||
| 6950 | update(rect()); | - | ||||||||||||||||||||||||||||||||||||
| 6951 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6952 | void QWidget::update(const QRect &rect) | - | ||||||||||||||||||||||||||||||||||||
| 6953 | { | - | ||||||||||||||||||||||||||||||||||||
| 6954 | if (!isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6955 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6956 | - | |||||||||||||||||||||||||||||||||||||
| 6957 | QRect r = rect & QWidget::rect(); | - | ||||||||||||||||||||||||||||||||||||
| 6958 | - | |||||||||||||||||||||||||||||||||||||
| 6959 | if (r.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6960 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6961 | - | |||||||||||||||||||||||||||||||||||||
| 6962 | if (testAttribute(Qt::WA_WState_InPaintEvent)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6963 | QApplication::postEvent(this, new QUpdateLaterEvent(r)); | - | ||||||||||||||||||||||||||||||||||||
| 6964 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6965 | } | - | ||||||||||||||||||||||||||||||||||||
| 6966 | - | |||||||||||||||||||||||||||||||||||||
| 6967 | if (hasBackingStoreSupport()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6968 | QTLWExtra *tlwExtra = window()->d_func()->maybeTopData(); | - | ||||||||||||||||||||||||||||||||||||
| 6969 | if (tlwExtra
| 0 | ||||||||||||||||||||||||||||||||||||
| 6970 | tlwExtra->backingStoreTracker->markDirty(r, this); never executed: tlwExtra->backingStoreTracker->markDirty(r, this); | 0 | ||||||||||||||||||||||||||||||||||||
| 6971 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6972 | d_func()->repaint_sys(r); | - | ||||||||||||||||||||||||||||||||||||
| 6973 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 6974 | } | - | ||||||||||||||||||||||||||||||||||||
| 6975 | - | |||||||||||||||||||||||||||||||||||||
| 6976 | - | |||||||||||||||||||||||||||||||||||||
| 6977 | - | |||||||||||||||||||||||||||||||||||||
| 6978 | - | |||||||||||||||||||||||||||||||||||||
| 6979 | - | |||||||||||||||||||||||||||||||||||||
| 6980 | - | |||||||||||||||||||||||||||||||||||||
| 6981 | void QWidget::update(const QRegion &rgn) | - | ||||||||||||||||||||||||||||||||||||
| 6982 | { | - | ||||||||||||||||||||||||||||||||||||
| 6983 | if (!isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6984 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6985 | - | |||||||||||||||||||||||||||||||||||||
| 6986 | QRegion r = rgn & QWidget::rect(); | - | ||||||||||||||||||||||||||||||||||||
| 6987 | - | |||||||||||||||||||||||||||||||||||||
| 6988 | if (r.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6989 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6990 | - | |||||||||||||||||||||||||||||||||||||
| 6991 | if (testAttribute(Qt::WA_WState_InPaintEvent)
| 0 | ||||||||||||||||||||||||||||||||||||
| 6992 | QApplication::postEvent(this, new QUpdateLaterEvent(r)); | - | ||||||||||||||||||||||||||||||||||||
| 6993 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 6994 | } | - | ||||||||||||||||||||||||||||||||||||
| 6995 | - | |||||||||||||||||||||||||||||||||||||
| 6996 | if (hasBackingStoreSupport()
| 0 | ||||||||||||||||||||||||||||||||||||
| 6997 | QTLWExtra *tlwExtra = window()->d_func()->maybeTopData(); | - | ||||||||||||||||||||||||||||||||||||
| 6998 | if (tlwExtra
| 0 | ||||||||||||||||||||||||||||||||||||
| 6999 | tlwExtra->backingStoreTracker->markDirty(r, this); never executed: tlwExtra->backingStoreTracker->markDirty(r, this); | 0 | ||||||||||||||||||||||||||||||||||||
| 7000 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7001 | d_func()->repaint_sys(r); | - | ||||||||||||||||||||||||||||||||||||
| 7002 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7003 | } | - | ||||||||||||||||||||||||||||||||||||
| 7004 | - | |||||||||||||||||||||||||||||||||||||
| 7005 | - | |||||||||||||||||||||||||||||||||||||
| 7006 | - | |||||||||||||||||||||||||||||||||||||
| 7007 | - | |||||||||||||||||||||||||||||||||||||
| 7008 | - | |||||||||||||||||||||||||||||||||||||
| 7009 | - | |||||||||||||||||||||||||||||||||||||
| 7010 | - | |||||||||||||||||||||||||||||||||||||
| 7011 | static void setAttribute_internal(Qt::WidgetAttribute attribute, bool on, QWidgetData *data, | - | ||||||||||||||||||||||||||||||||||||
| 7012 | QWidgetPrivate *d) | - | ||||||||||||||||||||||||||||||||||||
| 7013 | { | - | ||||||||||||||||||||||||||||||||||||
| 7014 | if (attribute < int(8*sizeof(uint))
| 0 | ||||||||||||||||||||||||||||||||||||
| 7015 | if (on
| 0 | ||||||||||||||||||||||||||||||||||||
| 7016 | data->widget_attributes |= (1<<attribute); never executed: data->widget_attributes |= (1<<attribute); | 0 | ||||||||||||||||||||||||||||||||||||
| 7017 | else | - | ||||||||||||||||||||||||||||||||||||
| 7018 | data->widget_attributes &= ~(1<<attribute); never executed: data->widget_attributes &= ~(1<<attribute); | 0 | ||||||||||||||||||||||||||||||||||||
| 7019 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 7020 | const int x = attribute - 8*sizeof(uint); | - | ||||||||||||||||||||||||||||||||||||
| 7021 | const int int_off = x / (8*sizeof(uint)); | - | ||||||||||||||||||||||||||||||||||||
| 7022 | if (on
| 0 | ||||||||||||||||||||||||||||||||||||
| 7023 | d->high_attributes[int_off] |= (1<<(x-(int_off*8*sizeof(uint)))); never executed: d->high_attributes[int_off] |= (1<<(x-(int_off*8*sizeof(uint)))); | 0 | ||||||||||||||||||||||||||||||||||||
| 7024 | else | - | ||||||||||||||||||||||||||||||||||||
| 7025 | d->high_attributes[int_off] &= ~(1<<(x-(int_off*8*sizeof(uint)))); never executed: d->high_attributes[int_off] &= ~(1<<(x-(int_off*8*sizeof(uint)))); | 0 | ||||||||||||||||||||||||||||||||||||
| 7026 | } | - | ||||||||||||||||||||||||||||||||||||
| 7027 | } | - | ||||||||||||||||||||||||||||||||||||
| 7028 | void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) | - | ||||||||||||||||||||||||||||||||||||
| 7029 | { | - | ||||||||||||||||||||||||||||||||||||
| 7030 | if (testAttribute(attribute) == on
| 0 | ||||||||||||||||||||||||||||||||||||
| 7031 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 7032 | - | |||||||||||||||||||||||||||||||||||||
| 7033 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7034 | static_assert(bool(sizeof(d->high_attributes)*8 >= (Qt::WA_AttributeCount - sizeof(uint)*8)), "QWidget::setAttribute(WidgetAttribute, bool): " "QWidgetPrivate::high_attributes[] too small to contain all attributes in WidgetAttribute") | - | ||||||||||||||||||||||||||||||||||||
| 7035 | - | |||||||||||||||||||||||||||||||||||||
| 7036 | ; | - | ||||||||||||||||||||||||||||||||||||
| 7037 | if (attribute == Qt::WA_NativeWindow
| 0 | ||||||||||||||||||||||||||||||||||||
| 7038 | QPlatformIntegration *platformIntegration = QGuiApplicationPrivate::platformIntegration(); | - | ||||||||||||||||||||||||||||||||||||
| 7039 | if (!platformIntegration->hasCapability(QPlatformIntegration::NativeWidgets)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7040 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 7041 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7042 | - | |||||||||||||||||||||||||||||||||||||
| 7043 | setAttribute_internal(attribute, on, data, d); | - | ||||||||||||||||||||||||||||||||||||
| 7044 | - | |||||||||||||||||||||||||||||||||||||
| 7045 | switch (attribute) { | - | ||||||||||||||||||||||||||||||||||||
| 7046 | - | |||||||||||||||||||||||||||||||||||||
| 7047 | - | |||||||||||||||||||||||||||||||||||||
| 7048 | case never executed: Qt::WA_AcceptDrops:case Qt::WA_AcceptDrops:never executed: {case Qt::WA_AcceptDrops: | 0 | ||||||||||||||||||||||||||||||||||||
| 7049 | if (on
| 0 | ||||||||||||||||||||||||||||||||||||
| 7050 | setAttribute(Qt::WA_DropSiteRegistered, true); never executed: setAttribute(Qt::WA_DropSiteRegistered, true); | 0 | ||||||||||||||||||||||||||||||||||||
| 7051 | else if (!on
| 0 | ||||||||||||||||||||||||||||||||||||
| 7052 | setAttribute(Qt::WA_DropSiteRegistered, false); never executed: setAttribute(Qt::WA_DropSiteRegistered, false); | 0 | ||||||||||||||||||||||||||||||||||||
| 7053 | QEvent e(QEvent::AcceptDropsChange); | - | ||||||||||||||||||||||||||||||||||||
| 7054 | QApplication::sendEvent(this, &e); | - | ||||||||||||||||||||||||||||||||||||
| 7055 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7056 | } | - | ||||||||||||||||||||||||||||||||||||
| 7057 | case never executed: Qt::WA_DropSiteRegistered:case Qt::WA_DropSiteRegistered:never executed: {case Qt::WA_DropSiteRegistered: | 0 | ||||||||||||||||||||||||||||||||||||
| 7058 | d->registerDropSite(on); | - | ||||||||||||||||||||||||||||||||||||
| 7059 | for (int i = 0; i < d->children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7060 | QWidget *w = qobject_cast<QWidget *>(d->children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 7061 | if (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 7062 | w->setAttribute(Qt::WA_DropSiteRegistered, on); never executed: w->setAttribute(Qt::WA_DropSiteRegistered, on); | 0 | ||||||||||||||||||||||||||||||||||||
| 7063 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7064 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7065 | } | - | ||||||||||||||||||||||||||||||||||||
| 7066 | - | |||||||||||||||||||||||||||||||||||||
| 7067 | - | |||||||||||||||||||||||||||||||||||||
| 7068 | case never executed: Qt::WA_NoChildEventsForParent:case Qt::WA_NoChildEventsForParent:never executed: case Qt::WA_NoChildEventsForParent: | 0 | ||||||||||||||||||||||||||||||||||||
| 7069 | d->sendChildEvents = !on; | - | ||||||||||||||||||||||||||||||||||||
| 7070 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7071 | case never executed: Qt::WA_NoChildEventsFromChildren:case Qt::WA_NoChildEventsFromChildren:never executed: case Qt::WA_NoChildEventsFromChildren: | 0 | ||||||||||||||||||||||||||||||||||||
| 7072 | d->receiveChildEvents = !on; | - | ||||||||||||||||||||||||||||||||||||
| 7073 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7074 | case never executed: Qt::WA_MacBrushedMetal:case Qt::WA_MacBrushedMetal:never executed: case Qt::WA_MacBrushedMetal: | 0 | ||||||||||||||||||||||||||||||||||||
| 7075 | case never executed: Qt::WA_MacAlwaysShowToolWindow:case Qt::WA_MacAlwaysShowToolWindow:never executed: case Qt::WA_MacAlwaysShowToolWindow: | 0 | ||||||||||||||||||||||||||||||||||||
| 7076 | - | |||||||||||||||||||||||||||||||||||||
| 7077 | - | |||||||||||||||||||||||||||||||||||||
| 7078 | - | |||||||||||||||||||||||||||||||||||||
| 7079 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7080 | case never executed: Qt::WA_MacNormalSize:case Qt::WA_MacNormalSize:never executed: case Qt::WA_MacNormalSize: | 0 | ||||||||||||||||||||||||||||||||||||
| 7081 | case never executed: Qt::WA_MacSmallSize:case Qt::WA_MacSmallSize:never executed: case Qt::WA_MacSmallSize: | 0 | ||||||||||||||||||||||||||||||||||||
| 7082 | case never executed: Qt::WA_MacMiniSize:case Qt::WA_MacMiniSize:never executed: case Qt::WA_MacMiniSize: | 0 | ||||||||||||||||||||||||||||||||||||
| 7083 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7084 | case never executed: Qt::WA_ShowModal:case Qt::WA_ShowModal:never executed: case Qt::WA_ShowModal: | 0 | ||||||||||||||||||||||||||||||||||||
| 7085 | if (!on
| 0 | ||||||||||||||||||||||||||||||||||||
| 7086 | - | |||||||||||||||||||||||||||||||||||||
| 7087 | data->window_modality = Qt::NonModal; | - | ||||||||||||||||||||||||||||||||||||
| 7088 | } never executed: else if (data->window_modality == Qt::NonModalend of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 7089 | - | |||||||||||||||||||||||||||||||||||||
| 7090 | - | |||||||||||||||||||||||||||||||||||||
| 7091 | - | |||||||||||||||||||||||||||||||||||||
| 7092 | - | |||||||||||||||||||||||||||||||||||||
| 7093 | QWidget *w = parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 7094 | if (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 7095 | w = w->window(); never executed: w = w->window(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7096 | while (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 7097 | w = w->parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 7098 | if (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 7099 | w = w->window(); never executed: w = w->window(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7100 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7101 | data->window_modality = (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 7102 | ? Qt::WindowModal | - | ||||||||||||||||||||||||||||||||||||
| 7103 | : Qt::ApplicationModal; | - | ||||||||||||||||||||||||||||||||||||
| 7104 | - | |||||||||||||||||||||||||||||||||||||
| 7105 | - | |||||||||||||||||||||||||||||||||||||
| 7106 | - | |||||||||||||||||||||||||||||||||||||
| 7107 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7108 | if (testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7109 | - | |||||||||||||||||||||||||||||||||||||
| 7110 | d->setModal_sys(); | - | ||||||||||||||||||||||||||||||||||||
| 7111 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7112 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7113 | case never executed: Qt::WA_MouseTracking:case Qt::WA_MouseTracking:never executed: {case Qt::WA_MouseTracking: | 0 | ||||||||||||||||||||||||||||||||||||
| 7114 | QEvent e(QEvent::MouseTrackingChange); | - | ||||||||||||||||||||||||||||||||||||
| 7115 | QApplication::sendEvent(this, &e); | - | ||||||||||||||||||||||||||||||||||||
| 7116 | break; never executed: }break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7117 | case never executed: Qt::WA_NativeWindow:case Qt::WA_NativeWindow:never executed: {case Qt::WA_NativeWindow: | 0 | ||||||||||||||||||||||||||||||||||||
| 7118 | d->createTLExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 7119 | if (on
| 0 | ||||||||||||||||||||||||||||||||||||
| 7120 | d->createTLSysExtra(); never executed: d->createTLSysExtra(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7121 | - | |||||||||||||||||||||||||||||||||||||
| 7122 | QWidget *focusWidget = d->effectiveFocusWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 7123 | if (on
| 0 | ||||||||||||||||||||||||||||||||||||
| 7124 | && focusWidget->testAttribute(Qt::WA_InputMethodEnabled)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7125 | QGuiApplication::inputMethod()->commit(); | - | ||||||||||||||||||||||||||||||||||||
| 7126 | QGuiApplication::inputMethod()->update(Qt::ImEnabled); | - | ||||||||||||||||||||||||||||||||||||
| 7127 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7128 | if (!(static_cast<QApplication *>(QCoreApplication::instance()))->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7129 | parentWidget()->d_func()->enforceNativeChildren(); never executed: parentWidget()->d_func()->enforceNativeChildren(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7130 | if (on
| 0 | ||||||||||||||||||||||||||||||||||||
| 7131 | d->createWinId(); never executed: d->createWinId(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7132 | if (isEnabled()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7133 | && focusWidget->testAttribute(Qt::WA_InputMethodEnabled)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7134 | QGuiApplication::inputMethod()->update(Qt::ImEnabled); | - | ||||||||||||||||||||||||||||||||||||
| 7135 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7136 | - | |||||||||||||||||||||||||||||||||||||
| 7137 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7138 | } | - | ||||||||||||||||||||||||||||||||||||
| 7139 | case never executed: Qt::WA_PaintOnScreen:case Qt::WA_PaintOnScreen:never executed: case Qt::WA_PaintOnScreen: | 0 | ||||||||||||||||||||||||||||||||||||
| 7140 | d->updateIsOpaque(); | - | ||||||||||||||||||||||||||||||||||||
| 7141 | case never executed: Qt::WA_OpaquePaintEvent:case Qt::WA_OpaquePaintEvent:never executed: case Qt::WA_OpaquePaintEvent:code before this statement never executed: case Qt::WA_OpaquePaintEvent: | 0 | ||||||||||||||||||||||||||||||||||||
| 7142 | d->updateIsOpaque(); | - | ||||||||||||||||||||||||||||||||||||
| 7143 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7144 | case never executed: Qt::WA_NoSystemBackground:case Qt::WA_NoSystemBackground:never executed: case Qt::WA_NoSystemBackground: | 0 | ||||||||||||||||||||||||||||||||||||
| 7145 | d->updateIsOpaque(); | - | ||||||||||||||||||||||||||||||||||||
| 7146 | - | |||||||||||||||||||||||||||||||||||||
| 7147 | case never executed: Qt::WA_UpdatesDisabled:case Qt::WA_UpdatesDisabled:never executed: case Qt::WA_UpdatesDisabled:code before this statement never executed: case Qt::WA_UpdatesDisabled: | 0 | ||||||||||||||||||||||||||||||||||||
| 7148 | d->updateSystemBackground(); | - | ||||||||||||||||||||||||||||||||||||
| 7149 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7150 | case never executed: Qt::WA_TransparentForMouseEvents:case Qt::WA_TransparentForMouseEvents:never executed: case Qt::WA_TransparentForMouseEvents: | 0 | ||||||||||||||||||||||||||||||||||||
| 7151 | - | |||||||||||||||||||||||||||||||||||||
| 7152 | - | |||||||||||||||||||||||||||||||||||||
| 7153 | - | |||||||||||||||||||||||||||||||||||||
| 7154 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7155 | case never executed: Qt::WA_InputMethodEnabled:case Qt::WA_InputMethodEnabled:never executed: {case Qt::WA_InputMethodEnabled: | 0 | ||||||||||||||||||||||||||||||||||||
| 7156 | - | |||||||||||||||||||||||||||||||||||||
| 7157 | if (QGuiApplication::focusObject() == this
| 0 | ||||||||||||||||||||||||||||||||||||
| 7158 | if (!on
| 0 | ||||||||||||||||||||||||||||||||||||
| 7159 | QGuiApplication::inputMethod()->commit(); never executed: QGuiApplication::inputMethod()->commit(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7160 | QGuiApplication::inputMethod()->update(Qt::ImEnabled); | - | ||||||||||||||||||||||||||||||||||||
| 7161 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7162 | - | |||||||||||||||||||||||||||||||||||||
| 7163 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7164 | } | - | ||||||||||||||||||||||||||||||||||||
| 7165 | case never executed: Qt::WA_WindowPropagation:case Qt::WA_WindowPropagation:never executed: case Qt::WA_WindowPropagation: | 0 | ||||||||||||||||||||||||||||||||||||
| 7166 | d->resolvePalette(); | - | ||||||||||||||||||||||||||||||||||||
| 7167 | d->resolveFont(); | - | ||||||||||||||||||||||||||||||||||||
| 7168 | d->resolveLocale(); | - | ||||||||||||||||||||||||||||||||||||
| 7169 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7170 | case never executed: Qt::WA_DontShowOnScreen:case Qt::WA_DontShowOnScreen:never executed: {case Qt::WA_DontShowOnScreen: | 0 | ||||||||||||||||||||||||||||||||||||
| 7171 | if (on
| 0 | ||||||||||||||||||||||||||||||||||||
| 7172 | - | |||||||||||||||||||||||||||||||||||||
| 7173 | - | |||||||||||||||||||||||||||||||||||||
| 7174 | - | |||||||||||||||||||||||||||||||||||||
| 7175 | d->hide_sys(); | - | ||||||||||||||||||||||||||||||||||||
| 7176 | d->show_sys(); | - | ||||||||||||||||||||||||||||||||||||
| 7177 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7178 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7179 | } | - | ||||||||||||||||||||||||||||||||||||
| 7180 | - | |||||||||||||||||||||||||||||||||||||
| 7181 | case never executed: Qt::WA_X11NetWmWindowTypeDesktop:case Qt::WA_X11NetWmWindowTypeDesktop:never executed: case Qt::WA_X11NetWmWindowTypeDesktop: | 0 | ||||||||||||||||||||||||||||||||||||
| 7182 | case never executed: Qt::WA_X11NetWmWindowTypeDock:case Qt::WA_X11NetWmWindowTypeDock:never executed: case Qt::WA_X11NetWmWindowTypeDock: | 0 | ||||||||||||||||||||||||||||||||||||
| 7183 | case never executed: Qt::WA_X11NetWmWindowTypeToolBar:case Qt::WA_X11NetWmWindowTypeToolBar:never executed: case Qt::WA_X11NetWmWindowTypeToolBar: | 0 | ||||||||||||||||||||||||||||||||||||
| 7184 | case never executed: Qt::WA_X11NetWmWindowTypeMenu:case Qt::WA_X11NetWmWindowTypeMenu:never executed: case Qt::WA_X11NetWmWindowTypeMenu: | 0 | ||||||||||||||||||||||||||||||||||||
| 7185 | case never executed: Qt::WA_X11NetWmWindowTypeUtility:case Qt::WA_X11NetWmWindowTypeUtility:never executed: case Qt::WA_X11NetWmWindowTypeUtility: | 0 | ||||||||||||||||||||||||||||||||||||
| 7186 | case never executed: Qt::WA_X11NetWmWindowTypeSplash:case Qt::WA_X11NetWmWindowTypeSplash:never executed: case Qt::WA_X11NetWmWindowTypeSplash: | 0 | ||||||||||||||||||||||||||||||||||||
| 7187 | case never executed: Qt::WA_X11NetWmWindowTypeDialog:case Qt::WA_X11NetWmWindowTypeDialog:never executed: case Qt::WA_X11NetWmWindowTypeDialog: | 0 | ||||||||||||||||||||||||||||||||||||
| 7188 | case never executed: Qt::WA_X11NetWmWindowTypeDropDownMenu:case Qt::WA_X11NetWmWindowTypeDropDownMenu:never executed: case Qt::WA_X11NetWmWindowTypeDropDownMenu: | 0 | ||||||||||||||||||||||||||||||||||||
| 7189 | case never executed: Qt::WA_X11NetWmWindowTypePopupMenu:case Qt::WA_X11NetWmWindowTypePopupMenu:never executed: case Qt::WA_X11NetWmWindowTypePopupMenu: | 0 | ||||||||||||||||||||||||||||||||||||
| 7190 | case never executed: Qt::WA_X11NetWmWindowTypeToolTip:case Qt::WA_X11NetWmWindowTypeToolTip:never executed: case Qt::WA_X11NetWmWindowTypeToolTip: | 0 | ||||||||||||||||||||||||||||||||||||
| 7191 | case never executed: Qt::WA_X11NetWmWindowTypeNotification:case Qt::WA_X11NetWmWindowTypeNotification:never executed: case Qt::WA_X11NetWmWindowTypeNotification: | 0 | ||||||||||||||||||||||||||||||||||||
| 7192 | case never executed: Qt::WA_X11NetWmWindowTypeCombo:case Qt::WA_X11NetWmWindowTypeCombo:never executed: case Qt::WA_X11NetWmWindowTypeCombo: | 0 | ||||||||||||||||||||||||||||||||||||
| 7193 | case never executed: Qt::WA_X11NetWmWindowTypeDND:case Qt::WA_X11NetWmWindowTypeDND:never executed: case Qt::WA_X11NetWmWindowTypeDND: | 0 | ||||||||||||||||||||||||||||||||||||
| 7194 | d->setNetWmWindowTypes(); | - | ||||||||||||||||||||||||||||||||||||
| 7195 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7196 | - | |||||||||||||||||||||||||||||||||||||
| 7197 | case never executed: Qt::WA_StaticContents:case Qt::WA_StaticContents:never executed: case Qt::WA_StaticContents: | 0 | ||||||||||||||||||||||||||||||||||||
| 7198 | if (QWidgetBackingStore *bs = d->maybeBackingStore()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7199 | if (on
| 0 | ||||||||||||||||||||||||||||||||||||
| 7200 | bs->addStaticWidget(this); never executed: bs->addStaticWidget(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 7201 | else | - | ||||||||||||||||||||||||||||||||||||
| 7202 | bs->removeStaticWidget(this); never executed: bs->removeStaticWidget(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 7203 | } | - | ||||||||||||||||||||||||||||||||||||
| 7204 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7205 | case never executed: Qt::WA_TranslucentBackground:case Qt::WA_TranslucentBackground:never executed: case Qt::WA_TranslucentBackground: | 0 | ||||||||||||||||||||||||||||||||||||
| 7206 | if (on
| 0 | ||||||||||||||||||||||||||||||||||||
| 7207 | setAttribute(Qt::WA_NoSystemBackground); | - | ||||||||||||||||||||||||||||||||||||
| 7208 | d->updateIsTranslucent(); | - | ||||||||||||||||||||||||||||||||||||
| 7209 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7210 | - | |||||||||||||||||||||||||||||||||||||
| 7211 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7212 | case never executed: Qt::WA_AcceptTouchEvents:case Qt::WA_AcceptTouchEvents:never executed: case Qt::WA_AcceptTouchEvents: | 0 | ||||||||||||||||||||||||||||||||||||
| 7213 | - | |||||||||||||||||||||||||||||||||||||
| 7214 | - | |||||||||||||||||||||||||||||||||||||
| 7215 | - | |||||||||||||||||||||||||||||||||||||
| 7216 | - | |||||||||||||||||||||||||||||||||||||
| 7217 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7218 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
| 7219 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7220 | } | - | ||||||||||||||||||||||||||||||||||||
| 7221 | } | - | ||||||||||||||||||||||||||||||||||||
| 7222 | bool QWidget::testAttribute_helper(Qt::WidgetAttribute attribute) const | - | ||||||||||||||||||||||||||||||||||||
| 7223 | { | - | ||||||||||||||||||||||||||||||||||||
| 7224 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7225 | const int x = attribute - 8*sizeof(uint); | - | ||||||||||||||||||||||||||||||||||||
| 7226 | const int int_off = x / (8*sizeof(uint)); | - | ||||||||||||||||||||||||||||||||||||
| 7227 | return never executed: (d->high_attributes[int_off] & (1<<(x-(int_off*8*sizeof(uint)))));return (d->high_attributes[int_off] & (1<<(x-(int_off*8*sizeof(uint)))));never executed: return (d->high_attributes[int_off] & (1<<(x-(int_off*8*sizeof(uint))))); | 0 | ||||||||||||||||||||||||||||||||||||
| 7228 | } | - | ||||||||||||||||||||||||||||||||||||
| 7229 | qreal QWidget::windowOpacity() const | - | ||||||||||||||||||||||||||||||||||||
| 7230 | { | - | ||||||||||||||||||||||||||||||||||||
| 7231 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7232 | return never executed: (isWindow() && d->maybeTopData()) ? d->maybeTopData()->opacity / 255. : 1.0;return (isWindow() && d->maybeTopData()) ? d->maybeTopData()->opacity / 255. : 1.0;never executed: return (isWindow() && d->maybeTopData()) ? d->maybeTopData()->opacity / 255. : 1.0; | 0 | ||||||||||||||||||||||||||||||||||||
| 7233 | } | - | ||||||||||||||||||||||||||||||||||||
| 7234 | - | |||||||||||||||||||||||||||||||||||||
| 7235 | void QWidget::setWindowOpacity(qreal opacity) | - | ||||||||||||||||||||||||||||||||||||
| 7236 | { | - | ||||||||||||||||||||||||||||||||||||
| 7237 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7238 | if (!isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7239 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 7240 | - | |||||||||||||||||||||||||||||||||||||
| 7241 | opacity = qBound(qreal(0.0), opacity, qreal(1.0)); | - | ||||||||||||||||||||||||||||||||||||
| 7242 | QTLWExtra *extra = d->topData(); | - | ||||||||||||||||||||||||||||||||||||
| 7243 | extra->opacity = uint(opacity * 255); | - | ||||||||||||||||||||||||||||||||||||
| 7244 | setAttribute(Qt::WA_WState_WindowOpacitySet); | - | ||||||||||||||||||||||||||||||||||||
| 7245 | d->setWindowOpacity_sys(opacity); | - | ||||||||||||||||||||||||||||||||||||
| 7246 | - | |||||||||||||||||||||||||||||||||||||
| 7247 | if (!testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7248 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 7249 | - | |||||||||||||||||||||||||||||||||||||
| 7250 | - | |||||||||||||||||||||||||||||||||||||
| 7251 | if (QGraphicsProxyWidget *proxy = graphicsProxyWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7252 | - | |||||||||||||||||||||||||||||||||||||
| 7253 | if (proxy->cacheMode() == QGraphicsItem::NoCache
| 0 | ||||||||||||||||||||||||||||||||||||
| 7254 | proxy->update(); never executed: proxy->update(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7255 | else if (QGraphicsScene *scene = proxy->scene()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7256 | scene->update(proxy->sceneBoundingRect()); never executed: scene->update(proxy->sceneBoundingRect()); | 0 | ||||||||||||||||||||||||||||||||||||
| 7257 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 7258 | } | - | ||||||||||||||||||||||||||||||||||||
| 7259 | - | |||||||||||||||||||||||||||||||||||||
| 7260 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7261 | - | |||||||||||||||||||||||||||||||||||||
| 7262 | void QWidgetPrivate::setWindowOpacity_sys(qreal level) | - | ||||||||||||||||||||||||||||||||||||
| 7263 | { | - | ||||||||||||||||||||||||||||||||||||
| 7264 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7265 | if (q->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7266 | q->windowHandle()->setOpacity(level); never executed: q->windowHandle()->setOpacity(level); | 0 | ||||||||||||||||||||||||||||||||||||
| 7267 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7268 | bool QWidget::isWindowModified() const | - | ||||||||||||||||||||||||||||||||||||
| 7269 | { | - | ||||||||||||||||||||||||||||||||||||
| 7270 | return never executed: testAttribute(Qt::WA_WindowModified);return testAttribute(Qt::WA_WindowModified);never executed: return testAttribute(Qt::WA_WindowModified); | 0 | ||||||||||||||||||||||||||||||||||||
| 7271 | } | - | ||||||||||||||||||||||||||||||||||||
| 7272 | - | |||||||||||||||||||||||||||||||||||||
| 7273 | void QWidget::setWindowModified(bool mod) | - | ||||||||||||||||||||||||||||||||||||
| 7274 | { | - | ||||||||||||||||||||||||||||||||||||
| 7275 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7276 | setAttribute(Qt::WA_WindowModified, mod); | - | ||||||||||||||||||||||||||||||||||||
| 7277 | - | |||||||||||||||||||||||||||||||||||||
| 7278 | d->setWindowModified_helper(); | - | ||||||||||||||||||||||||||||||||||||
| 7279 | - | |||||||||||||||||||||||||||||||||||||
| 7280 | QEvent e(QEvent::ModifiedChange); | - | ||||||||||||||||||||||||||||||||||||
| 7281 | QApplication::sendEvent(this, &e); | - | ||||||||||||||||||||||||||||||||||||
| 7282 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7283 | - | |||||||||||||||||||||||||||||||||||||
| 7284 | void QWidgetPrivate::setWindowModified_helper() | - | ||||||||||||||||||||||||||||||||||||
| 7285 | { | - | ||||||||||||||||||||||||||||||||||||
| 7286 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7287 | QWindow *window = q->windowHandle(); | - | ||||||||||||||||||||||||||||||||||||
| 7288 | if (!window
| 0 | ||||||||||||||||||||||||||||||||||||
| 7289 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 7290 | QPlatformWindow *platformWindow = window->handle(); | - | ||||||||||||||||||||||||||||||||||||
| 7291 | if (!platformWindow
| 0 | ||||||||||||||||||||||||||||||||||||
| 7292 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 7293 | bool on = q->testAttribute(Qt::WA_WindowModified); | - | ||||||||||||||||||||||||||||||||||||
| 7294 | if (!platformWindow->setWindowModified(on)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7295 | if (__builtin_expect(!!(on && !q->windowTitle().contains(QLatin1String("[*]"))), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7296 | QMessageLogger(__FILE__, 11451, __PRETTY_FUNCTION__).warning("QWidget::setWindowModified: The window title does not contain a '[*]' placeholder"); never executed: QMessageLogger(__FILE__, 11451, __PRETTY_FUNCTION__).warning("QWidget::setWindowModified: The window title does not contain a '[*]' placeholder"); | 0 | ||||||||||||||||||||||||||||||||||||
| 7297 | setWindowTitle_helper(q->windowTitle()); | - | ||||||||||||||||||||||||||||||||||||
| 7298 | setWindowIconText_helper(q->windowIconText()); | - | ||||||||||||||||||||||||||||||||||||
| 7299 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7300 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7301 | void QWidget::setToolTip(const QString &s) | - | ||||||||||||||||||||||||||||||||||||
| 7302 | { | - | ||||||||||||||||||||||||||||||||||||
| 7303 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7304 | d->toolTip = s; | - | ||||||||||||||||||||||||||||||||||||
| 7305 | - | |||||||||||||||||||||||||||||||||||||
| 7306 | QEvent event(QEvent::ToolTipChange); | - | ||||||||||||||||||||||||||||||||||||
| 7307 | QApplication::sendEvent(this, &event); | - | ||||||||||||||||||||||||||||||||||||
| 7308 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7309 | - | |||||||||||||||||||||||||||||||||||||
| 7310 | QString QWidget::toolTip() const | - | ||||||||||||||||||||||||||||||||||||
| 7311 | { | - | ||||||||||||||||||||||||||||||||||||
| 7312 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7313 | return never executed: d->toolTip;return d->toolTip;never executed: return d->toolTip; | 0 | ||||||||||||||||||||||||||||||||||||
| 7314 | } | - | ||||||||||||||||||||||||||||||||||||
| 7315 | void QWidget::setToolTipDuration(int msec) | - | ||||||||||||||||||||||||||||||||||||
| 7316 | { | - | ||||||||||||||||||||||||||||||||||||
| 7317 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7318 | d->toolTipDuration = msec; | - | ||||||||||||||||||||||||||||||||||||
| 7319 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7320 | - | |||||||||||||||||||||||||||||||||||||
| 7321 | int QWidget::toolTipDuration() const | - | ||||||||||||||||||||||||||||||||||||
| 7322 | { | - | ||||||||||||||||||||||||||||||||||||
| 7323 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7324 | return never executed: d->toolTipDuration;return d->toolTipDuration;never executed: return d->toolTipDuration; | 0 | ||||||||||||||||||||||||||||||||||||
| 7325 | } | - | ||||||||||||||||||||||||||||||||||||
| 7326 | void QWidget::setStatusTip(const QString &s) | - | ||||||||||||||||||||||||||||||||||||
| 7327 | { | - | ||||||||||||||||||||||||||||||||||||
| 7328 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7329 | d->statusTip = s; | - | ||||||||||||||||||||||||||||||||||||
| 7330 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7331 | - | |||||||||||||||||||||||||||||||||||||
| 7332 | QString QWidget::statusTip() const | - | ||||||||||||||||||||||||||||||||||||
| 7333 | { | - | ||||||||||||||||||||||||||||||||||||
| 7334 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7335 | return never executed: d->statusTip;return d->statusTip;never executed: return d->statusTip; | 0 | ||||||||||||||||||||||||||||||||||||
| 7336 | } | - | ||||||||||||||||||||||||||||||||||||
| 7337 | void QWidget::setWhatsThis(const QString &s) | - | ||||||||||||||||||||||||||||||||||||
| 7338 | { | - | ||||||||||||||||||||||||||||||||||||
| 7339 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7340 | d->whatsThis = s; | - | ||||||||||||||||||||||||||||||||||||
| 7341 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7342 | - | |||||||||||||||||||||||||||||||||||||
| 7343 | QString QWidget::whatsThis() const | - | ||||||||||||||||||||||||||||||||||||
| 7344 | { | - | ||||||||||||||||||||||||||||||||||||
| 7345 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7346 | return never executed: d->whatsThis;return d->whatsThis;never executed: return d->whatsThis; | 0 | ||||||||||||||||||||||||||||||||||||
| 7347 | } | - | ||||||||||||||||||||||||||||||||||||
| 7348 | void QWidget::setAccessibleName(const QString &name) | - | ||||||||||||||||||||||||||||||||||||
| 7349 | { | - | ||||||||||||||||||||||||||||||||||||
| 7350 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7351 | d->accessibleName = name; | - | ||||||||||||||||||||||||||||||||||||
| 7352 | QAccessibleEvent event(this, QAccessible::NameChanged); | - | ||||||||||||||||||||||||||||||||||||
| 7353 | QAccessible::updateAccessibility(&event); | - | ||||||||||||||||||||||||||||||||||||
| 7354 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7355 | - | |||||||||||||||||||||||||||||||||||||
| 7356 | QString QWidget::accessibleName() const | - | ||||||||||||||||||||||||||||||||||||
| 7357 | { | - | ||||||||||||||||||||||||||||||||||||
| 7358 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7359 | return never executed: d->accessibleName;return d->accessibleName;never executed: return d->accessibleName; | 0 | ||||||||||||||||||||||||||||||||||||
| 7360 | } | - | ||||||||||||||||||||||||||||||||||||
| 7361 | void QWidget::setAccessibleDescription(const QString &description) | - | ||||||||||||||||||||||||||||||||||||
| 7362 | { | - | ||||||||||||||||||||||||||||||||||||
| 7363 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7364 | d->accessibleDescription = description; | - | ||||||||||||||||||||||||||||||||||||
| 7365 | QAccessibleEvent event(this, QAccessible::DescriptionChanged); | - | ||||||||||||||||||||||||||||||||||||
| 7366 | QAccessible::updateAccessibility(&event); | - | ||||||||||||||||||||||||||||||||||||
| 7367 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7368 | - | |||||||||||||||||||||||||||||||||||||
| 7369 | QString QWidget::accessibleDescription() const | - | ||||||||||||||||||||||||||||||||||||
| 7370 | { | - | ||||||||||||||||||||||||||||||||||||
| 7371 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7372 | return never executed: d->accessibleDescription;return d->accessibleDescription;never executed: return d->accessibleDescription; | 0 | ||||||||||||||||||||||||||||||||||||
| 7373 | } | - | ||||||||||||||||||||||||||||||||||||
| 7374 | int QWidget::grabShortcut(const QKeySequence &key, Qt::ShortcutContext context) | - | ||||||||||||||||||||||||||||||||||||
| 7375 | { | - | ||||||||||||||||||||||||||||||||||||
| 7376 | ((!((static_cast<QApplication *>(QCoreApplication::instance())))) ? qt_assert("qApp",__FILE__,11655) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 7377 | if (key.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7378 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 7379 | setAttribute(Qt::WA_GrabbedShortcut); | - | ||||||||||||||||||||||||||||||||||||
| 7380 | return never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.addShortcut(this, key, context, qWidgetShortcutContextMatcher);return (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.addShortcut(this, key, context, qWidgetShortcutContextMatcher);never executed: return (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.addShortcut(this, key, context, qWidgetShortcutContextMatcher); | 0 | ||||||||||||||||||||||||||||||||||||
| 7381 | } | - | ||||||||||||||||||||||||||||||||||||
| 7382 | void QWidget::releaseShortcut(int id) | - | ||||||||||||||||||||||||||||||||||||
| 7383 | { | - | ||||||||||||||||||||||||||||||||||||
| 7384 | ((!((static_cast<QApplication *>(QCoreApplication::instance())))) ? qt_assert("qApp",__FILE__,11679) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 7385 | if (id
| 0 | ||||||||||||||||||||||||||||||||||||
| 7386 | (static_cast< never executed: QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.removeShortcut(id, this, 0);(static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.removeShortcut(id, this, 0);never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.removeShortcut(id, this, 0); | 0 | ||||||||||||||||||||||||||||||||||||
| 7387 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7388 | void QWidget::setShortcutEnabled(int id, bool enable) | - | ||||||||||||||||||||||||||||||||||||
| 7389 | { | - | ||||||||||||||||||||||||||||||||||||
| 7390 | ((!((static_cast<QApplication *>(QCoreApplication::instance())))) ? qt_assert("qApp",__FILE__,11698) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 7391 | if (id
| 0 | ||||||||||||||||||||||||||||||||||||
| 7392 | (static_cast< never executed: QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.setShortcutEnabled(enable, id, this, 0);(static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.setShortcutEnabled(enable, id, this, 0);never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.setShortcutEnabled(enable, id, this, 0); | 0 | ||||||||||||||||||||||||||||||||||||
| 7393 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7394 | void QWidget::setShortcutAutoRepeat(int id, bool enable) | - | ||||||||||||||||||||||||||||||||||||
| 7395 | { | - | ||||||||||||||||||||||||||||||||||||
| 7396 | ((!((static_cast<QApplication *>(QCoreApplication::instance())))) ? qt_assert("qApp",__FILE__,11713) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 7397 | if (id
| 0 | ||||||||||||||||||||||||||||||||||||
| 7398 | (static_cast< never executed: QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.setShortcutAutoRepeat(enable, id, this, 0);(static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.setShortcutAutoRepeat(enable, id, this, 0);never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.setShortcutAutoRepeat(enable, id, this, 0); | 0 | ||||||||||||||||||||||||||||||||||||
| 7399 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7400 | - | |||||||||||||||||||||||||||||||||||||
| 7401 | - | |||||||||||||||||||||||||||||||||||||
| 7402 | - | |||||||||||||||||||||||||||||||||||||
| 7403 | - | |||||||||||||||||||||||||||||||||||||
| 7404 | - | |||||||||||||||||||||||||||||||||||||
| 7405 | void QWidget::updateMicroFocus() | - | ||||||||||||||||||||||||||||||||||||
| 7406 | { | - | ||||||||||||||||||||||||||||||||||||
| 7407 | - | |||||||||||||||||||||||||||||||||||||
| 7408 | if (this == QGuiApplication::focusObject()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7409 | QGuiApplication::inputMethod()->update(Qt::ImQueryAll); never executed: QGuiApplication::inputMethod()->update(Qt::ImQueryAll); | 0 | ||||||||||||||||||||||||||||||||||||
| 7410 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7411 | void QWidget::raise() | - | ||||||||||||||||||||||||||||||||||||
| 7412 | { | - | ||||||||||||||||||||||||||||||||||||
| 7413 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7414 | if (!isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7415 | QWidget *p = parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 7416 | const int parentChildCount = p->d_func()->children.size(); | - | ||||||||||||||||||||||||||||||||||||
| 7417 | if (parentChildCount < 2
| 0 | ||||||||||||||||||||||||||||||||||||
| 7418 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 7419 | const int from = p->d_func()->children.indexOf(this); | - | ||||||||||||||||||||||||||||||||||||
| 7420 | ((!(from >= 0)) ? qt_assert("from >= 0",__FILE__,11750) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 7421 | - | |||||||||||||||||||||||||||||||||||||
| 7422 | if (from != parentChildCount -1
| 0 | ||||||||||||||||||||||||||||||||||||
| 7423 | p->d_func()->children.move(from, parentChildCount - 1); never executed: p->d_func()->children.move(from, parentChildCount - 1); | 0 | ||||||||||||||||||||||||||||||||||||
| 7424 | if (!testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7425 | create(); never executed: create(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7426 | else if (from == parentChildCount - 1
| 0 | ||||||||||||||||||||||||||||||||||||
| 7427 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 7428 | - | |||||||||||||||||||||||||||||||||||||
| 7429 | QRegion region(rect()); | - | ||||||||||||||||||||||||||||||||||||
| 7430 | d->subtractOpaqueSiblings(region); | - | ||||||||||||||||||||||||||||||||||||
| 7431 | d->invalidateBuffer(region); | - | ||||||||||||||||||||||||||||||||||||
| 7432 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7433 | if (testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7434 | d->raise_sys(); never executed: d->raise_sys(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7435 | - | |||||||||||||||||||||||||||||||||||||
| 7436 | if (d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 7437 | QWindowContainer::parentWasRaised(this); never executed: QWindowContainer::parentWasRaised(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 7438 | - | |||||||||||||||||||||||||||||||||||||
| 7439 | QEvent e(QEvent::ZOrderChange); | - | ||||||||||||||||||||||||||||||||||||
| 7440 | QApplication::sendEvent(this, &e); | - | ||||||||||||||||||||||||||||||||||||
| 7441 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7442 | - | |||||||||||||||||||||||||||||||||||||
| 7443 | void QWidgetPrivate::raise_sys() | - | ||||||||||||||||||||||||||||||||||||
| 7444 | { | - | ||||||||||||||||||||||||||||||||||||
| 7445 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7446 | if (q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7447 | q->windowHandle()->raise(); | - | ||||||||||||||||||||||||||||||||||||
| 7448 | } never executed: else if (renderToTextureend of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 7449 | if (QWidget *p = q->parentWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7450 | setDirtyOpaqueRegion(); | - | ||||||||||||||||||||||||||||||||||||
| 7451 | p->d_func()->invalidateBuffer(effectiveRectFor(q->geometry())); | - | ||||||||||||||||||||||||||||||||||||
| 7452 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7453 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7454 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7455 | void QWidget::lower() | - | ||||||||||||||||||||||||||||||||||||
| 7456 | { | - | ||||||||||||||||||||||||||||||||||||
| 7457 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7458 | if (!isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7459 | QWidget *p = parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 7460 | const int parentChildCount = p->d_func()->children.size(); | - | ||||||||||||||||||||||||||||||||||||
| 7461 | if (parentChildCount < 2
| 0 | ||||||||||||||||||||||||||||||||||||
| 7462 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 7463 | const int from = p->d_func()->children.indexOf(this); | - | ||||||||||||||||||||||||||||||||||||
| 7464 | ((!(from >= 0)) ? qt_assert("from >= 0",__FILE__,11804) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 7465 | - | |||||||||||||||||||||||||||||||||||||
| 7466 | if (from != 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 7467 | p->d_func()->children.move(from, 0); never executed: p->d_func()->children.move(from, 0); | 0 | ||||||||||||||||||||||||||||||||||||
| 7468 | if (!testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7469 | create(); never executed: create(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7470 | else if (from == 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 7471 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 7472 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7473 | if (testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7474 | d->lower_sys(); never executed: d->lower_sys(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7475 | - | |||||||||||||||||||||||||||||||||||||
| 7476 | if (d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 7477 | QWindowContainer::parentWasLowered(this); never executed: QWindowContainer::parentWasLowered(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 7478 | - | |||||||||||||||||||||||||||||||||||||
| 7479 | QEvent e(QEvent::ZOrderChange); | - | ||||||||||||||||||||||||||||||||||||
| 7480 | QApplication::sendEvent(this, &e); | - | ||||||||||||||||||||||||||||||||||||
| 7481 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7482 | - | |||||||||||||||||||||||||||||||||||||
| 7483 | void QWidgetPrivate::lower_sys() | - | ||||||||||||||||||||||||||||||||||||
| 7484 | { | - | ||||||||||||||||||||||||||||||||||||
| 7485 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7486 | if (q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7487 | ((!(q->testAttribute(Qt::WA_WState_Created))) ? qt_assert("q->testAttribute(Qt::WA_WState_Created)",__FILE__,11827) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 7488 | q->windowHandle()->lower(); | - | ||||||||||||||||||||||||||||||||||||
| 7489 | } never executed: else if (QWidget *p = q->parentWidget()end of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 7490 | setDirtyOpaqueRegion(); | - | ||||||||||||||||||||||||||||||||||||
| 7491 | p->d_func()->invalidateBuffer(effectiveRectFor(q->geometry())); | - | ||||||||||||||||||||||||||||||||||||
| 7492 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7493 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7494 | void QWidget::stackUnder(QWidget* w) | - | ||||||||||||||||||||||||||||||||||||
| 7495 | { | - | ||||||||||||||||||||||||||||||||||||
| 7496 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7497 | QWidget *p = parentWidget(); | - | ||||||||||||||||||||||||||||||||||||
| 7498 | if (!w
| 0 | ||||||||||||||||||||||||||||||||||||
| 7499 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 7500 | if (p
| 0 | ||||||||||||||||||||||||||||||||||||
| 7501 | int from = p->d_func()->children.indexOf(this); | - | ||||||||||||||||||||||||||||||||||||
| 7502 | int to = p->d_func()->children.indexOf(w); | - | ||||||||||||||||||||||||||||||||||||
| 7503 | ((!(from >= 0)) ? qt_assert("from >= 0",__FILE__,11851) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 7504 | ((!(to >= 0)) ? qt_assert("to >= 0",__FILE__,11852) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 7505 | if (from < to
| 0 | ||||||||||||||||||||||||||||||||||||
| 7506 | -- never executed: to;--to;never executed: --to; | 0 | ||||||||||||||||||||||||||||||||||||
| 7507 | - | |||||||||||||||||||||||||||||||||||||
| 7508 | if (from != to
| 0 | ||||||||||||||||||||||||||||||||||||
| 7509 | p->d_func()->children.move(from, to); never executed: p->d_func()->children.move(from, to); | 0 | ||||||||||||||||||||||||||||||||||||
| 7510 | if (!testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7511 | create(); never executed: create(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7512 | else if (from == to
| 0 | ||||||||||||||||||||||||||||||||||||
| 7513 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 7514 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7515 | if (testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7516 | d->stackUnder_sys(w); never executed: d->stackUnder_sys(w); | 0 | ||||||||||||||||||||||||||||||||||||
| 7517 | - | |||||||||||||||||||||||||||||||||||||
| 7518 | QEvent e(QEvent::ZOrderChange); | - | ||||||||||||||||||||||||||||||||||||
| 7519 | QApplication::sendEvent(this, &e); | - | ||||||||||||||||||||||||||||||||||||
| 7520 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7521 | - | |||||||||||||||||||||||||||||||||||||
| 7522 | void QWidgetPrivate::stackUnder_sys(QWidget*) | - | ||||||||||||||||||||||||||||||||||||
| 7523 | { | - | ||||||||||||||||||||||||||||||||||||
| 7524 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7525 | if (QWidget *p = q->parentWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7526 | setDirtyOpaqueRegion(); | - | ||||||||||||||||||||||||||||||||||||
| 7527 | p->d_func()->invalidateBuffer(effectiveRectFor(q->geometry())); | - | ||||||||||||||||||||||||||||||||||||
| 7528 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7529 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7530 | QRect QWidgetPrivate::frameStrut() const | - | ||||||||||||||||||||||||||||||||||||
| 7531 | { | - | ||||||||||||||||||||||||||||||||||||
| 7532 | const QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7533 | if (!q->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7534 | - | |||||||||||||||||||||||||||||||||||||
| 7535 | return never executed: QRect(0, 0, 1, 1);return QRect(0, 0, 1, 1);never executed: return QRect(0, 0, 1, 1); | 0 | ||||||||||||||||||||||||||||||||||||
| 7536 | } | - | ||||||||||||||||||||||||||||||||||||
| 7537 | - | |||||||||||||||||||||||||||||||||||||
| 7538 | if (data.fstrut_dirty
| 0 | ||||||||||||||||||||||||||||||||||||
| 7539 | - | |||||||||||||||||||||||||||||||||||||
| 7540 | - | |||||||||||||||||||||||||||||||||||||
| 7541 | && q->isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7542 | - | |||||||||||||||||||||||||||||||||||||
| 7543 | && q->testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7544 | const_cast< never executed: QWidgetPrivate *>(this)->updateFrameStrut();const_cast<QWidgetPrivate *>(this)->updateFrameStrut();never executed: const_cast<QWidgetPrivate *>(this)->updateFrameStrut(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7545 | - | |||||||||||||||||||||||||||||||||||||
| 7546 | return never executed: maybeTopData() ? maybeTopData()->frameStrut : QRect();return maybeTopData() ? maybeTopData()->frameStrut : QRect();never executed: return maybeTopData() ? maybeTopData()->frameStrut : QRect(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7547 | } | - | ||||||||||||||||||||||||||||||||||||
| 7548 | - | |||||||||||||||||||||||||||||||||||||
| 7549 | void QWidgetPrivate::updateFrameStrut() | - | ||||||||||||||||||||||||||||||||||||
| 7550 | { | - | ||||||||||||||||||||||||||||||||||||
| 7551 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7552 | if (q->data->fstrut_dirty
| 0 | ||||||||||||||||||||||||||||||||||||
| 7553 | if (QTLWExtra *te = maybeTopData()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7554 | if (te->window
| 0 | ||||||||||||||||||||||||||||||||||||
| 7555 | const QMargins margins = te->window->frameMargins(); | - | ||||||||||||||||||||||||||||||||||||
| 7556 | if (!margins.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7557 | te->frameStrut.setCoords(margins.left(), margins.top(), margins.right(), margins.bottom()); | - | ||||||||||||||||||||||||||||||||||||
| 7558 | q->data->fstrut_dirty = false; | - | ||||||||||||||||||||||||||||||||||||
| 7559 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7560 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7561 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7562 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7563 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7564 | void QWidget::setBackingStore(QBackingStore *store) | - | ||||||||||||||||||||||||||||||||||||
| 7565 | { | - | ||||||||||||||||||||||||||||||||||||
| 7566 | - | |||||||||||||||||||||||||||||||||||||
| 7567 | - | |||||||||||||||||||||||||||||||||||||
| 7568 | if (!isTopLevel()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7569 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 7570 | - | |||||||||||||||||||||||||||||||||||||
| 7571 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7572 | - | |||||||||||||||||||||||||||||||||||||
| 7573 | QTLWExtra *topData = d->topData(); | - | ||||||||||||||||||||||||||||||||||||
| 7574 | if (topData->backingStore == store
| 0 | ||||||||||||||||||||||||||||||||||||
| 7575 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 7576 | - | |||||||||||||||||||||||||||||||||||||
| 7577 | QBackingStore *oldStore = topData->backingStore; | - | ||||||||||||||||||||||||||||||||||||
| 7578 | deleteBackingStore(d); | - | ||||||||||||||||||||||||||||||||||||
| 7579 | topData->backingStore = store; | - | ||||||||||||||||||||||||||||||||||||
| 7580 | - | |||||||||||||||||||||||||||||||||||||
| 7581 | QWidgetBackingStore *bs = d->maybeBackingStore(); | - | ||||||||||||||||||||||||||||||||||||
| 7582 | if (!bs
| 0 | ||||||||||||||||||||||||||||||||||||
| 7583 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 7584 | - | |||||||||||||||||||||||||||||||||||||
| 7585 | if (isTopLevel()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7586 | if (bs->store != oldStore
| 0 | ||||||||||||||||||||||||||||||||||||
| 7587 | delete bs->store; never executed: delete bs->store; | 0 | ||||||||||||||||||||||||||||||||||||
| 7588 | bs->store = store; | - | ||||||||||||||||||||||||||||||||||||
| 7589 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7590 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7591 | - | |||||||||||||||||||||||||||||||||||||
| 7592 | - | |||||||||||||||||||||||||||||||||||||
| 7593 | - | |||||||||||||||||||||||||||||||||||||
| 7594 | - | |||||||||||||||||||||||||||||||||||||
| 7595 | - | |||||||||||||||||||||||||||||||||||||
| 7596 | - | |||||||||||||||||||||||||||||||||||||
| 7597 | QBackingStore *QWidget::backingStore() const | - | ||||||||||||||||||||||||||||||||||||
| 7598 | { | - | ||||||||||||||||||||||||||||||||||||
| 7599 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7600 | QTLWExtra *extra = d->maybeTopData(); | - | ||||||||||||||||||||||||||||||||||||
| 7601 | if (extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 7602 | return never executed: extra->backingStore;return extra->backingStore;never executed: return extra->backingStore; | 0 | ||||||||||||||||||||||||||||||||||||
| 7603 | - | |||||||||||||||||||||||||||||||||||||
| 7604 | QWidgetBackingStore *bs = d->maybeBackingStore(); | - | ||||||||||||||||||||||||||||||||||||
| 7605 | - | |||||||||||||||||||||||||||||||||||||
| 7606 | return never executed: bs ? bs->store : 0;return bs ? bs->store : 0;never executed: return bs ? bs->store : 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 7607 | } | - | ||||||||||||||||||||||||||||||||||||
| 7608 | - | |||||||||||||||||||||||||||||||||||||
| 7609 | void QWidgetPrivate::getLayoutItemMargins(int *left, int *top, int *right, int *bottom) const | - | ||||||||||||||||||||||||||||||||||||
| 7610 | { | - | ||||||||||||||||||||||||||||||||||||
| 7611 | if (left
| 0 | ||||||||||||||||||||||||||||||||||||
| 7612 | * never executed: left = (int)leftLayoutItemMargin;*left = (int)leftLayoutItemMargin;never executed: *left = (int)leftLayoutItemMargin; | 0 | ||||||||||||||||||||||||||||||||||||
| 7613 | if (top
| 0 | ||||||||||||||||||||||||||||||||||||
| 7614 | * never executed: top = (int)topLayoutItemMargin;*top = (int)topLayoutItemMargin;never executed: *top = (int)topLayoutItemMargin; | 0 | ||||||||||||||||||||||||||||||||||||
| 7615 | if (right
| 0 | ||||||||||||||||||||||||||||||||||||
| 7616 | * never executed: right = (int)rightLayoutItemMargin;*right = (int)rightLayoutItemMargin;never executed: *right = (int)rightLayoutItemMargin; | 0 | ||||||||||||||||||||||||||||||||||||
| 7617 | if (bottom
| 0 | ||||||||||||||||||||||||||||||||||||
| 7618 | * never executed: bottom = (int)bottomLayoutItemMargin;*bottom = (int)bottomLayoutItemMargin;never executed: *bottom = (int)bottomLayoutItemMargin; | 0 | ||||||||||||||||||||||||||||||||||||
| 7619 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7620 | - | |||||||||||||||||||||||||||||||||||||
| 7621 | void QWidgetPrivate::setLayoutItemMargins(int left, int top, int right, int bottom) | - | ||||||||||||||||||||||||||||||||||||
| 7622 | { | - | ||||||||||||||||||||||||||||||||||||
| 7623 | if (leftLayoutItemMargin == left
| 0 | ||||||||||||||||||||||||||||||||||||
| 7624 | && topLayoutItemMargin == top
| 0 | ||||||||||||||||||||||||||||||||||||
| 7625 | && rightLayoutItemMargin == right
| 0 | ||||||||||||||||||||||||||||||||||||
| 7626 | && bottomLayoutItemMargin == bottom
| 0 | ||||||||||||||||||||||||||||||||||||
| 7627 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 7628 | - | |||||||||||||||||||||||||||||||||||||
| 7629 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7630 | leftLayoutItemMargin = (signed char)left; | - | ||||||||||||||||||||||||||||||||||||
| 7631 | topLayoutItemMargin = (signed char)top; | - | ||||||||||||||||||||||||||||||||||||
| 7632 | rightLayoutItemMargin = (signed char)right; | - | ||||||||||||||||||||||||||||||||||||
| 7633 | bottomLayoutItemMargin = (signed char)bottom; | - | ||||||||||||||||||||||||||||||||||||
| 7634 | q->updateGeometry(); | - | ||||||||||||||||||||||||||||||||||||
| 7635 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7636 | - | |||||||||||||||||||||||||||||||||||||
| 7637 | void QWidgetPrivate::setLayoutItemMargins(QStyle::SubElement element, const QStyleOption *opt) | - | ||||||||||||||||||||||||||||||||||||
| 7638 | { | - | ||||||||||||||||||||||||||||||||||||
| 7639 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7640 | QStyleOption myOpt; | - | ||||||||||||||||||||||||||||||||||||
| 7641 | if (!opt
| 0 | ||||||||||||||||||||||||||||||||||||
| 7642 | myOpt.initFrom(q); | - | ||||||||||||||||||||||||||||||||||||
| 7643 | myOpt.rect.setRect(0, 0, 32768, 32768); | - | ||||||||||||||||||||||||||||||||||||
| 7644 | opt = &myOpt; | - | ||||||||||||||||||||||||||||||||||||
| 7645 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7646 | - | |||||||||||||||||||||||||||||||||||||
| 7647 | QRect liRect = q->style()->subElementRect(element, opt, q); | - | ||||||||||||||||||||||||||||||||||||
| 7648 | if (liRect.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7649 | leftLayoutItemMargin = (signed char)(opt->rect.left() - liRect.left()); | - | ||||||||||||||||||||||||||||||||||||
| 7650 | topLayoutItemMargin = (signed char)(opt->rect.top() - liRect.top()); | - | ||||||||||||||||||||||||||||||||||||
| 7651 | rightLayoutItemMargin = (signed char)(liRect.right() - opt->rect.right()); | - | ||||||||||||||||||||||||||||||||||||
| 7652 | bottomLayoutItemMargin = (signed char)(liRect.bottom() - opt->rect.bottom()); | - | ||||||||||||||||||||||||||||||||||||
| 7653 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7654 | leftLayoutItemMargin = 0; | - | ||||||||||||||||||||||||||||||||||||
| 7655 | topLayoutItemMargin = 0; | - | ||||||||||||||||||||||||||||||||||||
| 7656 | rightLayoutItemMargin = 0; | - | ||||||||||||||||||||||||||||||||||||
| 7657 | bottomLayoutItemMargin = 0; | - | ||||||||||||||||||||||||||||||||||||
| 7658 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7659 | } | - | ||||||||||||||||||||||||||||||||||||
| 7660 | - | |||||||||||||||||||||||||||||||||||||
| 7661 | void QWidgetPrivate::adjustQuitOnCloseAttribute() | - | ||||||||||||||||||||||||||||||||||||
| 7662 | { | - | ||||||||||||||||||||||||||||||||||||
| 7663 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7664 | - | |||||||||||||||||||||||||||||||||||||
| 7665 | if (!q->parentWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7666 | Qt::WindowType type = q->windowType(); | - | ||||||||||||||||||||||||||||||||||||
| 7667 | if (type == Qt::Widget
| 0 | ||||||||||||||||||||||||||||||||||||
| 7668 | type = Qt::Window; never executed: type = Qt::Window; | 0 | ||||||||||||||||||||||||||||||||||||
| 7669 | if (type != Qt::Widget
| 0 | ||||||||||||||||||||||||||||||||||||
| 7670 | q->setAttribute(Qt::WA_QuitOnClose, false); never executed: q->setAttribute(Qt::WA_QuitOnClose, false); | 0 | ||||||||||||||||||||||||||||||||||||
| 7671 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7672 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7673 | - | |||||||||||||||||||||||||||||||||||||
| 7674 | QOpenGLContext *QWidgetPrivate::shareContext() const | - | ||||||||||||||||||||||||||||||||||||
| 7675 | { | - | ||||||||||||||||||||||||||||||||||||
| 7676 | - | |||||||||||||||||||||||||||||||||||||
| 7677 | - | |||||||||||||||||||||||||||||||||||||
| 7678 | - | |||||||||||||||||||||||||||||||||||||
| 7679 | if (__builtin_expect(!!(!extra || !extra->topextra || !extra->topextra->window), false)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7680 | QMessageLogger(__FILE__, 12203, __PRETTY_FUNCTION__).warning("Asking for share context for widget that does not have a window handle"); | - | ||||||||||||||||||||||||||||||||||||
| 7681 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 7682 | } | - | ||||||||||||||||||||||||||||||||||||
| 7683 | QWidgetPrivate *that = const_cast<QWidgetPrivate *>(this); | - | ||||||||||||||||||||||||||||||||||||
| 7684 | if (!extra->topextra->shareContext
| 0 | ||||||||||||||||||||||||||||||||||||
| 7685 | QOpenGLContext *ctx = new QOpenGLContext; | - | ||||||||||||||||||||||||||||||||||||
| 7686 | ctx->setShareContext(qt_gl_global_share_context()); | - | ||||||||||||||||||||||||||||||||||||
| 7687 | ctx->setFormat(extra->topextra->window->format()); | - | ||||||||||||||||||||||||||||||||||||
| 7688 | ctx->setScreen(extra->topextra->window->screen()); | - | ||||||||||||||||||||||||||||||||||||
| 7689 | ctx->create(); | - | ||||||||||||||||||||||||||||||||||||
| 7690 | that->extra->topextra->shareContext = ctx; | - | ||||||||||||||||||||||||||||||||||||
| 7691 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7692 | return never executed: that->extra->topextra->shareContext;return that->extra->topextra->shareContext;never executed: return that->extra->topextra->shareContext; | 0 | ||||||||||||||||||||||||||||||||||||
| 7693 | - | |||||||||||||||||||||||||||||||||||||
| 7694 | } | - | ||||||||||||||||||||||||||||||||||||
| 7695 | - | |||||||||||||||||||||||||||||||||||||
| 7696 | - | |||||||||||||||||||||||||||||||||||||
| 7697 | void QWidgetPrivate::sendComposeStatus(QWidget *w, bool end) | - | ||||||||||||||||||||||||||||||||||||
| 7698 | { | - | ||||||||||||||||||||||||||||||||||||
| 7699 | QWidgetPrivate *wd = QWidgetPrivate::get(w); | - | ||||||||||||||||||||||||||||||||||||
| 7700 | if (!wd->textureChildSeen
| 0 | ||||||||||||||||||||||||||||||||||||
| 7701 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 7702 | if (end
| 0 | ||||||||||||||||||||||||||||||||||||
| 7703 | wd->endCompose(); never executed: wd->endCompose(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7704 | else | - | ||||||||||||||||||||||||||||||||||||
| 7705 | wd->beginCompose(); never executed: wd->beginCompose(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7706 | for (int i = 0; i < wd->children.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7707 | w = qobject_cast<QWidget *>(wd->children.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 7708 | if (w
| 0 | ||||||||||||||||||||||||||||||||||||
| 7709 | sendComposeStatus(w, end); never executed: sendComposeStatus(w, end); | 0 | ||||||||||||||||||||||||||||||||||||
| 7710 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7711 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7712 | - | |||||||||||||||||||||||||||||||||||||
| 7713 | - | |||||||||||||||||||||||||||||||||||||
| 7714 | __attribute__((visibility("default"))) QWidgetData *qt_qwidget_data(QWidget *widget) | - | ||||||||||||||||||||||||||||||||||||
| 7715 | { | - | ||||||||||||||||||||||||||||||||||||
| 7716 | return never executed: widget->data;return widget->data;never executed: return widget->data; | 0 | ||||||||||||||||||||||||||||||||||||
| 7717 | } | - | ||||||||||||||||||||||||||||||||||||
| 7718 | - | |||||||||||||||||||||||||||||||||||||
| 7719 | __attribute__((visibility("default"))) QWidgetPrivate *qt_widget_private(QWidget *widget) | - | ||||||||||||||||||||||||||||||||||||
| 7720 | { | - | ||||||||||||||||||||||||||||||||||||
| 7721 | return never executed: widget->d_func();return widget->d_func();never executed: return widget->d_func(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7722 | } | - | ||||||||||||||||||||||||||||||||||||
| 7723 | QGraphicsProxyWidget *QWidget::graphicsProxyWidget() const | - | ||||||||||||||||||||||||||||||||||||
| 7724 | { | - | ||||||||||||||||||||||||||||||||||||
| 7725 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7726 | if (d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 7727 | return never executed: d->extra->proxyWidget;return d->extra->proxyWidget;never executed: return d->extra->proxyWidget; | 0 | ||||||||||||||||||||||||||||||||||||
| 7728 | } | - | ||||||||||||||||||||||||||||||||||||
| 7729 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 7730 | } | - | ||||||||||||||||||||||||||||||||||||
| 7731 | void QWidget::grabGesture(Qt::GestureType gesture, Qt::GestureFlags flags) | - | ||||||||||||||||||||||||||||||||||||
| 7732 | { | - | ||||||||||||||||||||||||||||||||||||
| 7733 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7734 | d->gestureContext.insert(gesture, flags); | - | ||||||||||||||||||||||||||||||||||||
| 7735 | (void)QGestureManager::instance(); | - | ||||||||||||||||||||||||||||||||||||
| 7736 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7737 | - | |||||||||||||||||||||||||||||||||||||
| 7738 | - | |||||||||||||||||||||||||||||||||||||
| 7739 | - | |||||||||||||||||||||||||||||||||||||
| 7740 | - | |||||||||||||||||||||||||||||||||||||
| 7741 | - | |||||||||||||||||||||||||||||||||||||
| 7742 | - | |||||||||||||||||||||||||||||||||||||
| 7743 | - | |||||||||||||||||||||||||||||||||||||
| 7744 | void QWidget::ungrabGesture(Qt::GestureType gesture) | - | ||||||||||||||||||||||||||||||||||||
| 7745 | { | - | ||||||||||||||||||||||||||||||||||||
| 7746 | - | |||||||||||||||||||||||||||||||||||||
| 7747 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7748 | if (d->gestureContext.remove(gesture)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7749 | if (QGestureManager *manager = QGestureManager::instance()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7750 | manager->cleanupCachedGestures(this, gesture); never executed: manager->cleanupCachedGestures(this, gesture); | 0 | ||||||||||||||||||||||||||||||||||||
| 7751 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7752 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7753 | void QWidget::destroy(bool destroyWindow, bool destroySubWindows) | - | ||||||||||||||||||||||||||||||||||||
| 7754 | { | - | ||||||||||||||||||||||||||||||||||||
| 7755 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7756 | - | |||||||||||||||||||||||||||||||||||||
| 7757 | d->aboutToDestroy(); | - | ||||||||||||||||||||||||||||||||||||
| 7758 | if (!isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7759 | parentWidget()->d_func()->invalidateBuffer(d->effectiveRectFor(geometry())); never executed: parentWidget()->d_func()->invalidateBuffer(d->effectiveRectFor(geometry())); | 0 | ||||||||||||||||||||||||||||||||||||
| 7760 | d->deactivateWidgetCleanup(); | - | ||||||||||||||||||||||||||||||||||||
| 7761 | - | |||||||||||||||||||||||||||||||||||||
| 7762 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 7763 | (static_cast< never executed: QApplication *>(QCoreApplication::instance()))->d_func()->closePopup(this);(static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->closePopup(this);never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->closePopup(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 7764 | - | |||||||||||||||||||||||||||||||||||||
| 7765 | if (this == QApplicationPrivate::active_window
| 0 | ||||||||||||||||||||||||||||||||||||
| 7766 | QApplication::setActiveWindow(0); never executed: QApplication::setActiveWindow(0); | 0 | ||||||||||||||||||||||||||||||||||||
| 7767 | if (QWidget::mouseGrabber() == this
| 0 | ||||||||||||||||||||||||||||||||||||
| 7768 | releaseMouse(); never executed: releaseMouse(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7769 | if (QWidget::keyboardGrabber() == this
| 0 | ||||||||||||||||||||||||||||||||||||
| 7770 | releaseKeyboard(); never executed: releaseKeyboard(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7771 | - | |||||||||||||||||||||||||||||||||||||
| 7772 | setAttribute(Qt::WA_WState_Created, false); | - | ||||||||||||||||||||||||||||||||||||
| 7773 | - | |||||||||||||||||||||||||||||||||||||
| 7774 | if (windowType() != Qt::Desktop
| 0 | ||||||||||||||||||||||||||||||||||||
| 7775 | if (destroySubWindows
| 0 | ||||||||||||||||||||||||||||||||||||
| 7776 | QObjectList childList(children()); | - | ||||||||||||||||||||||||||||||||||||
| 7777 | for (int i = 0; i < childList.size()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7778 | QWidget *widget = qobject_cast<QWidget *>(childList.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 7779 | if (widget
| 0 | ||||||||||||||||||||||||||||||||||||
| 7780 | if (widget->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7781 | widget->destroy(); | - | ||||||||||||||||||||||||||||||||||||
| 7782 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7783 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7784 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7785 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7786 | if (destroyWindow
| 0 | ||||||||||||||||||||||||||||||||||||
| 7787 | d->deleteTLSysExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 7788 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7789 | if (parentWidget()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7790 | d->hide_sys(); | - | ||||||||||||||||||||||||||||||||||||
| 7791 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7792 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7793 | - | |||||||||||||||||||||||||||||||||||||
| 7794 | d->setWinId(0); | - | ||||||||||||||||||||||||||||||||||||
| 7795 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7796 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7797 | QPaintEngine *QWidget::paintEngine() const | - | ||||||||||||||||||||||||||||||||||||
| 7798 | { | - | ||||||||||||||||||||||||||||||||||||
| 7799 | QMessageLogger(__FILE__, 12369, __PRETTY_FUNCTION__).warning("QWidget::paintEngine: Should no longer be called"); | - | ||||||||||||||||||||||||||||||||||||
| 7800 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 7801 | } | - | ||||||||||||||||||||||||||||||||||||
| 7802 | - | |||||||||||||||||||||||||||||||||||||
| 7803 | - | |||||||||||||||||||||||||||||||||||||
| 7804 | static inline bool canMapPosition(QWindow *window) | - | ||||||||||||||||||||||||||||||||||||
| 7805 | { | - | ||||||||||||||||||||||||||||||||||||
| 7806 | return never executed: window->handle() && !qt_window_private(window)->resizeEventPending;return window->handle() && !qt_window_private(window)->resizeEventPending;never executed: return window->handle() && !qt_window_private(window)->resizeEventPending; | 0 | ||||||||||||||||||||||||||||||||||||
| 7807 | } | - | ||||||||||||||||||||||||||||||||||||
| 7808 | - | |||||||||||||||||||||||||||||||||||||
| 7809 | - | |||||||||||||||||||||||||||||||||||||
| 7810 | static inline QGraphicsProxyWidget *graphicsProxyWidget(const QWidget *w) | - | ||||||||||||||||||||||||||||||||||||
| 7811 | { | - | ||||||||||||||||||||||||||||||||||||
| 7812 | QGraphicsProxyWidget *result = nullptr; | - | ||||||||||||||||||||||||||||||||||||
| 7813 | const QWidgetPrivate *d = qt_widget_private(const_cast<QWidget *>(w)); | - | ||||||||||||||||||||||||||||||||||||
| 7814 | if (d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 7815 | result = d->extra->proxyWidget; never executed: result = d->extra->proxyWidget; | 0 | ||||||||||||||||||||||||||||||||||||
| 7816 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||||||||||||||||||||||||||
| 7817 | } | - | ||||||||||||||||||||||||||||||||||||
| 7818 | - | |||||||||||||||||||||||||||||||||||||
| 7819 | - | |||||||||||||||||||||||||||||||||||||
| 7820 | struct MapToGlobalTransformResult { | - | ||||||||||||||||||||||||||||||||||||
| 7821 | QTransform transform; | - | ||||||||||||||||||||||||||||||||||||
| 7822 | QWindow *window; | - | ||||||||||||||||||||||||||||||||||||
| 7823 | }; | - | ||||||||||||||||||||||||||||||||||||
| 7824 | - | |||||||||||||||||||||||||||||||||||||
| 7825 | static MapToGlobalTransformResult mapToGlobalTransform(const QWidget *w) | - | ||||||||||||||||||||||||||||||||||||
| 7826 | { | - | ||||||||||||||||||||||||||||||||||||
| 7827 | MapToGlobalTransformResult result; | - | ||||||||||||||||||||||||||||||||||||
| 7828 | result.window = nullptr; | - | ||||||||||||||||||||||||||||||||||||
| 7829 | for ( ; w
| 0 | ||||||||||||||||||||||||||||||||||||
| 7830 | - | |||||||||||||||||||||||||||||||||||||
| 7831 | if (QGraphicsProxyWidget *qgpw = graphicsProxyWidget(w)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7832 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||
| 7833 | const QList <QGraphicsView *> views = scene->views(); | - | ||||||||||||||||||||||||||||||||||||
| 7834 | if (!views.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7835 | result.transform *= qgpw->sceneTransform(); | - | ||||||||||||||||||||||||||||||||||||
| 7836 | result.transform *= views.first()->viewportTransform(); | - | ||||||||||||||||||||||||||||||||||||
| 7837 | w = views.first()->viewport(); | - | ||||||||||||||||||||||||||||||||||||
| 7838 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7839 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7840 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7841 | - | |||||||||||||||||||||||||||||||||||||
| 7842 | QWindow *window = w->windowHandle(); | - | ||||||||||||||||||||||||||||||||||||
| 7843 | if (window
| 0 | ||||||||||||||||||||||||||||||||||||
| 7844 | result.window = window; | - | ||||||||||||||||||||||||||||||||||||
| 7845 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7846 | } | - | ||||||||||||||||||||||||||||||||||||
| 7847 | - | |||||||||||||||||||||||||||||||||||||
| 7848 | const QPoint topLeft = w->geometry().topLeft(); | - | ||||||||||||||||||||||||||||||||||||
| 7849 | result.transform.translate(topLeft.x(), topLeft.y()); | - | ||||||||||||||||||||||||||||||||||||
| 7850 | if (w->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7851 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 7852 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7853 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||||||||||||||||||||||||||
| 7854 | } | - | ||||||||||||||||||||||||||||||||||||
| 7855 | QPoint QWidget::mapToGlobal(const QPoint &pos) const | - | ||||||||||||||||||||||||||||||||||||
| 7856 | { | - | ||||||||||||||||||||||||||||||||||||
| 7857 | const MapToGlobalTransformResult t = mapToGlobalTransform(this); | - | ||||||||||||||||||||||||||||||||||||
| 7858 | const QPoint g = t.transform.map(pos); | - | ||||||||||||||||||||||||||||||||||||
| 7859 | return never executed: t.window ? t.window->mapToGlobal(g) : g;return t.window ? t.window->mapToGlobal(g) : g;never executed: return t.window ? t.window->mapToGlobal(g) : g; | 0 | ||||||||||||||||||||||||||||||||||||
| 7860 | } | - | ||||||||||||||||||||||||||||||||||||
| 7861 | QPoint QWidget::mapFromGlobal(const QPoint &pos) const | - | ||||||||||||||||||||||||||||||||||||
| 7862 | { | - | ||||||||||||||||||||||||||||||||||||
| 7863 | const MapToGlobalTransformResult t = mapToGlobalTransform(this); | - | ||||||||||||||||||||||||||||||||||||
| 7864 | const QPoint windowLocal = t.window
| 0 | ||||||||||||||||||||||||||||||||||||
| 7865 | return never executed: t.transform.inverted().map(windowLocal);return t.transform.inverted().map(windowLocal);never executed: return t.transform.inverted().map(windowLocal); | 0 | ||||||||||||||||||||||||||||||||||||
| 7866 | } | - | ||||||||||||||||||||||||||||||||||||
| 7867 | - | |||||||||||||||||||||||||||||||||||||
| 7868 | QWidget *qt_pressGrab = 0; | - | ||||||||||||||||||||||||||||||||||||
| 7869 | QWidget *qt_mouseGrb = 0; | - | ||||||||||||||||||||||||||||||||||||
| 7870 | static bool mouseGrabWithCursor = false; | - | ||||||||||||||||||||||||||||||||||||
| 7871 | static QWidget *keyboardGrb = 0; | - | ||||||||||||||||||||||||||||||||||||
| 7872 | - | |||||||||||||||||||||||||||||||||||||
| 7873 | static inline QWindow *grabberWindow(const QWidget *w) | - | ||||||||||||||||||||||||||||||||||||
| 7874 | { | - | ||||||||||||||||||||||||||||||||||||
| 7875 | QWindow *window = w->windowHandle(); | - | ||||||||||||||||||||||||||||||||||||
| 7876 | if (!window
| 0 | ||||||||||||||||||||||||||||||||||||
| 7877 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||
| 7878 | window = nativeParent->windowHandle(); never executed: window = nativeParent->windowHandle(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7879 | return never executed: window;return window;never executed: return window; | 0 | ||||||||||||||||||||||||||||||||||||
| 7880 | } | - | ||||||||||||||||||||||||||||||||||||
| 7881 | - | |||||||||||||||||||||||||||||||||||||
| 7882 | - | |||||||||||||||||||||||||||||||||||||
| 7883 | static void grabMouseForWidget(QWidget *widget, const QCursor *cursor = 0) | - | ||||||||||||||||||||||||||||||||||||
| 7884 | - | |||||||||||||||||||||||||||||||||||||
| 7885 | - | |||||||||||||||||||||||||||||||||||||
| 7886 | - | |||||||||||||||||||||||||||||||||||||
| 7887 | { | - | ||||||||||||||||||||||||||||||||||||
| 7888 | if (qt_mouseGrb
| 0 | ||||||||||||||||||||||||||||||||||||
| 7889 | qt_mouseGrb->releaseMouse(); never executed: qt_mouseGrb->releaseMouse(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7890 | - | |||||||||||||||||||||||||||||||||||||
| 7891 | mouseGrabWithCursor = false; | - | ||||||||||||||||||||||||||||||||||||
| 7892 | if (QWindow *window = grabberWindow(widget)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7893 | - | |||||||||||||||||||||||||||||||||||||
| 7894 | if (cursor
| 0 | ||||||||||||||||||||||||||||||||||||
| 7895 | mouseGrabWithCursor = true; | - | ||||||||||||||||||||||||||||||||||||
| 7896 | QGuiApplication::setOverrideCursor(*cursor); | - | ||||||||||||||||||||||||||||||||||||
| 7897 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7898 | - | |||||||||||||||||||||||||||||||||||||
| 7899 | window->setMouseGrabEnabled(true); | - | ||||||||||||||||||||||||||||||||||||
| 7900 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7901 | - | |||||||||||||||||||||||||||||||||||||
| 7902 | qt_mouseGrb = widget; | - | ||||||||||||||||||||||||||||||||||||
| 7903 | qt_pressGrab = 0; | - | ||||||||||||||||||||||||||||||||||||
| 7904 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7905 | - | |||||||||||||||||||||||||||||||||||||
| 7906 | static void releaseMouseGrabOfWidget(QWidget *widget) | - | ||||||||||||||||||||||||||||||||||||
| 7907 | { | - | ||||||||||||||||||||||||||||||||||||
| 7908 | if (qt_mouseGrb == widget
| 0 | ||||||||||||||||||||||||||||||||||||
| 7909 | if (QWindow *window = grabberWindow(widget)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7910 | - | |||||||||||||||||||||||||||||||||||||
| 7911 | if (mouseGrabWithCursor
| 0 | ||||||||||||||||||||||||||||||||||||
| 7912 | QGuiApplication::restoreOverrideCursor(); | - | ||||||||||||||||||||||||||||||||||||
| 7913 | mouseGrabWithCursor = false; | - | ||||||||||||||||||||||||||||||||||||
| 7914 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7915 | - | |||||||||||||||||||||||||||||||||||||
| 7916 | window->setMouseGrabEnabled(false); | - | ||||||||||||||||||||||||||||||||||||
| 7917 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7918 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7919 | qt_mouseGrb = 0; | - | ||||||||||||||||||||||||||||||||||||
| 7920 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7921 | void QWidget::grabMouse() | - | ||||||||||||||||||||||||||||||||||||
| 7922 | { | - | ||||||||||||||||||||||||||||||||||||
| 7923 | grabMouseForWidget(this); | - | ||||||||||||||||||||||||||||||||||||
| 7924 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7925 | void QWidget::grabMouse(const QCursor &cursor) | - | ||||||||||||||||||||||||||||||||||||
| 7926 | { | - | ||||||||||||||||||||||||||||||||||||
| 7927 | grabMouseForWidget(this, &cursor); | - | ||||||||||||||||||||||||||||||||||||
| 7928 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7929 | - | |||||||||||||||||||||||||||||||||||||
| 7930 | - | |||||||||||||||||||||||||||||||||||||
| 7931 | bool QWidgetPrivate::stealMouseGrab(bool grab) | - | ||||||||||||||||||||||||||||||||||||
| 7932 | { | - | ||||||||||||||||||||||||||||||||||||
| 7933 | - | |||||||||||||||||||||||||||||||||||||
| 7934 | - | |||||||||||||||||||||||||||||||||||||
| 7935 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7936 | QWindow *window = grabberWindow(q); | - | ||||||||||||||||||||||||||||||||||||
| 7937 | return never executed: window ? window->setMouseGrabEnabled(grab) : false;return window ? window->setMouseGrabEnabled(grab) : false;never executed: return window ? window->setMouseGrabEnabled(grab) : false; | 0 | ||||||||||||||||||||||||||||||||||||
| 7938 | } | - | ||||||||||||||||||||||||||||||||||||
| 7939 | void QWidget::releaseMouse() | - | ||||||||||||||||||||||||||||||||||||
| 7940 | { | - | ||||||||||||||||||||||||||||||||||||
| 7941 | releaseMouseGrabOfWidget(this); | - | ||||||||||||||||||||||||||||||||||||
| 7942 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7943 | void QWidget::grabKeyboard() | - | ||||||||||||||||||||||||||||||||||||
| 7944 | { | - | ||||||||||||||||||||||||||||||||||||
| 7945 | if (keyboardGrb
| 0 | ||||||||||||||||||||||||||||||||||||
| 7946 | keyboardGrb->releaseKeyboard(); never executed: keyboardGrb->releaseKeyboard(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7947 | if (QWindow *window = grabberWindow(this)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7948 | window->setKeyboardGrabEnabled(true); never executed: window->setKeyboardGrabEnabled(true); | 0 | ||||||||||||||||||||||||||||||||||||
| 7949 | keyboardGrb = this; | - | ||||||||||||||||||||||||||||||||||||
| 7950 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7951 | - | |||||||||||||||||||||||||||||||||||||
| 7952 | bool QWidgetPrivate::stealKeyboardGrab(bool grab) | - | ||||||||||||||||||||||||||||||||||||
| 7953 | { | - | ||||||||||||||||||||||||||||||||||||
| 7954 | - | |||||||||||||||||||||||||||||||||||||
| 7955 | - | |||||||||||||||||||||||||||||||||||||
| 7956 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7957 | QWindow *window = grabberWindow(q); | - | ||||||||||||||||||||||||||||||||||||
| 7958 | return never executed: window ? window->setKeyboardGrabEnabled(grab) : false;return window ? window->setKeyboardGrabEnabled(grab) : false;never executed: return window ? window->setKeyboardGrabEnabled(grab) : false; | 0 | ||||||||||||||||||||||||||||||||||||
| 7959 | } | - | ||||||||||||||||||||||||||||||||||||
| 7960 | void QWidget::releaseKeyboard() | - | ||||||||||||||||||||||||||||||||||||
| 7961 | { | - | ||||||||||||||||||||||||||||||||||||
| 7962 | if (keyboardGrb == this
| 0 | ||||||||||||||||||||||||||||||||||||
| 7963 | if (QWindow *window = grabberWindow(this)
| 0 | ||||||||||||||||||||||||||||||||||||
| 7964 | window->setKeyboardGrabEnabled(false); never executed: window->setKeyboardGrabEnabled(false); | 0 | ||||||||||||||||||||||||||||||||||||
| 7965 | keyboardGrb = 0; | - | ||||||||||||||||||||||||||||||||||||
| 7966 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7967 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7968 | QWidget *QWidget::mouseGrabber() | - | ||||||||||||||||||||||||||||||||||||
| 7969 | { | - | ||||||||||||||||||||||||||||||||||||
| 7970 | if (qt_mouseGrb
| 0 | ||||||||||||||||||||||||||||||||||||
| 7971 | return never executed: qt_mouseGrb;return qt_mouseGrb;never executed: return qt_mouseGrb; | 0 | ||||||||||||||||||||||||||||||||||||
| 7972 | return never executed: qt_pressGrab;return qt_pressGrab;never executed: return qt_pressGrab; | 0 | ||||||||||||||||||||||||||||||||||||
| 7973 | } | - | ||||||||||||||||||||||||||||||||||||
| 7974 | QWidget *QWidget::keyboardGrabber() | - | ||||||||||||||||||||||||||||||||||||
| 7975 | { | - | ||||||||||||||||||||||||||||||||||||
| 7976 | return never executed: keyboardGrb;return keyboardGrb;never executed: return keyboardGrb; | 0 | ||||||||||||||||||||||||||||||||||||
| 7977 | } | - | ||||||||||||||||||||||||||||||||||||
| 7978 | void QWidget::activateWindow() | - | ||||||||||||||||||||||||||||||||||||
| 7979 | { | - | ||||||||||||||||||||||||||||||||||||
| 7980 | QWindow *const wnd = window()->windowHandle(); | - | ||||||||||||||||||||||||||||||||||||
| 7981 | - | |||||||||||||||||||||||||||||||||||||
| 7982 | if (wnd
| 0 | ||||||||||||||||||||||||||||||||||||
| 7983 | wnd->requestActivate(); never executed: wnd->requestActivate(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7984 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7985 | int QWidget::metric(PaintDeviceMetric m) const | - | ||||||||||||||||||||||||||||||||||||
| 7986 | { | - | ||||||||||||||||||||||||||||||||||||
| 7987 | const QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 7988 | - | |||||||||||||||||||||||||||||||||||||
| 7989 | QWindow *topLevelWindow = 0; | - | ||||||||||||||||||||||||||||||||||||
| 7990 | QScreen *screen = 0; | - | ||||||||||||||||||||||||||||||||||||
| 7991 | if (QWidget *topLevel = window()
| 0 | ||||||||||||||||||||||||||||||||||||
| 7992 | topLevelWindow = topLevel->windowHandle(); | - | ||||||||||||||||||||||||||||||||||||
| 7993 | if (topLevelWindow
| 0 | ||||||||||||||||||||||||||||||||||||
| 7994 | screen = topLevelWindow->screen(); never executed: screen = topLevelWindow->screen(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7995 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 7996 | if (!screen
| 0 | ||||||||||||||||||||||||||||||||||||
| 7997 | screen = QGuiApplication::primaryScreen(); never executed: screen = QGuiApplication::primaryScreen(); | 0 | ||||||||||||||||||||||||||||||||||||
| 7998 | - | |||||||||||||||||||||||||||||||||||||
| 7999 | if (!screen
| 0 | ||||||||||||||||||||||||||||||||||||
| 8000 | if (m == PdmDpiX
| 0 | ||||||||||||||||||||||||||||||||||||
| 8001 | return never executed: 72;return 72;never executed: return 72; | 0 | ||||||||||||||||||||||||||||||||||||
| 8002 | return never executed: QPaintDevice::metric(m);return QPaintDevice::metric(m);never executed: return QPaintDevice::metric(m); | 0 | ||||||||||||||||||||||||||||||||||||
| 8003 | } | - | ||||||||||||||||||||||||||||||||||||
| 8004 | int val; | - | ||||||||||||||||||||||||||||||||||||
| 8005 | if (m == PdmWidth
| 0 | ||||||||||||||||||||||||||||||||||||
| 8006 | val = data->crect.width(); | - | ||||||||||||||||||||||||||||||||||||
| 8007 | } never executed: else if (m == PdmWidthMMend of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 8008 | val = data->crect.width() * screen->physicalSize().width() / screen->geometry().width(); | - | ||||||||||||||||||||||||||||||||||||
| 8009 | } never executed: else if (m == PdmHeightend of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 8010 | val = data->crect.height(); | - | ||||||||||||||||||||||||||||||||||||
| 8011 | } never executed: else if (m == PdmHeightMMend of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 8012 | val = data->crect.height() * screen->physicalSize().height() / screen->geometry().height(); | - | ||||||||||||||||||||||||||||||||||||
| 8013 | } never executed: else if (m == PdmDepthend of block
| 0 | ||||||||||||||||||||||||||||||||||||
| 8014 | return never executed: screen->depth();return screen->depth();never executed: return screen->depth(); | 0 | ||||||||||||||||||||||||||||||||||||
| 8015 | } else if (m == PdmDpiX
| 0 | ||||||||||||||||||||||||||||||||||||
| 8016 | if (d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 8017 | return never executed: d->extra->customDpiX;return d->extra->customDpiX;never executed: return d->extra->customDpiX; | 0 | ||||||||||||||||||||||||||||||||||||
| 8018 | else if (d->parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 8019 | return never executed: static_cast<QWidget *>(d->parent)->metric(m);return static_cast<QWidget *>(d->parent)->metric(m);never executed: return static_cast<QWidget *>(d->parent)->metric(m); | 0 | ||||||||||||||||||||||||||||||||||||
| 8020 | return never executed: qRound(screen->logicalDotsPerInchX());return qRound(screen->logicalDotsPerInchX());never executed: return qRound(screen->logicalDotsPerInchX()); | 0 | ||||||||||||||||||||||||||||||||||||
| 8021 | } else if (m == PdmDpiY
| 0 | ||||||||||||||||||||||||||||||||||||
| 8022 | if (d->extra
| 0 | ||||||||||||||||||||||||||||||||||||
| 8023 | return never executed: d->extra->customDpiY;return d->extra->customDpiY;never executed: return d->extra->customDpiY; | 0 | ||||||||||||||||||||||||||||||||||||
| 8024 | else if (d->parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 8025 | return never executed: static_cast<QWidget *>(d->parent)->metric(m);return static_cast<QWidget *>(d->parent)->metric(m);never executed: return static_cast<QWidget *>(d->parent)->metric(m); | 0 | ||||||||||||||||||||||||||||||||||||
| 8026 | return never executed: qRound(screen->logicalDotsPerInchY());return qRound(screen->logicalDotsPerInchY());never executed: return qRound(screen->logicalDotsPerInchY()); | 0 | ||||||||||||||||||||||||||||||||||||
| 8027 | } else if (m == PdmPhysicalDpiX
| 0 | ||||||||||||||||||||||||||||||||||||
| 8028 | return never executed: qRound(screen->physicalDotsPerInchX());return qRound(screen->physicalDotsPerInchX());never executed: return qRound(screen->physicalDotsPerInchX()); | 0 | ||||||||||||||||||||||||||||||||||||
| 8029 | } else if (m == PdmPhysicalDpiY
| 0 | ||||||||||||||||||||||||||||||||||||
| 8030 | return never executed: qRound(screen->physicalDotsPerInchY());return qRound(screen->physicalDotsPerInchY());never executed: return qRound(screen->physicalDotsPerInchY()); | 0 | ||||||||||||||||||||||||||||||||||||
| 8031 | } else if (m == PdmDevicePixelRatio
| 0 | ||||||||||||||||||||||||||||||||||||
| 8032 | return never executed: topLevelWindow ? topLevelWindow->devicePixelRatio() : (static_cast<QApplication *>(QCoreApplication::instance()))->devicePixelRatio();return topLevelWindow ? topLevelWindow->devicePixelRatio() : (static_cast<QApplication *>(QCoreApplication::instance()))->devicePixelRatio();never executed: return topLevelWindow ? topLevelWindow->devicePixelRatio() : (static_cast<QApplication *>(QCoreApplication::instance()))->devicePixelRatio(); | 0 | ||||||||||||||||||||||||||||||||||||
| 8033 | } else if (m == PdmDevicePixelRatioScaled
| 0 | ||||||||||||||||||||||||||||||||||||
| 8034 | return never executed: (QPaintDevice::devicePixelRatioFScale() *return (QPaintDevice::devicePixelRatioFScale() * (topLevelWindow ? topLevelWindow->devicePixelRatio() : (static_cast<QApplication *>(QCoreApplication::instance()))->devicePixelRatio()));never executed: return (QPaintDevice::devicePixelRatioFScale() * (topLevelWindow ? topLevelWindow->devicePixelRatio() : (static_cast<QApplication *>(QCoreApplication::instance()))->devicePixelRatio())); | 0 | ||||||||||||||||||||||||||||||||||||
| 8035 | (topLevelWindow ? topLevelWindow->devicePixelRatio() : (static_cast<QApplication *>(QCoreApplication::instance()))->devicePixelRatio())); never executed: return (QPaintDevice::devicePixelRatioFScale() * (topLevelWindow ? topLevelWindow->devicePixelRatio() : (static_cast<QApplication *>(QCoreApplication::instance()))->devicePixelRatio())); | 0 | ||||||||||||||||||||||||||||||||||||
| 8036 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 8037 | val = QPaintDevice::metric(m); | - | ||||||||||||||||||||||||||||||||||||
| 8038 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 8039 | return never executed: val;return val;never executed: return val; | 0 | ||||||||||||||||||||||||||||||||||||
| 8040 | } | - | ||||||||||||||||||||||||||||||||||||
| 8041 | - | |||||||||||||||||||||||||||||||||||||
| 8042 | - | |||||||||||||||||||||||||||||||||||||
| 8043 | - | |||||||||||||||||||||||||||||||||||||
| 8044 | - | |||||||||||||||||||||||||||||||||||||
| 8045 | - | |||||||||||||||||||||||||||||||||||||
| 8046 | - | |||||||||||||||||||||||||||||||||||||
| 8047 | void QWidget::initPainter(QPainter *painter) const | - | ||||||||||||||||||||||||||||||||||||
| 8048 | { | - | ||||||||||||||||||||||||||||||||||||
| 8049 | const QPalette &pal = palette(); | - | ||||||||||||||||||||||||||||||||||||
| 8050 | painter->d_func()->state->pen = QPen(pal.brush(foregroundRole()), 1); | - | ||||||||||||||||||||||||||||||||||||
| 8051 | painter->d_func()->state->bgBrush = pal.brush(backgroundRole()); | - | ||||||||||||||||||||||||||||||||||||
| 8052 | QFont f(font(), const_cast<QWidget *>(this)); | - | ||||||||||||||||||||||||||||||||||||
| 8053 | painter->d_func()->state->deviceFont = f; | - | ||||||||||||||||||||||||||||||||||||
| 8054 | painter->d_func()->state->font = f; | - | ||||||||||||||||||||||||||||||||||||
| 8055 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 8056 | - | |||||||||||||||||||||||||||||||||||||
| 8057 | - | |||||||||||||||||||||||||||||||||||||
| 8058 | - | |||||||||||||||||||||||||||||||||||||
| 8059 | - | |||||||||||||||||||||||||||||||||||||
| 8060 | - | |||||||||||||||||||||||||||||||||||||
| 8061 | - | |||||||||||||||||||||||||||||||||||||
| 8062 | QPaintDevice *QWidget::redirected(QPoint *offset) const | - | ||||||||||||||||||||||||||||||||||||
| 8063 | { | - | ||||||||||||||||||||||||||||||||||||
| 8064 | return never executed: d_func()->redirected(offset);return d_func()->redirected(offset);never executed: return d_func()->redirected(offset); | 0 | ||||||||||||||||||||||||||||||||||||
| 8065 | } | - | ||||||||||||||||||||||||||||||||||||
| 8066 | - | |||||||||||||||||||||||||||||||||||||
| 8067 | - | |||||||||||||||||||||||||||||||||||||
| 8068 | - | |||||||||||||||||||||||||||||||||||||
| 8069 | - | |||||||||||||||||||||||||||||||||||||
| 8070 | - | |||||||||||||||||||||||||||||||||||||
| 8071 | - | |||||||||||||||||||||||||||||||||||||
| 8072 | QPainter *QWidget::sharedPainter() const | - | ||||||||||||||||||||||||||||||||||||
| 8073 | { | - | ||||||||||||||||||||||||||||||||||||
| 8074 | - | |||||||||||||||||||||||||||||||||||||
| 8075 | if (!d_func()->redirectDev
| 0 | ||||||||||||||||||||||||||||||||||||
| 8076 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 8077 | - | |||||||||||||||||||||||||||||||||||||
| 8078 | QPainter *sp = d_func()->sharedPainter(); | - | ||||||||||||||||||||||||||||||||||||
| 8079 | if (!sp
| 0 | ||||||||||||||||||||||||||||||||||||
| 8080 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 8081 | - | |||||||||||||||||||||||||||||||||||||
| 8082 | if (sp->paintEngine()->paintDevice() != d_func()->redirectDev
| 0 | ||||||||||||||||||||||||||||||||||||
| 8083 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 8084 | - | |||||||||||||||||||||||||||||||||||||
| 8085 | return never executed: sp;return sp;never executed: return sp; | 0 | ||||||||||||||||||||||||||||||||||||
| 8086 | } | - | ||||||||||||||||||||||||||||||||||||
| 8087 | void QWidget::setMask(const QRegion &newMask) | - | ||||||||||||||||||||||||||||||||||||
| 8088 | { | - | ||||||||||||||||||||||||||||||||||||
| 8089 | QWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||
| 8090 | - | |||||||||||||||||||||||||||||||||||||
| 8091 | d->createExtra(); | - | ||||||||||||||||||||||||||||||||||||
| 8092 | if (newMask == d->extra->mask
| 0 | ||||||||||||||||||||||||||||||||||||
| 8093 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 8094 | - | |||||||||||||||||||||||||||||||||||||
| 8095 | - | |||||||||||||||||||||||||||||||||||||
| 8096 | const QRegion oldMask(d->extra->mask); | - | ||||||||||||||||||||||||||||||||||||
| 8097 | - | |||||||||||||||||||||||||||||||||||||
| 8098 | - | |||||||||||||||||||||||||||||||||||||
| 8099 | d->extra->mask = newMask; | - | ||||||||||||||||||||||||||||||||||||
| 8100 | d->extra->hasMask = !newMask.isEmpty(); | - | ||||||||||||||||||||||||||||||||||||
| 8101 | - | |||||||||||||||||||||||||||||||||||||
| 8102 | - | |||||||||||||||||||||||||||||||||||||
| 8103 | if (!testAttribute(Qt::WA_WState_Created)
| 0 | ||||||||||||||||||||||||||||||||||||
| 8104 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 8105 | - | |||||||||||||||||||||||||||||||||||||
| 8106 | - | |||||||||||||||||||||||||||||||||||||
| 8107 | d->setMask_sys(newMask); | - | ||||||||||||||||||||||||||||||||||||
| 8108 | - | |||||||||||||||||||||||||||||||||||||
| 8109 | - | |||||||||||||||||||||||||||||||||||||
| 8110 | if (!isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 8111 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 8112 | - | |||||||||||||||||||||||||||||||||||||
| 8113 | if (!d->extra->hasMask
| 0 | ||||||||||||||||||||||||||||||||||||
| 8114 | - | |||||||||||||||||||||||||||||||||||||
| 8115 | QRegion expose(rect()); | - | ||||||||||||||||||||||||||||||||||||
| 8116 | expose -= oldMask; | - | ||||||||||||||||||||||||||||||||||||
| 8117 | if (!expose.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 8118 | d->setDirtyOpaqueRegion(); | - | ||||||||||||||||||||||||||||||||||||
| 8119 | update(expose); | - | ||||||||||||||||||||||||||||||||||||
| 8120 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 8121 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 8122 | } | - | ||||||||||||||||||||||||||||||||||||
| 8123 | - | |||||||||||||||||||||||||||||||||||||
| 8124 | if (!isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 8125 | - | |||||||||||||||||||||||||||||||||||||
| 8126 | QRegion parentExpose(rect()); | - | ||||||||||||||||||||||||||||||||||||
| 8127 | parentExpose -= newMask; | - | ||||||||||||||||||||||||||||||||||||
| 8128 | if (!parentExpose.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 8129 | d->setDirtyOpaqueRegion(); | - | ||||||||||||||||||||||||||||||||||||
| 8130 | parentExpose.translate(data->crect.topLeft()); | - | ||||||||||||||||||||||||||||||||||||
| 8131 | parentWidget()->update(parentExpose); | - | ||||||||||||||||||||||||||||||||||||
| 8132 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 8133 | - | |||||||||||||||||||||||||||||||||||||
| 8134 | - | |||||||||||||||||||||||||||||||||||||
| 8135 | if (!oldMask.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 8136 | update(newMask - oldMask); never executed: update(newMask - oldMask); | 0 | ||||||||||||||||||||||||||||||||||||
| 8137 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 8138 | - | |||||||||||||||||||||||||||||||||||||
| 8139 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 8140 | - | |||||||||||||||||||||||||||||||||||||
| 8141 | void QWidgetPrivate::setMask_sys(const QRegion ®ion) | - | ||||||||||||||||||||||||||||||||||||
| 8142 | { | - | ||||||||||||||||||||||||||||||||||||
| 8143 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 8144 | if (QWindow *window = q->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 8145 | window->setMask(region); never executed: window->setMask(region); | 0 | ||||||||||||||||||||||||||||||||||||
| 8146 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 8147 | void QWidget::setMask(const QBitmap &bitmap) | - | ||||||||||||||||||||||||||||||||||||
| 8148 | { | - | ||||||||||||||||||||||||||||||||||||
| 8149 | setMask(QRegion(bitmap)); | - | ||||||||||||||||||||||||||||||||||||
| 8150 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 8151 | void QWidget::clearMask() | - | ||||||||||||||||||||||||||||||||||||
| 8152 | { | - | ||||||||||||||||||||||||||||||||||||
| 8153 | setMask(QRegion()); | - | ||||||||||||||||||||||||||||||||||||
| 8154 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 8155 | - | |||||||||||||||||||||||||||||||||||||
| 8156 | void QWidgetPrivate::setWidgetParentHelper(QObject *widgetAsObject, QObject *newParent) | - | ||||||||||||||||||||||||||||||||||||
| 8157 | { | - | ||||||||||||||||||||||||||||||||||||
| 8158 | ((!(widgetAsObject->isWidgetType())) ? qt_assert("widgetAsObject->isWidgetType()",__FILE__,12954) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 8159 | ((!(!newParent || newParent->isWidgetType())) ? qt_assert("!newParent || newParent->isWidgetType()",__FILE__,12955) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||
| 8160 | QWidget *widget = static_cast<QWidget*>(widgetAsObject); | - | ||||||||||||||||||||||||||||||||||||
| 8161 | widget->setParent(static_cast<QWidget*>(newParent)); | - | ||||||||||||||||||||||||||||||||||||
| 8162 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 8163 | - | |||||||||||||||||||||||||||||||||||||
| 8164 | void QWidgetPrivate::setNetWmWindowTypes(bool skipIfMissing) | - | ||||||||||||||||||||||||||||||||||||
| 8165 | { | - | ||||||||||||||||||||||||||||||||||||
| 8166 | QWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||
| 8167 | - | |||||||||||||||||||||||||||||||||||||
| 8168 | if (!q->windowHandle()
| 0 | ||||||||||||||||||||||||||||||||||||
| 8169 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 8170 | - | |||||||||||||||||||||||||||||||||||||
| 8171 | int wmWindowType = 0; | - | ||||||||||||||||||||||||||||||||||||
| 8172 | if (q->testAttribute(Qt::WA_X11NetWmWindowTypeDesktop)
| 0 | ||||||||||||||||||||||||||||||||||||
| 8173 | wmWindowType |= QXcbWindowFunctions::Desktop; never executed: wmWindowType |= QXcbWindowFunctions::Desktop; | 0 | ||||||||||||||||||||||||||||||||||||
| 8174 | if (q->testAttribute(Qt::WA_X11NetWmWindowTypeDock)
| 0 | ||||||||||||||||||||||||||||||||||||
| 8175 | wmWindowType |= QXcbWindowFunctions::Dock; never executed: wmWindowType |= QXcbWindowFunctions::Dock; | 0 | ||||||||||||||||||||||||||||||||||||
| 8176 | if (q->testAttribute(Qt::WA_X11NetWmWindowTypeToolBar)
| 0 | ||||||||||||||||||||||||||||||||||||
| 8177 | wmWindowType |= QXcbWindowFunctions::Toolbar; never executed: wmWindowType |= QXcbWindowFunctions::Toolbar; | 0 | ||||||||||||||||||||||||||||||||||||
| 8178 | if (q->testAttribute(Qt::WA_X11NetWmWindowTypeMenu)
| 0 | ||||||||||||||||||||||||||||||||||||
| 8179 | wmWindowType |= QXcbWindowFunctions::Menu; never executed: wmWindowType |= QXcbWindowFunctions::Menu; | 0 | ||||||||||||||||||||||||||||||||||||
| 8180 | if (q->testAttribute(Qt::WA_X11NetWmWindowTypeUtility)
| 0 | ||||||||||||||||||||||||||||||||||||
| 8181 | wmWindowType |= QXcbWindowFunctions::Utility; never executed: wmWindowType |= QXcbWindowFunctions::Utility; | 0 | ||||||||||||||||||||||||||||||||||||
| 8182 | if (q->testAttribute(Qt::WA_X11NetWmWindowTypeSplash)
| 0 | ||||||||||||||||||||||||||||||||||||
| 8183 | wmWindowType |= QXcbWindowFunctions::Splash; never executed: wmWindowType |= QXcbWindowFunctions::Splash; | 0 | ||||||||||||||||||||||||||||||||||||
| 8184 | if (q->testAttribute(Qt::WA_X11NetWmWindowTypeDialog)
| 0 | ||||||||||||||||||||||||||||||||||||
| 8185 | wmWindowType |= QXcbWindowFunctions::Dialog; never executed: wmWindowType |= QXcbWindowFunctions::Dialog; | 0 | ||||||||||||||||||||||||||||||||||||
| 8186 | if (q->testAttribute(Qt::WA_X11NetWmWindowTypeDropDownMenu)
| 0 | ||||||||||||||||||||||||||||||||||||
| 8187 | wmWindowType |= QXcbWindowFunctions::DropDownMenu; never executed: wmWindowType |= QXcbWindowFunctions::DropDownMenu; | 0 | ||||||||||||||||||||||||||||||||||||
| 8188 | if (q->testAttribute(Qt::WA_X11NetWmWindowTypePopupMenu)
| 0 | ||||||||||||||||||||||||||||||||||||
| 8189 | wmWindowType |= QXcbWindowFunctions::PopupMenu; never executed: wmWindowType |= QXcbWindowFunctions::PopupMenu; | 0 | ||||||||||||||||||||||||||||||||||||
| 8190 | if (q->testAttribute(Qt::WA_X11NetWmWindowTypeToolTip)
| 0 | ||||||||||||||||||||||||||||||||||||
| 8191 | wmWindowType |= QXcbWindowFunctions::Tooltip; never executed: wmWindowType |= QXcbWindowFunctions::Tooltip; | 0 | ||||||||||||||||||||||||||||||||||||
| 8192 | if (q->testAttribute(Qt::WA_X11NetWmWindowTypeNotification)
| 0 | ||||||||||||||||||||||||||||||||||||
| 8193 | wmWindowType |= QXcbWindowFunctions::Notification; never executed: wmWindowType |= QXcbWindowFunctions::Notification; | 0 | ||||||||||||||||||||||||||||||||||||
| 8194 | if (q->testAttribute(Qt::WA_X11NetWmWindowTypeCombo)
| 0 | ||||||||||||||||||||||||||||||||||||
| 8195 | wmWindowType |= QXcbWindowFunctions::Combo; never executed: wmWindowType |= QXcbWindowFunctions::Combo; | 0 | ||||||||||||||||||||||||||||||||||||
| 8196 | if (q->testAttribute(Qt::WA_X11NetWmWindowTypeDND)
| 0 | ||||||||||||||||||||||||||||||||||||
| 8197 | wmWindowType |= QXcbWindowFunctions::Dnd; never executed: wmWindowType |= QXcbWindowFunctions::Dnd; | 0 | ||||||||||||||||||||||||||||||||||||
| 8198 | - | |||||||||||||||||||||||||||||||||||||
| 8199 | if (wmWindowType == 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 8200 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 8201 | - | |||||||||||||||||||||||||||||||||||||
| 8202 | QXcbWindowFunctions::setWmWindowType(q->windowHandle(), static_cast<QXcbWindowFunctions::WmWindowType>(wmWindowType)); | - | ||||||||||||||||||||||||||||||||||||
| 8203 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 8204 | - | |||||||||||||||||||||||||||||||||||||
| 8205 | - | |||||||||||||||||||||||||||||||||||||
| 8206 | - | |||||||||||||||||||||||||||||||||||||
| 8207 | static inline void formatWidgetAttributes(QDebug debug, const QWidget *widget) | - | ||||||||||||||||||||||||||||||||||||
| 8208 | { | - | ||||||||||||||||||||||||||||||||||||
| 8209 | const QMetaObject *qtMo = qt_getEnumMetaObject(Qt::WA_AttributeCount); | - | ||||||||||||||||||||||||||||||||||||
| 8210 | const QMetaEnum me = qtMo->enumerator(qtMo->indexOfEnumerator("WidgetAttribute")); | - | ||||||||||||||||||||||||||||||||||||
| 8211 | debug << ", attributes=["; | - | ||||||||||||||||||||||||||||||||||||
| 8212 | int count = 0; | - | ||||||||||||||||||||||||||||||||||||
| 8213 | for (int a = 0; a < Qt::WA_AttributeCount
| 0 | ||||||||||||||||||||||||||||||||||||
| 8214 | if (widget->testAttribute(static_cast<Qt::WidgetAttribute>(a))
| 0 | ||||||||||||||||||||||||||||||||||||
| 8215 | if (count++
| 0 | ||||||||||||||||||||||||||||||||||||
| 8216 | debug << ','; never executed: debug << ','; | 0 | ||||||||||||||||||||||||||||||||||||
| 8217 | debug << me.valueToKey(a); | - | ||||||||||||||||||||||||||||||||||||
| 8218 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 8219 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 8220 | debug << ']'; | - | ||||||||||||||||||||||||||||||||||||
| 8221 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 8222 | - | |||||||||||||||||||||||||||||||||||||
| 8223 | QDebug operator<<(QDebug debug, const QWidget *widget) | - | ||||||||||||||||||||||||||||||||||||
| 8224 | { | - | ||||||||||||||||||||||||||||||||||||
| 8225 | const QDebugStateSaver saver(debug); | - | ||||||||||||||||||||||||||||||||||||
| 8226 | debug.nospace(); | - | ||||||||||||||||||||||||||||||||||||
| 8227 | if (widget
| 0 | ||||||||||||||||||||||||||||||||||||
| 8228 | debug << widget->metaObject()->className() << '(' << (const void *)widget; | - | ||||||||||||||||||||||||||||||||||||
| 8229 | if (!widget->objectName().isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 8230 | debug << ", name=" << widget->objectName(); never executed: debug << ", name=" << widget->objectName(); | 0 | ||||||||||||||||||||||||||||||||||||
| 8231 | if (debug.verbosity() > 2
| 0 | ||||||||||||||||||||||||||||||||||||
| 8232 | const QRect geometry = widget->geometry(); | - | ||||||||||||||||||||||||||||||||||||
| 8233 | const QRect frameGeometry = widget->frameGeometry(); | - | ||||||||||||||||||||||||||||||||||||
| 8234 | if (widget->isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||
| 8235 | debug << ", visible"; never executed: debug << ", visible"; | 0 | ||||||||||||||||||||||||||||||||||||
| 8236 | if (!widget->isEnabled()
| 0 | ||||||||||||||||||||||||||||||||||||
| 8237 | debug << ", disabled"; never executed: debug << ", disabled"; | 0 | ||||||||||||||||||||||||||||||||||||
| 8238 | debug << ", states=" << widget->windowState() | - | ||||||||||||||||||||||||||||||||||||
| 8239 | << ", type=" << widget->windowType() << ", flags=" << widget->windowFlags(); | - | ||||||||||||||||||||||||||||||||||||
| 8240 | formatWidgetAttributes(debug, widget); | - | ||||||||||||||||||||||||||||||||||||
| 8241 | if (widget->isWindow()
| 0 | ||||||||||||||||||||||||||||||||||||
| 8242 | debug << ", window"; never executed: debug << ", window"; | 0 | ||||||||||||||||||||||||||||||||||||
| 8243 | debug << ", " << geometry.width() << 'x' << geometry.height() | - | ||||||||||||||||||||||||||||||||||||
| 8244 | << forcesign << geometry.x() << geometry.y() << noforcesign; | - | ||||||||||||||||||||||||||||||||||||
| 8245 | if (frameGeometry != geometry
| 0 | ||||||||||||||||||||||||||||||||||||
| 8246 | const QMargins margins(geometry.x() - frameGeometry.x(), | - | ||||||||||||||||||||||||||||||||||||
| 8247 | geometry.y() - frameGeometry.y(), | - | ||||||||||||||||||||||||||||||||||||
| 8248 | frameGeometry.right() - geometry.right(), | - | ||||||||||||||||||||||||||||||||||||
| 8249 | frameGeometry.bottom() - geometry.bottom()); | - | ||||||||||||||||||||||||||||||||||||
| 8250 | debug << ", margins=" << margins; | - | ||||||||||||||||||||||||||||||||||||
| 8251 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 8252 | debug << ", devicePixelRatio=" << widget->devicePixelRatioF(); | - | ||||||||||||||||||||||||||||||||||||
| 8253 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||
| 8254 | debug << ", winId=0x" << hex << wid << dec; never executed: debug << ", winId=0x" << hex << wid << dec; | 0 | ||||||||||||||||||||||||||||||||||||
| 8255 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 8256 | debug << ')'; | - | ||||||||||||||||||||||||||||||||||||
| 8257 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 8258 | debug << "QWidget(0x0)"; | - | ||||||||||||||||||||||||||||||||||||
| 8259 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 8260 | return never executed: debug;return debug;never executed: return debug; | 0 | ||||||||||||||||||||||||||||||||||||
| 8261 | } | - | ||||||||||||||||||||||||||||||||||||
| 8262 | - | |||||||||||||||||||||||||||||||||||||
| 8263 | - | |||||||||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |