forked from zealdocs/zeal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement createWindow() allowing creation of windows from ctrl-click…
…s and context menu 'Open in new window' action.
- Loading branch information
Krzysztof Zych
committed
Oct 3, 2014
1 parent
a40d15c
commit 1248cad
Showing
5 changed files
with
41 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
HEADERS += widgets/searchablewebview.h \ | ||
widgets/zealsearchedit.h \ | ||
widgets/razorshortcutbutton.h \ | ||
widgets/razorshortcutbutton_p.h | ||
widgets/razorshortcutbutton_p.h \ | ||
widgets/zealwebview.h | ||
|
||
SOURCES += widgets/searchablewebview.cpp \ | ||
widgets/zealsearchedit.cpp \ | ||
widgets/razorshortcutbutton.cpp | ||
widgets/razorshortcutbutton.cpp \ | ||
widgets/zealwebview.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "zealwebview.h" | ||
#include "../mainwindow.h" | ||
|
||
ZealWebView::ZealWebView(QWidget *parent) : QWebView(parent) {}; | ||
|
||
QWebView *ZealWebView::createWindow(QWebPage::WebWindowType type) { | ||
Q_UNUSED(type) | ||
|
||
MainWindow *mw = qobject_cast<MainWindow *>(qApp->activeWindow()); | ||
mw->createTab(); | ||
return this; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef ZEALWEBVIEW_H | ||
#define ZEALWEBVIEW_H | ||
|
||
#include <QWebView> | ||
|
||
// Subclass QWebView so we can override createWindow | ||
class ZealWebView : public QWebView | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit ZealWebView(QWidget *parent = 0); | ||
|
||
protected: | ||
virtual QWebView *createWindow(QWebPage::WebWindowType type); | ||
|
||
signals: | ||
|
||
public slots: | ||
|
||
}; | ||
|
||
#endif // ZEALWEBVIEW_H |