From: Cerion Armour-B. <ce...@ke...> - 2008-04-15 07:58:19
|
On Friday 11 Apr 2008, Amit Perelman wrote: > Hi All, > > In the very near future I want to start porting Valkyrie to QT4. > If anyone has useful infomation regarding this task I will glad to hear it. Hi Amit, "Dinosaur" had a go at this back in 2006, but didn't manage to finish it. Take a look at our correspondance below. I have his code from 2006, but haven't used it yet. I'll send this along in an off-list email (is large), hopefully this will be of some use! Note - the codebase hasn't changed much for quite a while now, so his code will still be diff'able with the trunk. Regards, Cerion ---------- Forwarded Message ---------- Subject: Re: Porting Valkyrie to Qt 4 Date: Monday 07 Aug 2006 From: Cerion Armour-Brown <ce...@op...> To: Dinosaur <din...@us...> On Saturday 05 August 2006 10:27, Dinosaur wrote: > Hello! > > I got trouble while trying to port Valkyrie to Qt 4 - there's no analog or > replacement to QCleanupHandler and docs doesn't contain any information > about this class (particularily, "Porting from Qt 3 to Qt 4" chapter). > > The situation is worse than I expected... :( Ah, you're falling over an experiment: 'FileDialog', taken from Qt3's QFileDialog. Don't worry - you can rip that out. It's not actually used anywhere yet, and we can rewrite it from Qt4's QFileDialog if needed. If you come across other stuff like this (i.e. code taken from Qt3 that was either buggy or didn't have enough functionality), it'd probably be a good idea to start from Qt4's version of the same. Cheers, Cerion ------------------------------------------------------- ---------- Forwarded Message ---------- Subject: Re: Valkyrie and Qt4 - IDs Date: Monday 18 Sep 2006 From: Dinosaur <din...@us...> To: "Cerion Armour-Brown" <ce...@op...> > On Sunday 17 September 2006 14:13, you wrote: >> Hello! >> >> Well, I think Valkyrie GUI needs major re-writing to be ported to Qt4 as >> there're no IDs for menus nor widget stacks. Qt4 menus work directly with >> actions (QAction) and that causes LOTS of changes in the code (primarily >> main_window.cpp that seems to need more than 50% to be re-written). >> >> I can send the partially ported code if you wish. >> >> Thank you. > Hi Dinosaur, > > Great that you've been working on it! > If you've had enough, sure, send us what you have, and we'll try to get to it when we can. Here it is. Of course, I don't know if it's ported correctly as the compilation fails. There's a new switch in configure script, look at that and, probably, edit it as I'm not very familiar with autotools. > If you're up for a pushing it a bit further, however, here's some thoughts... Yes, I'll continue the work. > I just had a quick look at QStackedWidget, and I see 'currentIndex()', 'indexOf()' etc. At first glance these look fine to replace the old QWidgetStack usage, or have I missed something? Unfortunatelly, I've had very little expierence with Qt3 so the primary source for the information is "Porting from Qt 3 to Qt 4" page of Qt4 docs. > As for menus, yes, hmm, looks like a bit more work... > For the tools, looks like we need a QActionGroup with the exclusive property set, create the actions for those tools, and add those actions to the menu and the lower statusFrame tool buttons... Plus more messing around to disable file->run etc. if there is no current tool window... > > (Assuming we can still retain stack ids...) > Perhaps have a map of toolView_id -> tool_action, so can enable/disable the right tool actions in setToggles() ? > And replacing FILE_RUN etc enums with QActions shouldn't be a problem. > > Hth, > Cerion While trying to port existing code to the new version of Qt, I still think that it'd be better to create new Valkyrie 2 branch made for Qt4 only. All those workarounds will make the code (primarily in relatively complex files like main_window.cpp with lots of uncompatible code) look terrible and very difficult to support. There were no serious code changes for a while, anyway. -- Dinosaur ------------------------------------------------------- |