Skip to content
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

QWebEngineView #43

Closed
5k3105 opened this issue Jun 20, 2016 · 2 comments
Closed

QWebEngineView #43

5k3105 opened this issue Jun 20, 2016 · 2 comments

Comments

@5k3105
Copy link
Contributor

5k3105 commented Jun 20, 2016

Hi tr :)

I saw you implemented webengine and gave it a try :)

package main

import (
    "github.com/therecipe/qt/core"
    "github.com/therecipe/qt/webengine"
    "github.com/therecipe/qt/widgets"
)

func main() {
    widgets.NewQApplication(len(os.Args), os.Args)

    // Main Window
    var window = widgets.NewQMainWindow(nil, 0)
    window.SetWindowTitle("Browser")

    // Main Widget
    view := widgets.NewQWebEngineView(window)

    // Set Central Widget
    window.SetCentralWidget(view)

    var url = core.NewQUrl("http://doc.qt.io/qt-5/qurl.html", 0)
    view.Load(url)
    view.Show()

    // Run App
    widgets.QApplication_SetStyle2("fusion")
    window.ShowMaximized()
    widgets.QApplication_Exec()
}
build_1                                                                                                                      
output:# github.com/therecipe/qt/webengine                                                                                   
C:\windows\go-build081060382\github.com\therecipe\qt\webengine\_obj\_cgo_main.c: In function 'crosscall2':                   
C:\windows\go-build081060382\github.com\therecipe\qt\webengine\_obj\_cgo_main.c:2:23: warning: unused parameter 'fn' [-Wunuse
d-parameter]                                                                                                                 
 void crosscall2(void(*fn)(void*, int), void *a, int c) { }                                                                  
                       ^                                                                                                     
C:\windows\go-build081060382\github.com\therecipe\qt\webengine\_obj\_cgo_main.c:2:46: warning: unused parameter 'a' [-Wunused
-parameter]                                                                                                                  
 void crosscall2(void(*fn)(void*, int), void *a, int c) { }                                                                  
                                              ^                                                                              
C:\windows\go-build081060382\github.com\therecipe\qt\webengine\_obj\_cgo_main.c:2:53: warning: unused parameter 'c' [-Wunused
-parameter]                                                                                                                  
 void crosscall2(void(*fn)(void*, int), void *a, int c) { }                                                                  
                                                     ^                                                                       
C:\windows\go-build081060382\github.com\therecipe\qt\webengine\_obj\_cgo_main.c: In function '_cgo_allocate':                
C:\windows\go-build081060382\github.com\therecipe\qt\webengine\_obj\_cgo_main.c:5:26: warning: unused parameter 'a' [-Wunused
-parameter]                                                                                                                  
 void _cgo_allocate(void *a, int c) { }                                                                                      
                          ^                                                                                                  
C:\windows\go-build081060382\github.com\therecipe\qt\webengine\_obj\_cgo_main.c:5:33: warning: unused parameter 'c' [-Wunused
-parameter]                                                                                                                  
 void _cgo_allocate(void *a, int c) { }                                                                                      
                                 ^                                                                                           
C:\windows\go-build081060382\github.com\therecipe\qt\webengine\_obj\_cgo_main.c: In function '_cgo_panic':                   
C:\windows\go-build081060382\github.com\therecipe\qt\webengine\_obj\_cgo_main.c:6:23: warning: unused parameter 'a' [-Wunused
-parameter]                                                                                                                  
 void _cgo_panic(void *a, int c) { }                                                                                         
                       ^                                                                                                     
C:\windows\go-build081060382\github.com\therecipe\qt\webengine\_obj\_cgo_main.c:6:30: warning: unused parameter 'c' [-Wunused
-parameter]                                                                                                                  
 void _cgo_panic(void *a, int c) { }                                                                                         
                              ^                                                                                              
# github.com/therecipe/qt/webengine                                                                                          
..\..\github.com\therecipe\qt\webengine\webengine.cpp:42:34: fatal error: QQuickWebEngineProfile: No such file or directory  
compilation terminated.                                                                                                      

error:exit status 2                                                                                                          
@therecipe
Copy link
Owner

Hey

Unfortunately the module is currently only working on mac and linux.

To get it working on windows, you would need to download Visual Studio 2013 or 2015 and also a different version of Qt with Visual Studio support.
http://doc.qt.io/qt-5/qtwebengine-platform-notes.html

And I would need to change a few imports in the generated cgo files.

I will look into this and report back if there is a simple way to get it working.

@5k3105
Copy link
Contributor Author

5k3105 commented Jun 21, 2016

Ok. Thanks. I'll put that idea on the back burner or move over to linux at some point. Thanks!

@5k3105 5k3105 closed this as completed Jun 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants