禁断の広告法だったことが判明。開発中止。
Revision | 45b4731cdba290765a0550813e5cf4ed071a4100 (tree) |
---|---|
Time | 2011-08-16 18:06:17 |
Author | h_ikeda <ikedahiroki@user...> |
Commiter | X |
ローカルを読み込めるがエスケープ必要!?
@@ -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> |
@@ -0,0 +1,5 @@ | ||
1 | +<RCC> | |
2 | + <qresource prefix="/"> | |
3 | + <file>Ads.html</file> | |
4 | + </qresource> | |
5 | +</RCC> |
@@ -4,13 +4,19 @@ | ||
4 | 4 | # |
5 | 5 | #------------------------------------------------- |
6 | 6 | |
7 | -QT += core gui | |
7 | +QT += core gui\ | |
8 | + webkit | |
8 | 9 | |
9 | 10 | TARGET = Splash_AdSense |
10 | 11 | TEMPLATE = app |
11 | 12 | |
12 | 13 | |
13 | -SOURCES += main.cpp\ | |
14 | - widget.cpp | |
14 | +SOURCES += main.cpp | |
15 | 15 | |
16 | -HEADERS += widget.h | |
16 | +HEADERS += | |
17 | + | |
18 | +RESOURCES += \ | |
19 | + HTML.qrc | |
20 | + | |
21 | +OTHER_FILES += \ | |
22 | + Ads.html |
@@ -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> | |
3 | 6 | |
4 | 7 | int main(int argc, char *argv[]) |
5 | 8 | { |
6 | 9 | 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())); | |
9 | 24 | |
10 | 25 | return a.exec(); |
11 | 26 | } |
@@ -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 | -} |
@@ -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 |