×

Discussion Board

Results 1 to 13 of 13

Thread: Button border

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    22

    disable QPushButton border

    Hello
    How I can disable the borber around the QPushButton when it's focused in Symbian 3rd devices?
    I tried with stylesheet ( border : 0px; ) but it doesn't work.

    I would like to disable borders like the one around Button 1:
    Last edited by kenouz1234; 2011-01-09 at 01:01.

  2. #2
    Registered User
    Join Date
    May 2008
    Posts
    15

    Re: disable QPushButton border

    Try setFocusPolicy property:

    Code:
    setFocusPolicy(Qt::NoFocus);

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    22

    Re: disable QPushButton border

    Quote Originally Posted by lgmenu View Post
    Try setFocusPolicy property:

    Code:
    setFocusPolicy(Qt::NoFocus);
    No, this doesn't work, this disable completely the possibility to select and click on button

  4. #4
    Registered User
    Join Date
    Mar 2009
    Posts
    22

    Re: disable QPushButton border

    please, any help?

  5. #5
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: disable QPushButton border

    I think you set a style for the :focus pseudo-state.

  6. #6
    Registered User
    Join Date
    Mar 2009
    Posts
    22

    Re: disable QPushButton border

    Quote Originally Posted by danhicksbyron View Post
    I think you set a style for the :focus pseudo-state.
    I tried :

    Code:
    QPushButton:focus {
    border: 0px;
    }
    but it doesn't work

  7. #7
    Registered User
    Join Date
    Dec 2010
    Posts
    31

    Re: disable QPushButton border

    Hello man, Focus Policy from the Button properties is the only thing i know,other than that i found no other way with css,when the button comes under focus

    Cheers,
    ZeroSum

  8. #8
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: disable QPushButton border

    There may be a way if you write your own painter or style or some such.

  9. #9
    Registered User
    Join Date
    Mar 2009
    Posts
    22

    Re: disable QPushButton border

    Quote Originally Posted by danhicksbyron View Post
    There may be a way if you write your own painter or style or some such.
    Have you an example please?

  10. #10
    Registered User
    Join Date
    Aug 2006
    Posts
    182

    Re: disable QPushButton border

    Hey,

    Try calling following line whenever button is focussed

    btn->setDown ( false )
    Regards,
    PS: Before posting do try wiki search to save your time and effort:
    http://wiki.forum.nokia.com/index.php/Wiki_Home

  11. #11
    Registered User
    Join Date
    Mar 2009
    Posts
    22

    Re: disable QPushButton border

    Quote Originally Posted by PopAndDestroy View Post
    Hey,

    Try calling following line whenever button is focussed



    Regards,
    doesn't work

  12. #12
    Nokia Developer Expert
    Join Date
    Feb 2008
    Posts
    183

    Re: disable QPushButton border

    This might work.

    Set the QPalette::Text for all QFocusFrames to Qt::transparent in your application. Store the changed palette back to your app palette.

    I.e. something like (note didn't try to compile this)

    Code:
    QPalette widgetPalette = QApplication::palette();
    widgetPalette.setColor(QPalette::Text, Qt::transparent);
    QApplication::setPalette(widgetPalette, "QFocusFrame");

  13. #13
    Registered User
    Join Date
    Mar 2009
    Posts
    22

    Re: disable QPushButton border

    Quote Originally Posted by Fuzzbender View Post
    This might work.

    Set the QPalette::Text for all QFocusFrames to Qt::transparent in your application. Store the changed palette back to your app palette.

    I.e. something like (note didn't try to compile this)

    Code:
    QPalette widgetPalette = QApplication::palette();
    widgetPalette.setColor(QPalette::Text, Qt::transparent);
    QApplication::setPalette(widgetPalette, "QFocusFrame");
    this work, finally
    thank you very much Fuzzbender.
    and I found that someone reported a bug about this problem here: http://bugreports.qt.nokia.com/browse/QTBUG-16027

    thank you again
    Last edited by kenouz1234; 2011-01-13 at 00:22.

Similar Threads

  1. Replies: 8
    Last Post: 2010-05-20, 18:22
  2. Detroy app when user press hang up button (red button)
    By ammanage in forum Mobile Java General
    Replies: 9
    Last Post: 2009-09-21, 19:29
  3. Replies: 3
    Last Post: 2009-09-17, 19:48

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×