How can i fix qwebview edit text length?

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

  • Hi,


    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:
    Username: <input type="text" name="usrname" maxlength="10">

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

  • you can try to use the

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

  • use css style can match my Requirement

Log in to reply

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