Results 1 to 2 of 2

Thread: QMessageBox without Icon in the title bar of my OS

  1. #1
    Join Date
    Nov 2011
    Posts
    17
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default QMessageBox without Icon in the title bar of my OS

    Hi,

    I use a QMessageBox in my Application. When the QMessageBox is displayed, a new Icon is shown in the title bar of my OS.
    Regardless of the number of windows (MainWindow, QMessageBoxes, etc), I want to see one icon in my title bar only.
    Is it posible to prevent this behavior?

    Thanks.
    Last edited by klenze; 11th November 2011 at 18:01. Reason: spelling corrections

  2. #2
    Join Date
    Nov 2011
    Posts
    17
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: QMessageBox without Icon in the title bar of my OS

    In the meantime I got a solution, which works perfect.

    Calling a QMessageBox with its own parent, the messagebox is displayed in the center of the parent window and does not have its own title bar icon.
    Qt Code:
    1. QMessageBox msg(this);
    To copy to clipboard, switch view to plain text mode 
    Otherwise it is possible to set the parent as follows:
    Qt Code:
    1. msg.setParent(this);
    2. msg.setWindowFlags(Qt::Dialog);
    To copy to clipboard, switch view to plain text mode 
    The function setParent(this) changes the window flags, so that the function setWindowFlags(flags) must be called.

Similar Threads

  1. QMessageBox icon
    By penny in forum Qt Programming
    Replies: 1
    Last Post: 8th April 2011, 11:39
  2. QMessageBox missing icon
    By zanth in forum Qt Programming
    Replies: 3
    Last Post: 8th July 2010, 21:20
  3. Scrollable Panel
    By qtoptus in forum Qt Programming
    Replies: 1
    Last Post: 5th May 2010, 10:07
  4. QMessageBox Icon Issue and How to add a dir to Qt Resources File
    By vishal.chauhan in forum Qt Programming
    Replies: 19
    Last Post: 25th March 2007, 00:13
  5. customize the Icon QMessageBox
    By QiT in forum Newbie
    Replies: 1
    Last Post: 26th August 2006, 10: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.