-
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is it possible to use this plugin in a qml script? #158
Comments
If we are talking about the QMarkdownTextEdit widget, I don't think you can use Qt widgets in QML, but I can be wrong... |
Acording to this Website it would be possible to create a fork and port it to QML. Qt Version 6.2 or abowe required. |
Hm, but those are no QWidgets, right? |
We can only try. I'll see what can be done in a few hours. |
Good luck, have fun. 😁 |
I have created a new repo (I already have a fork). The code works, but I can't figure out how to display in QML a TextEdit object or in this case QMarkdownTextEdit object. Please help. The files here: |
Nice 😁 |
@tim-gromeyer, did you manage to make this work?? I'm eagerly looking for something like this. |
No, not really. It was just a black window, but I can give it another try |
That would be great. I'm looking to convert our app https://github.com/nuttyartist/notes over to QML and porting this repo would be one of the main things to achieve before continuing. |
Porting qmarkdowntextedit (which is a widget) to QML? Please keep me posted. 😀 |
@nuttyartist Which Qt version(s) should it be compatible with? I'm planning to use the |
We want to support Qt5 as well. But if it's just the imports that shouldn't be a problem? We can easily add the .qml files into a resource file and load them that way, no? |
I don't know if the imports are going to make problems yet, I have no experience with QML. The problem I'm facing is, that |
Well, any success in this would be appreciated! We can always improve thereafter. |
Okay, here some updates:
I got it working, at least partially: HOWEVER:
If you wanna test it, use this tarball (I hope this is allowed (License)). I'M NOT DONE YET and will create a GitHub repo if I'm. |
I'm getting an error during cmake:
Although I see that module version is set: qt_add_qml_module(ExampleProject
URI ExampleProjectApp
VERSION 1.0
QML_FILES example.qml
) |
Nevermind, I added
|
Hmm... it works for me. Which Qt version are you using? I'm using my system's Qt which is version 6.5.1 |
For the simplicity I created a new branch on my fork. I made some changes which might/should fix this issue. Here the link: https://github.com/tim-gromeyer/qmarkdowntextedit/tree/qml (later, I'll squash the commits and rename the branch) |
I'm using Qt 6.5.0. Using the mentioned repo I get this error:
Am I missing something? |
Nope. I created a github actions workflow and there it fails too |
Oh, great, the build finally works! @nuttyartist would you test it again and See if the "MarkdownTextEdit is not installed" error is fixed? |
Yay! it works! Do you think you can make editing work as well? |
BTW, I'm getting the following runtime errors if helpful:
|
Hmm... I don't know. It looks like it doesn't receive |
Oh okay, I hope you succeed! We won't be able to incorporate this into our app without editing. |
Yeah, an editor which doesn't support editing would indeed be a problem 😅️ I figured out, that the I'm gonna try to map the |
Haha yes. Okay, crossing fingers. |
@nuttyartist, I have an idea. We could just port the syntax highlighter from QMarkdownTextEdit to QML and apply it to a standard TextEdit, would this be a solution? Or do you need some special functions from QMarkdowntextEdit |
I think that should work as well. How will it be different than QMarkdowntextEdit? Not quite related question: Qt Quick already supports Markdown rendering but not in a live editor (as a user types) and no syntex highlighting, will it be hard to add live markdown rendering to it? |
I'm not sure but ai think you will lose features like the search widget, line number area, brackets auto closing, etc.
AFAIK it support Markdown text, which it renders using md4c. |
Sounds like things our app isn't using already so seems alright.
But it isn't live inside the same editor like QMarkdownTextEdit is.
Well I still think porting the syntax highlighter from QMarkdownTextEdit to QML will be valuable. |
@nuttyartist I made a nee commit, it should work now. Here a demo video: |
Not sure why I'm getting:
EDIT: I was running on Qt 5... testing now again. |
Woohoo! Amazing work, @tim-gromeyer! You made my day. Is that using the second approach, using just the syntax highlighter from QMarkdownTextEdit? |
Thank you! 😁️
Yeah, it is! Works like a charm. |
@nuttyartist I got it to work with Qt 5.12! And I might upstream these changes here. @pbek What do you think about the idea (upstreaming)? I'll squash the commits before creating the pull request. |
Awesome! |
Sure, that would be great! We are talking about develop...tim-gromeyer:qmarkdowntextedit:qml, right? |
I made it so that if QtQuick was not found it just doesn't build it.
Yes, exactly. As you can see there QtQuick is completely optional and I tested it with Qt 5.12 - 6.6 |
No description provided.
The text was updated successfully, but these errors were encountered: