2017-07-19 23:20:32 +02:00
|
|
|
#pragma once
|
2013-08-09 06:57:18 +02:00
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
2017-07-27 02:34:25 +02:00
|
|
|
QString lcFormatValue(float Value, int Precision);
|
2016-06-13 03:46:50 +02:00
|
|
|
QString lcFormatValueLocalized(float Value);
|
2016-06-14 01:57:31 +02:00
|
|
|
float lcParseValueLocalized(const QString& Value);
|
2015-01-20 00:48:46 +01:00
|
|
|
|
2013-08-09 06:57:18 +02:00
|
|
|
class lcQTreeWidgetColumnStretcher : public QObject
|
|
|
|
{
|
|
|
|
public:
|
2020-03-22 23:44:41 +01:00
|
|
|
lcQTreeWidgetColumnStretcher(QTreeWidget* TreeWidget, int ColumnToStretch);
|
2013-08-09 06:57:18 +02:00
|
|
|
|
2020-03-22 23:44:41 +01:00
|
|
|
bool eventFilter(QObject* Object, QEvent* Event) override;
|
2013-08-09 06:57:18 +02:00
|
|
|
|
|
|
|
const int m_columnToStretch;
|
|
|
|
};
|
|
|
|
|
2017-11-14 02:24:36 +01:00
|
|
|
class lcTransformLineEdit : public QLineEdit
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
lcTransformLineEdit()
|
|
|
|
: QLineEdit()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-03-22 23:44:41 +01:00
|
|
|
QSize sizeHint() const override
|
2017-11-14 02:24:36 +01:00
|
|
|
{
|
|
|
|
QFontMetrics FontMetrics(font());
|
|
|
|
|
|
|
|
int Width = FontMetrics.width(QLatin1Char('x')) * 10;
|
|
|
|
|
|
|
|
return QLineEdit::sizeHint() - QSize(Width, 0);
|
|
|
|
}
|
2018-01-01 19:14:05 +01:00
|
|
|
|
|
|
|
protected:
|
2020-03-22 23:44:41 +01:00
|
|
|
bool event(QEvent* Event) override
|
2018-01-01 19:14:05 +01:00
|
|
|
{
|
|
|
|
if (Event->type() == QEvent::ShortcutOverride)
|
|
|
|
{
|
|
|
|
QKeyEvent* KeyEvent = (QKeyEvent*)Event;
|
|
|
|
int Key = KeyEvent->key();
|
|
|
|
|
|
|
|
if (KeyEvent->modifiers() == Qt::NoModifier && Key >= Qt::Key_A && Key <= Qt::Key_Z)
|
|
|
|
Event->accept();
|
|
|
|
|
|
|
|
switch (Key)
|
|
|
|
{
|
|
|
|
case Qt::Key_Down:
|
|
|
|
case Qt::Key_Up:
|
|
|
|
case Qt::Key_Left:
|
|
|
|
case Qt::Key_Right:
|
|
|
|
case Qt::Key_Home:
|
|
|
|
case Qt::Key_End:
|
|
|
|
case Qt::Key_PageUp:
|
|
|
|
case Qt::Key_PageDown:
|
|
|
|
case Qt::Key_Plus:
|
|
|
|
case Qt::Key_Minus:
|
|
|
|
case Qt::Key_Enter:
|
|
|
|
Event->accept();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return QLineEdit::event(Event);
|
|
|
|
}
|
2017-11-14 02:24:36 +01:00
|
|
|
};
|