Mailinglist Archive: opensuse-kde (114 mails)

< Previous Next >
Qt/KDE Integration Bug
  • From: Brad Pepers <brad@xxxxxxxxxxxxxxx>
  • Date: Sun, 25 Sep 2005 19:27:36 -0600
  • Message-id: <43374E88.1050708@xxxxxxxxxxxxxxx>
There is a bug in the Qt/KDE integration patches to Qt in SuSE 9.3 which is causing third-party applications such as Quasar, Scribus, and LinCVS to fail to work properly. Its easy to duplicate and show and is a problem in the patch to redirect Qt QMessageBox static methods to KDE message boxes. The basic problem is that there are two ways to call the QMessageBox functions. One way you pass in the text for the buttons on the message box and it should return which button was pressed (0, 1, or 2). The other way to call something like QMessageBox::warning though is to pass in a list of button ids such as QMessageBox::Yes/No/Cancel/... and in this case what should be returned is the button id that was clicked. The replacement code added in SuSE 9.3 that passes these functions off to KDE treats these both the same and will return the button number (0/1/2) in each case. So any code that uses Qt and calls QMessageBox::warning with button ids of QMessageBox::Yes and
QMessageBox::No and then checks the result to make sure it matches QMessageBox::Yes will now fail and the user is left with an application that won't do the work regardless of whether they choose Yes or No!

I reported this to SuSE support and then to the Technical Feedback and have not yet seen a fix or any acknowledgment of the problem so I thought I would have one last kick at trying to get through to someone at SuSE to get this fixed. The only other alternative for applications effected is to static compile the application with our own copy of Qt which doesn't have the KDE integration patches but this is a pain and means the application doesn't have the native look and feel and SuSE should fix this problem!

Here is a simple program to demonstrate the problem:

#include <qapplication.h>
#include <qmessagebox.h>

int
main(int argc, char** argv)
{
QApplication app(argc, argv);

int ch = QMessageBox::warning(NULL, "Test", "This is a test dialog",
QMessageBox::Yes, QMessageBox::No);
qDebug("choice = %d", ch);

return 0;
}

Compile it and run it and try each button and you will see that its returning 0 and 1 for the buttons which are *not* the button ids like it should be. To show how it should work, disable the Qt/KDE integration using "export QT_NO_KDE_INTEGRATION=1" and run the program again and you will see the function returns back 3 and 4 which is QMessageBox::Yes and QMessageBox::No.

--
Brad Pepers
brad@xxxxxxxxxxxxxxx

< Previous Next >
Follow Ups