Пример #1
0
    Py::Object openBrowser(const Py::Tuple& args)
    {
        const char* url;
        if (!PyArg_ParseTuple(args.ptr(), "s",&url))
            throw Py::Exception();

        WebGui::BrowserView* pcBrowserView;

        pcBrowserView = new WebGui::BrowserView(Gui::getMainWindow());
        pcBrowserView->setWindowTitle(QObject::tr("Browser"));
        pcBrowserView->resize(400, 300);
        pcBrowserView->load(url);
        Gui::getMainWindow()->addWindow(pcBrowserView);

        return Py::None();
    }
Пример #2
0
/* module functions */
static PyObject * 
openBrowser(PyObject *self, PyObject *args) 
{
    const char* Url;
    if (! PyArg_ParseTuple(args, "s",&Url))
        return NULL; 
    
    PY_TRY {

        WebGui::BrowserView* pcBrowserView;

        pcBrowserView = new WebGui::BrowserView(Gui::getMainWindow());   
        pcBrowserView->setWindowTitle(QObject::tr("Browser"));
        pcBrowserView->resize(400, 300);
        pcBrowserView->load(Url);
        Gui::getMainWindow()->addWindow(pcBrowserView);

    } PY_CATCH;

    Py_Return; 
}