Results 1 to 6 of 6

Thread: Pushbutton sizing problem on Mac OS

  1. #1
    Join Date
    Jul 2007
    Posts
    56
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Unhappy Pushbutton sizing problem on Mac OS

    I'm trying to make a series of 3 push buttons in a row 32x32 in size that have 16x16 icons inside them. In designer I have the geometry size set to 32x32, as well as the maximum and minimum sizes. All 3 are put inside a horizontal layout.

    On Windows everything looks fine. Also when I preview in Qt Designer on a Mac everything looks fine.

    However when I actually open the dialog in my app, the horizontal spacing of the icons is incorrect and they overlap as shown.

    Any ideas on what is going wrong?

    Attached image shows what is happening. I'm using Qt 4.3.1.
    Attached Images Attached Images

  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: Pushbutton sizing problem on Mac OS

    Set a minimum size on the buttons to 32x32.

  3. #3
    Join Date
    Jul 2007
    Posts
    56
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Pushbutton sizing problem on Mac OS

    Already done that. I've set geometry, maximum and minimum sizes to 32.

    It seems to maybe be a Mac specific thing. Same code works fine on Windows.

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Pushbutton sizing problem on Mac OS

    Try adding a horizontal spacer at the right side of the buttons. And make sure you give them the correct minimum/maximum sizes.

    And try to give the buttons more room, and see if that works. In that case, the container should be enlarged.

  5. #5
    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: Pushbutton sizing problem on Mac OS

    Use tool buttons instead of pushbuttons. There is a high chance they'll be working as you expect it out of the box.

  6. #6
    Join Date
    Jul 2007
    Posts
    56
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Pushbutton sizing problem on Mac OS

    Using tool buttons instead worked great. Always best to use the right tools for the job I guess ;-)

Similar Threads

  1. Delegate editor sizing problem
    By smacchia in forum Qt Programming
    Replies: 19
    Last Post: 7th December 2007, 17:27
  2. Sizing problem
    By Levon Nikoghosyan in forum Qt Programming
    Replies: 7
    Last Post: 2nd April 2007, 18:31
  3. PushButton height problem
    By impeteperry in forum Qt Tools
    Replies: 4
    Last Post: 28th January 2007, 21:36
  4. Replies: 16
    Last Post: 7th March 2006, 16:57

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.