Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

QT host #177

Closed
redtide opened this issue Jul 8, 2020 · 8 comments
Closed

QT host #177

redtide opened this issue Jul 8, 2020 · 8 comments
Labels

Comments

@redtide
Copy link
Contributor

redtide commented Jul 8, 2020

I started to create a Qt host for elements but I'm not sure if this is really doable with the current status of Cairo Qt backend.
I made a custom QWidget where to forward all required signals/events to elements but I'm not sure how to access the host_view (mainly for the Cairo surface). Any advice?

@djowel
Copy link
Member

djowel commented Jul 8, 2020

I am not familiar with QT. I'm not sure how I can help. What do you mean by accessing the host_view?

@redtide
Copy link
Contributor Author

redtide commented Jul 10, 2020

The host_view class is declared in base_view.cpp, IIUC that is the one to use for cairo access to the surface.
But I see there are some problems to interface cairo with Qt, there was some work years ago but it seems it's still a work in progress.
How is going the Artist port? I saw Skia has some more documentation and examples to use with Qt.

@djowel
Copy link
Member

djowel commented Jul 12, 2020

Are you working on something like @jpcima's PR here: #111 ?

Artist is fine. I just need some time to integrate it. It's a bandwidth issue for me at the moment. But I'll get time one way or another.

@redtide
Copy link
Contributor Author

redtide commented Jul 12, 2020

Just trying to make a Qt5 host implementation, to be able to add elements over a view implemented in a QWidget, inside a QMainWindow.

@djowel
Copy link
Member

djowel commented Jul 12, 2020

Just trying to make a Qt5 host implementation, to be able to add elements over a view implemented in a QWidget, inside a QMainWindow.

That's certainly a good use-case!

@djowel
Copy link
Member

djowel commented Jul 14, 2020

Ok, let's see... There's actually an artist branch already (https://github.com/cycfi/elements/tree/artist_port). It's not by any means in a good state yet. I'm really tempted to have artist into elements sooner rather than later. My worry is that it will require a lot of time from me, which I do not have for the moment. The issue is not actually the port itself, but the maintenance of it after the port. The plan was to back-port element's cairo based canvas into artist first. Then have the cairo ported artist in elements as default 'canvas' backend. That would prevent a big disruption.

There's talk of a roadmap in another "issue". I'll start a draft and add this there.

In the meantime, do you have a simple example project for creating a qt window and widget I can look at, and we can discuss? I'm not a QT user, but that might inspire some ideas.

@jpcima
Copy link
Contributor

jpcima commented Jul 15, 2020

If I may add to this discussion, there are multiple strategies to go for the implementation.

  • create an intermediate image surface, paint on it, and transfer pixels to the qt widget
    (slow, but tolerable if UI doesn't move too much)
  • extract the platform-dependent draw context (HDC/Quartz port/Xlib drawable) if possible, and make cairo paint on it
  • create an OpenGL widget, setup a 2d context, and create a cairo painter to target OpenGL

@redtide
Copy link
Contributor Author

redtide commented Jul 15, 2020

I'm not sure what you requested is a simple Qt example or a basic Qt elements host case, on which I have only implemented the application and window classes, not having a view yet I can't provide a widget.

@djowel djowel added the TODO label Sep 13, 2020
@cycfi cycfi locked and limited conversation to collaborators Oct 20, 2023
@redtide redtide converted this issue into discussion #324 Oct 20, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

3 participants