Results 1 to 3 of 3

Thread: [qt4]QPixmap::fromMimeSource

  1. #1
    Join Date
    Dec 2008
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default [qt4]QPixmap::fromMimeSource

    Hi, I ported qt3 code to qt4, but this error happens when I make the code.

    ####code
    setIcon(QPixmap::fromMimeSource("document.png"));
    ####
    and it returns...

    editor.cpp: In constructor 'Editor::Editor(QWidget*, const char*)':
    editor.cpp:38: error: 'qPixmapFromMimeSource' is not a member of 'QPixmap'


    What is wrong and what should I do ?

    Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: [qt4]QPixmap::fromMimeSource

    Well... there is no such method in Qt4 You should use the resource system available in Qt4. Once you place the icon in the resources, you'll be able to load it via:
    Qt Code:
    1. QPixmap myIcon = QPixmap(":/document.png");
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Dec 2008
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [qt4]QPixmap::fromMimeSource

    Thanks !

    It worked.

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.