• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

禁断の広告法だったことが判明。開発中止。


Commit MetaInfo

Revision45b4731cdba290765a0550813e5cf4ed071a4100 (tree)
Time2011-08-16 18:06:17
Authorh_ikeda <ikedahiroki@user...>
CommiterX

Log Message

ローカルを読み込めるがエスケープ必要!?

Change Summary

Incremental Difference

--- /dev/null
+++ b/Ads.html
@@ -0,0 +1,15 @@
1+<html>
2+<body>
3+<script type="text/javascript"><!--
4+google_ad_client = "ca-pub-3600741293730423";
5+/* スプラッシュ広告 */
6+google_ad_slot = "8694222147";
7+google_ad_width = 336;
8+google_ad_height = 280;
9+//-->
10+</script>
11+<script type="text/javascript"
12+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
13+</script>
14+</body>
15+</html>
--- /dev/null
+++ b/HTML.qrc
@@ -0,0 +1,5 @@
1+<RCC>
2+ <qresource prefix="/">
3+ <file>Ads.html</file>
4+ </qresource>
5+</RCC>
--- a/Splash_AdSense.pro
+++ b/Splash_AdSense.pro
@@ -4,13 +4,19 @@
44 #
55 #-------------------------------------------------
66
7-QT += core gui
7+QT += core gui\
8+ webkit
89
910 TARGET = Splash_AdSense
1011 TEMPLATE = app
1112
1213
13-SOURCES += main.cpp\
14- widget.cpp
14+SOURCES += main.cpp
1515
16-HEADERS += widget.h
16+HEADERS +=
17+
18+RESOURCES += \
19+ HTML.qrc
20+
21+OTHER_FILES += \
22+ Ads.html
--- a/main.cpp
+++ b/main.cpp
@@ -1,11 +1,26 @@
1-#include <QtGui/QApplication>
2-#include "widget.h"
1+#include <QApplication>
2+#include <QStyle>
3+#include <QtWebKit/QWebView>
4+#include <QTimer>
5+#include <QMessageBox>
36
47 int main(int argc, char *argv[])
58 {
69 QApplication a(argc, argv);
7- Widget w;
8- w.show();
10+
11+ QWebSettings* webSettings = QWebSettings::globalSettings();
12+ webSettings->setAttribute( QWebSettings::JavascriptEnabled, true );
13+ webSettings->setAttribute(QWebSettings::PluginsEnabled,true);
14+
15+ QWebView *window= new QWebView;
16+ window->setWindowFlags(Qt::FramelessWindowHint);
17+ window->setFixedSize(336,280);
18+ window->move(150,150);
19+ window->setHtml(QObject::tr("<html><body><a href=\"http://\">test</a><script type=\"text/javascript\"><!--\ngoogle_ad_client = \"ca-pub-3600741293730423\";\n/* スプラッシュ広告 */\ngoogle_ad_slot = \"8694222147\";\ngoogle_ad_width = 336;\ngoogle_ad_height = 280;\n//-->\n</script><script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"></script></body></html>"));
20+QMessageBox::information(window,QObject::tr("test"),QObject::tr("<html><body><a href=\"http://\">test</a><script type=\"text/javascript\"><!--\ngoogle_ad_client = \"ca-pub-3600741293730423\";\n/* スプラッシュ広告 */\ngoogle_ad_slot = \"8694222147\";\ngoogle_ad_width = 336;\ngoogle_ad_height = 280;\n//-->\n</script><script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"></script></body></html>"));
21+ window->show();
22+
23+ QTimer::singleShot(10000,window,SLOT(close()));
924
1025 return a.exec();
1126 }
--- a/widget.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
1-#include "widget.h"
2-
3-Widget::Widget(QWidget *parent)
4- : QWidget(parent)
5-{
6-}
7-
8-Widget::~Widget()
9-{
10-
11-}
--- a/widget.h
+++ /dev/null
@@ -1,15 +0,0 @@
1-#ifndef WIDGET_H
2-#define WIDGET_H
3-
4-#include <QtGui/QWidget>
5-
6-class Widget : public QWidget
7-{
8- Q_OBJECT
9-
10-public:
11- Widget(QWidget *parent = 0);
12- ~Widget();
13-};
14-
15-#endif // WIDGET_H