Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Commit

Permalink
Fix issue 93: build with Qt 4.5.
Browse files Browse the repository at this point in the history
Guard some Qt >= 4.6 features in version checks.
  • Loading branch information
ariya committed Apr 19, 2011
1 parent 391d3a4 commit 7ee97f3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/networkaccessmanager.cpp
Expand Up @@ -74,10 +74,12 @@ QNetworkReply *NetworkAccessManager::createRequest(Operation op, const QNetworkR
qDebug() << "HTTP/1.1 POST Request";
break;
}
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
case QNetworkAccessManager::DeleteOperation: {
qDebug() << "HTTP/1.1 DELETE Request";
break;
}
#endif
#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
case QNetworkAccessManager::CustomOperation: {
qDebug() << "HTTP/1.1 CUSTOM Request";
Expand Down
4 changes: 4 additions & 0 deletions src/phantom.cpp
Expand Up @@ -135,7 +135,9 @@ Phantom::Phantom(QObject *parent)
}

if (m_proxyHost.isEmpty()) {
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QNetworkProxyFactory::setUseSystemConfiguration(true);
#endif
} else {
QNetworkProxy proxy(QNetworkProxy::HttpProxy, m_proxyHost, m_proxyPort);
QNetworkProxy::setApplicationProxy(proxy);
Expand Down Expand Up @@ -385,11 +387,13 @@ void Phantom::sleep(int ms)
}
}

#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
void Phantom::setFormInputFile(QWebElement el, const QString &fileTag)
{
m_page.m_nextFileTag = fileTag;
el.evaluateJavaScript(JS_MOUSEEVENT_CLICK_WEBELEMENT);
}
#endif

// private slots:
void Phantom::finish(bool success)
Expand Down
4 changes: 4 additions & 0 deletions src/phantom.h
Expand Up @@ -83,7 +83,11 @@ class Phantom: public QObject
public slots:
void exit(int code = 0);
void open(const QString &address);

// moc does not understand QT_VERSION_CHECK and hence the encoded hex
#if QT_VERSION >= 0x040600
void setFormInputFile(QWebElement el, const QString &fileTag);
#endif
bool render(const QString &fileName);
void sleep(int ms);

Expand Down

0 comments on commit 7ee97f3

Please sign in to comment.