3.0
This commit is contained in:
parent
a41c082864
commit
51189b9789
4 changed files with 162 additions and 75 deletions
|
@ -1,4 +1,4 @@
|
|||
QT += core gui sql
|
||||
QT += core gui sql printsupport
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
|
|
|
@ -516,6 +516,67 @@ if(Debug) qDebug() << "on_pushButton_pfad_clicked";
|
|||
Dateiname = Dateiname + "." + Dateiname_tmp[i];
|
||||
}
|
||||
ui->lineEdit_titel->setText(Dateiname);
|
||||
if(Debug) qDebug() << "on_pushButton_pfad_clicked";
|
||||
if(Debug) qDebug() << "on_pushButton_pfad_clicked-Ende";
|
||||
}
|
||||
|
||||
void MainWindow::on_pushButton_PDF_speichern_clicked(){
|
||||
if(Debug) qDebug() << "on_pushButton_PDF_speichern_clicked";
|
||||
if(ui->pushButton_id->text().toInt() <= 0 || ui->pushButton_id->text().toInt() > ui->pushButton_max->text().toInt()) return;
|
||||
|
||||
QStringList Datei_tmp = ui->pushButton_pfad->text().split("/");
|
||||
QString Datei = Datei_tmp.at(Datei_tmp.length()-1);
|
||||
QStringList Dateiname_tmp = Datei.split(".");
|
||||
QString Dateiname;
|
||||
for(int i=0; i<Dateiname_tmp.length()-1; i++){
|
||||
if(i<1)
|
||||
Dateiname = Dateiname + Dateiname_tmp[i];
|
||||
else
|
||||
Dateiname = Dateiname + "." + Dateiname_tmp[i];
|
||||
}
|
||||
// -> Dateiname
|
||||
|
||||
ui->label_bild->grab().save(Dateiname + ".png");
|
||||
|
||||
QString html;
|
||||
html = " \
|
||||
<html> \
|
||||
<head> \
|
||||
<title>Video-Datenbak</title> \
|
||||
</head> \
|
||||
<body> \
|
||||
<table> \
|
||||
<tr><td rowspan=19><img src='" + Dateiname + ".png'></td><td> </td></tr> \
|
||||
<tr><td> </td><td> </td></tr> \
|
||||
<tr><td> </td><td> </td></tr> \
|
||||
<tr><td> </td><td> </td></tr> \
|
||||
<tr><td> </td><td> </td></tr> \
|
||||
<tr><td> </td><td> </td></tr> \
|
||||
<tr><td> </td><td> </td></tr> \
|
||||
<tr><td> </td><td> </td></tr> \
|
||||
<tr><td> </td><td> </td></tr> \
|
||||
<tr><td> </td><td> </td></tr> \
|
||||
<tr><td align=right>Pfad :</td><td>" + ui->pushButton_pfad->text() + "</td></tr> \
|
||||
<tr><td align=right>Titel :</td><td>" + ui->lineEdit_titel->text() + "</td></tr> \
|
||||
<tr><td align=right>Format :</td><td>" + ui->comboBox_bildformat->currentText() + "</td></tr> \
|
||||
<tr><td align=right>Typ :</td><td>" + ui->comboBox_filmtyp->currentText() + "</td></tr> \
|
||||
<tr><td align=right>Teil :</td><td>" + ui->lineEdit_teil->text() + "</td></tr> \
|
||||
<tr><td align=right>Genre :</td><td>" + ui->comboBox_genre->currentText() + "</td></tr> \
|
||||
<tr><td align=right>Länge :</td><td>" + ui->lineEdit_laenge->text() + "</td></tr> \
|
||||
<tr><td align=right>Jahr :</td><td>" + ui->lineEdit_jahr->text() + "</td></tr> \
|
||||
<tr><td align=right>FSK :</td><td>" + ui->comboBox_fsk->currentText() + "</td></tr> \
|
||||
</table> \
|
||||
<br><br><code>" + ui->plainTextEdit_handlung->toPlainText() + " </code> \
|
||||
</body> \
|
||||
</htnl> \
|
||||
";
|
||||
QTextDocument doc;
|
||||
doc.setHtml(html);
|
||||
QPrinter printer;
|
||||
printer.setOutputFileName(Dateiname + "-Text.pdf");
|
||||
printer.setOutputFormat(QPrinter::PdfFormat);
|
||||
doc.print(&printer);
|
||||
printer.newPage();
|
||||
|
||||
if(Debug) qDebug() << "on_pushButton_PDF_speichern_clicked-Ende";
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <QDateTime>
|
||||
#include <QDebug>
|
||||
#include <QTableWidgetItem>
|
||||
#include <QPrinter>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui { class MainWindow; }
|
||||
|
@ -47,6 +48,8 @@ private slots:
|
|||
|
||||
void on_pushButton_pfad_clicked();
|
||||
|
||||
void on_pushButton_PDF_speichern_clicked();
|
||||
|
||||
private:
|
||||
void oeffneDatenbank();
|
||||
void schiesseDatenbank();
|
||||
|
|
169
mainwindow.ui
169
mainwindow.ui
|
@ -174,53 +174,32 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0" colspan="16">
|
||||
<item row="5" column="3">
|
||||
<widget class="QComboBox" name="comboBox_bildformat"/>
|
||||
</item>
|
||||
<item row="5" column="13">
|
||||
<widget class="QLineEdit" name="lineEdit_jahr"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Pfad</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3" colspan="13">
|
||||
<widget class="QPushButton" name="pushButton_pfad">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0" colspan="13">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>/</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="pushButton_minus">
|
||||
<property name="text">
|
||||
<string><</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="7">
|
||||
<widget class="QPushButton" name="pushButton_abspielen">
|
||||
<property name="text">
|
||||
<string>Abspielen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="8">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QPushButton" name="pushButton_speichern">
|
||||
<property name="text">
|
||||
<string>Speichern</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
|
@ -234,24 +213,18 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QPushButton" name="pushButton_max">
|
||||
<property name="minimumSize">
|
||||
<item row="0" column="8">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>23</height>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="pushButton_id">
|
||||
|
@ -279,27 +252,77 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="pushButton_minus">
|
||||
<property name="text">
|
||||
<string><</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QPushButton" name="pushButton_speichern">
|
||||
<property name="text">
|
||||
<string>Speichern</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QPushButton" name="pushButton_max">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>/</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="7">
|
||||
<widget class="QPushButton" name="pushButton_abspielen">
|
||||
<property name="text">
|
||||
<string>Abspielen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="3">
|
||||
<widget class="QComboBox" name="comboBox_bildformat"/>
|
||||
</item>
|
||||
<item row="5" column="13">
|
||||
<widget class="QLineEdit" name="lineEdit_jahr"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Pfad</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3" colspan="13">
|
||||
<widget class="QPushButton" name="pushButton_pfad">
|
||||
<property name="text">
|
||||
<item row="10" column="13" colspan="3">
|
||||
<widget class="QGroupBox" name="groupBox_4">
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_8">
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="pushButton_PDF_Status">
|
||||
<property name="text">
|
||||
<string>Status</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="pushButton_PDF_speichern">
|
||||
<property name="text">
|
||||
<string>PDF speichern</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
Loading…
Add table
Reference in a new issue