Results 1 to 3 of 3

Thread: Design Qpushbutton

  1. #1
    Join Date
    Aug 2012
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Design Qpushbutton

    hey,

    how do i design the default button?

    Qt Code:
    1. QPushButton* pb = new QPushButton(statusBar());
    2.  
    3. QPixmap pixmap(icon);//the file name of the icon
    4. QIcon ButtonIcon(pixmap);
    5. pb->setIcon(ButtonIcon);
    6. QSize s(16,16);
    7. pb->setIconSize(s);
    8. QString tip(btnName);
    9. pb->setToolTip(tip);
    10. connect(pb, SIGNAL(clicked()), this, SLOT(statusBtnClicked()));
    To copy to clipboard, switch view to plain text mode 
    the button has an image in it (as meant to be)

    but it has some kind for frame (border) with padding that wraps the button.

    i want to remove that

    how do i do that?

    thank you

  2. #2
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Design Qpushbutton

    Qt Code:
    1. pb->setStyleSheet("QPushButton {background : transparent;}");
    To copy to clipboard, switch view to plain text mode 
    Last edited by sonulohani; 29th August 2012 at 13:41.
    Heavy Metal Rules. For those about to rock, we salute you.
    HIT THANKS IF I HELPED.

  3. The following user says thank you to sonulohani for this useful post:

    mattigot (29th August 2012)

  4. #3
    Join Date
    Aug 2012
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Design Qpushbutton

    found the answer thanx to sonulohani
    pb->setStyleSheet("QPushButton {border-style: none;}");

Similar Threads

  1. Tab Design
    By FoleyX90 in forum Newbie
    Replies: 11
    Last Post: 3rd May 2010, 19:14
  2. Replies: 0
    Last Post: 22nd February 2010, 10:30
  3. C++/QT Design
    By xmeister in forum Newbie
    Replies: 6
    Last Post: 2nd April 2009, 03:39
  4. Replies: 3
    Last Post: 6th October 2008, 00:41
  5. Replies: 3
    Last Post: 26th September 2006, 13:16

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.