本文整理汇总了C++中QWebSettings::enablePersistentStorage方法的典型用法代码示例。如果您正苦于以下问题:C++ QWebSettings::enablePersistentStorage方法的具体用法?C++ QWebSettings::enablePersistentStorage怎么用?C++ QWebSettings::enablePersistentStorage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWebSettings
的用法示例。
在下文中一共展示了QWebSettings::enablePersistentStorage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: icon
QtMainWindow::QtMainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::QtMainWindow),
webInspectorWindow(new QtWebInspector()),
mainWindowCallback(NULL),
cur_tbrp(0),
m_alertDialog(0),
m_LogicalDpiX(0),
m_LogicalDpiY(0),
firstShow(true)
//TODO: m_SyncStatusDlg
{
#ifdef OS_WINDOWS_DESKTOP
QPixmap icon(":/images/rho.png");
QApplication::setWindowIcon(icon);
#endif
ui->setupUi(this);
#ifdef RHODES_WIN32
ui->menuSimulate->clear();
ui->menuSimulate->setTitle("Navigate");
ui->menuSimulate->insertAction(0, ui->actionBack);
#endif
QWebSettings* qs = QWebSettings::globalSettings();
qs->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
qs->setOfflineStorageDefaultQuota(1024*1024*1024);
rho::String rs_dir = RHODESAPP().getRhoRootPath()+RHO_EMULATOR_DIR;
qs->enablePersistentStorage(rs_dir.c_str());
this->ui->webView->setContextMenuPolicy(Qt::NoContextMenu);
this->ui->webView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
this->ui->webView->page()->mainFrame()->securityOrigin().setDatabaseQuota(1024*1024*1024);
this->main_webView = this->ui->webView;
this->main_webInspector = webInspectorWindow->webInspector();
this->cur_webInspector = this->main_webInspector;
this->move(0,0);
this->ui->toolBar->hide();
this->ui->toolBarRight->hide();
// connecting WebInspector
main_webInspector->setPage(ui->webView->page());
#ifdef OS_SYMBIAN
QWebViewKineticScroller *newScroller = new QWebViewKineticScroller();
newScroller->setWidget(this->ui->webView);
QWebViewSelectionSuppressor* suppressor = new QWebViewSelectionSuppressor(this->ui->webView);
#endif
#if defined(RHODES_EMULATOR)
webInspectorWindow->show();
#endif
}
示例2: icon
QtMainWindow::QtMainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::QtMainWindow),
webInspectorWindow(new QtWebInspector()),
mainWindowCallback(NULL),
cur_tbrp(0),
m_alertDialog(0),
m_LogicalDpiX(0),
m_LogicalDpiY(0),
firstShow(true), m_bFirstLoad(true),
toolBarSeparatorWidth(0)
//TODO: m_SyncStatusDlg
{
#ifdef OS_WINDOWS_DESKTOP
QPixmap icon(":/images/rho.png");
QApplication::setWindowIcon(icon);
#endif
ui->setupUi(this);
#ifdef OS_WINDOWS_DESKTOP
ui->menuSimulate->clear();
ui->menuSimulate->setTitle("Navigate");
ui->menuSimulate->insertAction(0, ui->actionBack);
#endif
QWebSettings* qs = QWebSettings::globalSettings();
qs->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
qs->setOfflineStorageDefaultQuota(1024*1024*1024);
rho::String rs_dir = RHODESAPP().getRhoRootPath()+RHO_EMULATOR_DIR;
qs->enablePersistentStorage(rs_dir.c_str());
this->ui->webView->setContextMenuPolicy(Qt::NoContextMenu);
this->ui->webView->setPage(new QtWebPage());
setUpWebPage(this->ui->webView->page());
this->main_webView = this->ui->webView;
this->main_webInspector = webInspectorWindow->webInspector();
this->cur_webInspector = this->main_webInspector;
this->move(0,0);
this->ui->toolBar->hide();
this->ui->toolBarRight->hide();
this->main_webView->hide();
//this->ui->centralWidget->hide();
//this->ui->centralWidget->setStyleSheet("background-color: yellow");
//this->ui->centralWidget->setStyleSheet("QWidget {background-image: url(test.jpg)}" );
#ifdef RHODES_EMULATOR
int width = RHOSIMCONF().getInt("screen_width");
int height = RHOSIMCONF().getInt("screen_height");
#else
int width = RHOCONF().getInt("screen_width");
int height = RHOCONF().getInt("screen_height");
#endif
if ((width>0) && (height>0))
this->setSize(width, height);
else if (width>0)
this->setSize(width, this->height());
else if (height>0)
this->setSize(this->width(), height);
#if defined(RHODES_EMULATOR)
// connecting WebInspector
main_webInspector->setPage(ui->webView->page());
#endif
#ifdef OS_SYMBIAN
QWebViewKineticScroller *newScroller = new QWebViewKineticScroller();
newScroller->setWidget(this->ui->webView);
QWebViewSelectionSuppressor* suppressor = new QWebViewSelectionSuppressor(this->ui->webView);
#endif
#if defined(RHODES_EMULATOR)
webInspectorWindow->show();
#endif
}
示例3: icon
QtMainWindow::QtMainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::QtMainWindow),
webInspectorWindow(new QtWebInspector()),
mainWindowCallback(NULL),
cur_tbrp(0),
m_alertDialog(0),
m_LogicalDpiX(0),
m_LogicalDpiY(0),
firstShow(true), m_bFirstLoad(true),
toolBarSeparatorWidth(0),
m_proxy(QNetworkProxy(QNetworkProxy::DefaultProxy)),
m_logView(0)
//TODO: m_SyncStatusDlg
{
#if !defined(RHODES_EMULATOR)
QPixmap icon(QCoreApplication::applicationDirPath().append(QDir::separator()).append("icon.png"));
QApplication::setWindowIcon(icon);
QApplication::setApplicationDisplayName(QString::fromStdString(RHOCONF().getString("title_text")));
QApplication::setApplicationName(QString::fromStdString(RHOCONF().getString("app_name")));
QApplication::setApplicationVersion(QString::fromStdString(RHOCONF().getString("app_version")));
QApplication::setOrganizationName(QString::fromStdString(RHOCONF().getString("org_name")));
#elif defined(OS_WINDOWS_DESKTOP)
QPixmap icon(":/images/rho.png");
QApplication::setWindowIcon(icon);
#endif
QApplication::setStyle(new QtCustomStyle());
ui->setupUi(this);
#ifdef OS_WINDOWS_DESKTOP
ui->menuSimulate->clear();
ui->menuSimulate->setTitle("Navigate");
ui->menuSimulate->insertAction(0, ui->actionBack);
#endif
QWebSettings* qs = QWebSettings::globalSettings();
qs->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
qs->setOfflineStorageDefaultQuota(1024*1024*1024);
rho::String rs_dir = RHODESAPP().getRhoRootPath()+RHO_EMULATOR_DIR;
qs->enablePersistentStorage(rs_dir.c_str());
this->ui->webView->setContextMenuPolicy(Qt::NoContextMenu);
this->ui->webView->setPage(new QtWebPage());
this->ui->webView->setAttribute(Qt::WA_AcceptTouchEvents, false);
setUpWebPage(this->ui->webView->page());
this->main_webView = this->ui->webView;
this->main_webInspector = webInspectorWindow->webInspector();
this->cur_webInspector = this->main_webInspector;
this->move(0,0);
this->ui->toolBar->hide();
this->ui->toolBarRight->hide();
this->main_webView->hide();
//this->ui->centralWidget->hide();
//this->ui->centralWidget->setStyleSheet("background-color: yellow");
//this->ui->centralWidget->setStyleSheet("QWidget {background-image: url(test.jpg)}" );
#ifdef RHODES_EMULATOR
int width = RHOSIMCONF().getInt("screen_width");
int height = RHOSIMCONF().getInt("screen_height");
#else
int width = RHOCONF().getInt("screen_width");
int height = RHOCONF().getInt("screen_height");
#endif
if ((width>0) && (height>0))
this->setSize(width, height);
else if (width>0)
this->setSize(width, this->height());
else if (height>0)
this->setSize(this->width(), height);
#if defined(RHODES_EMULATOR)
// connecting WebInspector
main_webInspector->setPage(ui->webView->page());
#endif
#ifdef OS_SYMBIAN
QWebViewKineticScroller *newScroller = new QWebViewKineticScroller();
newScroller->setWidget(this->ui->webView);
QWebViewSelectionSuppressor* suppressor = new QWebViewSelectionSuppressor(this->ui->webView);
#endif
#if defined(RHODES_EMULATOR)
webInspectorWindow->show();
#endif
if (RHOCONF().isExist("http_proxy_host"))
{
setProxy(QString::fromStdString(RHOCONF().getString("http_proxy_host")),
QString::fromStdString(RHOCONF().getString("http_proxy_port")),
QString::fromStdString(RHOCONF().getString("http_proxy_login")),
QString::fromStdString(RHOCONF().getString("http_proxy_password")));
} else {
unsetProxy();
}
}