PDA

View Full Version : Problems with QPen



prosass
13th March 2007, 14:49
Hello everyone, I´m using Qt 4.2.3 open source edition with the MinGw compiler and Code::blocks as an IDE.

I´m trying to recompile one program that I had already compiled with success under Visual C++ (2005) and I´m getting one error that doesn´t seem to make much sense:

152: error: conversion from `Qt::GlobalColor' to non-scalar type `QPen' requested

The line in question is:



QPen dark = Qt::black;


Why could this happen?

jpn
13th March 2007, 15:09
Try
#include <QPen>?

high_flyer
13th March 2007, 15:10
Try QPen dark(Qt::black);

prosass
13th March 2007, 15:54
Thanks both, it was a really stupid mistake, but it just worked in Visual C++ before...

Kind regards