On Sat, 24 May 2014 14:37:09 -0300 Mariano Reingart wrote:
MR> wxQT (2.9.2) is finally merged against latest master trunk (3.1.0) and
MR> running (at least minimal sample with controls: wxStaticText,
MR> wxTextCtrl, wxButton, wxBoxSizer and wxCommandEvent).
Very nice, congratulations! This was indeed a very important first step
and I'm glad you've already managed to finish it.
Do we have a list of things missing from wxQt at this point?
On Wed, 4 Jun 2014 06:02:17 -0300 Mariano Reingart wrote:
MR> I've made progress with the wxNotebook control for wxQT fixinig some issues
MR> and implementing image (icon) support and events.
Good news! wxNotebook is useful on its own, but it's also an example of a
relatively complex control, so it's encouraging to see that you didn't have
any particular problems with it.
MR> For the signal connection, I've created a helper class wxQtTabWidget,
MR> similar to the others already implemented like wxQtPushButton, but instead
MR> of the old syntax (SIGNAL / SLOT), I've used new Qt5 syntax QObject member.
MR>
MR> I think this is a better way as it doesn't requires the moc precompilation
MR> step nor separate files (_qt.moc.cpp and .h not needed)
MR>
MR> https://github.com/reingart/wxWidgets/commit/ef2a4515515a46bbd944b79a3843466e05404bac
Yes, definitely better.
MR> This implementation is simpler as the notebook has only one custom event,
MR> but I'll have to investigate how to merge with wxQtEventSignalHandler if
MR> you agree this form is ok.
I don't know much about wxQtEventSignalHandler but if we can avoid using
moc, it would be really great.
MR> More info at:
MR>
MR> https://github.com/reingart/wxWidgets/issues/4 (critical controls)
MR>
MR> https://github.com/reingart/wxWidgets/issues/6 (controls sample)
MR>
MR> I'd taken some screenshots and made some comments there.
MR>
MR> As allways, any advice is welcomed
I've left some, mostly trivial, comments there, but I think you already
received notifications for them, haven't you?
Once again, good work!
On Fri, 6 Jun 2014 06:33:40 -0300 Mariano Reingart wrote:
MR> BTW, I've fixed two issues that caused Controls sample to not work
MR> properly: sizing event not triggered in wxWindow::Show() and GetBestSize()
MR> problem due qt's sizeHint() (detailed info in the issue #6)
Yes, I saw your comments, thanks!
MR> Ok, I'll try to implement new controls this way, and then if I have enough
MR> time I could remove moc files at all (maybe in last milestone after the
MR> mid-term evaluation).
Right.
MR> AFAIK wxQtEventSignalHandler is a helper template class that reimplements
MR> events (just methods, as they are different than signals in qt!). It is
MR> used mainly in *_qt.moc.cpp files to connect signals/slots.
MR> From the wxWidgets side it just has a EmitEvent method to bridge to Qt
MR> Events and Signals.
Looking at https://github.com/reingart/wxWidgets/blob/SOC2014_QT/include/wx/qt/winevent_qt.h
I don't really like this, having all events inside a single class is a bad
idea from dependencies point of view (compilation dependencies, as adding a
new event results in recompilation of everything; link dependencies as this
class is always used and pulls in all the code used in it even if it is not
used). What exactly is this class supposed to be doing anyhow? I just don't
see the big picture here...
MR> https://github.com/reingart/wxWidgets/commit/01a334bfe15348e87abf257e195b295790271a93
MR>
MR> It compiles but it doesn't link:
MR>
MR> reingart@s5ultra:~/src/wxWidgets/bldqt5/samples/controls$ LANG=C make
MR> g++ -o controls controls_controls.o
MR> -L/home/reingart/src/wxWidgets/bldqt5/lib
MR> -Wl,-rpath,/home/reingart/src/wxWidgets/bldqt5/lib -pthread
MR> -lwx_qtu_core-3.1 -lwx_baseu-3.1 -lQt5Widgets -lQt5Gui -lQt5Test
MR> -lQt5Core -lSM -lpng -lz -ljpeg -ltiff -lwxregexu-3.1 -pthread
MR> -Wl,--version-script,/home/reingart/src/wxWidgets/bldqt5/version-script -lz
MR> -ldl -lm -lQt5Gui -lQt5Test -lQt5Core -lz -ldl -lm -lQt5Gui -lQt5Test
MR> -lQt5Core
MR> /home/reingart/src/wxWidgets/bldqt5/lib/libwx_qtu_core-3.1.so: undefined
MR> reference to `vtable for wxQtTabWidget'
MR> collect2: error: ld returned 1 exit status
MR> make: *** [controls] Error 1
MR>
MR> I cannot figure out what I'm missing...
MR> Could you give me any advice here?
I suspect you'd work around the problem if you declared a virtual dtor in
wxQtTabWidget and defined it (even if it's empty) in src/qt/notebook.cpp
but I'm not really sure what's going on here, I'd need to build it myself
to see it (and be able to run nm on various object files).
BTW, it would be really great to have docs/qt/install.txt similar to the
other ports describing how to build wxQt, including the dependencies needed
and so on. Could you please write some minimal instructions?
On Fri, 6 Jun 2014 13:09:49 -0300 Mariano Reingart wrote:OK, after reading this I see how Qt does it now. I still have no idea why
MR> Just in case, note that signal and slots are a different concept than
MR> events in Qt:
MR>
MR> http://qt-project.org/doc/qt-5/signalsandslots.html
do they do it like this BTW, having two strongly overlapping yet completely
different ways to do almost the same thing is very strange. Dare I say that
I think wxWidgets approach of using events for everything is more elegant?
MR> To do both, QWidget (QTabWidget) needs to be subclassed (hence
MR> wxQtTabWidget).
AFAICS subclassing is only needed to handle events, not for handling
signals.
Anyhow, my point is, I guess, that we shouldn't put all event methods in a
single wxQtEventSignalHandler class, but that we should have
wxQtWidgetEventHandler and wxQtTabWidgetEventHandler inheriting from it.
Does this make sense?
I realized that there is still one thing I don't understand about Qt
events: are they "fixed", in the sense that there is only a (small)
predefined number of them in QWidget and no derived classes add to this
set? Or are they like wx events, with derived classes adding their own
events?
MR> Or you're suggesting to remove the template class and
MR> make wxQtWidgetEventHandler just to inherit from QWidget/QObject?
If the set of events is fixed, I indeed don't really see any reason for
using a template here.
MR> PS: about documentation, my plan is to make some more personal wiki page
MR> with notes and when this is settled I'll update
MR> http://wiki.wxwidgets.org/WxQt if you agree
This would be fine but, and sorry to insist, I'd still very much like to
have docs/qt/install.txt with the instructions for building (and maybe
using, if there is anything non trivial involved) this port. E.g. I'd like
to build it now, I literally don't know where to start. I'd like to be able
to follow the steps in this file and arrive at a working (well, as working
as can be) wxQt build.