1. 13 Nov, 2020 3 commits
  2. 12 Nov, 2020 6 commits
    • Volker Hilsheimer's avatar
      Clean up and pack data members of QEvent classes · d5ae51e0
      Volker Hilsheimer authored
      
      
      Make sure all bits reported by sizeof for the most important public
      event classes are used optimally.
      
      QEvent is 24bytes large due to default alignment in C++, so we might
      just as well use bool instead of bitfields for the most important
      data members. This generates less (and thus smaller and faster) code,
      and we still have plenty of bits available for future needs.
      Default the copy constructor and assignment operator, the assert and
      tracing seem to be relics from the Qt 3/4 days.
      
      Note: QEvent's d-pointer is currently unused, with the exception of a
      hack in QGraphicsView. Removing that would save another 8 bytes
      through the entire event hierarchy.
      
      For the new classes in the QInputEvent hierarchy, apply the same
      principle. Allocate bits in QInputEvent and QSinglePointEvent to fill
      the 8-byte aligned space. Using some of those bits for QMouseEvent
      and QWheelEvent makes sure we don't increase the size for those in
      spite of additionally reserved bits.
      
      As a result of this, several QInputEvent and subclasses become 8 bytes
      smaller on clang and gcc (with the exception of QNativeGestureEvent)
      while at the same we have more space for future extensions.
      
      The sizeof's for the various classes on different compilers produce
      these before and after result:
      
                         clang +/- gcc +/- msvc +/-
      QEvent               24   0   24  0   24   0
      QInputEvent          56  -8   56 -8   48   0
      QPointerEvent        80  -8   80 -8   72   0
      QSinglePointEvent    96  -8   96 -8   88   0
      QMouseEvent          96  -8   96 -8   88   0
      QTabletEvent        112  -8  112 -8   96 -16
      QKeyEvent           104  -8  104 -8   96   0
      QNativeGestureEvent 120   0  120  0  120   0
      QWheelEvent         112  -8  112 -8  112  -8
      
      So, with this change we save 8 bytes on gcc and clang for many
      event types, esp on Linux systems.
      
      As a drive-by: replace ulong with quint64, make QTabletEvent data
      floating point, and rename some variables for clarity.
      
      Change-Id: I4cf81c8283262cbf59ee3fb7064a59837332ced7
      Reviewed-by: default avatarShawn Rutledge <shawn.rutledge@qt.io>
      d5ae51e0
    • Morten Johan Sørvig's avatar
      Document physicalDotsPerInch high-DPI behavior · e4ee001d
      Morten Johan Sørvig authored
      
      
      The values are in device-independent dots, which may
      be unexpected.
      
      Task-number: QTBUG-62649
      Change-Id: I85d0e3dd6bd428dd351ebf22281b1f4d9a1b2dc4
      Reviewed-by: default avatarTor Arne Vestbø <tor.arne.vestbo@qt.io>
      e4ee001d
    • Morten Johan Sørvig's avatar
      Document physicalDotsPerInch high-DPI behavior · 8421a1f1
      Morten Johan Sørvig authored
      
      
      Add note to the member function documentation, in
      addition to the class documentation.
      
      Task-number: QTBUG-62649
      Change-Id: I5cce6c06b58e70ef6c051d63c2901b219fa6d6b9
      Reviewed-by: default avatarTor Arne Vestbø <tor.arne.vestbo@qt.io>
      8421a1f1
    • Volker Hilsheimer's avatar
      Purge QCoreApplicationPrivate::cloneEvent and overrides · 03e03d7c
      Volker Hilsheimer authored
      
      
      Not used anywhere in Qt 6, and if whatever needs this ever comes back,
      then we won't implement it like this.
      
      Change-Id: I99655ba5825644cef3686bbe50ca688b68f5c2a4
      Reviewed-by: default avatarLars Knoll <lars.knoll@qt.io>
      03e03d7c
    • Allan Sandfeld Jensen's avatar
      Remove Qt4Compatible painting · 94dd2ceb
      Allan Sandfeld Jensen authored
      
      
      Change-Id: Ie54206ca9b509875568f2158e229fca9cb1860a2
      Reviewed-by: default avatarLars Knoll <lars.knoll@qt.io>
      94dd2ceb
    • Topi Reinio's avatar
      Doc: Add missing brief statements for \property documentation · d01b9ac6
      Topi Reinio authored
      
      
      ... where applicable.
      
      Fixes: QTBUG-88232
      Change-Id: I835df434765caededd35d5114965b4a1663e7942
      Reviewed-by: default avatarPaul Wicking <paul.wicking@qt.io>
      d01b9ac6
  3. 11 Nov, 2020 1 commit
  4. 10 Nov, 2020 6 commits
  5. 09 Nov, 2020 6 commits
  6. 08 Nov, 2020 3 commits
    • Morten Johan Sørvig's avatar
      Teach QPixmapIconEngine how to handle @Nx pixmaps · 46a55258
      Morten Johan Sørvig authored
      
      
      Bring QPixmapIconEngine on par with QIconLoaderEngine
      when it comes to @Nx pixmap handling: Make the scale
      factor a test parameter during icon lookup.
      
      This allows storing e.g 16x16@1, 16x16@2, 16x16@3 versions
      of a pixmap in the icon, and then having QIcon select
      the correct one based on the target devicePixelRatio.
      
      Extend the qiconhighdpi test to also cover QPixmapIconEngine,
      via the addPixmap() API.
      
      The corner cases of pixmap lookup can be much complicated.
      QIconLoaderEngine and QPixmapIconEngine should ideally
      have identical behavior in order to avoid surprises.
      
      Change-Id: I17552cc61755bff9553c4a462e3983ac6759c13b
      Reviewed-by: default avatarTor Arne Vestbø <tor.arne.vestbo@qt.io>
      46a55258
    • Andreas Buhr's avatar
      Fix static assert in Markdown parser · 4c5c4c6d
      Andreas Buhr authored
      
      
      A static assert was misstated. The equality operator has precedence
      over the bitwise or operator, the static assert was thus not checking
      what it was intended to check. Fixed by this patch.
      
      Change-Id: If21faa617dca1d1786fc6bfaf0b87423e0d35e4e
      Reviewed-by: Volker Hilsheimer's avatarVolker Hilsheimer <volker.hilsheimer@qt.io>
      4c5c4c6d
    • Volker Hilsheimer's avatar
      Rename QRangeCollection to QPageRanges, make it a proper value type · b14b1c99
      Volker Hilsheimer authored
      
      
      The type is specific about printing, so give it a name in line with
      QPageLayout and QPageSize.
      
      As per API review comment, it's not clear why this type should not be a
      regular, copyable and movable value type. It stores a list of intervals.
      Give it value-type semantics, as an implicitly shared class.
      
      Convert the parse method into a static factory function.
      
      Add a Range type and use it instead of the semantic-free QPair.
      Move QPrinter getter into QPagedPainteDevice, make it return a copy
      rather than a pointer, and add a setter.
      
      Extend test case to cover all members and more merge cases. Fix bugs
      found that way.
      
      Fixes: QTBUG-88113
      Change-Id: If17ea4d410d49f16b097e88b7979db5d72add820
      Reviewed-by: default avatarQt CI Bot <qt_ci_bot@qt-project.org>
      Reviewed-by: Volker Hilsheimer's avatarVolker Hilsheimer <volker.hilsheimer@qt.io>
      b14b1c99
  7. 07 Nov, 2020 4 commits
    • Allan Sandfeld Jensen's avatar
      Protect QImage colorspace transform on shutdown · 86702fa2
      Allan Sandfeld Jensen authored
      
      
      Adding a check here similar to fixups in other threaded qimage routines.
      
      Pick-to: 5.15
      Change-Id: If7bf7aa0ef78cda15171c9038f41b281fb267dae
      Reviewed-by: default avatarEirik Aavitsland <eirik.aavitsland@qt.io>
      86702fa2
    • Shawn Rutledge's avatar
      Support the markdown underline extension · f5c7799f
      Shawn Rutledge authored
      
      
      MarkdownDialectGitHub now includes this feature, so *emph* is italicized
      and _emph_ is underlined. This is a better fit for QTextDocument capabilities;
      until now, _underlined_ markdown could be read, but would be rendered with
      italics, because in CommonMark, *emphasis* and _emphasis_ are the same.
      But QTextMarkdownWriter already writes underlining and italics distinctly
      in this way.
      
      [ChangeLog][QtGui][Text] By default (with MarkdownDialectGitHub), markdown
      _underline_ and *italic* text styles are now distinct.
      
      Fixes: QTBUG-84429
      Change-Id: Ifc6defa4852abe831949baa4ce28bae5f1a82265
      Reviewed-by: Volker Hilsheimer's avatarVolker Hilsheimer <volker.hilsheimer@qt.io>
      f5c7799f
    • Shawn Rutledge's avatar
      Introduce QEvent::isSinglePointEvent() · 9a1a15b4
      Shawn Rutledge authored
      This makes high-level event dispatching easier: for example we often
      need to cast an event to access getters like button() and buttons().
      We can so far assume that any QPointerEvent that is not a QTouchEvent
      is a QSinglePointEvent; but more explicit type-checking looks safer.
      
      Implemented in a similar way as c7f72799
      
      .
      
      Change-Id: I980d759e2a7538b6b30fd3bdc3be0c351ec6c246
      Reviewed-by: Volker Hilsheimer's avatarVolker Hilsheimer <volker.hilsheimer@qt.io>
      9a1a15b4
    • Volker Hilsheimer's avatar
      Move QEventPoint and QPointingDeviceUniqueId out of qevent · bdec189e
      Volker Hilsheimer authored
      
      
      qevent.h/cpp are huge already, no need for more classes. Move QEventPoint
      into new qeventpoint.h/cpp files, and QPointingDeviceUniqueId into
      qpointingdevice.cpp; the class is already declared in qpointingdevice.h.
      
      Move the documentation of QEventPoint APIs next to the implementation,
      and document all APIs as properties. Add Q_PROPERTY macro where missing.
      
      QEventPoint::device needs a workaround of qdoc due to the type being a
      pointer-to-const; qdoc doesn't know how to tie a \property to it, but
      documents it correctly.
      
      While at it, move the logging category declarations to the header
      matching the .cpp file where they are defined.
      
      Change-Id: I096e609edbb760b5686d577e7fe47eea0807904e
      Reviewed-by: default avatarShawn Rutledge <shawn.rutledge@qt.io>
      bdec189e
  8. 06 Nov, 2020 5 commits
  9. 05 Nov, 2020 1 commit
    • Martin Storsjö's avatar
      Add _MSC_VER check to MSVC ARM compiler workaround · 48faa8ed
      Martin Storsjö authored
      
      
      While _M_ARM is a MSVC specific builtin define, mingw headers do
      also define it (in code, as opposed to a compiler built in
      define), just as the same headers do for e.g. _M_IX86 and _M_X64.
      
      This avoids warnings about unrecognized pragmas, when compiling
      for armv7 mingw.
      
      The original compiler bug (from QTBUG-42038) probably already is
      fixed and/or no longer in scope.
      
      Change-Id: I98722e2a7ee1de4f1937a866555ec460f5d898d1
      Pick-to: 5.15
      Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@qt.io>
      48faa8ed
  10. 04 Nov, 2020 2 commits
  11. 03 Nov, 2020 3 commits
    • Shawn Rutledge's avatar
      Add QEventPoint::normalizedPosition() to replace normalizedPos() · f6418343
      Shawn Rutledge authored
      In 4e400369
      
       we deprecated
      normalizedPos() because we suspect it's a legacy feature that few
      users will need.  However Qt developers keep bringing up the continued
      usage in autotests over and over.  (It's IMO not wrong to keep testing
      deprecated functions in autotests, but the warning keeps attracting
      attention.)
      
      Of course it will turn out that normalizedPos() has users; we just
      don't know how many.  One way to look at it is: why should they copy
      a snippet of code to calculate it, when it costs us so little to
      continue to provide this accessor.
      
      It might also turn out that some users will complain that in Qt 5
      it was passed through from the device driver (or at least from the
      window system API) to the application, and perhaps the replacement will
      not always work, for example if availableVirtualGeometry() ends up
      wrong, or there is some strange scenario that generates events that are
      out-of-bounds for the device that the event professes to come from, so
      that the "normalized" coordinates also go outside the [0..1] range.
      We reserve the right to put back the storage in QEventPointPrivate if
      the need arises; so that's why this function is not inline.
      
      We continue to hope that startNormalizedPos() and lastNormalizedPos()
      are used even less and won't be missed much, because it would be
      wasteful to store them all the time if only a few users need them.
      
      Change-Id: I23ed78843e3f9e16133c5b6f462884a3845f91b6
      Reviewed-by: default avatarDavid Skoland <david.skoland@qt.io>
      Reviewed-by: Volker Hilsheimer's avatarVolker Hilsheimer <volker.hilsheimer@qt.io>
      f6418343
    • Volker Hilsheimer's avatar
      Remove left-over and unnecessarily exported operator== · ca85d337
      Volker Hilsheimer authored
      Amends a45a3b1e
      
      
      
      Change-Id: If481ec1818ec4cb263f271f0099f7452fbdce1a0
      Reviewed-by: default avatarAllan Sandfeld Jensen <allan.jensen@qt.io>
      ca85d337
    • Volker Hilsheimer's avatar
      Deprecate QFontDatabase constructor · 5ea1f403
      Volker Hilsheimer authored
      
      
      Move private methods into the private class.
      
      Fixes: QTBUG-88114
      Change-Id: I92fa52980ed5a0675eee310359d8875f614921e6
      Reviewed-by: default avatarEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
      5ea1f403