#!/usr/bin/perl use strict; use Gtk2 -init; use Gtk2::WebKit; use FindBin qw/$RealBin/; my $window = Gtk2::Window->new; $window->set_default_size( 1280, 768 ); $window->set_default_icon_from_file( $RealBin.'/dbninja.png'); $window->set_title('DbNinja'); $window->signal_connect( destroy => sub { Gtk2->main_quit } ); my $sw = Gtk2::ScrolledWindow->new; my $view = Gtk2::WebKit::WebView->new; $sw->add( $view ); $window->add( $sw ); $view->open( 'http://127.0.0.1/dbninja/' ); $window->show_all; Gtk2->main;
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); this->resize(1280, 768); QWebView *webView = new QWebView; QVBoxLayout *layout = new QVBoxLayout; this->centralWidget()->setLayout(layout); layout->addWidget(webView); webView->load(QUrl("http://127.0.0.1/dbninja/")); }
Source: https://habr.com/ru/post/227097/
All Articles