Results 1 to 2 of 2

Thread: customize the Icon QMessageBox

  1. #1
    Join Date
    Jul 2006
    Posts
    36
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Unhappy customize the Icon QMessageBox

    how can i customize QMessageBox Icon;i am using this code

    Qt Code:
    1. QMessageBox mb("Application Name",
    2. "Hardware failure.\n\nDisk error detected\nDo you want to stop?",
    3. QMessageBox::NoIcon,
    4. QMessageBox::Yes | QMessageBox::Default,
    5. QMessageBox::NoButton,
    6. QMessageBox::NoButton);
    7. QPixmap exportSuccess(":/new/prefix1/Resources/export.png");
    8.  
    9. mb.setIcon(QMessageBox::setIconPixmap(exportSuccess));
    To copy to clipboard, switch view to plain text mode 


    but i get this error "illegal call of non-static member function"
    power of mind > mind of power

  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: customize the Icon QMessageBox

    Qt Code:
    1. QPixmap exportSuccess(":/new/prefix1/Resources/export.png");
    2. mb.setIconPixmap(exportSuccess);
    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:

    QiT (26th August 2006)

Similar Threads

  1. Associating icon with a file type
    By munna in forum Qt Programming
    Replies: 3
    Last Post: 6th June 2006, 16:57
  2. Icon Text Alignment
    By nupul in forum Newbie
    Replies: 3
    Last Post: 1st May 2006, 04:47
  3. Missing action icons
    By ReilenBlaeyze in forum KDE Forum
    Replies: 4
    Last Post: 20th February 2006, 12:05
  4. Displaying Icon
    By Seema Rao in forum Qt Programming
    Replies: 4
    Last Post: 9th February 2006, 20:43
  5. How to dispay an icon in the first column of QTreeView
    By yogeshm02 in forum Qt Programming
    Replies: 1
    Last Post: 5th January 2006, 15:51

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.