×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    35

    QMessageBox setMinimumWidth not working !!

    Hi,
    I need to display short length of text with icons, so QMessageBox is best suitable for the same. But I need to set a minimum width for the same, then only it have a nice look. I used setMinimumWidth(), but it doesn't worked!, the QMessageBox displayed with a lesser width specified by setMinimumWidth(). How to solve the issue?

    Also tried with the following
    QMessageBox* msgBox;
    msgBox = new QMessageBox(this);
    msgBox->setWindowTitle("Message");
    msgBox->setMinimumWidth(450);
    msgBox->setFixedWidth(450);
    msgBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    Thanking You,
    Ras
    Last edited by ras123; 2010-09-01 at 07:06.

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QMessageBox setMinimumWidth not working !!

    QMessageBox is a window and its size depends on the platform heavily. What is yours?

  3. #3
    Registered User
    Join Date
    Jul 2010
    Posts
    35

    Re: QMessageBox setMinimumWidth not working !!

    Ubuntu 10.04 Lucid, and Qt version 4.6.2.

  4. #4
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QMessageBox setMinimumWidth not working !!

    Well, I can tell there is no problem with setting window size on Linux, unless you are not using really special window manager.

  5. #5
    Registered User
    Join Date
    Jul 2010
    Posts
    35

    Re: QMessageBox setMinimumWidth not working !!

    Quote Originally Posted by divanov View Post
    Well, I can tell there is no problem with setting window size on Linux, unless you are not using really special window manager.
    Hi,
    Is it worked in your side? The problem is the messagebox is small size just to hold the text, it does't obey the setMinimumWidth. I saw similar problems when googling,
    see

    http://www.qtcentre.org/archive/index.php/t-8273.html
    http://www.qtcentre.org/archive/index.php/t-24888.html

    etc.
    But when I implemented the solution in the first link, it worked but not at very first time call for msgbox.exe(), from second time onwards it worked!

  6. #6
    Registered User
    Join Date
    Jul 2010
    Posts
    35

    Re: QMessageBox setMinimumWidth not working !!

    Hi,
    Finally a solution found here,
    http://www.qtcentre.org/threads/2229...348#post113348
    It seems that there is a bug in QMessageBox!

Similar Threads

  1. QMessageBox Icons to a Window
    By ras123 in forum Qt
    Replies: 8
    Last Post: 2010-08-11, 19:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×