Ticket #52 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

xuvtools: remain compatible to Qt 4.4

Reported by: ne704 [niko@… Owned by: aaron@…
Priority: minor Milestone:
Component: xuvtools Version:
Keywords: xuvtools, qt4 Cc: niko@…, aponti@…, mario@…, ronneber@…

Description

compilation fails on an up-to-date Debian 5.0.1 with debian's qt4-dev-packages:


../../src/gui/interactivepanel.cpp: In member function 'void InteractivePanel::setBackgroundColor()':
../../src/gui/interactivepanel.cpp:1016: error: no matching function for call to 'QColorDialog::getColor(QColor&, int, QString)'


$ apt-cache policy libqt4-dev
libqt4-dev:

Installed: 4.4.3-1
Candidate: 4.4.3-1
Version table:

*** 4.4.3-1 0

500  http://ftp.de.debian.org lenny/main Packages
100 /var/lib/dpkg/status


according to  http://doc.qtsoftware.com/4.5/qcolordialog.html#getColor this function was introduced in Qt4.5, but there is a predecessor-function contained in Qt4.4 that is still present in 4.5 and only slightly differs by its interface (the 4.4-version doesn't have the possibility to set the window title, but I'm rather sure this feature doesn't really have high priority ;)), which could be used as a replacement without losing any functionality...

Mario agrees with me that we should remain compatibility to Qt 4.4

Change History

Changed 11 years ago by emmenlau

  • cc ronneber@… added
  • owner changed from emmenlau to aaron@…

Olaf has identified all Qt-4.5 functions, and made local changes in his local copy to be able to compile on Qt-4.4. Maybe they provide a good start to create a backward compatible Qt interface?

Changed 11 years ago by aaron@…

I suggest Olaf commits his changes -- I am sure they will compile in 4.5.

Changed 11 years ago by emmenlau

As far as I know Olaf has not replaced the functions with Qt-4.4 functions, but rather surrounded them by

#ifdef QT45
#endif

in order to be able to compile at all. Whether the resulting code is still useful I am not certain.

Changed 11 years ago by aaron@…

Then it would be useful if he could point me to the places where he did this.

Changed 11 years ago by ne704

  • owner changed from aaron@… to ne704
  • status changed from new to assigned

I agree to Mario that this will definitely mess up the code and decrease maintainability - but on the other side the diffset would be a rather good starting-point to pitch on 4.4-incompatible codeparts, so I vote pro committing

Changed 11 years ago by ne704 [niko@…

  • owner changed from ne704 to aaron@…
  • status changed from assigned to new

Changed 11 years ago by ronneber

Hi all, I had to modify the following files

M      src/gui/dialogs/aboutdialog.cpp
M      src/gui/tableitem.cpp
M      src/gui/mainwindow.cpp
M      src/gui/interactivepanel.cpp
M      src/main.cpp

I made it compatible even with Qt 4.3 (which is the version of the LTS Ubuntu (Hardy), that is in use at our institute). The include guards look like

#if QT_VERSION > 0x040400 // setApplicationVersion() introduced in Qt 4.4.0
        tr( " v" ) + qApp->applicationVersion( ) +
#endif

I did not write any replacement functions for missing stuff, so if you compile XuvTools? with QT 4.3, some features are just missing.

If this is OK, I will submit the changes. Best regards,

Olaf

Changed 11 years ago by ne704 [niko@…

Olaf, this looks fine to me since it won't affect building on Qt 4.5 and is easy to grep for (to identify the code-parts in an easy way), so each part could be discussed seperately if desired.

What does the rest think, Mario, Aaron?

Changed 11 years ago by aaron@…

I agree with Niko. If it is straightforward to fix the code for back-compatibility with Qt4.3/4 I will do it.

Changed 11 years ago by ne704 [niko@…

  • keywords xuvtools, added

ifdef's submitted by Olaf in r2741

Changed 11 years ago by ne704 [niko@…

  • status changed from new to closed
  • resolution set to fixed

Closing this as fixed unless stated otherwise (feel free to reopen if necessary).

Note: See TracTickets for help on using tickets.