Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Regarding the QPushbutton in Android devices
Forum Updated to NodeBB v4.3 + New Features

Regarding the QPushbutton in Android devices

Scheduled Pinned Locked Moved Solved Mobile and Embedded
5 Posts 2 Posters 1.6k Views 1 Watching
  • 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 KumarP Offline
    Pradeep KumarP Offline
    Pradeep Kumar
    wrote on last edited by
    #1

    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-worxR 1 Reply Last reply
    0
    • Pradeep KumarP Pradeep Kumar

      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,

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @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
      0
      • Pradeep KumarP Offline
        Pradeep KumarP Offline
        Pradeep Kumar
        wrote on last edited by
        #3

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

        Pradeep Kumar
        Qt,QML Developer

        1 Reply Last reply
        0
        • Pradeep KumarP Offline
          Pradeep KumarP Offline
          Pradeep Kumar
          wrote on last edited by
          #4

          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
          0
          • Pradeep KumarP Offline
            Pradeep KumarP Offline
            Pradeep Kumar
            wrote on last edited by
            #5

            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
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved