code format

This commit is contained in:
2022-12-14 14:14:33 +03:00
parent 09e5342956
commit cdb02fc9be
278 changed files with 15371 additions and 12176 deletions

View File

@@ -1,37 +1,37 @@
/*
QAD - Qt ADvanced
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TOUCHSLIDER_H
#define TOUCHSLIDER_H
#include "qad_touch_widgets_export.h"
#include <QGroupBox>
#include <QMouseEvent>
#include "qad_touch_widgets_export.h"
namespace Ui {
class TouchSlider;
class TouchSlider;
}
class QAD_TOUCH_WIDGETS_EXPORT TouchSlider: public QGroupBox
{
class QAD_TOUCH_WIDGETS_EXPORT TouchSlider: public QGroupBox {
Q_OBJECT
Q_PROPERTY(bool readOnly READ readOnly WRITE setReadOnly)
Q_PROPERTY(bool showMinMax READ showMinMax WRITE setShowMinMax)
@@ -46,26 +46,26 @@ class QAD_TOUCH_WIDGETS_EXPORT TouchSlider: public QGroupBox
Q_PROPERTY(int setID READ setID WRITE setSetID)
public:
explicit TouchSlider(QWidget *parent = 0);
explicit TouchSlider(QWidget * parent = 0);
~TouchSlider();
int clickID() const {return id_click;}
int setID() const {return id_set;}
int clickID() const { return id_click; }
int setID() const { return id_set; }
double minimum() const;
double maximum() const;
double value() const;
double precision() const;
QString prefix() const {return pref;}
QString suffix() const {return suff;}
bool readOnly() const {return m_readOnly;}
bool showMinMax() const {return m_showMinMax;}
bool showIncDec() const {return m_showIncDec;}
QString prefix() const { return pref; }
QString suffix() const { return suff; }
bool readOnly() const { return m_readOnly; }
bool showMinMax() const { return m_showMinMax; }
bool showIncDec() const { return m_showIncDec; }
private:
void updateCaption();
Ui::TouchSlider *ui;
Ui::TouchSlider * ui;
bool hasZero;
bool m_readOnly;
bool m_showMinMax;
@@ -75,46 +75,60 @@ private:
QString pref, suff;
public slots:
void enable() {setEnabled(true);}
void disable() {setEnabled(false);}
void setClickID(int id) {id_click = id;}
void setSetID(int id) {id_set = id;}
void setSuffix(const QString & text) {suff = text; updateCaption();}
void setPrefix(const QString & text) {pref = text; updateCaption();}
void enable() { setEnabled(true); }
void disable() { setEnabled(false); }
void setClickID(int id) { id_click = id; }
void setSetID(int id) { id_set = id; }
void setSuffix(const QString & text) {
suff = text;
updateCaption();
}
void setPrefix(const QString & text) {
pref = text;
updateCaption();
}
void setPrecision(double precision);
void setPrecision(int precision) {setPrecision((double)precision);}
void setPrecision(int precision) { setPrecision((double)precision); }
void setMinimum(double min);
void setMinimum(int min) {setMinimum((double)min);}
void setMinimum(int min) { setMinimum((double)min); }
void setMaximum(double max);
void setMaximum(int max) {setMaximum((double)max);}
void setMaximum(int max) { setMaximum((double)max); }
void setReadOnly(bool yes);
void setShowMinMax(bool yes);
void setShowIncDec(bool yes);
void setValue(double val);
void setValue(int val) {setValue((double)val);}
void enableID(int set_id) {if (set_id == id_set) enable();}
void disableID(int set_id) {if (set_id == id_set) disable();}
void setValueID(int set_id, double val) {if (set_id == id_set) setValue(val);}
void setValueID(int set_id, int val) {if (set_id == id_set) setValue(val);}
void clickMin() {on_pbMin_clicked();}
void clickMax() {on_pbMax_clicked();}
void clickInc() {on_pbInc_clicked();}
void clickDec() {on_pbDec_clicked();}
void clickZero() {on_pbZero_clicked();}
void setValue(int val) { setValue((double)val); }
void enableID(int set_id) {
if (set_id == id_set) enable();
}
void disableID(int set_id) {
if (set_id == id_set) disable();
}
void setValueID(int set_id, double val) {
if (set_id == id_set) setValue(val);
}
void setValueID(int set_id, int val) {
if (set_id == id_set) setValue(val);
}
void clickMin() { on_pbMin_clicked(); }
void clickMax() { on_pbMax_clicked(); }
void clickInc() { on_pbInc_clicked(); }
void clickDec() { on_pbDec_clicked(); }
void clickZero() { on_pbZero_clicked(); }
private slots:
void on_barPos_valueChanged(int value);
void on_barNeg_valueChanged(int value);
void on_barNeg_mousePressEvent(QMouseEvent*);
void on_barPos_mousePressEvent(QMouseEvent*);
void on_barNeg_mouseMoveEvent(QMouseEvent*);
void on_barPos_mouseMoveEvent(QMouseEvent*);
void on_barNeg_mousePressEvent(QMouseEvent *);
void on_barPos_mousePressEvent(QMouseEvent *);
void on_barNeg_mouseMoveEvent(QMouseEvent *);
void on_barPos_mouseMoveEvent(QMouseEvent *);
void on_pbZero_clicked();
void on_pbDec_clicked();
void on_pbInc_clicked();