Commit Graph

220 Commits

Author SHA1 Message Date
dsr
a3d58dadd9 Implement wxGestureEvent support for wxQt
Do it generically in wxWindow and also provide a special version for
wxGLCanvas for which the standard implementation doesn't work well.
2021-01-27 19:01:50 +01:00
dsr
2cf57fda36 Avoid crashes when destroying wxGLCanvas
Block signals that are not safe to process any more.
2021-01-27 18:42:16 +01:00
Vadim Zeitlin
d046a8fbc6 Remove currently unused wxGLContext::m_glContext
No real changes, just remove unused private field.
2021-01-27 18:41:06 +01:00
dsr
b692dd8aef Implement wxMenuItem::SetFont() for wxQt 2021-01-27 18:31:49 +01:00
Vadim Zeitlin
d47fa718cd Add wxDataViewCtrl::ExpandChildren()
This convenient method allows to expand all children of the item
recursively.

This is directly supported by both native implementations, so it makes
sense to have this in wxDataViewCtrl itself, even if it could be also
(less efficiently) implemented in the user code.
2020-12-05 16:37:13 +01:00
Vadim Zeitlin
1e28312035 Override DoExpand() in wxQt wxDataViewCtrl stub
This code doesn't work (and probably doesn't compile) anyhow, but at
least try to do the right thing in it and override DoExpand() instead of
adding a virtual Expand() hiding the non-virtual version in the base
class.
2020-12-05 13:52:48 +01:00
Vadim Zeitlin
712c2d4004 Add possibility to create "Close" bitmap button from XRC
This requires refactoring NewCloseButton() in order to extract
CreateCloseButton() from it, as XRC relies on being able to use two-step
creation which was previously impossible for this kind of buttons.

CreateCloseButton() is rather unusual, as it has to be declared in the
derived, platform-specific class, in order to be able to call its
Create(), but is defined only once in common, platform-independent,
code. However the only alternative seems to be to have a static
function, e.g. InitCloseButton(), which wouldn't be very pretty neither.

Closes https://github.com/wxWidgets/wxWidgets/pull/2118
2020-11-19 15:44:54 +01:00
Vadim Zeitlin
bcb016613e Make wxRadioButtonBase a plain class, not template
Use a dirty hack to accommodate wxUniv by deriving wxRadioButtonBase
from wxCheckBox, rather than wxControl, there. This is not pretty, but
should be addressed by refactoring wxUniv code and in the meanwhile all
the other ports don't have to bother with using a template class
unnecessarily.
2020-09-21 18:01:37 +02:00
Vadim Zeitlin
3d72c009be Add wxRadioButtonBase::{Set,Get}Value()
Now that we do have wxRadioButtonBase class, declare wxRadioButton API
methods as pure virtual in it, to force the derived classes to implement
them.

Also remove the outdated comment saying that there is no base class for
wxRadioButtons in different ports, this is not true any longer.
2020-09-21 16:13:55 +02:00
Stefan Csomor
92ea83f00b First implementation 2020-09-17 22:35:22 +02:00
Vadim Zeitlin
7352a2879c Rename Qt-specific GetEventType() to start with "Qt" prefix
This avoids conflicts with another method with the same name defined in
generic wxGenericFileDirButton, which must neither override nor hide
this method of wxButton.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
9f63592eba Remove unnecessary wxBitmap copy ctor from wxQt
This ctor is not needed as the inherited wxObject ctor is sufficient and
defining it but not operator=() explicitly results in -Wdeprecated-copy
from gcc 10.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
19bc293086 Remove extraneous semicolon in wx/qt/menuitem.h
Avoid -Wpedantic from gcc.
2020-08-31 01:25:45 +02:00
Arrigo Marchiori
c86bcf962d Use wxASCII_STR() on string literals
Fix the build with wxNO_IMPLICIT_WXSTRING_ENCODING.
2020-07-17 17:52:16 +02:00
Vadim Zeitlin
d7f19ee610 Fix spelling in comments and documentation using codespell
Apply the utility from https://github.com/codespell-project/codespell/
to fix spelling issues in the headers under both include and interface
directories and add a file with a couple of exceptions.

The exact command line used was:

    $ codespell -w -I misc/scripts/codespell.ignore -i 3 in*
2020-06-27 22:56:22 +02:00
Paul Cornett
896512c732 Change fractional point size from float to double
There doesn't seem to be any compelling reason to use float. Using double
is simpler, and avoids otherwise unnecessary float<->double conversions.
2020-04-21 09:00:04 -07:00
Vadim Zeitlin
52ae67ef86 Replace dynamic casts with virtual wxWindow::WXGetTextEntry()
Instead of checking for all text-like controls one by one in
wxCommandEvent::GetString(), call a virtual function checking for this.

This is simpler, less error-prone and faster -- at the cost of
increasing the vtbl size of all wxWindow-derived classes.

Closes https://github.com/wxWidgets/wxWidgets/pull/1696
2020-01-09 23:25:49 +01:00
Vadim Zeitlin
f95ce8d9d5 Add wxListCtrlBase::GetItemCount() pure virtual
No real changes, just ensure that all derived classes implement this
method (which already was the case).
2019-10-08 01:16:50 +02:00
Vadim Zeitlin
4c517dea40 Merge branch 'qt_clipboard_bitmap' of https://github.com/GeoTeric/wxWidgets
Implement copying bitmap to clipboard for wxQt.

See https://github.com/wxWidgets/wxWidgets/pull/1368
2019-10-05 15:04:47 +02:00
Matthew Griffin
5c169c0cf2 Update function names, indentation and added comments 2019-10-02 15:40:16 +01:00
Matthew Griffin
531e988e5d Refactor to do custom qt clipboard actions without dynamic cast 2019-10-02 13:22:16 +01:00
Artur Wieczorek
90e4ceb1c6 Make wxMask::GetBitmap a public function
According to the documentation this function should be declared as public,
not protected.
2019-09-29 20:19:10 +02:00
Vadim Zeitlin
04949050b2 Merge branch 'qt-fixes'
A multitude of miscellaneous Qt fixes and improvements.

See https://github.com/wxWidgets/wxWidgets/pull/1552
2019-09-27 19:18:11 +02:00
Matthew Griffin
f608b340c2 Send set cursor events whenever there is mouse movement
This is required in order to allow application code to change the cursor
dynamically.

Closes https://github.com/wxWidgets/wxWidgets/pull/1549
2019-09-27 14:00:02 +02:00
Vadim Zeitlin
3a918864f9 Make accelerators work for menu items created in the code too
The previous commit fixed accelerators support in wxQt for the items
created in XRC, but not for those created directly in the code, as
wxMenuItem::SetItemLabel() is not called in this case.

Refactor the code to extract UpdateShortcutsFromLabel() from
SetItemLabel() and call the new function both from there and from
wxMenuItem ctor, to ensure that the accelerators are taken into account
in any case.

This commit is best viewed with "git diff --color-moved".

See https://github.com/wxWidgets/wxWidgets/pull/1544
2019-09-27 13:47:45 +02:00
Matthew Griffin
2c91463c81 Enable mouse tracking on construction of every wxQt widget
Not all controls use wxWindow::Create(), so move setMouseTracking() call
where it is always executed.

Closes https://github.com/wxWidgets/wxWidgets/pull/1528
2019-09-27 13:24:29 +02:00
Graham Dawes
cd7594e639 Don't include scrollbars in client area size
Return the size of just the viewport when using QScrollArea.

Closes https://github.com/wxWidgets/wxWidgets/pull/1418
2019-09-22 02:37:11 +02:00
David Roberts
18b87b2ab5 Send wxEVT_CHECKLISTBOX when a checkbox is clicked
Fix sending events from wxCheckListBox in wxQt.

Closes https://github.com/wxWidgets/wxWidgets/pull/1403
2019-09-22 02:30:05 +02:00
Graham Dawes
cc1ec9e562 Show tooltip in wxTreeCtrl when item text doesn't fit on screen
This matches the behaviour of the native control in wxMSW and is
generally useful.

Closes https://github.com/wxWidgets/wxWidgets/pull/1397
2019-09-22 02:12:35 +02:00
Matthew Griffin
9434a443f5 Ensure that QCloseEvents can be vetoed by wx
These events use a different convention from all the other ones in Qt
and need to be ignored, rather than accepted, to prevent the default
action from occurring.

And these events are also sent to disabled windows, which are never
supposed to receive them in wx API.

Closes https://github.com/wxWidgets/wxWidgets/pull/1371
2019-09-22 02:05:32 +02:00
Liam Treacy
4bfb3a5f01 Implement wxFrame::DoSetClientSize()
Resize the central widget to fit the new size.

See https://github.com/wxWidgets/wxWidgets/pull/1340
2019-09-15 01:35:54 +02:00
Vadim Zeitlin
b8d5c85ecb Make Reparent() work for wxFrame in wxQt
Use the correct parent window, i.e. the one of the central widget and
not of the frame itself.
2019-09-15 01:35:54 +02:00
Graham Dawes
7454fc151b Rewrite wxListCtrl to use QTreeView and a custom model
This notably allows to support wxLC_VIRTUAL style.

Also implement support for checkboxes, improve in-place editing and
implement many other methods and missing functionality (e.g. send the
expected events now).

Closes https://github.com/wxWidgets/wxWidgets/pull/1229
2019-09-15 00:14:02 +02:00
Igor Korot
1879e8e646 Make wxColourData parameter of wxColourDialog ctor const
This parameter is not modified by wxColourDialog (this might have been
the case, or at least the plan, some long time ago) and so has no reason
not to be "const".

Just add the qualifier to ctor and Create() in all ports.

Closes https://github.com/wxWidgets/wxWidgets/pull/1421

Closes #12511.
2019-07-16 20:19:33 +02:00
Vadim Zeitlin
4a6f16cf15 Merge branch 'statictext-setlabel'
wxControl label-related fixes and improvements.

See https://github.com/wxWidgets/wxWidgets/pull/1364
2019-07-08 10:09:49 +02:00
Vadim Zeitlin
958521183a Add minimal support for ellipsization to wxQt wxStaticText
Set the visible label to the ellipsized value, if necessary.

Also call AutoResizeIfNecessary() for consistency with the other ports.
2019-07-08 10:09:14 +02:00
Vadim Zeitlin
8e15849706 Use wxOVERRIDE for deprecated wxBitmap methods in wxQt too
When WXWIN_COMPATIBILITY_3_0 is on, compiling this header results in a
bunch of harmless but annoying -Winconsistent-missing-override clang
warnings, so add wxOVERRIDE to silence them.

No real changes.
2019-07-03 15:31:15 +02:00
Graham Dawes
e5ba6d9393 Implement SetForegroundColour and SetBackgroundColour for wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1373
2019-07-03 13:25:55 +02:00
Graham Dawes
9e35bb92c0 Avoid focus loss event when wxComboBox popup is opened in wxQt
Prevent wxComboBox from generating a wxEVT_KILL_FOCUS event when the
user opens the drop-down list under wxQt, as logically the drop-down is
part of wxComboBox, even if it's a separate window at Qt level.

Closes https://github.com/wxWidgets/wxWidgets/pull/1377
2019-07-03 13:18:30 +02:00
Vadim Zeitlin
66d596dd09 Use standard naming convention for wxQtListTextCtrl::OnMove() 2019-06-29 20:49:47 +02:00
Vadim Zeitlin
44634cbf90 Merge branch 'qt_tree_control' of https://github.com/GeoTeric/wxWidgets into qt-fixes
See https://github.com/wxWidgets/wxWidgets/pull/1225
2019-06-29 20:49:25 +02:00
Matthew Griffin
aa786e813b Use QtClipboard image functions instead of setting mime type 2019-06-25 11:21:37 +01:00
Matthew Griffin
a4e0c2cc34 Implement Copy to Clipboard for images 2019-06-24 16:30:29 +01:00
Matthew Griffin
9bb9bf5718 Code review changes 2019-06-04 10:29:17 +01:00
Matthew Griffin
12c8741704 Fix crash on Linux 2019-06-03 10:58:56 +01:00
Matthew Griffin
3e3f888582 Removed spurious indent 2019-05-30 11:59:07 +01:00
Matthew Griffin
3f4b74baea Fixed build issues 2019-05-30 11:45:16 +01:00
Matthew Griffin
77d5d31690 Close the Tree Control editor correctly
Ensure that wxTreeItemData is deleted.
Use a QT delegate to create editor and perform custom model update.
Connect to the closeEditor signal to send out end label edit events and decide whether to accept changes.
2019-05-30 10:47:09 +01:00
Maarten Bent
ceaf2aa803 Move virtual stub functions to wxListCtrlBase 2019-05-05 14:23:44 +02:00
Paul Cornett
9511ab08f1 More use of wxOVERRIDE 2019-04-05 11:08:53 -07:00