PDA

View Full Version : Different behaviour on different distributions



Kumula
4th February 2006, 18:33
Hi all,

Qt is platform independent - isn't it? Well, currently I'm testing my software on various Linux distributions, and I can watch different behaviour on them.

On my development notebook with Gentoo Linux everything is fine. On my workstation with the same distributions and software versions, a pixmap drawn on the application's menubar is not shown:

http://www.kumula.org/Pixmap-on-Menubar-Error.png
(left side: how it should be, right side: icon isn't shown)
(here my workstation's Xinerama mode could be the reason, but no... that would be crazy :o )

Also I tested the software on SUSE 10. There is also no pixmap drawn on the menubar (maybe because SUSE is running in VMware? :rolleyes: ), and additionally the text in QMessageBoxes isn't displayed correctly. Instead of

Line 1
Line 2
the text is shown as

Line 1<br>Line 2
so the HTML tags are visible!

I really don't know if Xinerama or VMware could be a reason for this behaviour, but of course, they shouldn't be. Maybe it's a PyQt issue. Does anyone have an idea, why these errors occur? :confused: How can I optimize my code to be *really* platform-indepent?

Sincere thanks,
Juergen

Xagen
4th February 2006, 18:45
I don't know why, but maybe application couldn't find the icon path?

I have Slackware 10 (Home), Debian Sarge 3.1 (notebook), Windows XP (Home), Windows 2003 Server (notebook) and in all systems my applications look ok.

jacek
4th February 2006, 18:53
Do you have the same version of PyQt on all systems?

Kumula
4th February 2006, 19:07
On the 2 Gentoo boxes (notebook and workstation) there are exactly the same software versions installed:

PyQt-3.15.1
qt-3.3.5
On the SUSE VM I don't know exactly, I couldn't find "PyQt", but I guess "python-qt" is the same... Here is version 3.5.0-16 installed...

The wrong icon path shouldn't be the reason, because the application converts the path to a full path (starting with "/") at runtime, and all the other icons are found and very well displayed. The error occurs only with the pixmap on the menubar...

jacek
4th February 2006, 19:15
The error occurs only with the pixmap on the menubar...
What is the format of that icon? Do you have proper image format plugins installed?

Kumula
4th February 2006, 19:44
What are the "proper image format plugins"?
Where can I see them?

The icon is in PNG format, the same as the icons used by the toolbar.
But on the toolbar the icons are shown, but not on the menubar... :p

Anyway... what could be the reason of the "HTML-tags-are-not-interpreted" failure?

jacek
4th February 2006, 19:56
What are the "proper image format plugins"?
Where can I see them?
Somewhere around $QTDIR/plugins/imageformats, but you aren't missing any plugins if all of the icons are in of the same format.


Anyway... what could be the reason of the "HTML-tags-are-not-interpreted" failure?
I would suspect PyQt. Does it output anything to the console when you run your application?

Kumula
4th February 2006, 21:14
The "imageplugins" folder is in my Qt4 directory, but I'm using PyQt (which still uses Qt3).
When PyQt4 is released, I'll port my apps to Qt4, maybe the problems are solved then automatically.
But even from the Qt3 point of view, the behaviour is very strange...

Also, there aren't any messages, when I start the apps from the console...

Tomorrow I'll post an alpha release of my software here,
so all QtCentre users can make their own impression... :cool:

jacek
4th February 2006, 21:28
The "imageplugins" folder is in my Qt4 directory, but I'm using PyQt (which still uses Qt3).
Qt3 has such plugins also.


Tomorrow I'll post an alpha release of my software here,
so all QtCentre users can make their own impression... :cool:
Could you tell us a bit more about your project?

Kumula
5th February 2006, 13:28
Qt3 has such plugins also.
Okay, but I couldn't find them. But both Gentoo boxes have nearly the same USE flags (except of some workstation-related stuff like "cups" or "xinerama"), so the support for various image format should be there. Additionally, I can't believe that a binary distribution like SUSE has Qt's PNG support missing... (SUSE has *everything* ;) )


Could you tell us a bit more about your project?
Well, it's a small business suite to be enhanced to fit the needs of various branches. You can visit http://www.kumula.org to find out more, and if you think "Why another business software?" please read http://www.kumula.org/docs/?title=Paradigm

As promised, I post a development version here: http://www.kumula.org/kumula-2006.02alpha.tar.gz
Extract it anywhere, and run "./Kumula/bin/configurator.py", because the Configurator program is the one and only which doesn't need a database. You should see the Kumula icon on the left side of the menubar, and the QMessageBoxes shouldn't have visible HTML tags... :o

Thanks for any help!

jacek
5th February 2006, 16:32
You should see the Kumula icon on the left side of the menubar, and the QMessageBoxes shouldn't have visible HTML tags...
I can't see the icon, but message boxes are OK.

Kumula
5th February 2006, 16:41
Okay, now it's 3:1 for an invisible PNG icon in the menubar... Did I implement something wrong? The menubar for all applications is defined in ./Kumula/lib/KumulaMainWindow.py, in class "KKumulaMainWindow", in method "createMenuBar()". The Python code

self.MenuBar.insertItem(kumula.getMenuBarIcon("kumula",1), self.menuProg, -1)
should be equivalent to the following Qt method:

int insertItem ( const QPixmap & pixmap, QPopupMenu * popup, int id = -1, int index = -1 )
What did I wrong? Or is it a PyQt issue?

And what could be the reason for the not-interpreted HTML tags in the QMessageBox?
Curious, things that should be visible are not, and vice versa... :(

Anyway, thank you for testing!

jacek
5th February 2006, 17:18
What did I wrong? Or is it a PyQt issue?
This might be a Qt bug similar to this one: http://www.trolltech.com/developer/tasktracker.html?method=entry&id=82181


And what could be the reason for the not-interpreted HTML tags in the QMessageBox?
I don't know, but it works on my system.

Are you sure that you have exactly the same version of Qt on both Gentoo systems?

Kumula
5th February 2006, 17:36
Yep, both have "qt-3.3.5" installed. The only difference are some
qt-unrelated USE variables, like "xinerama" or "cups".

But I wonder why it doesn't work on binary distributions like SUSE.
In the meanwhile I tried it on a Kubuntu machine, and there the icon is invisible, too. :rolleyes:

Maybe I'm calling the wrong PyQt method? Or PyQt is calling the wrong Qt method?
Or the right method with wrong parameters? I don't have a clue... :confused:

jacek
5th February 2006, 17:46
Yep, both have "qt-3.3.5" installed. The only difference are some
qt-unrelated USE variables, like "xinerama" or "cups".
Maybe there were some patches applied to one of those versions?

Kumula
5th February 2006, 18:59
That's improbable, because Gentoo would increase
the version number like "qt-3.3.5-r1". Additionally,
my workstation is nearly a fresh install (with no
Qt update since them), so everything should be working...

But... what's the correct Qt behaviour?
In my opinion, the icon should be visible everywhere,
and the visible icon on my notebook shouldn't be the exception. ;)

Is it possible for you to do this in a little C++ program?
Maybe we can narrow down the error to Qt or PyQt...
(I don't have so much C++ experience at all)

jacek
5th February 2006, 19:19
Is it possible for you to do this in a little C++ program?
Maybe we can narrow down the error to Qt or PyQt...

#include <qapplication.h>
#include <qiconset.h>
#include <qmainwindow.h>
#include <qmenubar.h>
#include <qpixmap.h>

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

QPixmap icon( "m_kumula.png" );
qWarning( "icon.isNull == %d", icon.isNull() );

QMainWindow mw;
QMenuBar *menuBar = mw.menuBar();

menuBar->insertItem( icon );
menuBar->insertItem( QIconSet( icon ), icon );
menuBar->insertItem( QIconSet( icon, QIconSet::Small ), icon );
menuBar->insertItem( QIconSet( icon, QIconSet::Large ), icon );
menuBar->insertItem( QIconSet( icon ), "test" );

app.setMainWidget( &mw );
mw.show();

return app.exec();
}

I guess it's Qt bug.

Kumula
7th March 2006, 00:58
Sorry for re-activating this thread after a long time, but I guess the problem is solved. I happened to try different widget styles, and with some of them the error occurs (pixmap is invisible), and with other styles the pixmap is shown correctly.

Some widget styles known to draw pixmaps in the menubar: :)
Keramik, Active Heart, ThinKeramik, Phase

Some widget styles known to NOT supporting this: :mad:
Plastik, Baghira, .NET

Hope this helps anyone someday.

Greets,
Juergen