Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Regarding the QPushbutton in Android devices

    Mobile and Embedded
    2
    5
    1077
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Pradeep Kumar
      Pradeep Kumar last edited by

      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,

      Pradeep Kumar
      Qt,QML Developer

      raven-worx 1 Reply Last reply Reply Quote 0
      • raven-worx
        raven-worx Moderators @Pradeep Kumar last edited by

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

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply Reply Quote 0
        • Pradeep Kumar
          Pradeep Kumar last edited by

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

          Pradeep Kumar
          Qt,QML Developer

          1 Reply Last reply Reply Quote 0
          • Pradeep Kumar
            Pradeep Kumar last edited by

            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.?.

            Pradeep Kumar
            Qt,QML Developer

            1 Reply Last reply Reply Quote 0
            • Pradeep Kumar
              Pradeep Kumar last edited by

              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,

              Pradeep Kumar
              Qt,QML Developer

              1 Reply Last reply Reply Quote 0
              • First post
                Last post