Skip to content

Instantly share code, notes, and snippets.

@nowrep
nowrep / gist:1336283
Created November 3, 2011 11:27
QupZilla description at Qt Ambassador
<p>QupZilla is a new and very fast QtWebKit Browser aiming at providing modern, fast, reliable and multiplatform browser.</p>
<p>In addition to standard web browser features, QupZilla offers for example native look'n'feel on Linux platform by using desktop theme and icons, unified library (history, bookmarks and rss reader in one window), integrated AdBlock support, stylable user interface through themes or Windows 7 API integration.<br/>
QupZilla also care about your privacy, you can enter private browsing mode or send DNT (Do-Not-Track) header in all requests.</p>
<p><b>QupZilla is developed with Qt 4.7 and use following modules:</b><br/>
QtCore, QtGui, QtNetwork, QtSql, QtScript, QtXml, QtWebKit</p>
<p>To learn more about QupZilla, please visit: <a href="http://www.qupzilla.co.cc">http://www.qupzilla.co.cc</a> <br/>
To get latest news about development, please visit blog: <a href="http://qupzilla.blogspot.com">http://qupzilla.blogspot.com</a> <br/>
@nowrep
nowrep / gist:1653169
Created January 21, 2012 16:09
Paste&Go action in LocationBar context menu
void LocationBar::contextMenuEvent(QContextMenuEvent* event)
{
Q_UNUSED(event)
if (!m_pasteAndGoAction) {
m_pasteAndGoAction = new QAction(QIcon::fromTheme("edit-paste"), tr("Paste And &Go"), this);
m_pasteAndGoAction->setShortcut(QKeySequence("Ctrl+Shift+V"));
connect(m_pasteAndGoAction, SIGNAL(triggered()), this, SLOT(pasteAndGo()));
}
@nowrep
nowrep / gist:1653589
Created January 21, 2012 18:56
NoScript
class NoScript : public QObject
{
Q_OBJECT
public:
explicit NoScript(QObject* parent = 0);
bool isEnabled();
void loadSettings();
void saveSettings();
@nowrep
nowrep / gist:1808911
Created February 12, 2012 14:55
Listing all available plugins
QStringList availablePlugins = mApp->plugins()->getAvailablePlugins();
QStringList allowedPlugins = mApp->plugins()->getAllowedPlugins();
foreach(const QString & fileName, availablePlugins) {
PluginInterface* plugin = mApp->plugins()->getPlugin(fileName);
if (!plugin) {
continue;
}
// You now have plugin variable that can represent one plugin
plugin->pluginName();
@nowrep
nowrep / gist:1810670
Created February 12, 2012 20:11
Iterate through all groups and keys in QSettings
QString allGroupsString;
QSettings* settings = Settings::globalObject();
foreach (const QString &group, settings->childGroups()) {
QString groupString = QString("<table><th>..%1..</th>").arg(group);
settings->beginGroup(group);
foreach (const QString &key, settings->childKeys()) {
groupString.append(QString("<tr><td>%1</td><td>%2</td></tr>").arg(key, settings->value(key).toString()));
}
@nowrep
nowrep / gist:2313746
Created April 5, 2012 20:12
youtuber
void YouTuber_Handler::populateWebViewMenu(QMenu* menu, WebView* view, const QWebHitTestResult &r)
{
// Why are you storing pointer to webview? (And even as guarded pointer :-D )
m_view = view;
QRegExp rx("v=([^&]+)|youtu.be/([^&]+)");
rx.indexIn(r.linkUrl().toString());
QString videoId = rx.cap(1).isEmpty() ? rx.cap(2) : rx.cap(1);
#include <QApplication>
#include <QWebView>
#include <QPrintPreviewDialog>
class Test : public QWidget
{
Q_OBJECT
public:
QWebView* view;
diff --git a/Tools/Scripts/webkitdirs.pm b/Tools/Scripts/webkitdirs.pm
index 4d6e7c4..176ee88 100755
--- a/Tools/Scripts/webkitdirs.pm
+++ b/Tools/Scripts/webkitdirs.pm
@@ -1569,7 +1569,7 @@ sub checkRequiredSystemConfig
}
my @missing = ();
my $oldPath = $ENV{PATH};
- if (isQt() and isWindows()) {
+ if (isQt() and isWindows() and $qtMajorVersion == 5) {
diff --git a/Source/WebCore/DerivedSources.pri b/Source/WebCore/DerivedSources.pri
index 2c819ab..94974a5 100644
--- a/Source/WebCore/DerivedSources.pri
+++ b/Source/WebCore/DerivedSources.pri
@@ -834,7 +834,7 @@ GENERATORS += arrayBufferViewCustomScript
cssbison.output = CSSGrammar.cpp
cssbison.input = CSSBISON
cssbison.script = $$PWD/css/makegrammar.pl
-cssbison.commands = perl -I $$PWD/bindings/scripts $$cssbison.script --outputDir ${QMAKE_FUNC_FILE_OUT_PATH} --extraDefines \"$${DEFINES} $${FEATURE_DEFINES_JAVASCRIPT}\" --symbolsPrefix cssyy ${QMAKE_FILE_NAME}
+cssbison.commands = perl -I $$PWD/bindings/scripts $$cssbison.script --preprocessor \"cl -E\" --outputDir ${QMAKE_FUNC_FILE_OUT_PATH} --extraDefines \"$${DEFINES} $${FEATURE_DEFINES_JAVASCRIPT}\" --symbolsPrefix cssyy ${QMAKE_FILE_NAME}
DownloadManager::DownloadInfo info;
info.page = page(); // QWebPage*
info.suggestedFileName = suggestedFileName;
info.askWhatToDo = false;
info.forceChoosingPath = true;
DownloadManager* dManager = mApp->downManager();
dManager->download(request, info);