Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Unable to edit TextField font size
Forum Updated to NodeBB v4.3 + New Features

Unable to edit TextField font size

Scheduled Pinned Locked Moved QML and Qt Quick
qml
7 Posts 2 Posters 2.3k Views 2 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.
  • sosunS Offline
    sosunS Offline
    sosun
    wrote on last edited by sosun
    #1

    I'm unable to edit font size of TextField. Here's my code:

    TextField {
                id: textField
                TextFieldStyle { font.pointSize: 15 }
                placeholderText: "BlaBla"
            }
    

    I've also tried a case with capitalized F like TextFieldStyle { Font.pointSize: 15 }, because this was in auto-suggestions, but compiler keep saying Cannot assign to non-existent property "font" in the first case and Non-existent attached object in the second one.

    p3c0P 1 Reply Last reply
    0
    • sosunS sosun

      I'm unable to edit font size of TextField. Here's my code:

      TextField {
                  id: textField
                  TextFieldStyle { font.pointSize: 15 }
                  placeholderText: "BlaBla"
              }
      

      I've also tried a case with capitalized F like TextFieldStyle { Font.pointSize: 15 }, because this was in auto-suggestions, but compiler keep saying Cannot assign to non-existent property "font" in the first case and Non-existent attached object in the second one.

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @sosun To use TextFieldStyle you need to assign it to style

      TextField {
          id: textField
          style: TextFieldStyle { font.pointSize: 32 }
          placeholderText: "BlaBla"
      }
      

      157

      sosunS 1 Reply Last reply
      0
      • p3c0P p3c0

        @sosun To use TextFieldStyle you need to assign it to style

        TextField {
            id: textField
            style: TextFieldStyle { font.pointSize: 32 }
            placeholderText: "BlaBla"
        }
        
        sosunS Offline
        sosunS Offline
        sosun
        wrote on last edited by
        #3

        @p3c0 hmm, can you tell me what imports you're using, because it gives me an error: Cannot assign to non-existent property "style"

        p3c0P 1 Reply Last reply
        0
        • sosunS sosun

          @p3c0 hmm, can you tell me what imports you're using, because it gives me an error: Cannot assign to non-existent property "style"

          p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          @sosun QtQuick.Controls 1.3and QtQuick.Controls.Styles 1.3 on Qt 5.4.1

          157

          sosunS 1 Reply Last reply
          0
          • p3c0P p3c0

            @sosun QtQuick.Controls 1.3and QtQuick.Controls.Styles 1.3 on Qt 5.4.1

            sosunS Offline
            sosunS Offline
            sosun
            wrote on last edited by
            #5

            @p3c0 I have the same imports, but Qt 5.4.0. AFAIK new 4.1 has nothing different with 4.0 speaking of TextField type. How do you think, could this error be caused by using custom qml components from Papyros?

            p3c0P 1 Reply Last reply
            0
            • sosunS sosun

              @p3c0 I have the same imports, but Qt 5.4.0. AFAIK new 4.1 has nothing different with 4.0 speaking of TextField type. How do you think, could this error be caused by using custom qml components from Papyros?

              p3c0P Offline
              p3c0P Offline
              p3c0
              Moderators
              wrote on last edited by
              #6

              @sosun Not sure. Does it work separately ? I mean in the project which doesnot have those custom qml components included.

              157

              sosunS 1 Reply Last reply
              1
              • p3c0P p3c0

                @sosun Not sure. Does it work separately ? I mean in the project which doesnot have those custom qml components included.

                sosunS Offline
                sosunS Offline
                sosun
                wrote on last edited by
                #7

                @p3c0 Yep, it works! I had to test this case before creating new thread. Anyway, thanks! I'll open an issue on GitHub.

                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