nav-left cat-right
cat-right
Home » Blog » C++ » Archiv nach Kategorie 'Qt'

fixes for Qt plugin makefiles...

There are many usefull Qt plugins, such as qwt, qextserialport, qxt and others. With a new major version of Qt, or a new version of a compiler I have to recompile the plugins to make sure everything is working well together. However many plugins are not compilable from comandline such that the resulting files can easily be deployed. Also they should be compilable with mingw and msvc.

Here I show the necessary modifications to enable compilation of everything necessary in a naming scheme for windows.

(weiterlesen…)

Windows SDK 7 messed up...

I am trying to set up the Windows SDK environment for compilation of an other C++ project (Qt phonon library). However the script seems to be totally broken. It does not work and destroys the path variable.

This is what the path looks like before anything is called:

C:\Users\Matthias>PATH
PATH=C:\Program Files\PC Connectivity Solution\;C:\Program Files\MiKTeX 2.8\mikt
ex\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System
32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;
C:\Program Files\TortoiseSVN\bin;C:\Program Files\doxygen\bin;C:\Program Files\C
ommon Files\Roxio Shared\9.0\DLLShared\;C:\Program Files\MATLAB\R2008a\bin;C:\Pr
ogram Files\MATLAB\R2008a\bin\win32;C:\Program Files\ispell;C:\Program Files\gs\
gs8.63\bin;C:\Program Files\gnuplot\bin;"C:\Program Files\Microsoft SDKs\Windows
\v7.0\bin";"C:\Program Files\Microsoft Visual Studio 8\VC\bin"

If I call SetEnv.cmd it is messed up:

C:\Users\Matthias>SetEnv.cmd
C:\Users\Matthias>PATH
PATH=;C:\Program Files\Microsoft Visual Studio 9.0vcpackages;C:\Program Files\Mi
crosoft Visual Studio 9.0\Common7\IDE;C:\Program Files\Microsoft SDKs\Windows\v7
.0\Bin;C:\Windows\Microsoft.NET\Framework\v3.5;C:\Windows\Microsoft.NET\Framewor
k\v2.0.50727;!Path!

Apart from that the script fails to find the compilers, though the SDK was installed completely.

The x86 compilers are not currently installed.
Please go to Add/Remove Programs to update your installation.
.
Setting SDK environment relative to C:\Program Files\Microsoft SDKs\Windows\v7.0
.
Das Sprungziel - Set_x86 wurde nicht gefunden.
Debugging the code that is throwing this error the following seems to happen
SET "VCRoot=%ProgramFiles%\Microsoft Visual Studio 9.0"
SET "VCTools=%VCRoot%Bin"
IF NOT EXIST "%VCTools%\cl.exe" (
  SET VCTools=
  ECHO The x86 compilers are not currently installed.
  ECHO Please go to Add/Remove Programs to update your installation.
  ECHO .
)
So the script if looking for C:\Program Files\Microsoft Visual Studio 9.0\Bin\cl.exe – which does not exist, because there is no bin path. The correct path would be C:\Program Files\Microsoft Visual Studio 9.0\VC\bin.

If anyone has any idea, that would be helpfull.

Qt SpinBox Widget with Scientific Notation...

QScienceSpinBox

Since I started using Qt over a year ago I have been asking and looking for a Qt widget that can handle numbers in a scientific notation. Unfortunately Qt Software does not offer such a solution nor is it trivial to implement. With the hints I got in some public web forums I implementet the solution provided here.

This widget is derived from QDoubleSpinBox. It uses a decimal value of 1000 (that is more decimal points than a double can handle) and implements a new decimal value for the presentation in scientific notation. The Validator is realised by setting the LineEdit to a QDoubleValidator::ScientificNotation. However the most important part is the reimplementation of textFromValue and valueFromText. This unfortunately requires to copy the whole validation code of QDoubleSpinBox, which can not be borrowed and represents the major part of the code.

If someone can show a shrinked but still functional equivalent version that would be great. In the end I think that it would be better if such a solution would be included into a Qt release, especially because in its current form I use so much of their code.

Sample Project

(weiterlesen…)

free Qt Visual Studio Integration...

Volker Wiendl has released a new Version of his VsQtAddin Visual Studio Plugin:

In case you have a previous installed version uninstall it first, and make sure no component is remaining on the system. You may also run

"C:\Programme\Microsoft Visual Studio 8\Common7\IDE\devenv.exe" /resetaddin VsQtAddIn.Connect /Command File.Exit
with your appropriate directory.

In this version (compared to the one from 2007) the settings (moc, ui directory and such) are selected within Visual Studio and not in external files anymore.

Compilation of Phonon under Windows XP...

The original documentation of Trolltech was not sufficient to get me compile the phonon.dll and phonon_ds94.dll under Windows XP. Therefore you find here a description of what I did to get it compile.

I use Visual Studio 2005 and the corresponding nmake compiler. The description here thus relates to this compiler. If it works the same with the 2008 Version I do not know. I did not test mingw, but since the Qt docs itself say that the phonon library is not compatible with mingw that does not make much sense. I do not use Windows 2000 nor Vista. So I do not know what is necessary in such cases.

  1. Installation of SDKs
  2. Patch SDKs
  3. Change System Variables
  4. phonon.bat
  5. Visual C++ command shell
  6. Configure
  7. Compilation

Installation of SDKs

First of all one needs additional SDKs for the compilation, which are not bundled with Visual Studio. These are

Patch SDKs

Wired but true, the Windows SDK does not compile. It is somehow broken. You need to do the following:

Add the following line

#include "rpcsal.h"

to linenumber 32 in files

  • C:\Programme\Microsoft SDKs\Windows\v6.1\Include\medparam.h
  • C:\Programme\Microsoft SDKs\Windows\v6.1\Include\mediaobj.h

Change System Variables

These variables need to be set, otherwise Visual C++ does not find the header and library files.

  • Add “C:\Programme\Microsoft SDKs\Windows\v6.1\Include” to variable “INCLUDE“.
  • Add “C:\Programme\Microsoft SDKs\Windows\v6.1\Lib” to variable “LIB

phonon.bat

Some Variables need to be set before compilation. The easiest way is to create a phonon.bat file that can be executed before one starts configure.

"%PROGRAMFILES%\Microsoft DirectX SDK (April 2007)\utilities\bin\dx_setenv.cmd"
%PROGRAMFILES%\Microsoft SDKs\Windows\v6.1\Bin\SetEnv.Cmd

The last one should only be necessary if you use the Express Version, but it is no problem if is called anyway

Visual C++ command shell

Start the “Visual C++ command shell”. If variables should not be in right order for some reason you can achieve the same by doing
  • Start cmd.exe
  • Run phonon.bat
  • run %PROGRAMFILES%\Microsoft Visual Studio 8\VC\vcvarsall.bat x86

Configure

Run phonon.bat if not done already, as described above. Then call configure

configure -platform win32-msvc2005 -phonon
in the Qt directory.

Compilation

Change to the directories

  • src/phonon
  • src/plugins/phonon

and call nmake in both.

You should end up with phonon.dll and phonon_ds94.dll (in directory “plugins\phonon_backend”).

Page 1 of 212»