Skip to content
  • QTextView changes the HTML string

    Unsolved General and Desktop html
    7
    0 Votes
    7 Posts
    2k Views
    raven-worxR
    @moravas QTextEdit and buddies only support rich-text and are not suitable for full HTML editing. You should use either QtWebkit module or QtWebEngine (depending on the Qt version you are using) and set the contents editable. But at least QtWebkit (and i guess also QtWebEngine) changes the content a little bit, but the HTML stays valid all the time at least.
  • Is there a clear way to parse HTML in Qt 5.7

    Unsolved Qt WebKit html parser c++ windows linux
    15
    0 Votes
    15 Posts
    19k Views
    danttiD
    @cochise said in Is there a clear way to parse HTML in Qt 5.7: https://github.com/cutelyst/html-qt This is a bit of an old thread but as @cochise said html-qt is an HTML parser, sadly I didn't finish it yet but it follows WHATWG specification on how to implement an HTML parser as HTML is not XML. It's mostly complete but outputting a DOM tree isn't ready yet, so help is welcome.
  • GUI creation guidance / HTML+JS?

    General and Desktop gui html javascript
    3
    0 Votes
    3 Posts
    2k Views
    DavideBarrancaD
    @raven-worx Thank you for pointing me to the proper documentation pages – I'll have a look at them asap. If the project actually takes off, I'll be a regular in the forums :-) Best regards, – Davide
  • Parse HTML in Qt 5.7

    Unsolved General and Desktop html parsing
    12
    0 Votes
    12 Posts
    6k Views
    A
    @Joel-Bodenmann So I can just use "runJavaScript" function ?! @SGaist No, that was just an example !! :D
  • 0 Votes
    5 Posts
    2k Views
    J
    @raven-worx Thanx for the suggestion. I think we can go a long way with this, except that we are on Windows and it seems we need some Windows-specific MIME-conversions. We'll try to tinker a bit with that.
  • 0 Votes
    8 Posts
    4k Views
    QjayQ
    @Wieland Thanks !! it works fine . I will now complete the QMLbook . i am still noob :/ Thanks for the help
  • 0 Votes
    8 Posts
    6k Views
    K
    @HenrikSt. You got a number of different possibilities suggested. Possibly you are overwhelmed by the different things. Sometimes it is hard for the people answering to know where the real problem was/is. I am not sure now if this might be too detailed for you. Anyway I move forward. I would suggest, if you have not done yet, The example from QFile as also listed by @jsulm and play a bit around. Just change the file name to somthing you need. E.g. QFile file("c:/data/myNewFolder/out.txt"); That is a possibility to specify a complete (absolute) file name. If you are a beginner, I was in that stage before as all the others, there might be a problem with the not existing folder name, if your file not created. There is QDir::mkPath, which is slightly different from mkDir. It may help you in code to ensure that you actually can create the file. The other thing driving me personally nuts is the stupid folder separator for windows, which is a back slash '\'. However, in the mean time you can easily substitute with a forward slash also for most things in Windows (especially Qt). This also part of some of the suggestions. If you have difficulties sometimes it helps for others to post a short section of code and the error message.
  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    7 Posts
    4k Views
    antonlindgrenA
    @mrjj Wow, super. That actually solved it. Thank you so much for your response, your time and your help. I really appreciate it. Thanks. Best regards, Anton
  • How to insert a div into a QTextEdit?

    Solved General and Desktop qtextedit html
    4
    0 Votes
    4 Posts
    6k Views
    Chris KawaC
    I don't really like that As I said - QTextEdit is not an HTML browser. It handles rich text and stores it as styled text blocks. It accepts subset of HTML as input but it does not store it as such. So it doesn't put the content in <p>. It simply has no notion of <p>, <div> etc. at all. That's the source of the remark in the docs, that the stylesheet is only applied on entry. After that there are no <div> to style. The output you get back is a result of another conversion, where every paragraph is simply output as <p>. It does not reflect what you input. Take a look at the link I posted previously. QTextEdit supports only subset of HTML/CSS. It does not support class attribute or a "border" CSS property. How about you try to operate directly on text blocks, and not go through HTML? Here's an example for a chat-like formatting: QTextBlockFormat tbf1; tbf1.setAlignment(Qt::AlignLeft); tbf1.setBackground(Qt::red); QTextBlockFormat tbf2; tbf2.setAlignment(Qt::AlignRight); tbf2.setBackground(Qt::green); ui->textEdit->textCursor().beginEditBlock(); ui->textEdit->textCursor().setBlockFormat(tbf1); ui->textEdit->textCursor().insertText("Wassup?\n"); ui->textEdit->textCursor().endEditBlock(); ui->textEdit->textCursor().beginEditBlock(); ui->textEdit->textCursor().setBlockFormat(tbf2); ui->textEdit->textCursor().insertText("Nothin' much\n"); ui->textEdit->textCursor().insertText("Just playin' a game. How 'bout you?\n"); ui->textEdit->textCursor().endEditBlock(); ui->textEdit->textCursor().beginEditBlock(); ui->textEdit->textCursor().setBlockFormat(tbf1); ui->textEdit->textCursor().insertText("Nothin' much\n"); ui->textEdit->textCursor().endEditBlock();
  • Changing HTML in QtWebView

    Unsolved Mobile and Embedded qml html android qtwebview
    1
    0 Votes
    1 Posts
    929 Views
    No one has replied
  • Qwebview and printer issue(paper size)

    Unsolved General and Desktop qwebview qprinter html
    2
    0 Votes
    2 Posts
    1k Views
    N
    Anyone? Any Idea?
  • Parsing HTML content

    Solved General and Desktop html qwebkit
    5
    0 Votes
    5 Posts
    3k Views
    SGaistS
    Good point, I should have added that if it's only to parse html tables, the XML parser should be enough.
  • 0 Votes
    1 Posts
    987 Views
    No one has replied
  • Hint about help documentation

    Unsolved General and Desktop help html pdf
    2
    0 Votes
    2 Posts
    1k Views
    M
    Found: Sphinx
  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    2 Posts
    1k Views
    Chris KawaC
    < and > are special characters in html. To display them literally you can use entities: &lt; and &gt; i.e. &lt;80 will result in <80. For a list of possible entities you can scout the web, e.g. here.
  • 0 Votes
    0 Posts
    955 Views
    No one has replied
  • 0 Votes
    8 Posts
    10k Views
    P
    I am having more issues in it. When I run this on my andorid devices. It runs fine for teh forst time, but after that it shows me below error- I/chromium(17111): [INFO:CONSOLE(16)] "WebSocket connection to 'ws://127.0.0.1:12345/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED" Can someone help me ?
  • 0 Votes
    8 Posts
    9k Views
    siropS
    @ChrisW67 said: The relative path will be relative to the current working directory of the running process. This is >quite unlikely to be where the source code is (esp. if you are shadow building). Your hint is almost right. Of course, I use the build and not the source directory. The point is that QTextEdit understands the image path within the HTML file also only if the image path is relative to the working dir of the running process and not to the directory of the HTML file. So now my HTML file looks like: <html> <head> <title></title> </head> <body> <h2> TEST <img src='html\images\Diagramm-mit-Dehngrenzen.png' height='480' width='480'> </h2> </body> </html> Which slashes -- forward or backward -- I use, does not matter. However, now neither firefox nor opera show the image as you can understand.