Results 1 to 9 of 9

Thread: MFC PALLETEINDEX to QColor()

Hybrid View

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

    Default Re: MFC PALLETEINDEX to QColor()

    Where does the palette index come from? Are you writing something portable?
    J-P Nurmi

  2. #2
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    40
    Thanked 8 Times in 4 Posts

    Default Re: MFC PALLETEINDEX to QColor()

    Hi,

    Yes it is intended to be portable, there are some sets of colors and they have their RBG values. But the programmer who written the old application used some #define color1 int_value
    and than create QPEN(...,...,...PALLETEINDEX(color1)); etc

    Is it possible to use the "color1" and create a QColor from it ?

    Maverick
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  3. #3
    Join Date
    Aug 2007
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default hi to all

    can anybody tell me how to begin with QT Programmering.
    I m new to this Technology.

  4. #4
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    40
    Thanked 8 Times in 4 Posts

    Default Re: MFC PALLETEINDEX to QColor()

    Start a new thread or read docs first.

    Do not write non-related posts in this thread.

    Thanks
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

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

    Default Re: MFC PALLETEINDEX to QColor()

    Quote Originally Posted by maverick_pol View Post
    But the programmer who written the old application used some #define color1 int_value
    and than create QPEN(...,...,...PALLETEINDEX(color1)); etc

    Is it possible to use the "color1" and create a QColor from it ?
    Try:
    Qt Code:
    1. QColor color = QColormap::instance().colorAt(color1));
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

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

    maverick_pol (24th September 2007)

  7. #6
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    40
    Thanked 8 Times in 4 Posts

    Default Re: MFC PALLETEINDEX to QColor()

    Hi,

    I will test the code today in the afternoon. Thank you for your advice. If anything come up(any errors) I will renew this thread.

    Thanks
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

Similar Threads

  1. RGB values greater than 8bit & QColor?
    By smacchia in forum Newbie
    Replies: 11
    Last Post: 21st March 2007, 14:40

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
  •  
Qt is a trademark of The Qt Company.