Results 1 to 4 of 4

Thread: Problems with QPen

  1. #1
    Join Date
    Feb 2007
    Posts
    15
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Problems with QPen

    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:

    Qt Code:
    1. QPen dark = Qt::black;
    To copy to clipboard, switch view to plain text mode 

    Why could this happen?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Problems with QPen

    Try
    Qt Code:
    1. #include <QPen>
    To copy to clipboard, switch view to plain text mode 
    ?
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    prosass (13th March 2007)

  4. #3
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Problems with QPen

    Try QPen dark(Qt::black);

  5. The following user says thank you to high_flyer for this useful post:

    prosass (13th March 2007)

  6. #4
    Join Date
    Feb 2007
    Posts
    15
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problems with QPen

    Thanks both, it was a really stupid mistake, but it just worked in Visual C++ before...

    Kind regards

Similar Threads

  1. Replies: 2
    Last Post: 8th March 2007, 22:22
  2. Problems with Unicode(UTF8)
    By cristiano in forum Qt Programming
    Replies: 15
    Last Post: 5th December 2006, 12:33
  3. Problems building mysql plugin for Qt 4.1.2 on windows XP
    By Philip_Anselmo in forum Installation and Deployment
    Replies: 3
    Last Post: 17th May 2006, 15:38
  4. Canvas problems
    By Tommytrojan in forum Qt Programming
    Replies: 22
    Last Post: 9th May 2006, 16:46
  5. QT4 Plugins - problems, problems
    By NormanDunbar in forum Qt Programming
    Replies: 6
    Last Post: 9th May 2006, 15:39

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.