Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

Qt Integration Tutorial Error - Does not Work #3

Open
Pebaz opened this issue Mar 28, 2019 · 5 comments
Open

Qt Integration Tutorial Error - Does not Work #3

Pebaz opened this issue Mar 28, 2019 · 5 comments

Comments

@Pebaz
Copy link

Pebaz commented Mar 28, 2019

The Qt Integration Tutorial:
https://www.harfang3d.com/doc/1.2.0/man.TutorialGuiIntegration.html

Throws an error:

AttributeError: module 'harfang' has no attribute 'VideoWindowedQuiet'

Which is indeed the case. My guess is the tutorial is outdated.

However, I am extremely interested in embedding Harfang with PyQt5 and would appreciate if someone could give me an absolutely bare-bones demonstration of how to do so.

The code I have so far:

import harfang as hg
hg.LoadPlugins()
hg.MountFileDriver(hg.StdFileDriver())

renderer = hg.CreateRenderer()
if not renderer.Open(8, 8, 32, hg.VideoWindowedQuiet):
    sys.exit(0)

from PyQt5.QtWidgets import QMainWindow

class WindowPlotter(QMainWindow):
    def __init__(self, renderer, render_system):
        super().__init__()
        self.renderer, self.render_system = renderer, render_system
        self.viewport_widget = QWidget()
        self.view_handle = hg.int_to_voidp(int(self.viewport_widget.winId()))
        self.window = renderer.NewOutputWindow(16, 16, 32, hg.VideoWindowed, self.view_handle)
        self.aspect_ratio = hg.Vector2(1, 1)

I basically copy-and-pasted this code from the referenced tutorial and it appears to be incomplete.

Again, if someone could just post a minimal Harfang-PyQt5 example, that would be amazing. Fixing the tutorial itself would be even better! ;)

@astrofra
Copy link
Contributor

astrofra commented Mar 28, 2019

Hi!
This tutorial is indeed outdated, as you understood quite easily.
One of my colleague did a quick fix a couple of weeks ago, to make it work again, but it is not public yet.
Could you please tell us on what platform you'd like to use that HARFANG/Qt bridge ? Windows ? Linux ? Both platforms ?

@Pebaz
Copy link
Author

Pebaz commented Mar 30, 2019

Hello!

I would ideally like to use Harfang + Qt on Windows and Linux but primarily Windows.

If possible, I would like to embed Harfang in a QWidget. This would allow maximum flexibility with regard to layout. However, I would be thrilled to be able to embed Harfang in any capacity.

Thank you for the quick reply!

@astrofra
Copy link
Contributor

astrofra commented Mar 30, 2019

Ok, fine.
This is the level of integration we have so far
Give us a couple of days, I need to check some details with my teammates.

@Pebaz
Copy link
Author

Pebaz commented Mar 30, 2019

That would be great!
I look forward to your response 😀

@astrofra
Copy link
Contributor

astrofra commented Apr 1, 2019

Can you send me an email to [email protected] and I'll take it from there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants