Results 1 to 6 of 6

Thread: How to hide the area around a icon in a toolbar button

  1. #1
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default How to hide the area around a icon in a toolbar button

    Hi,

    I want to hide the area around a icon in the toolbarbutton.
    Please help?
    Always Believe in Urself
    Merry

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to hide the area around a icon in a toolbar button

    I want to hide the area around a icon in the toolbarbutton.
    You mean icons with transparent borders,,, isnt it ?

    I guess the icons you are using have opaque borders.

  3. #3
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: How to hide the area around a icon in a toolbar button

    you can take it like this ,
    suppose i have a toolbutton of size 50 ,40
    and a icon in that of size 20, 20 .........
    Now i want to hide the area of the button which doesn't contain icon.........
    Always Believe in Urself
    Merry

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to hide the area around a icon in a toolbar button

    If you hide that area, wont the size of the button reduce to 20,20 ??
    So you can either resize the button to fit the icon, or you can resize the icon to fit the button.

    Also may be QWidget::setMask might be of some use to you.

  5. #5
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: How to hide the area around a icon in a toolbar button

    Actually the height of Toolbutton is controlling the height of my toolbar ,which i can't compromise with .
    So i can't change the size.
    QWidget::setMask() is not working for me.
    Always Believe in Urself
    Merry

  6. #6
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to hide the area around a icon in a toolbar button

    What did you try with setMask ? you need to apply mask on the toolbutton.
    I guess simplest way would be using a png/jpg with transparent backgroung.
    If this is not what you want, can you some snapshot of what functionality you want to achieve ?

Similar Threads

  1. Tray icon & taskbar app button hide
    By been_1990 in forum Qt Programming
    Replies: 23
    Last Post: 12th March 2011, 22:28
  2. how to hide seperator in toolbar using Qt 2.3 NCE
    By Sandip in forum Qt Programming
    Replies: 0
    Last Post: 16th December 2008, 08:16
  3. QAxWidget hide other widgets in it's area
    By sprnshld in forum Qt Programming
    Replies: 1
    Last Post: 27th July 2008, 15:56
  4. Couple of questions: main window icon + toolbar icon
    By bpackard in forum Qt Programming
    Replies: 0
    Last Post: 20th March 2008, 19:03
  5. Initialise toolbar in a different area
    By georgie in forum Qt Programming
    Replies: 4
    Last Post: 4th May 2006, 03:49

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.