author | sheepluva |
Thu, 26 Apr 2012 16:15:37 +0200 | |
changeset 6937 | 7f77fa908a4e |
parent 6616 | f77bb02b669f |
child 6948 | 7271ce89950f |
permissions | -rw-r--r-- |
5755
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff
changeset
|
1 |
#ifndef DATABROWSER_H |
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff
changeset
|
2 |
#define DATABROWSER_H |
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff
changeset
|
3 |
|
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff
changeset
|
4 |
#include <QTextBrowser> |
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff
changeset
|
5 |
#include <QSet> |
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff
changeset
|
6 |
|
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff
changeset
|
7 |
class QNetworkAccessManager; |
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff
changeset
|
8 |
|
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff
changeset
|
9 |
class DataBrowser : public QTextBrowser |
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff
changeset
|
10 |
{ |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
11 |
Q_OBJECT |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
12 |
public: |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
13 |
explicit DataBrowser(QWidget *parent = 0); |
5755
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff
changeset
|
14 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
15 |
signals: |
5755
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff
changeset
|
16 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
17 |
public slots: |
5755
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff
changeset
|
18 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
19 |
private: |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
20 |
QNetworkAccessManager *manager; |
5755
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff
changeset
|
21 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
22 |
// hash and set of QString instead of QUrl to support Qt versions |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
23 |
// older than 4.7 (those have no support for qHash(const QUrl &)) |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
24 |
QHash<QString, QByteArray> resources; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
25 |
QSet<QString> requestedResources; |
5755
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff
changeset
|
26 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
27 |
QVariant loadResource(int type, const QUrl & name); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
28 |
|
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
29 |
private slots: |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
30 |
void resourceDownloaded(); |
5755
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff
changeset
|
31 |
}; |
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff
changeset
|
32 |
|
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
diff
changeset
|
33 |
#endif // DATABROWSER_H |