| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/kernel/qplatformwindow.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | - | |||||||||||||||||||
| 4 | - | |||||||||||||||||||
| 5 | - | |||||||||||||||||||
| 6 | - | |||||||||||||||||||
| 7 | - | |||||||||||||||||||
| 8 | - | |||||||||||||||||||
| 9 | - | |||||||||||||||||||
| 10 | QPlatformWindow::QPlatformWindow(QWindow *window) | - | ||||||||||||||||||
| 11 | : QPlatformSurface(window) | - | ||||||||||||||||||
| 12 | , d_ptr(new QPlatformWindowPrivate) | - | ||||||||||||||||||
| 13 | { | - | ||||||||||||||||||
| 14 | QPlatformWindowPrivate * const d = d_func(); | - | ||||||||||||||||||
| 15 | d->rect = window->geometry(); | - | ||||||||||||||||||
| 16 | } never executed: end of block | 0 | ||||||||||||||||||
| 17 | - | |||||||||||||||||||
| 18 | - | |||||||||||||||||||
| 19 | - | |||||||||||||||||||
| 20 | - | |||||||||||||||||||
| 21 | QPlatformWindow::~QPlatformWindow() | - | ||||||||||||||||||
| 22 | { | - | ||||||||||||||||||
| 23 | } | - | ||||||||||||||||||
| 24 | - | |||||||||||||||||||
| 25 | - | |||||||||||||||||||
| 26 | - | |||||||||||||||||||
| 27 | - | |||||||||||||||||||
| 28 | QWindow *QPlatformWindow::window() const | - | ||||||||||||||||||
| 29 | { | - | ||||||||||||||||||
| 30 | return never executed: static_cast<QWindow *>(m_surface);return static_cast<QWindow *>(m_surface);never executed: return static_cast<QWindow *>(m_surface); | 0 | ||||||||||||||||||
| 31 | } | - | ||||||||||||||||||
| 32 | - | |||||||||||||||||||
| 33 | - | |||||||||||||||||||
| 34 | - | |||||||||||||||||||
| 35 | - | |||||||||||||||||||
| 36 | QPlatformWindow *QPlatformWindow::parent() const | - | ||||||||||||||||||
| 37 | { | - | ||||||||||||||||||
| 38 | return never executed: window()->parent()return window()->parent() ? window()->parent()->handle() : 0;
never executed: return window()->parent() ? window()->parent()->handle() : 0; | 0 | ||||||||||||||||||
| 39 | } | - | ||||||||||||||||||
| 40 | - | |||||||||||||||||||
| 41 | - | |||||||||||||||||||
| 42 | - | |||||||||||||||||||
| 43 | - | |||||||||||||||||||
| 44 | - | |||||||||||||||||||
| 45 | QPlatformScreen *QPlatformWindow::screen() const | - | ||||||||||||||||||
| 46 | { | - | ||||||||||||||||||
| 47 | QScreen *scr = window()->screen(); | - | ||||||||||||||||||
| 48 | return never executed: scrreturn scr ? scr->handle() : nullptr;
never executed: return scr ? scr->handle() : nullptr; | 0 | ||||||||||||||||||
| 49 | } | - | ||||||||||||||||||
| 50 | - | |||||||||||||||||||
| 51 | - | |||||||||||||||||||
| 52 | - | |||||||||||||||||||
| 53 | - | |||||||||||||||||||
| 54 | QSurfaceFormat QPlatformWindow::format() const | - | ||||||||||||||||||
| 55 | { | - | ||||||||||||||||||
| 56 | return never executed: QSurfaceFormat();return QSurfaceFormat();never executed: return QSurfaceFormat(); | 0 | ||||||||||||||||||
| 57 | } | - | ||||||||||||||||||
| 58 | void QPlatformWindow::setGeometry(const QRect &rect) | - | ||||||||||||||||||
| 59 | { | - | ||||||||||||||||||
| 60 | QPlatformWindowPrivate * const d = d_func(); | - | ||||||||||||||||||
| 61 | d->rect = rect; | - | ||||||||||||||||||
| 62 | } never executed: end of block | 0 | ||||||||||||||||||
| 63 | - | |||||||||||||||||||
| 64 | - | |||||||||||||||||||
| 65 | - | |||||||||||||||||||
| 66 | - | |||||||||||||||||||
| 67 | QRect QPlatformWindow::geometry() const | - | ||||||||||||||||||
| 68 | { | - | ||||||||||||||||||
| 69 | const QPlatformWindowPrivate * const d = d_func(); | - | ||||||||||||||||||
| 70 | return never executed: d->rect;return d->rect;never executed: return d->rect; | 0 | ||||||||||||||||||
| 71 | } | - | ||||||||||||||||||
| 72 | QRect QPlatformWindow::normalGeometry() const | - | ||||||||||||||||||
| 73 | { | - | ||||||||||||||||||
| 74 | return never executed: QRect();return QRect();never executed: return QRect(); | 0 | ||||||||||||||||||
| 75 | } | - | ||||||||||||||||||
| 76 | - | |||||||||||||||||||
| 77 | QMargins QPlatformWindow::frameMargins() const | - | ||||||||||||||||||
| 78 | { | - | ||||||||||||||||||
| 79 | return never executed: QMargins();return QMargins();never executed: return QMargins(); | 0 | ||||||||||||||||||
| 80 | } | - | ||||||||||||||||||
| 81 | - | |||||||||||||||||||
| 82 | - | |||||||||||||||||||
| 83 | - | |||||||||||||||||||
| 84 | - | |||||||||||||||||||
| 85 | - | |||||||||||||||||||
| 86 | - | |||||||||||||||||||
| 87 | - | |||||||||||||||||||
| 88 | void QPlatformWindow::setVisible(bool visible) | - | ||||||||||||||||||
| 89 | { | - | ||||||||||||||||||
| 90 | (void)visible;; | - | ||||||||||||||||||
| 91 | QRect rect(QPoint(), geometry().size()); | - | ||||||||||||||||||
| 92 | QWindowSystemInterface::handleExposeEvent(window(), rect); | - | ||||||||||||||||||
| 93 | QWindowSystemInterface::flushWindowSystemEvents(); | - | ||||||||||||||||||
| 94 | } never executed: end of block | 0 | ||||||||||||||||||
| 95 | - | |||||||||||||||||||
| 96 | - | |||||||||||||||||||
| 97 | - | |||||||||||||||||||
| 98 | - | |||||||||||||||||||
| 99 | - | |||||||||||||||||||
| 100 | void QPlatformWindow::setWindowFlags(Qt::WindowFlags flags) | - | ||||||||||||||||||
| 101 | { | - | ||||||||||||||||||
| 102 | (void)flags;; | - | ||||||||||||||||||
| 103 | } never executed: end of block | 0 | ||||||||||||||||||
| 104 | - | |||||||||||||||||||
| 105 | - | |||||||||||||||||||
| 106 | - | |||||||||||||||||||
| 107 | - | |||||||||||||||||||
| 108 | - | |||||||||||||||||||
| 109 | - | |||||||||||||||||||
| 110 | - | |||||||||||||||||||
| 111 | bool QPlatformWindow::isExposed() const | - | ||||||||||||||||||
| 112 | { | - | ||||||||||||||||||
| 113 | return never executed: window()->isVisible();return window()->isVisible();never executed: return window()->isVisible(); | 0 | ||||||||||||||||||
| 114 | } | - | ||||||||||||||||||
| 115 | - | |||||||||||||||||||
| 116 | - | |||||||||||||||||||
| 117 | - | |||||||||||||||||||
| 118 | - | |||||||||||||||||||
| 119 | - | |||||||||||||||||||
| 120 | - | |||||||||||||||||||
| 121 | - | |||||||||||||||||||
| 122 | bool QPlatformWindow::isActive() const | - | ||||||||||||||||||
| 123 | { | - | ||||||||||||||||||
| 124 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 125 | } | - | ||||||||||||||||||
| 126 | bool QPlatformWindow::isEmbedded(const QPlatformWindow *parentWindow) const | - | ||||||||||||||||||
| 127 | { | - | ||||||||||||||||||
| 128 | (void)parentWindow;; | - | ||||||||||||||||||
| 129 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 130 | } | - | ||||||||||||||||||
| 131 | QPoint QPlatformWindow::mapToGlobal(const QPoint &pos) const | - | ||||||||||||||||||
| 132 | { | - | ||||||||||||||||||
| 133 | const QPlatformWindow *p = this; | - | ||||||||||||||||||
| 134 | QPoint result = pos; | - | ||||||||||||||||||
| 135 | while (p
| 0 | ||||||||||||||||||
| 136 | result += p->geometry().topLeft(); | - | ||||||||||||||||||
| 137 | p = p->parent(); | - | ||||||||||||||||||
| 138 | } never executed: end of block | 0 | ||||||||||||||||||
| 139 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||||||||
| 140 | } | - | ||||||||||||||||||
| 141 | QPoint QPlatformWindow::mapFromGlobal(const QPoint &pos) const | - | ||||||||||||||||||
| 142 | { | - | ||||||||||||||||||
| 143 | const QPlatformWindow *p = this; | - | ||||||||||||||||||
| 144 | QPoint result = pos; | - | ||||||||||||||||||
| 145 | while (p
| 0 | ||||||||||||||||||
| 146 | result -= p->geometry().topLeft(); | - | ||||||||||||||||||
| 147 | p = p->parent(); | - | ||||||||||||||||||
| 148 | } never executed: end of block | 0 | ||||||||||||||||||
| 149 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||||||||
| 150 | } | - | ||||||||||||||||||
| 151 | - | |||||||||||||||||||
| 152 | - | |||||||||||||||||||
| 153 | - | |||||||||||||||||||
| 154 | - | |||||||||||||||||||
| 155 | - | |||||||||||||||||||
| 156 | - | |||||||||||||||||||
| 157 | - | |||||||||||||||||||
| 158 | void QPlatformWindow::setWindowState(Qt::WindowState) | - | ||||||||||||||||||
| 159 | { | - | ||||||||||||||||||
| 160 | } | - | ||||||||||||||||||
| 161 | - | |||||||||||||||||||
| 162 | - | |||||||||||||||||||
| 163 | - | |||||||||||||||||||
| 164 | - | |||||||||||||||||||
| 165 | WId QPlatformWindow::winId() const | - | ||||||||||||||||||
| 166 | { | - | ||||||||||||||||||
| 167 | - | |||||||||||||||||||
| 168 | - | |||||||||||||||||||
| 169 | - | |||||||||||||||||||
| 170 | - | |||||||||||||||||||
| 171 | return never executed: WId(1);return WId(1);never executed: return WId(1); | 0 | ||||||||||||||||||
| 172 | } | - | ||||||||||||||||||
| 173 | void QPlatformWindow::setParent(const QPlatformWindow *parent) | - | ||||||||||||||||||
| 174 | { | - | ||||||||||||||||||
| 175 | (void)parent;; | - | ||||||||||||||||||
| 176 | QMessageLogger(__FILE__, 269, __PRETTY_FUNCTION__).warning("This plugin does not support setParent!"); | - | ||||||||||||||||||
| 177 | } never executed: end of block | 0 | ||||||||||||||||||
| 178 | void QPlatformWindow::setWindowTitle(const QString &title) { (void)title;; } never executed: end of block | 0 | ||||||||||||||||||
| 179 | - | |||||||||||||||||||
| 180 | - | |||||||||||||||||||
| 181 | - | |||||||||||||||||||
| 182 | - | |||||||||||||||||||
| 183 | void QPlatformWindow::setWindowFilePath(const QString &filePath) { (void)filePath;; } never executed: end of block | 0 | ||||||||||||||||||
| 184 | - | |||||||||||||||||||
| 185 | - | |||||||||||||||||||
| 186 | - | |||||||||||||||||||
| 187 | - | |||||||||||||||||||
| 188 | void QPlatformWindow::setWindowIcon(const QIcon &icon) { (void)icon;; } never executed: end of block | 0 | ||||||||||||||||||
| 189 | - | |||||||||||||||||||
| 190 | - | |||||||||||||||||||
| 191 | - | |||||||||||||||||||
| 192 | - | |||||||||||||||||||
| 193 | void QPlatformWindow::raise() { QMessageLogger(__FILE__, 295, __PRETTY_FUNCTION__).warning("This plugin does not support raise()"); } never executed: end of block | 0 | ||||||||||||||||||
| 194 | - | |||||||||||||||||||
| 195 | - | |||||||||||||||||||
| 196 | - | |||||||||||||||||||
| 197 | - | |||||||||||||||||||
| 198 | void QPlatformWindow::lower() { QMessageLogger(__FILE__, 300, __PRETTY_FUNCTION__).warning("This plugin does not support lower()"); } never executed: end of block | 0 | ||||||||||||||||||
| 199 | - | |||||||||||||||||||
| 200 | - | |||||||||||||||||||
| 201 | - | |||||||||||||||||||
| 202 | - | |||||||||||||||||||
| 203 | - | |||||||||||||||||||
| 204 | - | |||||||||||||||||||
| 205 | - | |||||||||||||||||||
| 206 | void QPlatformWindow::propagateSizeHints() {QMessageLogger(__FILE__, 308, __PRETTY_FUNCTION__).warning("This plugin does not support propagateSizeHints()"); } never executed: end of block | 0 | ||||||||||||||||||
| 207 | - | |||||||||||||||||||
| 208 | - | |||||||||||||||||||
| 209 | - | |||||||||||||||||||
| 210 | - | |||||||||||||||||||
| 211 | void QPlatformWindow::setOpacity(qreal level) | - | ||||||||||||||||||
| 212 | { | - | ||||||||||||||||||
| 213 | (void)level;; | - | ||||||||||||||||||
| 214 | QMessageLogger(__FILE__, 316, __PRETTY_FUNCTION__).warning("This plugin does not support setting window opacity"); | - | ||||||||||||||||||
| 215 | } never executed: end of block | 0 | ||||||||||||||||||
| 216 | - | |||||||||||||||||||
| 217 | - | |||||||||||||||||||
| 218 | - | |||||||||||||||||||
| 219 | - | |||||||||||||||||||
| 220 | - | |||||||||||||||||||
| 221 | void QPlatformWindow::setMask(const QRegion ®ion) | - | ||||||||||||||||||
| 222 | { | - | ||||||||||||||||||
| 223 | (void)region;; | - | ||||||||||||||||||
| 224 | QMessageLogger(__FILE__, 326, __PRETTY_FUNCTION__).warning("This plugin does not support setting window masks"); | - | ||||||||||||||||||
| 225 | } never executed: end of block | 0 | ||||||||||||||||||
| 226 | void QPlatformWindow::requestActivateWindow() | - | ||||||||||||||||||
| 227 | { | - | ||||||||||||||||||
| 228 | QWindowSystemInterface::handleWindowActivated(window()); | - | ||||||||||||||||||
| 229 | } never executed: end of block | 0 | ||||||||||||||||||
| 230 | void QPlatformWindow::handleContentOrientationChange(Qt::ScreenOrientation orientation) | - | ||||||||||||||||||
| 231 | { | - | ||||||||||||||||||
| 232 | (void)orientation;; | - | ||||||||||||||||||
| 233 | } never executed: end of block | 0 | ||||||||||||||||||
| 234 | qreal QPlatformWindow::devicePixelRatio() const | - | ||||||||||||||||||
| 235 | { | - | ||||||||||||||||||
| 236 | return never executed: 1.0;return 1.0;never executed: return 1.0; | 0 | ||||||||||||||||||
| 237 | } | - | ||||||||||||||||||
| 238 | - | |||||||||||||||||||
| 239 | bool QPlatformWindow::setKeyboardGrabEnabled(bool grab) | - | ||||||||||||||||||
| 240 | { | - | ||||||||||||||||||
| 241 | (void)grab;; | - | ||||||||||||||||||
| 242 | QMessageLogger(__FILE__, 376, __PRETTY_FUNCTION__).warning("This plugin does not support grabbing the keyboard"); | - | ||||||||||||||||||
| 243 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 244 | } | - | ||||||||||||||||||
| 245 | - | |||||||||||||||||||
| 246 | bool QPlatformWindow::setMouseGrabEnabled(bool grab) | - | ||||||||||||||||||
| 247 | { | - | ||||||||||||||||||
| 248 | (void)grab;; | - | ||||||||||||||||||
| 249 | QMessageLogger(__FILE__, 383, __PRETTY_FUNCTION__).warning("This plugin does not support grabbing the mouse"); | - | ||||||||||||||||||
| 250 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 251 | } | - | ||||||||||||||||||
| 252 | - | |||||||||||||||||||
| 253 | - | |||||||||||||||||||
| 254 | - | |||||||||||||||||||
| 255 | - | |||||||||||||||||||
| 256 | - | |||||||||||||||||||
| 257 | - | |||||||||||||||||||
| 258 | bool QPlatformWindow::setWindowModified(bool modified) | - | ||||||||||||||||||
| 259 | { | - | ||||||||||||||||||
| 260 | (void)modified;; | - | ||||||||||||||||||
| 261 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 262 | } | - | ||||||||||||||||||
| 263 | void QPlatformWindow::windowEvent(QEvent *event) | - | ||||||||||||||||||
| 264 | { | - | ||||||||||||||||||
| 265 | (void)event;; | - | ||||||||||||||||||
| 266 | } never executed: end of block | 0 | ||||||||||||||||||
| 267 | bool QPlatformWindow::startSystemResize(const QPoint &pos, Qt::Corner corner) | - | ||||||||||||||||||
| 268 | { | - | ||||||||||||||||||
| 269 | (void)pos; | - | ||||||||||||||||||
| 270 | (void)corner; | - | ||||||||||||||||||
| 271 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 272 | } | - | ||||||||||||||||||
| 273 | void QPlatformWindow::setFrameStrutEventsEnabled(bool enabled) | - | ||||||||||||||||||
| 274 | { | - | ||||||||||||||||||
| 275 | (void)enabled; | - | ||||||||||||||||||
| 276 | } never executed: end of block | 0 | ||||||||||||||||||
| 277 | - | |||||||||||||||||||
| 278 | - | |||||||||||||||||||
| 279 | - | |||||||||||||||||||
| 280 | - | |||||||||||||||||||
| 281 | - | |||||||||||||||||||
| 282 | - | |||||||||||||||||||
| 283 | bool QPlatformWindow::frameStrutEventsEnabled() const | - | ||||||||||||||||||
| 284 | { | - | ||||||||||||||||||
| 285 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 286 | } | - | ||||||||||||||||||
| 287 | QString QPlatformWindow::formatWindowTitle(const QString &title, const QString &separator) | - | ||||||||||||||||||
| 288 | { | - | ||||||||||||||||||
| 289 | QString fullTitle = title; | - | ||||||||||||||||||
| 290 | if (QGuiApplicationPrivate::displayName
| 0 | ||||||||||||||||||
| 291 | - | |||||||||||||||||||
| 292 | if (!fullTitle.isEmpty()
| 0 | ||||||||||||||||||
| 293 | fullTitle += separator; never executed: fullTitle += separator; | 0 | ||||||||||||||||||
| 294 | fullTitle += *QGuiApplicationPrivate::displayName; | - | ||||||||||||||||||
| 295 | } never executed: else if (fullTitle.isEmpty()end of block
| 0 | ||||||||||||||||||
| 296 | - | |||||||||||||||||||
| 297 | fullTitle = QCoreApplication::applicationName(); | - | ||||||||||||||||||
| 298 | } never executed: end of block | 0 | ||||||||||||||||||
| 299 | return never executed: fullTitle;return fullTitle;never executed: return fullTitle; | 0 | ||||||||||||||||||
| 300 | } | - | ||||||||||||||||||
| 301 | QPlatformScreen *QPlatformWindow::screenForGeometry(const QRect &newGeometry) const | - | ||||||||||||||||||
| 302 | { | - | ||||||||||||||||||
| 303 | QPlatformScreen *currentScreen = screen(); | - | ||||||||||||||||||
| 304 | QPlatformScreen *fallback = currentScreen; | - | ||||||||||||||||||
| 305 | - | |||||||||||||||||||
| 306 | - | |||||||||||||||||||
| 307 | QPoint center = newGeometry.isEmpty()
| 0 | ||||||||||||||||||
| 308 | if (window()->type() == Qt::ForeignWindow
| 0 | ||||||||||||||||||
| 309 | center = mapToGlobal(center - newGeometry.topLeft()); never executed: center = mapToGlobal(center - newGeometry.topLeft()); | 0 | ||||||||||||||||||
| 310 | - | |||||||||||||||||||
| 311 | if (!parent()
| 0 | ||||||||||||||||||
| 312 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(currentScreen->virtualSiblings())>::type> _container_((currentScreen->virtualSiblings())); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QPlatformScreen* screen = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||
| 313 | if (screen->geometry().contains(center)
| 0 | ||||||||||||||||||
| 314 | return never executed: screen;return screen;never executed: return screen; | 0 | ||||||||||||||||||
| 315 | if (screen->geometry().intersects(newGeometry)
| 0 | ||||||||||||||||||
| 316 | fallback = screen; never executed: fallback = screen; | 0 | ||||||||||||||||||
| 317 | } never executed: end of block | 0 | ||||||||||||||||||
| 318 | } never executed: end of block | 0 | ||||||||||||||||||
| 319 | return never executed: fallback;return fallback;never executed: return fallback; | 0 | ||||||||||||||||||
| 320 | } | - | ||||||||||||||||||
| 321 | - | |||||||||||||||||||
| 322 | - | |||||||||||||||||||
| 323 | - | |||||||||||||||||||
| 324 | - | |||||||||||||||||||
| 325 | QSize QPlatformWindow::constrainWindowSize(const QSize &size) | - | ||||||||||||||||||
| 326 | { | - | ||||||||||||||||||
| 327 | return never executed: size.expandedTo(QSize(0, 0)).boundedTo(QSize(((1<<24)-1), ((1<<24)-1)));return size.expandedTo(QSize(0, 0)).boundedTo(QSize(((1<<24)-1), ((1<<24)-1)));never executed: return size.expandedTo(QSize(0, 0)).boundedTo(QSize(((1<<24)-1), ((1<<24)-1))); | 0 | ||||||||||||||||||
| 328 | } | - | ||||||||||||||||||
| 329 | void QPlatformWindow::setAlertState(bool enable) | - | ||||||||||||||||||
| 330 | { | - | ||||||||||||||||||
| 331 | (void)enable; | - | ||||||||||||||||||
| 332 | } never executed: end of block | 0 | ||||||||||||||||||
| 333 | bool QPlatformWindow::isAlertState() const | - | ||||||||||||||||||
| 334 | { | - | ||||||||||||||||||
| 335 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 336 | } | - | ||||||||||||||||||
| 337 | - | |||||||||||||||||||
| 338 | - | |||||||||||||||||||
| 339 | - | |||||||||||||||||||
| 340 | - | |||||||||||||||||||
| 341 | - | |||||||||||||||||||
| 342 | static inline const QScreen *effectiveScreen(const QWindow *window) | - | ||||||||||||||||||
| 343 | { | - | ||||||||||||||||||
| 344 | if (!window
| 0 | ||||||||||||||||||
| 345 | return never executed: QGuiApplication::primaryScreen();return QGuiApplication::primaryScreen();never executed: return QGuiApplication::primaryScreen(); | 0 | ||||||||||||||||||
| 346 | const QScreen *screen = window->screen(); | - | ||||||||||||||||||
| 347 | if (!screen
| 0 | ||||||||||||||||||
| 348 | return never executed: QGuiApplication::primaryScreen();return QGuiApplication::primaryScreen();never executed: return QGuiApplication::primaryScreen(); | 0 | ||||||||||||||||||
| 349 | const QList<QScreen *> siblings = screen->virtualSiblings(); | - | ||||||||||||||||||
| 350 | - | |||||||||||||||||||
| 351 | if (siblings.size() > 1
| 0 | ||||||||||||||||||
| 352 | const QPoint referencePoint = window->transientParent()
| 0 | ||||||||||||||||||
| 353 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(siblings)>::type> _container_((siblings)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (const QScreen *sibling = *_container_.i; _container_.control; _container_.control = 0) | - | ||||||||||||||||||
| 354 | if (sibling->geometry().contains(referencePoint)
| 0 | ||||||||||||||||||
| 355 | return never executed: sibling;return sibling;never executed: return sibling; | 0 | ||||||||||||||||||
| 356 | } never executed: end of block | 0 | ||||||||||||||||||
| 357 | - | |||||||||||||||||||
| 358 | return never executed: screen;return screen;never executed: return screen; | 0 | ||||||||||||||||||
| 359 | } | - | ||||||||||||||||||
| 360 | void QPlatformWindow::invalidateSurface() | - | ||||||||||||||||||
| 361 | { | - | ||||||||||||||||||
| 362 | } | - | ||||||||||||||||||
| 363 | - | |||||||||||||||||||
| 364 | static QSize fixInitialSize(QSize size, const QWindow *w, | - | ||||||||||||||||||
| 365 | int defaultWidth, int defaultHeight) | - | ||||||||||||||||||
| 366 | { | - | ||||||||||||||||||
| 367 | if (size.width() == 0
| 0 | ||||||||||||||||||
| 368 | const int minWidth = w->minimumWidth(); | - | ||||||||||||||||||
| 369 | size.setWidth(minWidth > 0 ? minWidth : defaultWidth); | - | ||||||||||||||||||
| 370 | } never executed: end of block | 0 | ||||||||||||||||||
| 371 | if (size.height() == 0
| 0 | ||||||||||||||||||
| 372 | const int minHeight = w->minimumHeight(); | - | ||||||||||||||||||
| 373 | size.setHeight(minHeight > 0 ? minHeight : defaultHeight); | - | ||||||||||||||||||
| 374 | } never executed: end of block | 0 | ||||||||||||||||||
| 375 | return never executed: size;return size;never executed: return size; | 0 | ||||||||||||||||||
| 376 | } | - | ||||||||||||||||||
| 377 | QRect QPlatformWindow::initialGeometry(const QWindow *w, | - | ||||||||||||||||||
| 378 | const QRect &initialGeometry, int defaultWidth, int defaultHeight) | - | ||||||||||||||||||
| 379 | { | - | ||||||||||||||||||
| 380 | if (!w->isTopLevel()
| 0 | ||||||||||||||||||
| 381 | const qreal factor = QHighDpiScaling::factor(w); | - | ||||||||||||||||||
| 382 | const QSize size = fixInitialSize(QHighDpi::fromNative(initialGeometry.size(), factor), | - | ||||||||||||||||||
| 383 | w, defaultWidth, defaultHeight); | - | ||||||||||||||||||
| 384 | return never executed: QRect(initialGeometry.topLeft(), QHighDpi::toNative(size, factor));return QRect(initialGeometry.topLeft(), QHighDpi::toNative(size, factor));never executed: return QRect(initialGeometry.topLeft(), QHighDpi::toNative(size, factor)); | 0 | ||||||||||||||||||
| 385 | } | - | ||||||||||||||||||
| 386 | const QScreen *screen = effectiveScreen(w); | - | ||||||||||||||||||
| 387 | if (!screen
| 0 | ||||||||||||||||||
| 388 | return never executed: initialGeometry;return initialGeometry;never executed: return initialGeometry; | 0 | ||||||||||||||||||
| 389 | QRect rect(QHighDpi::fromNativePixels(initialGeometry, w)); | - | ||||||||||||||||||
| 390 | rect.setSize(fixInitialSize(rect.size(), w, defaultWidth, defaultHeight)); | - | ||||||||||||||||||
| 391 | if (qt_window_private(const_cast<QWindow*>(w))->positionAutomatic
| 0 | ||||||||||||||||||
| 392 | && w->type() != Qt::Popup
| 0 | ||||||||||||||||||
| 393 | const QRect availableGeometry = screen->availableGeometry(); | - | ||||||||||||||||||
| 394 | - | |||||||||||||||||||
| 395 | if (rect.height() < (availableGeometry.height() * 8) / 9
| 0 | ||||||||||||||||||
| 396 | && rect.width() < (availableGeometry.width() * 8) / 9
| 0 | ||||||||||||||||||
| 397 | const QWindow *tp = w->transientParent(); | - | ||||||||||||||||||
| 398 | if (tp
| 0 | ||||||||||||||||||
| 399 | - | |||||||||||||||||||
| 400 | rect.moveCenter(tp->geometry().center()); | - | ||||||||||||||||||
| 401 | } never executed: else {end of block | 0 | ||||||||||||||||||
| 402 | - | |||||||||||||||||||
| 403 | - | |||||||||||||||||||
| 404 | rect.moveCenter(availableGeometry.center()); | - | ||||||||||||||||||
| 405 | } never executed: end of block | 0 | ||||||||||||||||||
| 406 | } | - | ||||||||||||||||||
| 407 | } never executed: end of block | 0 | ||||||||||||||||||
| 408 | return never executed: QHighDpi::toNativePixels(rect, screen);return QHighDpi::toNativePixels(rect, screen);never executed: return QHighDpi::toNativePixels(rect, screen); | 0 | ||||||||||||||||||
| 409 | } | - | ||||||||||||||||||
| 410 | void QPlatformWindow::requestUpdate() | - | ||||||||||||||||||
| 411 | { | - | ||||||||||||||||||
| 412 | static int timeout = -1; | - | ||||||||||||||||||
| 413 | if (timeout == -1
| 0 | ||||||||||||||||||
| 414 | bool ok = false; | - | ||||||||||||||||||
| 415 | timeout = qEnvironmentVariableIntValue("QT_QPA_UPDATE_IDLE_TIME", &ok); | - | ||||||||||||||||||
| 416 | if (!ok
| 0 | ||||||||||||||||||
| 417 | timeout = 5; never executed: timeout = 5; | 0 | ||||||||||||||||||
| 418 | } never executed: end of block | 0 | ||||||||||||||||||
| 419 | - | |||||||||||||||||||
| 420 | QWindow *w = window(); | - | ||||||||||||||||||
| 421 | QWindowPrivate *wp = (QWindowPrivate *) QObjectPrivate::get(w); | - | ||||||||||||||||||
| 422 | ((!(wp->updateTimer == 0)) ? qt_assert("wp->updateTimer == 0",__FILE__,658) : qt_noop()); | - | ||||||||||||||||||
| 423 | wp->updateTimer = w->startTimer(timeout, Qt::PreciseTimer); | - | ||||||||||||||||||
| 424 | } never executed: end of block | 0 | ||||||||||||||||||
| 425 | - | |||||||||||||||||||
| 426 | - | |||||||||||||||||||
| 427 | - | |||||||||||||||||||
| 428 | - | |||||||||||||||||||
| 429 | QSize QPlatformWindow::windowMinimumSize() const | - | ||||||||||||||||||
| 430 | { | - | ||||||||||||||||||
| 431 | return never executed: constrainWindowSize(QHighDpi::toNativePixels(window()->minimumSize(), window()));return constrainWindowSize(QHighDpi::toNativePixels(window()->minimumSize(), window()));never executed: return constrainWindowSize(QHighDpi::toNativePixels(window()->minimumSize(), window())); | 0 | ||||||||||||||||||
| 432 | } | - | ||||||||||||||||||
| 433 | - | |||||||||||||||||||
| 434 | - | |||||||||||||||||||
| 435 | - | |||||||||||||||||||
| 436 | - | |||||||||||||||||||
| 437 | QSize QPlatformWindow::windowMaximumSize() const | - | ||||||||||||||||||
| 438 | { | - | ||||||||||||||||||
| 439 | return never executed: constrainWindowSize(QHighDpi::toNativePixels(window()->maximumSize(), window()));return constrainWindowSize(QHighDpi::toNativePixels(window()->maximumSize(), window()));never executed: return constrainWindowSize(QHighDpi::toNativePixels(window()->maximumSize(), window())); | 0 | ||||||||||||||||||
| 440 | } | - | ||||||||||||||||||
| 441 | - | |||||||||||||||||||
| 442 | - | |||||||||||||||||||
| 443 | - | |||||||||||||||||||
| 444 | - | |||||||||||||||||||
| 445 | QSize QPlatformWindow::windowBaseSize() const | - | ||||||||||||||||||
| 446 | { | - | ||||||||||||||||||
| 447 | return never executed: QHighDpi::toNativePixels(window()->baseSize(), window());return QHighDpi::toNativePixels(window()->baseSize(), window());never executed: return QHighDpi::toNativePixels(window()->baseSize(), window()); | 0 | ||||||||||||||||||
| 448 | } | - | ||||||||||||||||||
| 449 | - | |||||||||||||||||||
| 450 | - | |||||||||||||||||||
| 451 | - | |||||||||||||||||||
| 452 | - | |||||||||||||||||||
| 453 | QSize QPlatformWindow::windowSizeIncrement() const | - | ||||||||||||||||||
| 454 | { | - | ||||||||||||||||||
| 455 | QSize increment = window()->sizeIncrement(); | - | ||||||||||||||||||
| 456 | if (!QHighDpiScaling::isActive()
| 0 | ||||||||||||||||||
| 457 | return never executed: increment;return increment;never executed: return increment; | 0 | ||||||||||||||||||
| 458 | - | |||||||||||||||||||
| 459 | - | |||||||||||||||||||
| 460 | - | |||||||||||||||||||
| 461 | if (increment.isEmpty()
| 0 | ||||||||||||||||||
| 462 | increment = QSize(1, 1); never executed: increment = QSize(1, 1); | 0 | ||||||||||||||||||
| 463 | - | |||||||||||||||||||
| 464 | return never executed: QHighDpi::toNativePixels(increment, window());return QHighDpi::toNativePixels(increment, window());never executed: return QHighDpi::toNativePixels(increment, window()); | 0 | ||||||||||||||||||
| 465 | } | - | ||||||||||||||||||
| 466 | - | |||||||||||||||||||
| 467 | - | |||||||||||||||||||
| 468 | - | |||||||||||||||||||
| 469 | - | |||||||||||||||||||
| 470 | QRect QPlatformWindow::windowGeometry() const | - | ||||||||||||||||||
| 471 | { | - | ||||||||||||||||||
| 472 | return never executed: QHighDpi::toNativePixels(window()->geometry(), window());return QHighDpi::toNativePixels(window()->geometry(), window());never executed: return QHighDpi::toNativePixels(window()->geometry(), window()); | 0 | ||||||||||||||||||
| 473 | } | - | ||||||||||||||||||
| 474 | - | |||||||||||||||||||
| 475 | - | |||||||||||||||||||
| 476 | - | |||||||||||||||||||
| 477 | - | |||||||||||||||||||
| 478 | QRect QPlatformWindow::windowFrameGeometry() const | - | ||||||||||||||||||
| 479 | { | - | ||||||||||||||||||
| 480 | return never executed: QHighDpi::toNativePixels(window()->frameGeometry(), window());return QHighDpi::toNativePixels(window()->frameGeometry(), window());never executed: return QHighDpi::toNativePixels(window()->frameGeometry(), window()); | 0 | ||||||||||||||||||
| 481 | } | - | ||||||||||||||||||
| 482 | - | |||||||||||||||||||
| 483 | - | |||||||||||||||||||
| 484 | - | |||||||||||||||||||
| 485 | - | |||||||||||||||||||
| 486 | - | |||||||||||||||||||
| 487 | - | |||||||||||||||||||
| 488 | - | |||||||||||||||||||
| 489 | QRectF QPlatformWindow::closestAcceptableGeometry(const QWindow *qWindow, const QRectF &nativeRect) | - | ||||||||||||||||||
| 490 | { | - | ||||||||||||||||||
| 491 | const QRectF rectF = QHighDpi::fromNativePixels(nativeRect, qWindow); | - | ||||||||||||||||||
| 492 | const QRectF correctedGeometryF = qt_window_private(const_cast<QWindow *>(qWindow))->closestAcceptableGeometry(rectF); | - | ||||||||||||||||||
| 493 | return never executed: !correctedGeometryF.isEmpty()return !correctedGeometryF.isEmpty() && rectF != correctedGeometryF ? QHighDpi::toNativePixels(correctedGeometryF, qWindow) : nativeRect;
never executed: return !correctedGeometryF.isEmpty() && rectF != correctedGeometryF ? QHighDpi::toNativePixels(correctedGeometryF, qWindow) : nativeRect; | 0 | ||||||||||||||||||
| 494 | ? QHighDpi::toNativePixels(correctedGeometryF, qWindow) : nativeRect; never executed: return !correctedGeometryF.isEmpty() && rectF != correctedGeometryF ? QHighDpi::toNativePixels(correctedGeometryF, qWindow) : nativeRect; | 0 | ||||||||||||||||||
| 495 | } | - | ||||||||||||||||||
| 496 | - | |||||||||||||||||||
| 497 | QRectF QPlatformWindow::windowClosestAcceptableGeometry(const QRectF &nativeRect) const | - | ||||||||||||||||||
| 498 | { | - | ||||||||||||||||||
| 499 | return never executed: QPlatformWindow::closestAcceptableGeometry(window(), nativeRect);return QPlatformWindow::closestAcceptableGeometry(window(), nativeRect);never executed: return QPlatformWindow::closestAcceptableGeometry(window(), nativeRect); | 0 | ||||||||||||||||||
| 500 | } | - | ||||||||||||||||||
| 501 | - | |||||||||||||||||||
| Switch to Source code | Preprocessed file |