Commit Graph

526 Commits

Author SHA1 Message Date
Vadim Zeitlin
0145916fb6 Unindent contents of anonymous namespaces
No real changes, only formatting.
2019-02-02 15:50:13 +01:00
Graham Dawes
f2d20384a0 Implement wxListCtrl::GetEditControl() for wxQt
To get access to the control used for editing items, we need to create
it ourselves, which involves defining our own factory for doing this,
but seems to be the only way of achieving our goal.

Closes https://github.com/wxWidgets/wxWidgets/pull/1204
2019-02-02 15:35:26 +01:00
phowstan
89e5663a75 Handle calling wxWindow::Hide() before Create() in wxQt
Hide the window explicitly once it's created. This is not very useful,
as the real purpose of calling Hide() before Create() is to prevent the
window from being initially shown at all to avoid flicker, but better
than not hiding it at all.

Closes https://github.com/wxWidgets/wxWidgets/pull/1203
2019-02-02 15:11:42 +01:00
Vadim Zeitlin
27f1c8f445 Fix wxRadioButton grouping in wxQt
Create QButtonGroup as needed to honour wxRB_GROUP and wxRB_SINGLE
styles.

Co-Authored-By: Cătălin Răceanu <maildus@gmail.com>

Co-Authored-By: liamtreacy <liam.treacy@gmail.com>
2019-02-02 15:06:14 +01:00
Vadim Zeitlin
1a9f0f8b8d Make trivial Qt <-> wx conversion functions inline
No real changes, just make often used and trivial functions inline as
this like an obviously better thing to do.
2019-02-02 14:24:16 +01:00
phowstan
e831703aae Handled null cursor correctly in wxQt SetCursor()
Make passing invalid wxCursor object to SetCursor() work and reset any
previously specified cursor.

Closes https://github.com/wxWidgets/wxWidgets/pull/1197
2019-02-02 14:15:11 +01:00
Vadim Zeitlin
5154cc711a Include QRect, QSize and QString from wx/qt/private/converter.h
Similarly to the previous commit, it doesn't seem to be worth it to
avoid including these simple and common headers from there and it
simplifies code and will allow making the converter functions inline.
2019-01-30 18:12:12 +01:00
Vadim Zeitlin
b0d88a306d Include wx/qt/private/converter.h from src/qt/converter.cpp
Follow standard practice and include the header corresponding to the
source file from it explicitly.

Also include wx/gdicmn.h from the header itself, this is a pretty common
header and there is no real advantage in avoiding it there and including
it allows to avoid a bunch of forward declarations.
2019-01-30 18:07:33 +01:00
Vadim Zeitlin
6bd15cd1ee Remove duplicate header inclusion in wxQt
No real changes, just remove a redundant line.
2019-01-30 18:06:09 +01:00
Vadim Zeitlin
b5b415af87 Stop converting wxPoint(-1,-1) to QPoint(0,0) and vice versa
QPoint(0,0) is a valid position and there just doesn't seem to be any
good reason to make it invalid by mapping it to wxDefaultPosition.

Closes https://github.com/wxWidgets/wxWidgets/pull/1202
2019-01-30 18:04:42 +01:00
Vadim Zeitlin
4d16029f8b Merge branch 'notebook-add-page-events'
Harmonize events sent by wxNotebook::AddPage(): they are now sent only
when adding any page except the first one if it is selected in all
ports.

See https://github.com/wxWidgets/wxWidgets/pull/1192
2019-01-30 17:38:51 +01:00
Vadim Zeitlin
8fbca5cb70 Remove all trailing spaces
No real changes, just clean up sources by removing trailing spaces from
all the non-generated files.

This should hopefully avoid future commits mixing significant changes
with insignificant whitespace ones.
2019-01-30 17:35:54 +01:00
Matthew Griffin
ae94f4da9c Ensure that top level window is active when it's shown in wxQt
Under some (not totally clear) circumstances, a TLW can remain inactive
after being shown, which is undesirable, as it prevents setting focus to
its children from working.

Work around this by calling activateWindow() explicitly if necessary.

Closes https://github.com/wxWidgets/wxWidgets/pull/1179
2019-01-30 17:27:15 +01:00
Jay Nabonne
111a37fd73 Get rid of another switch/default issue by avoiding switch altogther. Makes the code more readable (I think) actually. 2019-01-30 16:09:18 +00:00
Jay Nabonne
653979936b Clean up the code a bit to follow the guidelines, including handling of default in switches and line length. 2019-01-30 15:59:37 +00:00
Jay Nabonne
58639481c6 Make OnData behave like other implementations in terms of paying attention to what GetData returns. 2019-01-30 15:25:51 +00:00
Jay Nabonne
76eee80738 Initialize m_pendingMimeData to NULL! 2019-01-30 15:21:43 +00:00
Jay Nabonne
4844c80e18 Add some consts to const things. 2019-01-30 15:19:39 +00:00
Jay Nabonne
32780f00f2 Combine two separate anonymous namespaces into one. 2019-01-30 15:11:46 +00:00
Jay Nabonne
ece6626a59 Switch wxQt to use UTF-8 for text data transfer via wxDataObject. The result otherwise was less than useful. 2019-01-30 15:03:05 +00:00
Jay Nabonne
6fa65900f9 Implement cursor overriding for DnD on wxQt.
This uses the cursor variant (as opposed to the icon one) since these actually are cursors, the base class looks like cursors are meant to be used, and the icon thing looks like a hack.
2019-01-30 14:22:01 +00:00
Jay Nabonne
abdebb1895 Do not allow drag and drop process on targets that do not support the formats dragged.
Privatize some Impl members.
2019-01-30 10:42:01 +00:00
Graham Dawes
fbc39bac54 Fix Linux build 2019-01-30 09:12:08 +00:00
Jay Nabonne
6ba6d9967a Change Qt wxDropTarget to remember widget and disconnect self when necessary. Clean up naming a bit. 2019-01-29 17:11:09 +00:00
Jay Nabonne
e995618a3a Be sure drop target is disconnected before destructing window. 2019-01-29 17:07:14 +00:00
Jay Nabonne
87f6707123 Fix some spacing transgressions. 2019-01-29 16:58:52 +00:00
Jay Nabonne
8c63c40953 Clean up wxDropTarget and wxWindow a bit more by moving DnD stuff fully into drop target (besides connecting and disconnecting).
Window doesn't have to know more than how to hook itself up.
Impl now performs function of event filter/adapter.
2019-01-29 16:55:31 +00:00
Jay Nabonne
2bceaaa572 Clean up wxDropTarget (first stage) by moving Qt specific stuff (e.g. QMimeData) into an Impl. 2019-01-29 16:29:58 +00:00
Jay Nabonne
323cbdabdb Implement initial try of wxDropTarget.
The drop target needs to use an event filter to capture drag-and-drop events from the window.
2019-01-29 16:13:41 +00:00
Graham Dawes
3cb395a5a5 Implement wxNotebook::DeleteAllPages() for wxQt
See https://github.com/wxWidgets/wxWidgets/pull/1191
2019-01-28 19:07:28 +01:00
Vadim Zeitlin
da96ab179f Fix updating selection in wxNotebook::InsertPage() in wxQt
Just use DoSetSelectionAfterInsertion() provided by the base class,
which does the right thing already, including both setting m_selection
and sending (or not sending) the corresponding events.
2019-01-28 18:29:31 +01:00
Vadim Zeitlin
665b5a76a8 Remove unnecessary wxNotebook::DoSetSelection() from wxQt
Having this method didn't really help, it's simpler and more
straightforward to implement ChangeSelection() as a signal-blocking
wrapper around SetSelection() instead.

No real changes in behaviour, this is a pure refactoring.
2019-01-28 17:51:27 +01:00
Jay Nabonne
0dc1654ab6 Get simple (text) drag and drop case working with drop source.
We ended up not needing the underlying QMimeData-based implementation, as the classes sitting on top of it
bypassed it anyway. It now treats the hierarchy as a pure data storage mechanism, generating the
QMimeData when drag-drop is initiated.
2019-01-28 15:30:25 +00:00
Jay Nabonne
ea4c7120ff Fixed up and cleaned up Qt variant of wxDataFormat.
Kept "mime type" and "id" conceptually separate in the interface in case they need to diverge later.
Got rid of the odd "wxChar *" variants and the QString one.
Implemented unimplemented "type" functions.
Implemented "!=" in terms of "==", to keep from having two places to keep in sync.
2019-01-28 15:22:01 +00:00
Graham Dawes
0265139c11 Track Qt tab widget selection when adding pages to wxNotebook
Ensure the selected state tracks the Qt selection: without this, if
no explicit selection is made after adding the pages,
wxNotebook::GetSelection() returns wxNOT_FOUND even though the first
page is selected.

Closes https://github.com/wxWidgets/wxWidgets/pull/1182
2019-01-27 04:04:42 +01:00
chris2oph
b1594725c9 Use QWidget::update() rather than repaint() in wxClientDC
Qt documentation advises to avoid calling repaint() except when an
immediate update is required, i.e. it corresponds to wxWindow::Update().
Use update() instead to avoid many Qt warnings that appeared when
resizing the caret sample window, for example.

Closes https://github.com/wxWidgets/wxWidgets/pull/1178
2019-01-27 04:00:12 +01:00
Vadim Zeitlin
c74727c20f Merge branch 'qt_more_event_loop_improvements' of https://github.com/GeoTeric/wxWidgets
Event loop and idle events improvements for wxQt

See https://github.com/wxWidgets/wxWidgets/pull/1171
2019-01-27 03:55:38 +01:00
Graham Dawes
e40323d312 Simplify shared timer reference counting in wxEventLoop for wxQT 2019-01-25 16:44:23 +00:00
ali kettab
84fc5c1714 Fix changing tooltip via wxToolTip::SetTip() in wxQt
Update the actual tool tip used by Qt and not just the internal variable
when SetTip() is called.

Also implement wxToolTip::SetWindow().

Closes https://github.com/wxWidgets/wxWidgets/pull/1175
2019-01-25 14:39:37 +01:00
ali kettab
3c369af2e6 Translate QFocusEvent to wxFocusEvent correctly
Set the ID, object and the associated window.

Closes https://github.com/wxWidgets/wxWidgets/pull/1177
2019-01-25 03:31:22 +01:00
ali kettab
515031cf6b Set event object for wxKeyEvents generated in wxQt
Not setting the event object broke the code expecting it to be set,
notably in our own validators code.

Closes https://github.com/wxWidgets/wxWidgets/pull/1176
2019-01-24 22:47:26 +01:00
Liam Treacy
f9280c8529 Now use the column index to retrieve the correct text in GetItemText 2019-01-24 14:38:38 +00:00
Liam Treacy
ca00251454 Fix in wxListCtrl::FindItem. Every item is now iterated through, rather than only the first 2019-01-24 14:35:47 +00:00
Vadim Zeitlin
9c16a3748e Declare variable only needed inside an "if" inside it
No real changes, just make the code slightly more concise.
2019-01-23 16:47:05 +01:00
Vadim Zeitlin
6b3a0cc460 Make wxQtSpinBoxBase-derived valueChanged() methods inline
It seems better to have them in the class itself, near the connect()
call binding them.

This also resolves an inconsistency between wxQtSpinBox::valueChanged(),
which was defined elsewhere in the source file, and the same method of
wxQtDoubleSpinBox, which was defined directly after the class
declaration.

See https://github.com/wxWidgets/wxWidgets/pull/1168
2019-01-23 16:45:21 +01:00
Matthew Griffin
adee46d155 Send event when wxSpinCtrlDouble value changes in wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1168
2019-01-23 16:44:46 +01:00
phowstan
7cfb5b91a5 Implement wxStaticBox::Set/GetLabel() in wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1167
2019-01-23 16:38:25 +01:00
Graham Dawes
6aecaa8845 Share a single idle timer for all event loops in wxQT 2019-01-23 13:55:20 +00:00
Graham Dawes
0c28952ff6 Make ScheduleIdleCheck take into account whether the loop is exiting 2019-01-23 12:04:42 +00:00
Graham Dawes
b8f71efc04 Implement filtering in wxEventLoop::DoYieldFor under wxQT 2019-01-23 11:57:16 +00:00