Commit graph

62 commits

Author SHA1 Message Date
ali kettab
eebb5a587f Added translucent stipple brush support under wxQt 2024-02-18 18:32:33 +01:00
Alex Shvartzkop
253cfa3a31 Use white background brush by default in wxQt too
Just as this is done in the other ports.

This commit is best viewed with Git --color-moved option.
2024-02-13 21:54:07 +01:00
ali kettab
2d665338e9 Avoid Qt warnings about inactive painter
Qt spits out annoying warnings about inactive painter (QPainter::font:
Painter not active) when using wxDC::GetChar{Width,Height}(). Simply mute
them by using the default application font explicitly.
2023-10-15 00:10:02 +01:00
ali kettab
1bdcfd33e6 Fix clearing the dc with invalid brush in wxQt 2023-09-09 23:32:35 +01:00
ali kettab
a248edaf6f Default ctor should create uninitialised wxBrush too in wxQt as documented 2023-09-09 23:07:40 +01:00
ali kettab
c028f61d0f Default ctor should create uninitialised wxPen too in wxQt as documented 2023-09-09 22:53:16 +01:00
ali kettab
61e3c65872 Simplify setting the clipping region in QtPreparePainter() 2023-06-02 19:14:06 +01:00
ali kettab
ec6e78ab92 Reimplement DoSetClippingRegion() and DoSetDeviceClippingRegion()
For one hand this is a simplification. In the other hand, SetClippingRegion()
and SetDeviceClippingRegion() are both working the same as in the other ports.
2023-06-02 19:05:23 +01:00
ali kettab
f26f1cc701 Fix wxDC::GetClippingBox() in wxQt 2023-06-02 18:38:08 +01:00
ali kettab
dd01db12ed Fix applying logical origin for wxDC in wxQt
This makes wxQt works the same as the other ports.
2023-06-02 17:32:53 +01:00
ali kettab
7cc08a2c23 Fix wxDC::Clear() in wxQt 2023-06-02 17:22:43 +01:00
ali kettab
f0e167a17f Optimize GetTextExtent() for empty strings under wxQt 2022-10-30 14:02:31 +01:00
Vadim Zeitlin
e28ab8974d Avoid some simple to fix deprecation warnings with Qt 5.14
Replace the deprecated functions with the new equivalents when this
doesn't really change the code semantics.

Also add new compat.h private header where more functions like
wxQtGetWidthFromMetrics() can be added in the future.

There are still quite a few of deprecation warnings requiring more
changes remaining.
2022-10-21 19:00:36 +02:00
Vadim Zeitlin
4f4c5fcfdf Use nullptr instead of NULL in the code and documentation
This is a combination of running clang-tidy with modernize-use-nullptr
check for some ports (GTK, X11, OSX) and manual changes to the ports for
which it couldn't be used easily (MSW, DFB) and also manually updating
the docs.

Also replace NULL with null or nullptr in the comments as this is more
consistent with the use of nullptr in the code and makes it simpler to
grep for the remaining occurrences of NULL itself.

And also use null in the assert messages.

Only a few occurrences of "NULL" are still left in non-C files, mostly
corresponding to unclear comments or string output which it might not be
safe to change.
2022-10-18 01:25:25 +02:00
PB
f57f214122 Remove BCC-specific hdrstop pragma from everywhere 2020-10-12 21:58:37 +02:00
Stefan Brüns
d56d676450 Add missing QPainterPath include required with Qt 5.15
The header is no longer pulled in by QPainter, omitting it causes
failing builds due to incomplete type QPainterPath.

Closes https://github.com/wxWidgets/wxWidgets/pull/1880
2020-06-02 16:48:38 +02:00
Vadim Zeitlin
d841f7b34e Merge branch 'wxQt-memory-leaks' of https://github.com/catalinr/wxWidgets
Fix many memory leaks in wxQt port.

See https://github.com/wxWidgets/wxWidgets/pull/1243
2019-03-05 23:36:41 +01:00
Cătălin Răceanu
d34017f656 Initialize member variable 2019-02-26 23:31:54 +02:00
Paul Cornett
8df0cfba2a Use pre-increment on iterators 2019-02-25 09:20:44 -08:00
Jay Nabonne
5929c5831e Fix handling of empty clipping region in wxQt 2019-01-21 23:34:12 +01:00
Jay Nabonne
5b8b30d243 Don't use pointer for wxDC::m_clippingRegion in wxQt
An object can be used directly instead.
2019-01-21 23:34:12 +01:00
Jay Nabonne
a130a59111 Handle clipping regions with negative width or height in wxQt 2019-01-21 23:20:24 +01:00
Jay Nabonne
ce5301e4e6 Fix off by 1 errors in wxQt wxDC::SetClippingRegion() 2019-01-21 23:19:25 +01:00
Vadim Zeitlin
5ff49cb2e2 Merge branch 'qt_fix_unitialised_fields' of https://github.com/GeoTeric/wxWidgets
Add missing field initialization to a number of wxQt controls.

See https://github.com/wxWidgets/wxWidgets/pull/1092
2019-01-08 00:38:53 +01:00
Graham Dawes
538cdc0841 Add missing RTTI to some wxQT classes 2018-12-21 15:56:46 +00:00
Cătălin Răceanu
f0df737326
Update src/qt/dc.cpp
Co-Authored-By: ffa-grahamdawes <graham.dawes@geoteric.com>
2018-12-20 14:00:03 +00:00
Cătălin Răceanu
90165488f6
Update src/qt/dc.cpp
Co-Authored-By: ffa-grahamdawes <graham.dawes@geoteric.com>
2018-12-20 13:59:49 +00:00
Cătălin Răceanu
f8110c1c27
Update src/qt/dc.cpp
Co-Authored-By: ffa-grahamdawes <graham.dawes@geoteric.com>
2018-12-20 13:59:31 +00:00
Cătălin Răceanu
8f5acb341e
Update src/qt/dc.cpp
Co-Authored-By: ffa-grahamdawes <graham.dawes@geoteric.com>
2018-12-20 13:59:24 +00:00
Cătălin Răceanu
ae825ecd86
Update src/qt/dc.cpp
Co-Authored-By: ffa-grahamdawes <graham.dawes@geoteric.com>
2018-12-20 13:59:18 +00:00
Cătălin Răceanu
c7425b8c64
Update src/qt/dc.cpp
Co-Authored-By: ffa-grahamdawes <graham.dawes@geoteric.com>
2018-12-20 13:59:11 +00:00
Graham Dawes
5c3ddb7a7f Prevent crash when attempting to clear a DC with not device under wxQT 2018-12-20 13:41:02 +00:00
Jay Nabonne
c6d3b9c0b9 Fix background colour used by DrawEllipse() in wxQt
wxDC::DrawEllipse() used to use the text background for filling the
ellipses drawn with transparent pen, for some reason. According to
f9b28cd4325f42936d3122bfe7c847354bbbfee9 which changed this (this commit
was part of df13791078 merge done with
svn), this was done for compatibility with wxGTK, but wxGTK definitely
doesn't do it now and apparently never did, so there must have been some
mistake.

Simply remove the extra code using the text background for consistency
with this method behaviour in the other ports and also other methods
behaviour in the same port.

Closes https://github.com/wxWidgets/wxWidgets/pull/1087
2018-12-19 23:19:12 +01:00
Graham Dawes
ae20edb539 Fix several problem with wxMemoryDC in wxQt
Under wxQT, wxMemoryDC was previously rendering to a temporary image
which was only being blitted back to the original wxBitmap when either
the DC wx destroyed or a new bitmap was selected (via SelectObject).

With these change wxMemoryDCImpl now draws directly to the bitmap
managed by wxBitmap, this makes the behaviour more consistent with the
MSW and GTK implementations.

Closes https://github.com/wxWidgets/wxWidgets/pull/1083
2018-12-19 13:44:52 +01:00
Jay Nabonne
82a66e56b2 Fix possible usage of uninitialized variable in wxQt wxDC code
Make sure rasterColourOp is always initialized, even if none of the
switch cases matches, to avoid warnings about possibly uninitialized
variable.

See https://github.com/wxWidgets/wxWidgets/pull/1048
2018-12-07 00:11:56 +01:00
Jay Nabonne
194936ab26 Fix doubly-qualified namespace in wxQt wxDC code
Avoid (almost certainly accidentally) repeating "QPainter::".

See https://github.com/wxWidgets/wxWidgets/pull/1048
2018-12-07 00:11:01 +01:00
Maarten Bent
39ff5b90e5 Replace wxDeprecatedGUIConstants enum values 2018-11-25 21:29:32 +01:00
Maarten Bent
86c49283f5 Remove trailing spaces 2018-11-25 20:22:25 +01:00
Vadim Zeitlin
43ce00b5bd Call base class version from overridden DestroyClippingRegion()
No real changes, just call wxDCImpl::DestroyClippingRegion() from
the overridden versions in the derived classes instead of calling
ResetClipping(): this makes the code more clear as it follows the usual
pattern of the derived class doing something first and then forwarding
to the base class.

Also, as ResetClipping() is not really useful, add a comment documenting
that it shouldn't be used in the new code.
2018-06-19 00:17:43 +02:00
Sean D'Epagnier
1c249a6934 additional code style improvements from github comments 2017-11-06 02:06:02 +01:00
Sean D'Epagnier
169d61edb7 wxqt: correct formatting and casting, no functional change 2017-11-06 02:05:40 +01:00
Sean D'Epagnier
bf9eacad16 correct ppi implementation in wxqtdc 2017-11-06 02:05:40 +01:00
Sean D'Epagnier
988bc8b306 correct text extent to not require active painter 2017-11-06 02:05:40 +01:00
Sean D'Epagnier
cc01fbc3c0 defer dc screen grab until blit 2017-11-06 02:05:40 +01:00
Sean D'Epagnier
694decea6e apply mask to result after paint operations so that qt doesn't clobber the mask
also fixes small memory leak
2017-11-06 02:05:40 +01:00
Sean D'Epagnier
35bc8f449b Improve build and widget storage
There are no longer any qt headers included in wx/qt headers.
Applications do not need to link with qt librarys anymore, only wxqt libraries.
wxWindow and derived widgets only contain one pointer to their qtwidget, no longer
  carrying both base and derived pointers in parallel as was before.
2017-11-06 02:05:40 +01:00
Sean D'Epagnier
88e134ef81 improve cursor and color implementation in wxqt 2017-11-06 02:04:23 +01:00
Sean D'Epagnier
8be71bd900 fix failed assertions in wxqt from newer wx library code 2017-11-06 02:04:23 +01:00
Vadim Zeitlin
4b9dc20956 Remove or make optional tons of debug messages from wxQt
Using the library wasn't really possible with all the debug messages it
generated, so either suppress them completely or turn them into trace messages
which can be activated on demand if needed.
2016-02-24 23:12:37 +01:00
Tim Stahlhut
fb5d1a002c Fixes for wxQt build under Cygwin
Include the missing headers, notable QtGui/QFont from wx/fontutil.h which uses
a QFont object.

Closes #16750.
2015-10-25 18:00:05 +01:00