PDA

View Full Version : WindowsXP Style?



CaseMillennium
23rd June 2007, 09:07
Hi,

I am trying to set my application to use the WindowsXP-Style, but it just won´t work. This is, what I tried:

#include <Qt/QApplication.h>
#include <QtGui/QWindowsXPStyle.h>


int main( int argc, char* argv[])
{
QApplication::setStyle(new QWindowsXPStyle);
QApplication app( argc, argv);

But when I try to compile this, I only get

.\main.cpp(7) : error C2061: syntax error : identifier 'QWindowsXPStyle'

I turned the WindowsXPStyle during compilation of Qt 4.3 with qconfigure -qt-style-windowsxp and it didn´t produce any error.

Also, I would like to have the Qt Designer display the WindowsXP Style as well, but this doesn´t work either.

I am running Qt 4.3 OpenSource edition on WindowsXP.

Does anybody know what is wrong?

wysota
23rd June 2007, 13:09
First of all you should use QStyleFactory. And second of all, did you build Qt after reconfiguring it?

CaseMillennium
23rd June 2007, 15:53
Mmhh, ok, obviously the windowsxp style is missing since QStyleFactory doesn´t give me that choice. However, I have no clue what went wrong when compiling Qt4.3. I just run qmake with the option -qt-style-windowsxp and nmake. But this doesn´t seem to have produced the correct result :( Any ideas, how I can fix this?

wysota
23rd June 2007, 16:37
Did you compile on WindowsXP? Did you run on WindowsXP? What did configure report when it finished its job (before you ran nmake)? It should report what is going to be compiled.

CaseMillennium
23rd June 2007, 18:37
I am running Windows XP Home and did the compile on the same system, configure told me it will compile the windowsxpstyle and even after doing nmake all nothing has changed (except that designer won´t recognize my selfwritten widgets anymore....)

Any other ideas?

wysota
23rd June 2007, 19:13
It probably means you have two installations of Qt running in parallel and interfering each other. I suggest you remove all your Qt installations, download fresh sources and repeat the compilation process on a clean system.