Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void generateHtml(QDir outputDir, QList<VideoNode*> videoNodes) {
- QFile outputHtml(outputDir.filePath("index.html"));
- outputHtml.open(QIODevice::WriteOnly | QIODevice::Text);
- QTextStream html(&outputHtml);
- html << "<!doctype html>\n";
- html << "<html><body>\n";
- html << "<style>\n";
- html << "body { color: #FFF; background-color: #111; font-family: Monospace; width: 640px; margin: auto; }\n";
- html << "h1, td, th { padding: 5px; }\n";
- html << "</style>\n";
- html << "<h1>radiance library</h1>\n";
- html << "<table><tr><th>name</th><th>0%</th><th>100%</th><th>gif</th><th>description</th><tr>\n";
- for (auto videoNode : videoNodes) {
- auto name = videoNode->property("name").toString();
- html << "<tr><td>" << name << "</td>\n";
- html << " <td class='static'>" << "<img src='./_assets/" << name << "_0.png'>" << "</td>\n";
- html << " <td class='static'>" << "<img src='./_assets/" << name << "_51.png'>" << "</td>\n";
- html << " <td class='gif'>" << "<img src='./_assets/" << name << IMG_FORMAT "'>" << "</td>\n";
- html << " <td class='desc'>" << videoNode->property("description").toString();
- auto author = videoNode->property("author").toString();
- if (!author.isEmpty()) {
- html << "<p>[" << author << "]</p>";
- }
- html << "</td>\n";
- }
- html << "</table>\n";
- html << "</body></html>\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement