Results 1 to 8 of 8

Thread: reduce space-size of buttons

  1. #1
    Join Date
    Dec 2011
    Posts
    11
    Platforms
    Unix/X11

    Default reduce space-size of buttons

    Hello,

    look at the pictures here:
    http://ubuntuone.com/6rpPTkQeIauvyZQhMoUh0p
    http://ubuntuone.com/47k64UGZRjpzVL0aEkADay

    as you can see i have some buttons and i want to reduce the space between them, in the second picture you can see that the button get the most space...
    i have created the button with this code (example for play button) :
    Qt Code:
    1. mplay_pauseButton.setIcon(mplayIcon);
    2. mplay_pauseButton.setIconSize(mplayPixmap.rect().size());
    3. mplay_pauseButton.setFlat(true);
    To copy to clipboard, switch view to plain text mode 
    were mplayPixmap is the pixmap with the icon

    any idea how to reduce the space?

  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: reduce space-size of buttons

    Are you using QToolButton or QPushButton?
    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
    Dec 2011
    Posts
    11
    Platforms
    Unix/X11

    Default Re: reduce space-size of buttons

    qpushbutton

  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: reduce space-size of buttons

    Use QToolButton then.
    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
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: reduce space-size of buttons

    And/or crop your images to avoid empty space around them (GIMP is your friend ).

  6. #6
    Join Date
    Dec 2011
    Posts
    11
    Platforms
    Unix/X11

    Default Re: reduce space-size of buttons

    Quote Originally Posted by Spitfire View Post
    And/or crop your images to avoid empty space around them (GIMP is your friend ).
    i used gimp but i cannot crop it anymore..

    i used QToolButton

  7. #7
    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: reduce space-size of buttons

    QPushButton enforces a fixed minimum size so cropping the icon will not change anything.
    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.


  8. #8
    Join Date
    Dec 2011
    Posts
    11
    Platforms
    Unix/X11

    Default Re: reduce space-size of buttons

    ok thanks!

Similar Threads

  1. how to reduce the size of dll's of Qt
    By naren82 in forum Qt Programming
    Replies: 1
    Last Post: 2nd March 2011, 02:05
  2. I need to reduce size of qtgui dll
    By naren82 in forum Qt Programming
    Replies: 0
    Last Post: 16th February 2011, 13:11
  3. How to use QConfig to reduce the size of my Qt application?
    By haribo in forum Installation and Deployment
    Replies: 0
    Last Post: 25th November 2010, 21:39
  4. Reduce Qt/e library size for Arm ..!
    By jagadishjithu in forum Best Practices in Qt Programming
    Replies: 1
    Last Post: 13th March 2010, 09:39
  5. how to reduce the size of qt/e application
    By sar_van81 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 16th August 2007, 16:19

Tags for this Thread

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.