MINOR: window.cpp: Reformat code
No functional change.
This commit is contained in:
parent
edb781580e
commit
416bfa6314
38
window.cpp
38
window.cpp
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2019 Albert S. <mail at quitesimple dot org>
|
||||
* Copyright (c) 2018-2020 Albert S. <mail at quitesimple dot org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@ -13,20 +13,21 @@
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
#include <QProcess>
|
||||
#include <QProcessEnvironment>
|
||||
#include <QClipboard>
|
||||
#include <QDate>
|
||||
#include <QDebug>
|
||||
#include <QDesktopServices>
|
||||
#include <QDirIterator>
|
||||
#include <QFileIconProvider>
|
||||
#include <QHeaderView>
|
||||
#include <QIcon>
|
||||
#include <QKeySequence>
|
||||
#include <QLabel>
|
||||
#include <QDate>
|
||||
#include <QHeaderView>
|
||||
#include <QDesktopServices>
|
||||
#include <QFileIconProvider>
|
||||
#include <QDebug>
|
||||
#include <QMenu>
|
||||
#include <QClipboard>
|
||||
#include <QProcess>
|
||||
#include <QProcessEnvironment>
|
||||
#include <QScrollArea>
|
||||
|
||||
#include "window.h"
|
||||
#include "entryprovider.h"
|
||||
Window::Window(EntryProvider &entryProvider, SettingsProvider &configProvider)
|
||||
@ -43,13 +44,12 @@ Window::Window(EntryProvider &entryProvider, SettingsProvider &configProvider)
|
||||
calculationResultLabel.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
calculationResultLabel.setAlignment(Qt::AlignCenter);
|
||||
calculationResultLabel.setContextMenuPolicy(Qt::ContextMenuPolicy::CustomContextMenu);
|
||||
connect(&calculationResultLabel, &QLabel::customContextMenuRequested, this, &Window::showCalculationResultContextMenu);
|
||||
connect(&calculationResultLabel, &QLabel::customContextMenuRequested, this,
|
||||
&Window::showCalculationResultContextMenu);
|
||||
}
|
||||
|
||||
Window::~Window()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Window::initFromConfig()
|
||||
@ -198,7 +198,6 @@ void Window::addCalcResult(const QString &expression)
|
||||
calculationResultLabel.setText(labelText);
|
||||
calculationResultLabel.setVisible(true);
|
||||
|
||||
|
||||
QFont currentFont = calculationResultLabel.font();
|
||||
int calculatedPointSize = currentFont.pointSize();
|
||||
QFontMetrics fm(currentFont);
|
||||
@ -268,11 +267,11 @@ void Window::keyReleaseEvent(QKeyEvent *event)
|
||||
}
|
||||
}
|
||||
QWidget::keyReleaseEvent(event);
|
||||
|
||||
}
|
||||
void Window::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
bool closeWindow = ((event->modifiers() & Qt::ControlModifier && event->key() == Qt::Key_Q) || event->key() == Qt::Key_Escape);
|
||||
bool closeWindow =
|
||||
((event->modifiers() & Qt::ControlModifier && event->key() == Qt::Key_Q) || event->key() == Qt::Key_Escape);
|
||||
if(closeWindow)
|
||||
{
|
||||
this->closeWindow();
|
||||
@ -294,7 +293,8 @@ void Window::keyPressEvent(QKeyEvent *event)
|
||||
QKeySequence seq(event->key());
|
||||
QString key = seq.toString().toLower();
|
||||
|
||||
auto it = std::find_if(buttonsInGrid.begin(), buttonsInGrid.end(), [&key](const EntryPushButton *y) { return y->getShortcutKey() == key; });
|
||||
auto it = std::find_if(buttonsInGrid.begin(), buttonsInGrid.end(),
|
||||
[&key](const EntryPushButton *y) { return y->getShortcutKey() == key; });
|
||||
if(it != buttonsInGrid.end())
|
||||
{
|
||||
buttonClick(**it);
|
||||
@ -343,15 +343,11 @@ void Window::filterGridFor(QString filter)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
populateGrid(this->userEntryButtons);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
EntryPushButton *Window::createEntryButton(const EntryConfig &entry)
|
||||
@ -370,7 +366,6 @@ void Window::lineEditReturnPressed()
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(buttonsInGrid.length() > 0 && this->lineEdit->text().length() > 0)
|
||||
{
|
||||
buttonClick(*buttonsInGrid[0]);
|
||||
@ -401,7 +396,6 @@ bool Window::eventFilter(QObject *obj, QEvent *event)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return QObject::eventFilter(obj, event);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user