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 to insert a combobox to QTextTable cell or QTextEdit?
Forum Updated to NodeBB v4.3 + New Features

How to insert a combobox to QTextTable cell or QTextEdit?

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

    I'd like to add a combobox into my QTextEdit content, which just needs to provide options for user to pick and record the selected one. I tried to insert the following as HTML to QTextEdit, but it does not work.

    <form name=myform>
    <select name=mytextarea>
    <option name=one value=one> one </option>
    <option name=two value=two> two </option>
    <option name=three value=three> three </option>
    </select>
    </form>

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      QTextEdit is not a full featured web renderer. For what you want to do you should rather consider either QtWebEngine or QtWebKit.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • P Offline
        P Offline
        Pauly
        wrote on last edited by Pauly
        #3

        How easy it is to convert QTextEdit to QtWebEngine etc? I'm using QTextEdit as a rich text editor and I have gone quite far with it. Since it is like an editor, it to deal with dynamically adding/deleting table/image/text etc, can QtWebEngine do that? I read some introduction about QtWebEngine and it is more like an engine to display html content... Any suggestion? Thanks.

        For the combobox in QTextEdit, I do not need any signal etc. The combobox just need to show the text user select and that is it. Is there a way to achieve this in QTextEdit?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You should check with for example the Markdown Editor example.

          As for the combobox, I'm not aware of that possibility however, I don't know how it is supposed to work within your editor. You could maybe use a contextual menu for that or have a QComboBox has an overlay on your document when your user should make a choice.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Pauly
            wrote on last edited by
            #5

            context menu does the trick. Thank you very much.

            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