All: Reformat according to new standard
This commit is contained in:
committed by
Kacper Donat
parent
ef997f2259
commit
9fe130cd73
@@ -156,7 +156,7 @@ EditorView::~EditorView()
|
||||
{
|
||||
d->activityTimer->stop();
|
||||
// to avoid the assert introduced a debug version of Qt >6.3. See QTBUG-105473
|
||||
for (auto conn : connectionList) { // NOLINT(performance-for-range-copy)
|
||||
for (auto conn : connectionList) { // NOLINT(performance-for-range-copy)
|
||||
disconnect(conn);
|
||||
}
|
||||
delete d->activityTimer;
|
||||
@@ -205,13 +205,15 @@ void EditorView::checkTimestamp()
|
||||
QFileInfo fi(d->fileName);
|
||||
qint64 timeStamp = fi.lastModified().toSecsSinceEpoch();
|
||||
if (timeStamp != d->timeStamp) {
|
||||
switch (QMessageBox::question(this,
|
||||
tr("Modified file"),
|
||||
tr("%1.\n\nThis has been modified outside of the source "
|
||||
"editor. Reload it?")
|
||||
.arg(d->fileName),
|
||||
QMessageBox::Yes | QMessageBox::No,
|
||||
QMessageBox::Yes)) {
|
||||
switch (QMessageBox::question(
|
||||
this,
|
||||
tr("Modified file"),
|
||||
tr("%1.\n\nThis has been modified outside of the source "
|
||||
"editor. Reload it?")
|
||||
.arg(d->fileName),
|
||||
QMessageBox::Yes | QMessageBox::No,
|
||||
QMessageBox::Yes
|
||||
)) {
|
||||
case QMessageBox::Yes:
|
||||
// updates time stamp and timer
|
||||
open(d->fileName);
|
||||
@@ -342,12 +344,14 @@ bool EditorView::canClose()
|
||||
return true;
|
||||
}
|
||||
this->setFocus(); // raises the view to front
|
||||
switch (QMessageBox::question(this,
|
||||
tr("Unsaved document"),
|
||||
tr("The document has been modified.\n"
|
||||
"Save all changes?"),
|
||||
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
|
||||
QMessageBox::Cancel)) {
|
||||
switch (QMessageBox::question(
|
||||
this,
|
||||
tr("Unsaved document"),
|
||||
tr("The document has been modified.\n"
|
||||
"Save all changes?"),
|
||||
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
|
||||
QMessageBox::Cancel
|
||||
)) {
|
||||
case QMessageBox::Yes:
|
||||
return saveFile();
|
||||
case QMessageBox::No:
|
||||
@@ -373,7 +377,8 @@ bool EditorView::saveAs()
|
||||
this,
|
||||
QObject::tr("Save Macro"),
|
||||
QString(),
|
||||
QStringLiteral("%1 (*.FCMacro);;Python (*.py)").arg(tr("FreeCAD macro")));
|
||||
QStringLiteral("%1 (*.FCMacro);;Python (*.py)").arg(tr("FreeCAD macro"))
|
||||
);
|
||||
if (fn.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
@@ -485,10 +490,7 @@ void EditorView::printPreview()
|
||||
{
|
||||
QPrinter printer(QPrinter::ScreenResolution);
|
||||
QPrintPreviewDialog dlg(&printer, this);
|
||||
connect(&dlg,
|
||||
&QPrintPreviewDialog::paintRequested,
|
||||
this,
|
||||
qOverload<QPrinter*>(&EditorView::print));
|
||||
connect(&dlg, &QPrintPreviewDialog::paintRequested, this, qOverload<QPrinter*>(&EditorView::print));
|
||||
dlg.exec();
|
||||
}
|
||||
|
||||
@@ -502,11 +504,12 @@ void EditorView::print(QPrinter* printer)
|
||||
*/
|
||||
void EditorView::printPdf()
|
||||
{
|
||||
QString filename =
|
||||
FileDialog::getSaveFileName(this,
|
||||
tr("Export PDF"),
|
||||
QString(),
|
||||
QStringLiteral("%1 (*.pdf)").arg(tr("PDF file")));
|
||||
QString filename = FileDialog::getSaveFileName(
|
||||
this,
|
||||
tr("Export PDF"),
|
||||
QString(),
|
||||
QStringLiteral("%1 (*.pdf)").arg(tr("PDF file"))
|
||||
);
|
||||
if (!filename.isEmpty()) {
|
||||
QPrinter printer(QPrinter::ScreenResolution);
|
||||
// setPdfVersion sets the printed PDF Version to what is chosen in
|
||||
@@ -880,8 +883,9 @@ void SearchBar::findText(bool skip, bool next, const QString& str)
|
||||
newCursor = doc->find(str, cursor, options);
|
||||
if (newCursor.isNull()) {
|
||||
QTextCursor ac(doc);
|
||||
ac.movePosition(options & QTextDocument::FindBackward ? QTextCursor::End
|
||||
: QTextCursor::Start);
|
||||
ac.movePosition(
|
||||
options & QTextDocument::FindBackward ? QTextCursor::End : QTextCursor::Start
|
||||
);
|
||||
newCursor = doc->find(str, ac, options);
|
||||
if (newCursor.isNull()) {
|
||||
found = false;
|
||||
@@ -898,9 +902,11 @@ void SearchBar::findText(bool skip, bool next, const QString& str)
|
||||
|
||||
QString styleSheet;
|
||||
if (!found) {
|
||||
styleSheet = QStringLiteral(" QLineEdit {\n"
|
||||
" background-color: rgb(221,144,161);\n"
|
||||
" }\n");
|
||||
styleSheet = QStringLiteral(
|
||||
" QLineEdit {\n"
|
||||
" background-color: rgb(221,144,161);\n"
|
||||
" }\n"
|
||||
);
|
||||
}
|
||||
|
||||
searchText->setStyleSheet(styleSheet);
|
||||
|
||||
Reference in New Issue
Block a user