3.5
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 733 B After Width: | Height: | Size: 787 B |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 2.1 KiB |
BIN
Video-Datenbank-48.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 4.9 KiB |
|
@ -1,4 +1,4 @@
|
|||
QT += core gui sql printsupport
|
||||
QT += core gui sql printsupport network
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
|
|
|
@ -662,3 +662,61 @@ if(Debug) qDebug() << "on_pushButton_PDF_speichern_clicked";
|
|||
if(Debug) qDebug() << "on_pushButton_PDF_speichern_clicked-Ende";
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_pushButton_Wikipedia_clicked(){
|
||||
if(Debug) qDebug() << "on_pushButton_Wikipedia_clicked-Ende";
|
||||
if(ui->lineEdit_titel->text()==""){
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText("Kein Titel zum Suchen!");
|
||||
msgBox.exec();
|
||||
return;
|
||||
}
|
||||
|
||||
QNetworkAccessManager manager;
|
||||
QNetworkReply *reply = manager.get(QNetworkRequest(QUrl("https://de.wikipedia.org/w/api.php?action=query&list=search&srsearch=" + ui->lineEdit_titel->text() +"&srlimit=1&prop=info&inprop=url&utf8=&origin=*&format=json")));
|
||||
QEventLoop eventLoop;
|
||||
QObject::connect(&manager, SIGNAL(finished(QNetworkReply*)), &eventLoop, SLOT(quit()));
|
||||
eventLoop.exec();
|
||||
QJsonDocument getJD = QJsonDocument::fromJson(reply->readAll());
|
||||
QJsonObject getJO = getJD.object();
|
||||
QJsonValue queryJV = getJO.value(QString("query"));
|
||||
QJsonArray searchJA = queryJV["search"].toArray();
|
||||
QJsonObject searchJO = searchJA[0].toObject();
|
||||
QJsonValue titelJV = searchJO.value(QString("title"));
|
||||
|
||||
if(titelJV.toString()=="") return;
|
||||
|
||||
reply = manager.get(QNetworkRequest(QUrl("https://de.wikipedia.org/w/api.php?action=parse&page=" + titelJV.toString() + "&prop=text&formatversion=2&format=json")));
|
||||
QObject::connect(&manager, SIGNAL(finished(QNetworkReply*)), &eventLoop, SLOT(quit()));
|
||||
eventLoop.exec();
|
||||
getJD = QJsonDocument::fromJson(reply->readAll());
|
||||
getJO = getJD.object();
|
||||
QJsonValue parseJV = getJO.value(QString("parse"));
|
||||
QJsonObject parseJO = parseJV.toObject();
|
||||
QJsonValue textJV = parseJO.value(QString("text"));
|
||||
|
||||
if(textJV.toString()=="") return;
|
||||
|
||||
QTextDocument htmlDoc;
|
||||
htmlDoc.setHtml(textJV.toString());
|
||||
|
||||
QMessageBox messageBox;
|
||||
messageBox.setStyleSheet("QTextEdit{min-width:800 px;height: 500px; min-height: 500px; max-height: 500px;}");
|
||||
messageBox.deleteLater();
|
||||
messageBox.setText(titelJV.toString());
|
||||
//messageBox.setDetailedText(html.remove(QRegExp("<[^>]*>")));
|
||||
messageBox.setDetailedText(htmlDoc.toRawText());
|
||||
QAbstractButton *detailsButton = NULL;
|
||||
foreach (QAbstractButton *button, messageBox.buttons()) {
|
||||
if (messageBox.buttonRole(button) == QMessageBox::ActionRole) {
|
||||
detailsButton = button;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (detailsButton) {
|
||||
detailsButton->click();
|
||||
}
|
||||
messageBox.exec();
|
||||
if(Debug) qDebug() << "on_pushButton_Wikipedia_clicked-Ende";
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,11 @@
|
|||
#include <QDebug>
|
||||
#include <QTableWidgetItem>
|
||||
#include <QPrinter>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonArray>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui { class MainWindow; }
|
||||
|
@ -50,6 +55,8 @@ private slots:
|
|||
|
||||
void on_pushButton_PDF_speichern_clicked();
|
||||
|
||||
void on_pushButton_Wikipedia_clicked();
|
||||
|
||||
private:
|
||||
void oeffneDatenbank();
|
||||
void schiesseDatenbank();
|
||||
|
|
133
mainwindow.ui
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>956</width>
|
||||
<height>608</height>
|
||||
<height>616</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -192,6 +192,41 @@
|
|||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="2" column="2" colspan="4">
|
||||
<widget class="QPushButton" name="pushButton_abspielen">
|
||||
<property name="text">
|
||||
<string>Abspielen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="pushButton_PDF_Status">
|
||||
<property name="text">
|
||||
<string>PDF</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2" colspan="4">
|
||||
<widget class="QPushButton" name="pushButton_daten_loeschen">
|
||||
<property name="text">
|
||||
<string>Daten löschen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="pushButton_speichern">
|
||||
<property name="text">
|
||||
<string>Speichern</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2" colspan="4">
|
||||
<widget class="QPushButton" name="pushButton_PDF_speichern">
|
||||
<property name="text">
|
||||
<string>PDF speichern</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="pushButton_minus">
|
||||
<property name="minimumSize">
|
||||
|
@ -211,61 +246,12 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>/</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="pushButton_PDF_Status">
|
||||
<property name="text">
|
||||
<string>PDF</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="pushButton_speichern">
|
||||
<property name="text">
|
||||
<string>Speichern</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="pushButton_bild">
|
||||
<property name="text">
|
||||
<string>Bild</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="pushButton_status">
|
||||
<property name="text">
|
||||
<string>Film</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2" colspan="4">
|
||||
<widget class="QPushButton" name="pushButton_daten_loeschen">
|
||||
<property name="text">
|
||||
<string>Daten löschen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2" colspan="4">
|
||||
<widget class="QPushButton" name="pushButton_abspielen">
|
||||
<property name="text">
|
||||
<string>Abspielen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="pushButton_id">
|
||||
<item row="1" column="3">
|
||||
<widget class="QPushButton" name="pushButton_max">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>42</width>
|
||||
<height>23</height>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
|
@ -279,19 +265,12 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2" colspan="4">
|
||||
<widget class="QPushButton" name="pushButton_PDF_speichern">
|
||||
<property name="text">
|
||||
<string>PDF speichern</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QPushButton" name="pushButton_max">
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="pushButton_id">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>42</width>
|
||||
<height>0</height>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
|
@ -324,6 +303,34 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>/</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="pushButton_bild">
|
||||
<property name="text">
|
||||
<string>Bild</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="pushButton_status">
|
||||
<property name="text">
|
||||
<string>Film</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="pushButton_Wikipedia">
|
||||
<property name="text">
|
||||
<string>Wikipedia</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
11
source.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
https://openclipart.org/detail/212130/wmmaker
|
||||
|
||||
Programmsymbol: sixsixfive (openclipart.org)
|
||||
Remix: aer66 (created june 2022)
|
||||
Creative Commons Zero 1.0 Public Domain License
|
||||
creativecommons.org/publicdomain/zero/1.0
|
||||
|
||||
rodentia-icons_wmmaker
|
||||
uploaded on January 10, 2015, 4:15 pm
|
||||
an old rodentia icon theme once made for xfce, also keep in mind that it was based on a fixed color palette!
|
||||
Safe for Work? Yes
|