pythonqtqt4pyqt4spynner

How can I set GUI size of spynner python module?


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


Solution

  • 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()