Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How can i fix qwebview edit text length?
Forum Updated to NodeBB v4.3 + New Features

How can i fix qwebview edit text length?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.4k 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.
  • W Offline
    W Offline
    wearilybird
    wrote on last edited by
    #1

    i use qwebview to load a local html file . in qwebview control ,i can input some text .
    my question:how can i fix input text length ?so the user can not input so much text in a line.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      stevenceuppens
      wrote on last edited by
      #2

      Hi,

      Question:

      The control in your qwebview is HTML based i guess?

      If so, you can use JavaScript in your html file to limit the input!

      Html code:
      @<div>
      Username: <input type="text" name="usrname" maxlength="10">
      </div>@

      Steven CEUPPENS
      Developer &#x2F; Architect
      Mobile: +32 479 65 93 10

      1 Reply Last reply
      0
      • W Offline
        W Offline
        wearilybird
        wrote on last edited by
        #3

        it is html based ,but i can not use input type control ,my html code like this:
        <body>
        ......//input text
        <body>
        and i must support input picture .
        i set the qwebview->page()->setContentEditable(true);
        so i can input text in qwebview control.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          stevenceuppens
          wrote on last edited by
          #4

          you can try to use the

          @void QWebPage::contentsChanged() [signal]@

          Steven CEUPPENS
          Developer &#x2F; Architect
          Mobile: +32 479 65 93 10

          1 Reply Last reply
          0
          • W Offline
            W Offline
            wearilybird
            wrote on last edited by
            #5

            use css style can match my Requirement

            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