Regarding the QPushbutton in Android devices



  • Hi,

    I have used below code to make the pushbutton to look like the label and made the text underlined. It works in Desktop, but when i run the same code in Android device, Underline is missing from the text of pushbutton.

    And one thing i observed was if i remove the line m_firstLinkButton->setFlat(true);
    it works, i get underline for the text of pushbutton.

    styles will be missing as per docs if we use setFlat() , is it right?.

    QFont font;
    font.setUnderline(true);
    
    m_firstLinkButton = new QPushButton;
    m_firstLinkButton->setText("Android");
    m_firstLinkButton->setFlat(true);
    m_firstLinkButton->setFont(font);
    

    Guidance i required.

    Thanks,


  • Moderators

    @Pradeep-Kumar
    then probably this font doesn't support underline?
    What is the default used font?



  • I am using text color as #FFFFFF, font family as Helvetica.
    Because of font family?.



  • is any other factors causing for the pushbutton not to show the text with the underline,
    for the code which i used in my first post of this topic.?.



  • Hi,

    Guys i used text-decoration-underline property in setStyleSheet , so i am getting the Text of the pushbutton underlined.

    Below is the sample code.

    QFont font;
    font.setUnderline(true);

    m_firstLinkButton = new QPushButton;
    m_firstLinkButton->setText("Android");
    m_firstLinkButton->setStyleSheet("text-decoration:underline;");
    m_firstLinkButton->setFlat(true);
    m_firstLinkButton->setFont(font);

    So marking as solved,

    Thanks,


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.