Results 1 to 4 of 4

Thread: QT3 porting to QT4 problem

  1. #1
    Join Date
    Jun 2008
    Posts
    64
    Thanks
    7
    Qt products
    Qt3 Qt4

    Default QT3 porting to QT4 problem

    In QT3, I can use the following code in the .h file of my class:
    typedef QMap < QString, QString > SubNameVariableMap;
    typedef QMap < QString, SubNameVariableMap > NameVariableMap;
    typedef SubNameVariableMap::value_type SubNameVariableMapValue ;
    typedef NameVariableMap::value_type NameVariableMapValue;


    but in QT4, a compilation error comes:
    error:value_type in class QMap<QString, QString> does not name a type.

    Can anyone tell me what's going on?
    How can I solve this?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT3 porting to QT4 problem

    It's called mapped_type now.

  3. #3
    Join Date
    Jun 2008
    Posts
    64
    Thanks
    7
    Qt products
    Qt3 Qt4

    Default Re: QT3 porting to QT4 problem

    O....
    No.....
    I found that in QT3 it's related to
    typedef QPair<const key_type, mapped_type> value_type;
    in qmap.h

    but in QT4 qmap.h, there's no QPair related stuff....
    I think what I need is the QPair mapping instead of only having the mapped_type.

    Anyone can tell me how to achieve this?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT3 porting to QT4 problem

    Quote Originally Posted by batileon View Post
    I think what I need is the QPair mapping instead of only having the mapped_type.
    What do you need this for? Anyway you can always use:
    Qt Code:
    1. typedef QPair< const NameVariableMap::key_type, NameVariableMap::mapped_type > NameVariableMapValue;
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Weird problem while porting from Qt3 to Qt4
    By vermarajeev in forum Qt Programming
    Replies: 4
    Last Post: 8th August 2007, 08:51
  2. Font Problem Porting from Windows to Linux
    By rajeshs in forum Qt Programming
    Replies: 1
    Last Post: 13th July 2007, 11:25
  3. Problem related to porting from QT3 to QT4 in list items
    By rohitjun in forum Qt Programming
    Replies: 5
    Last Post: 1st June 2007, 10:05
  4. Problem porting Kivio MP on win32 from Qt 3 to Qt 4
    By Amanda in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2006, 20:40
  5. Problem in porting Main window on linux
    By jyoti kumar in forum Qt Tools
    Replies: 2
    Last Post: 2nd June 2006, 09:35

Tags for this Thread

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.