문제

I would like to set a particular size for spynner GUI, how can I do that ? (fullscreen)

I know there's QT doc but I don't know any C++ and moreover I need to mix C++ & python

도움이 되었습니까?

해결책

I am not really sure what you mean in your second line, as it doesn't really have anything to do with your question...

"...but I don't know any C++... and I need to mix C++ & python"

No C++ involved here.

If you check out the source code for spynner, and look at the Browser class, you will see that it stores the QWebView widget in an attribute: Browser.webview. It also says this in the docs as well.

https://github.com/makinacorpus/spynner/blob/master/src/spynner/browser.py#L96

So if you want to maximize the webview window, you just need to call showMaximized() on it:

browser = spynner.Browser()
browser.debug_level = spynner.DEBUG
browser.create_webview()
browser.show()
# now maximize the webview
browser.webview.showMaximized()
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top