Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QMessageBox does not open centered on Mac OS X (Qt 4.8.5)
Forum Update on Monday, May 27th 2025

QMessageBox does not open centered on Mac OS X (Qt 4.8.5)

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 857 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    laseranichris
    wrote on last edited by
    #1

    Hello,

    this is only a minor issue:

    When you open a QMessageBox, it is not centered relative to the parent on Mac OS X.
    On Windows it is centered.

    Here is the code I used:

    @QMessageBox box(this);
    box.setText("This is a message box!");
    box.exec();
    @

    And there is another small issue:
    The text displayed within the message box is bold. Even if it is not supposed to be.
    This is also different on Windows.

    Does anybody have a workaround for this?

    Thanks!

    1 Reply Last reply
    0
    • jensen82J Offline
      jensen82J Offline
      jensen82
      wrote on last edited by
      #2

      I would fetch the parent window-position and calculate the center-position and set it via move ("Move...":http://qt-project.org/doc/qt-4.8/qwidget.html#pos-prop). You can calc the position by subtracting your widgets geometry.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved