scale combobox: regenerate pdfs preview with choosen scale

Bu işleme şunda yer alıyor:
Albert S. 2018-09-02 20:30:52 +02:00
ebeveyn 7a485c55bb
işleme caafb114ca
5 değiştirilmiş dosya ile 18 ekleme ve 5 silme

Dosyayı Görüntüle

@ -5,9 +5,11 @@
#include <QDesktopServices>
#include <QUrl>
#include <QClipboard>
#include <QtGlobal>
#include <QSettings>
#include <QDateTime>
#include <QProcess>
#include <QComboBox>
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "clicklabel.h"
@ -43,8 +45,14 @@ void MainWindow::connectSignals()
connect(this, &MainWindow::startPdfPreviewGeneration, pdfWorker, &PdfWorker::generatePreviews);
connect(pdfWorker, &PdfWorker::previewReady, this, &MainWindow::pdfPreviewReceived);
connect(pdfWorker, &PdfWorker::previewsFinished, [&] { this->pdfDirty = false; });
connect(ui->comboScale, qOverload<const QString &>(&QComboBox::currentIndexChanged), this,
&MainWindow::comboScaleChanged);
}
void MainWindow::comboScaleChanged(QString text)
{
makePdfPreview();
}
bool MainWindow::pdfTabActive()
{
return ui->tabWidget->currentIndex() == 1;
@ -155,7 +163,10 @@ void MainWindow::makePdfPreview()
ui->scrollAreaWidgetContents->setLayout(new QHBoxLayout());
ui->pdfProcessBar->setMaximum(this->pdfSearchResults.size());
processedPdfPreviews = 0;
emit startPdfPreviewGeneration(this->pdfSearchResults, 0.75);
QString scaleText = ui->comboScale->currentText();
scaleText.chop(1);
emit startPdfPreviewGeneration(this->pdfSearchResults, scaleText.toInt() / 100.);
}
void MainWindow::handleCancelledSearch()

Dosyayı Görüntüle

@ -47,6 +47,7 @@ class MainWindow : public QMainWindow
void showSearchResultsContextMenu(const QPoint &point);
void tabChanged();
void pdfPreviewReceived(PdfPreview preview);
void comboScaleChanged(QString text);
};
#endif // MAINWINDOW_H

Dosyayı Görüntüle

@ -27,7 +27,7 @@
<enum>QTabWidget::South</enum>
</property>
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="resultsTab">
<attribute name="title">
@ -99,9 +99,9 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox">
<widget class="QComboBox" name="comboScale">
<property name="currentText">
<string>25%</string>
<string>75%</string>
</property>
<item>
<property name="text">

Dosyayı Görüntüle

@ -7,7 +7,7 @@
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++14
TARGET = qss
TEMPLATE = app

Dosyayı Görüntüle

@ -87,6 +87,7 @@ QString SearchWorker::createSql(const SearchWorker::Command &cmd)
{
QString key = cmd.key;
QString value = cmd.value;
value = value.replace("'", "\\'");
if(key == "AND" || key == "OR" || key == "(" || key == ")")
{
return " " + key + " ";