Formatting

This commit is contained in:
Jonas Kvinge
2021-07-11 09:49:38 +02:00
parent a6742d401c
commit e48b7d83a3
161 changed files with 370 additions and 369 deletions

View File

@@ -70,7 +70,7 @@ const int FancyTabWidget::IconSize_LargeSidebar = 40;
const int FancyTabWidget::IconSize_SmallSidebar = 32;
const int FancyTabWidget::TabSize_LargeSidebarMinWidth = 70;
class FancyTabBar: public QTabBar { // clazy:exclude=missing-qobject-macro
class FancyTabBar : public QTabBar { // clazy:exclude=missing-qobject-macro
private:
int mouseHoverTabIndex = -1;
@@ -345,13 +345,13 @@ class FancyTabBar: public QTabBar { // clazy:exclude=missing-qobject-macro
class TabData : public QObject { // clazy:exclude=missing-qobject-macro
public:
TabData(QWidget *widget_view, const QString &name, const QIcon &icon, const QString &label, const int idx, QWidget *parent) :
QObject(parent),
widget_view_(widget_view),
name_(name), icon_(icon),
label_(label),
index_(idx),
page_(new QWidget()) {
TabData(QWidget *widget_view, const QString &name, const QIcon &icon, const QString &label, const int idx, QWidget *parent)
: QObject(parent),
widget_view_(widget_view),
name_(name), icon_(icon),
label_(label),
index_(idx),
page_(new QWidget()) {
// In order to achieve the same effect as the "Bottom Widget" of the old Nokia based FancyTabWidget a VBoxLayout is used on each page
QVBoxLayout *layout = new QVBoxLayout(page_);
layout->setSpacing(0);
@@ -646,7 +646,7 @@ void FancyTabWidget::paintEvent(QPaintEvent *pe) {
// Shadow effect of the background
QColor light(255, 255, 255, 80);
p.setPen(light);
p.drawLine(backgroundRect.topRight() - QPoint(1, 0), backgroundRect.bottomRight() - QPoint(1, 0));
p.drawLine(backgroundRect.topRight() - QPoint(1, 0), backgroundRect.bottomRight() - QPoint(1, 0));
QColor dark(0, 0, 0, 90);
p.setPen(dark);
p.drawLine(backgroundRect.topLeft(), backgroundRect.bottomLeft());
@@ -672,7 +672,7 @@ void FancyTabWidget::SetMode(FancyTabWidget::Mode mode) {
mode_ = mode;
if (mode == FancyTabWidget::Mode_Tabs || mode == FancyTabWidget::Mode_IconOnlyTabs) {
if (mode == FancyTabWidget::Mode_Tabs || mode == FancyTabWidget::Mode_IconOnlyTabs) {
setTabPosition(QTabWidget::North);
}
else {
@@ -702,7 +702,7 @@ void FancyTabWidget::addMenuItem(QActionGroup *group, const QString &text, Mode
QAction *action = group->addAction(text);
action->setCheckable(true);
QObject::connect(action, &QAction::triggered, [this, mode]() { SetMode(mode); } );
QObject::connect(action, &QAction::triggered, [this, mode]() { SetMode(mode); });
if (mode == mode_) action->setChecked(true);

View File

@@ -64,7 +64,7 @@ class FancyTabWidget : public QTabWidget {
void SaveSettings(const QString &kSettingsGroup);
void ReloadSettings();
// Values are persisted - only add to the end
// Values are persisted - only add to the end
enum Mode {
Mode_None = 0,
Mode_LargeSidebar,

View File

@@ -130,7 +130,7 @@ void FileView::FileUp() {
// Is this the same as going back? If so just go back, so we can keep the view scroll position.
if (undo_stack_->canUndo()) {
const UndoCommand *last_dir = static_cast<const UndoCommand*>(undo_stack_->command(undo_stack_->index()-1));
const UndoCommand *last_dir = static_cast<const UndoCommand*>(undo_stack_->command(undo_stack_->index() - 1));
if (last_dir->undo_path() == dir.path()) {
undo_stack_->undo();
return;
@@ -195,8 +195,7 @@ void FileView::ItemDoubleClick(const QModelIndex &idx) {
}
FileView::UndoCommand::UndoCommand(FileView *view, const QString &new_path)
: view_(view) {
FileView::UndoCommand::UndoCommand(FileView *view, const QString &new_path) : view_(view) {
old_state_.path = view->model_->rootPath();
old_state_.scroll_pos = view_->ui_->list->verticalScrollBar()->value();

View File

@@ -185,7 +185,8 @@ void GroupedIconView::LayoutItems() {
QPoint this_position(next_position);
if (this_position.x() == 0) {
this_position.setX(this_position.x() + item_indent_);
} else {
}
else {
this_position.setX(this_position.x() + spacing());
}

View File

@@ -140,7 +140,7 @@ void ExtendedEditor::Paint(QPaintDevice *device) {
p.setPen(widget_->palette().color(QPalette::Disabled, QPalette::Text));
p.setFont(font);
QRect r(5, kBorder, device->width() - 10, device->height() - kBorder*2);
QRect r(5, kBorder, device->width() - 10, device->height() - kBorder * 2);
p.drawText(r, Qt::AlignLeft | Qt::AlignVCenter, m.elidedText(hint_, Qt::ElideRight, r.width()));
}
}
@@ -219,9 +219,10 @@ void TextEdit::resizeEvent(QResizeEvent *e) {
SpinBox::SpinBox(QWidget *parent)
: QSpinBox(parent),
ExtendedEditor(this, 14, false)
{
ExtendedEditor(this, 14, false) {
QObject::connect(reset_button_, &QToolButton::clicked, this, &SpinBox::Reset);
}
void SpinBox::paintEvent(QPaintEvent *e) {

View File

@@ -216,7 +216,7 @@ void PlayingWidget::CreateModeAction(const Mode mode, const QString &text, QActi
QAction *action = new QAction(text, group);
action->setCheckable(true);
QObject::connect(action, &QAction::triggered, [this, mode]() { SetMode(mode); } );
QObject::connect(action, &QAction::triggered, [this, mode]() { SetMode(mode); });
if (mode == mode_) action->setChecked(true);

View File

@@ -43,7 +43,7 @@ class QSearchField : public QWidget {
private:
friend class QSearchFieldPrivate;
QPointer <QSearchFieldPrivate> pimpl;
QPointer<QSearchFieldPrivate> pimpl;
};
#endif // QSEARCHFIELD_H
#endif // QSEARCHFIELD_H

View File

@@ -180,7 +180,7 @@ void QSearchField::resizeEvent(QResizeEvent *resizeEvent) {
QWidget::resizeEvent(resizeEvent);
const int x = pimpl->lineEditFrameWidth();
const int y = (height() - pimpl->clearbutton_->height())/2;
const int y = (height() - pimpl->clearbutton_->height()) / 2;
pimpl->clearbutton_->move(x, y);
}

View File

@@ -149,7 +149,7 @@ void StretchHeaderView::ShowSection(int logical) {
int visible_count = 0;
for (int i = 0 ; i < count() ; ++i) {
if (!isSectionHidden(i))
visible_count ++;
++visible_count;
}
column_widths_[logical] = visible_count == 0 ? 1.0 : 1.0 / visible_count;

View File

@@ -120,7 +120,7 @@ QSize TrackSlider::sizeHint() const {
void TrackSlider::SetValue(const int elapsed, const int total) {
setting_value_ = true; // This is so we don't emit from QAbstractSlider::valueChanged
setting_value_ = true; // This is so we don't emit from QAbstractSlider::valueChanged
ui_->slider->setMaximum(total);
if (!ui_->slider->isSliderDown()) {
ui_->slider->setValue(elapsed);

View File

@@ -91,7 +91,7 @@ class TrackSlider : public QWidget {
bool setting_value_;
bool show_remaining_time_;
int slider_maximum_value_; //we cache it to avoid unnecessary updates
int slider_maximum_value_; // We cache it to avoid unnecessary updates
};
#endif // TRACKSLIDER_H

View File

@@ -30,7 +30,7 @@
#include <QKeyEvent>
#include <QMouseEvent>
#include <QWheelEvent>
# include <QEnterEvent>
#include <QEnterEvent>
#include "core/timeconstants.h"
#include "core/utilities.h"