Results 1 to 5 of 5

Thread: Incorrect position of QPushButton on mac

  1. #1
    Join Date
    Feb 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Incorrect position of QPushButton on mac

    I am using Qt 4.7.1 on both mac and windows (downloaded from the binary packages), and am seeing a problem on mac with the layout and positioning of the QPushButton widget.

    Occasionally buttons will be placed in the wrong position, looking like they are incorrectly vertically offset by half their height.

    I've attached a screenshot to show what I mean:
    Squashed log buttons 2.jpg

    Has anyone seen this issue?

    I think it may be related to the behaviour of Qt on mac that converts small buttons from rounded to square, maybe I should be setting the minimum size for these buttons?

    thanks,
    francis

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

    Default Re: Incorrect position of QPushButton on mac

    Please show us your code for building the layout containing those buttons.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Feb 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Incorrect position of QPushButton on mac

    I've recreated the problem in a small QtCreator project, and attached it to this post.
    Also heres a screen shot of the problem again, recreated in this test app.

    maclayoutbug.png

    maclayoutbug.zip

    The button itself is layed out in a custom widget class. This widget is then added to a dock widget.

    The bug happens only when that dock is floating. Once you dock it into the main app window, the button reverts to being 'square' is not cut off any more.
    Whats odd is that, if you edit the code so that the dock is docked in the main app window by default, it gets layed out properly (both when docked and when floating)! Plus the button is rendered 'rounded' when docked!

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

    Default Re: Incorrect position of QPushButton on mac

    What happens if you add the dock widget manually and not with Designer?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Feb 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Incorrect position of QPushButton on mac

    If I create the dock widget programmatically instead of through the QtCreator template, then the same problem happens.

    I guess its time to support a bug report to Qt; I was hoping it was something I was doing wrong, so I could fix it quickly!

Similar Threads

  1. Incorrect Julian Day
    By Rayven in forum Qt Programming
    Replies: 6
    Last Post: 16th November 2011, 13:10
  2. Replies: 0
    Last Post: 22nd February 2010, 09:30
  3. Replies: 3
    Last Post: 17th May 2009, 20:17
  4. Defining position for QMenu used by QPushButton
    By Ghaleon in forum Qt Programming
    Replies: 1
    Last Post: 13th February 2009, 09:23
  5. Replies: 3
    Last Post: 26th September 2006, 12:16

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.