Commit Graph

526 Commits

Author SHA1 Message Date
Jay Nabonne
1d117b75f7 Add wxGraphicsContext implementation for wxQt
Add graphics renderer using Qt classes and use it by default in wxQt
port under MSW.

Closes https://github.com/wxWidgets/wxWidgets/pull/1139
2019-01-17 00:50:47 +01:00
chris2oph
dd306cac77 Various wxFont fixes in wxQt
Implement point/pixel size accessors correctly.

Implement support for strike-through fonts.

Also implement DoSetNativeFontInfo() for wxQt.

Make wxFont unit test pass by accounting for Qt-specific aspects.

Closes https://github.com/wxWidgets/wxWidgets/pull/1113
2019-01-14 23:39:02 +01:00
chris2oph
ebb50551c4 Fix typo in a comment in Qt font code
See https://github.com/wxWidgets/wxWidgets/pull/1113
2019-01-14 23:35:57 +01:00
Graham Dawes
4a18bc897d Improve layout of radioboxes in horizontal sizers with expand flag under wxQT 2019-01-14 08:06:34 +00:00
Graham Dawes
a823236ac1 Improve layout of wxRadioBox under wxQT 2019-01-11 15:11:28 +00:00
Graham Dawes
4f32cfc5fb Add support for grid layout in wxRadioBox under wxQT 2019-01-11 15:11:28 +00:00
Graham Dawes
12d4ed3e8c Collapse 2 loop dependent variables into a single variable 2019-01-11 15:11:28 +00:00
Graham Dawes
d411c3159c Replace template that is only ever instantiated with one type 2019-01-11 15:11:13 +00:00
Richard Smith
fc65bd92a6 Fix leaks/crashes related to window scrollbars in wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1135
2019-01-11 14:28:39 +01:00
Graham Dawes
5d3366abb9 Fixed another unitialised field in wxBrush for wxQT 2019-01-11 08:17:49 +00:00
Graham Dawes
79d8c6ff0c Fix uninitialised field 2019-01-10 16:53:51 +00:00
Graham Dawes
3f2db1b027 Fix item index in wxRadioBox events in wxQt
Use 0-based index for the radio box items, as in the other ports,
instead of auto-generated values.

Closes https://github.com/wxWidgets/wxWidgets/pull/1127
2019-01-10 04:01:39 +01:00
Graham Dawes
2969cefb3a Fix crash when calling wxRadioBox::Show() before Create() in wxQt
This notable happened when the radio box was loaded from XRC.

Closes https://github.com/wxWidgets/wxWidgets/pull/1126
2019-01-10 04:00:12 +01:00
Graham Dawes
dfdbba7ebc Fix wxQT crash if wxRadioBox is created without wxRA_SPECIFY_XXX
Fall back to wxRA_SPECIFY_COLS if neither it nor wxRA_SPECIFY_ROWS is
given instead of not initializing m_qtBoxLayout at all in this case and
subsequently crashing due to it.

Closes https://github.com/wxWidgets/wxWidgets/pull/1125
2019-01-10 03:58:20 +01:00
Graham Dawes
aa422c6be2 Make scrollbar private to wxWindow under wxQt
Use QScrollbar directly instead of wxScrollbar for the window scrollbars
to ensure that wxWindow::GetChildren() doesn't return these scrollbars.

Closes https://github.com/wxWidgets/wxWidgets/pull/1124
2019-01-10 03:55:19 +01:00
Graham Dawes
34ecc6efc4 Generate wxWindowCreateEvent when creating windows in wxQt
Send the expected event at the very end of window creation process.

Closes https://github.com/wxWidgets/wxWidgets/pull/1119
2019-01-10 03:50:43 +01:00
Graham Dawes
fbbdcc058a Fix client size for wxFrame under wxQt
Avoid implicitly creating the menu bar by calling menuBar() and use
menuWidget() instead which just returns NULL if there is no menu bar,
allowing to calculate correct client size for frames without menus.

Closes https://github.com/wxWidgets/wxWidgets/pull/1120
2019-01-08 00:41:34 +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
Vadim Zeitlin
7935dab2e8 Merge branch 'qt_fix_missing_rtti' of https://github.com/GeoTeric/wxWidgets
Add missing wx RTTI macros to many classes in wxQt.

See https://github.com/wxWidgets/wxWidgets/pull/1095
2019-01-08 00:34:30 +01:00
Graham Dawes
45fc60b549 wxBitmapToggleButton's reported base class is wxControl 2019-01-07 11:51:05 +00:00
Graham Dawes
00030b56cb Fix implementation details being used as base class for RTTI in wxQT 2019-01-07 09:18:50 +00:00
chris2oph
155a19a1a2 Improve checks for dates range in wxQt wxCalendarCtrl
Account for the minimum and maximum dates supported by QDatePicker, both
in the code and in the test suite, which shouldn't rely on not having
any range restrictions in wxQt.

Closes https://github.com/wxWidgets/wxWidgets/pull/1088
2019-01-03 00:18:37 +01:00
Cătălin Răceanu
2a9462a260 Honor text alignment for spin controls in wxQt
Add support for wxALIGN_CENTRE_HORIZONTAL and wxALIGN_RIGHT flags.

Closes https://github.com/wxWidgets/wxWidgets/pull/1108
2019-01-03 00:15:23 +01:00
Richard Smith
0fbf87d11b Split single/multi line behaviour in Qt wxTextCtrl
Introduce wxQtEdit class and wxQtMultiLineEdit and wxQtSingleLineEdit
derived classes instead of using ifs in many wxTextCtrl methods, making
the code more clear and maintainable.

Also fix some wxTextCtrl-related unit test failures with wxQt and
disable some other ones which still don't pass.

Closes https://github.com/wxWidgets/wxWidgets/pull/1039
2018-12-24 01:52:07 +01:00
chris2oph
a6dc3c78ab Really add items to the listbox in wxQt wxListBox::Create()
The initial choices were just ignored, do add them to the Qt listbox
now.

Closes https://github.com/wxWidgets/wxWidgets/pull/1094
2018-12-23 17:09:59 +01:00
Graham Dawes
538cdc0841 Add missing RTTI to some wxQT classes 2018-12-21 15:56:46 +00:00
Graham Dawes
b890f59bc9 Call base class Show from wxRadioBox::Show 2018-12-21 08:18:17 +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
Graham Dawes
172a97e411 Erase event now is now sent with a valid event object 2018-12-20 13:40:18 +00:00
Graham Dawes
bfb59228c1 Fix crashes due to unitialised fields 2018-12-20 10:51:03 +00:00
Graham Dawes
57b636b2d4 Fix for NULL pixmap when setting button icon in wxQT 2018-12-20 10:33:01 +00:00
Graham Dawes
bc4d3a4554 Initialise m_qtPushButton in wxAnyButton's constructor. 2018-12-20 08:06:46 +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
Jay Nabonne
c47c7de5ea Allow overriding the label for stock buttons in wxQt
Stock label should only be used if passed label is empty. Otherwise,
passed label should override the default value.

Closes https://github.com/wxWidgets/wxWidgets/pull/1086
2018-12-19 13:46:20 +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
Graham Dawes
db15e99884 Fix wxBitmap::GetRawData() in wxQt
This method used to return a dangling pointer to a temporary buffer,
which resulted in a crash when using it, e.g. in the unit test.

Fix this by keeping a QImage as a member in wxBitmapRefData, so that the
pointer to its data remain valid until UngetRawData() is called.

Also check that GetRawData() returns a non-null pointer in the test.

Closes https://github.com/wxWidgets/wxWidgets/pull/1067
2018-12-13 15:24:54 +01:00
Vadim Zeitlin
013c6a6b6a Speed up inserting many items in sorted wxChoice in wxQt
Only sort the combobox once instead of doing it for every item.

See https://github.com/wxWidgets/wxWidgets/pull/1054
2018-12-13 15:17:18 +01:00
chris2oph
89e4ee1ec0 Ensure items are sorted when added to wxChoice in wxQt
Call sort() to resort the model after inserting a new item.

Closes https://github.com/wxWidgets/wxWidgets/pull/1054
2018-12-13 15:10:59 +01:00
Graham Dawes
ac55d06bc1 Fix a crash when setting a menu icon to a null bitmap in wxQt
Previous implementation didn't take into account that
wxBitmap::GetHandle() could return NULL for wxQt. Specifically when
wxBitmap::IsNull returns true.

Closes https://github.com/wxWidgets/wxWidgets/pull/1071
2018-12-12 18:14:45 +01:00
Graham Dawes
331dc1fdfe Change wxFont::GetEncoding to return UTF8 for wxQt
QT doesn't have the concept of font encoding and is generally Unicode
aware throughout. The previous implementation of wxFont::GetEncoding for
wxQT returned a nonsensical value.

Closes https://github.com/wxWidgets/wxWidgets/pull/1070
2018-12-12 18:13:54 +01:00
Liam Treacy
e7260cffe0 Fix wxRadioBox::Show() behaviour in wxQt
If a QGroupBox is not visible, then you cannot set any of items to be
visible. Update the implementation to match that expected by wx.

Closes https://github.com/wxWidgets/wxWidgets/pull/1065
2018-12-12 03:23:24 +01:00
Liam Treacy
418a1b747e Select first item of wxRadioBox by default in wxQt too
Follow the other ports and select the first radio box item when it's
created, to ensure that it always has selection.

See https://github.com/wxWidgets/wxWidgets/pull/1065
2018-12-12 03:21:17 +01:00
Liam Treacy
2a64b65149 Fix enabling radiobox buttons in wxQt
If a QGroupBox is disabled, then you cannot set any of its items to be
enabled without first enabling it. Enabling/disabling it will set that
value (true/false) on all of its items, although setting the QGroupBox
to an enabled state which it already has does not result in this
behaviour.

Fix wxQt to match the expected wxRadioBox behaviour and allow the unit
test to pass.

Closes https://github.com/wxWidgets/wxWidgets/pull/1064
2018-12-10 19:52:22 +01:00
Liam Treacy
91a87e765b Don't omit "int" in wxQt wxRadioBox::GetCount() signature
No real changes, just use "unsigned int" instead of just "unsigned".

See https://github.com/wxWidgets/wxWidgets/pull/1064
2018-12-10 19:51:52 +01:00