git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27546
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-11-07 Simon Hausmann <hausmann@kde.org>
+
+ Reviewed by Lars.
+
+ Implemented createWindow() in QtLauncher.
+
+ * QtLauncher/main.cpp:
+ (WebPage::WebPage):
+ (MainWindow::MainWindow):
+ (WebPage::createWindow):
+
2007-11-07 Simon Hausmann <hausmann@kde.org>
Reviewed by Lars.
2007-11-07 Simon Hausmann <hausmann@kde.org>
Reviewed by Lars.
QPushButton *clearButton;
};
QPushButton *clearButton;
};
+class WebPage : public QWebPage
+{
+public:
+ inline WebPage(QWidget *parent) : QWebPage(parent) {}
+
+ virtual QWebPage *createWindow();
+};
+
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
- MainWindow(const QUrl &url)
+ MainWindow(const QUrl &url = QUrl())
- page = new QWebPage(this);
+ page = new WebPage(this);
InfoWidget *info = new InfoWidget(page);
info->setGeometry(20, 20, info->sizeHint().width(),
info->sizeHint().height());
InfoWidget *info = new InfoWidget(page);
info->setGeometry(20, 20, info->sizeHint().width(),
info->sizeHint().height());
hoverLabel = new HoverLabel(this);
hoverLabel->hide();
hoverLabel = new HoverLabel(this);
hoverLabel->hide();
+ if (url.isValid())
+ page->open(url);
+ inline QWebPage *webPage() const { return page; }
protected slots:
void changeLocation()
{
protected slots:
void changeLocation()
{
HoverLabel *hoverLabel;
};
HoverLabel *hoverLabel;
};
+QWebPage *WebPage::createWindow()
+{
+ MainWindow *mw = new MainWindow;
+ return mw->webPage();
+}
+
#include "main.moc"
int main(int argc, char **argv)
#include "main.moc"
int main(int argc, char **argv)