Wednesday 16 January 2013

Almost There...

So, it's a bit less than 1 month since I started working on QtMaxGUI, and it's fair to say that it is mostly functional at this point, and depending on what parts you need you could even say that it is capable of performing those functions completely.
MaxIDE is running fine apart from some outstanding issues :

  • Menu shortcuts do not currently override built-in keyboard shortcuts. I think I will need to implement a filter on the parent window to accomplish this, which will filter all the relevant key presses and create a Gui Event for them.
  • In/out-denting does not work as expected. This is due to issues with the position of the text cursor/anchor. Also programmed cursor movement may be raising events when they shouldn't be - confusing things somewhat.
  • Popup/Context menus are not yet working. There were problems creating an action with no parent (as MaxIDE does for pre-building the context menu), so I'm not sure what will happen when I plug this into a context menu creation event.
  • The HtmlView does not seem to work on Win32. I think on that platform there are issues with overriding the event handler functions, as I already had to comment out the paintEvent() override to stop it crashing. Which is funny, because all it does it how I explained it previously - by calling into BlitzMax which then calls the original super-class function. It almost seems as if there is some kind of corruption occurring during the C++ -> BlitzMax -> C++ path. The other platforms are fine. I may just end up removing all the event overrides for QWebView and see if it solves the problem.
That's all that come to mind at the moment. Everything else appears to be fine. "Dialogs" all seem to work. Find, finds stuff, etc.
I say "Dialogs" because they are not QDialogs (which are designed for the role of a small, in-program window). They are QMainWindows, which are really meant for a different job, but unfortunately MaxGUI assumes it can do all kinds of things to a window which a QDialog doesn't do without more work, and which a QMainWindow is designed for. But, I think I've managed to work around it and get things appearing to function as expected.

I had a few more issues recently with my item model. It turned out that the root node/item would often return an index of -1, -1, rather than an invalid index. This confused some views more than others, to the point that most TreeViews in MaxIDE were fine, but the Debug view didn't show any content, and the comboboxes were completely broken!
However, after a whole day of debugging, I found I only had to add a single check in the right place and it all started working. Black Magic :-p

It's certainly been an interesting project, which has advanced QtMax in leaps and bounds, and helped me to better understand more of the lower-level functionality of Qt.

Much of the QtMaxGUI glue is a dumbing down of the Qt API though, since we are having to throw away a lot of the "cool" stuff in order to make it work in a certain way. I would still recommend that you are better off using the Qt API as it was intended as your program will be much, much easier to write, and much much more object-oriented ;-)

No comments:

Post a Comment