diff --git a/0snap/miniblink.jpg b/0snap/miniblink.jpg new file mode 100644 index 0000000..4644e5c Binary files /dev/null and b/0snap/miniblink.jpg differ diff --git a/README.md b/README.md index b127962..ee7738b 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ | 38 | designer | QtDesigner4源码 | | 39 | netserver | 网络中转服务器 | | 40 | mpvdemo | 视频流播放mpv内核 | +| 41 | miniblink | miniblink示例 | ### 二、学习群 1. **Qt交流大会群 853086607(雨田哥)** @@ -92,4 +93,5 @@ ![avatar](https://github.com/feiyangqingyun/QWidgetDemo/raw/master/0snap/key.png) ![avatar](https://github.com/feiyangqingyun/QWidgetDemo/raw/master/0snap/live.png) ![avatar](https://github.com/feiyangqingyun/QWidgetDemo/raw/master/0snap/netserver.jpg) -![avatar](https://github.com/feiyangqingyun/QWidgetDemo/raw/master/0snap/designer.png) \ No newline at end of file +![avatar](https://github.com/feiyangqingyun/QWidgetDemo/raw/master/0snap/designer.png) +![avatar](https://github.com/feiyangqingyun/QWidgetDemo/raw/master/0snap/miniblink.jpg) \ No newline at end of file diff --git a/battery/battery.cpp b/battery/battery.cpp index 8a5a909..9ef0ab1 100644 --- a/battery/battery.cpp +++ b/battery/battery.cpp @@ -13,6 +13,7 @@ Battery::Battery(QWidget *parent) : QWidget(parent) alarmValue = 30; step = 0.5; + borderWidth = 5; borderRadius = 8; bgRadius = 5; headRadius = 3; @@ -57,15 +58,15 @@ void Battery::drawBorder(QPainter *painter) { painter->save(); - qreal headWidth = width() / 10; - qreal batteryWidth = width() - headWidth; + double headWidth = width() / 15; + double batteryWidth = width() - headWidth; //绘制电池边框 - QPointF topLeft(5, 5); - QPointF bottomRight(batteryWidth, height() - 5); + QPointF topLeft(borderWidth, borderWidth); + QPointF bottomRight(batteryWidth, height() - borderWidth); batteryRect = QRectF(topLeft, bottomRight); - painter->setPen(QPen(borderColorStart, 5)); + painter->setPen(QPen(borderColorStart, borderWidth)); painter->setBrush(Qt::NoBrush); painter->drawRoundedRect(batteryRect, borderRadius, borderRadius); @@ -74,6 +75,10 @@ void Battery::drawBorder(QPainter *painter) void Battery::drawBg(QPainter *painter) { + if (value == minValue) { + return; + } + painter->save(); QLinearGradient batteryGradient(QPointF(0, 0), QPointF(0, height())); @@ -86,10 +91,10 @@ void Battery::drawBg(QPainter *painter) } int margin = qMin(width(), height()) / 20; - qreal unit = (batteryRect.width() - (margin * 2)) / 100; - qreal width = currentValue * unit; + double unit = (batteryRect.width() - (margin * 2)) / 100; + double width = currentValue * unit; QPointF topLeft(batteryRect.topLeft().x() + margin, batteryRect.topLeft().y() + margin); - QPointF bottomRight(width + margin + 5, batteryRect.bottomRight().y() - margin); + QPointF bottomRight(width + margin + borderWidth, batteryRect.bottomRight().y() - margin); QRectF rect(topLeft, bottomRight); painter->setPen(Qt::NoPen); @@ -122,13 +127,11 @@ void Battery::updateValue() { if (isForward) { currentValue -= step; - if (currentValue <= value) { timer->stop(); } } else { currentValue += step; - if (currentValue >= value) { timer->stop(); } @@ -137,31 +140,36 @@ void Battery::updateValue() this->update(); } -qreal Battery::getMinValue() const +double Battery::getMinValue() const { return this->minValue; } -qreal Battery::getMaxValue() const +double Battery::getMaxValue() const { return this->maxValue; } -qreal Battery::getValue() const +double Battery::getValue() const { return this->value; } -qreal Battery::getAlarmValue() const +double Battery::getAlarmValue() const { return this->alarmValue; } -qreal Battery::getStep() const +double Battery::getStep() const { return this->step; } +int Battery::getBorderWidth() const +{ + return this->borderWidth; +} + int Battery::getBorderRadius() const { return this->borderRadius; @@ -217,7 +225,7 @@ QSize Battery::minimumSizeHint() const return QSize(30, 10); } -void Battery::setRange(qreal minValue, qreal maxValue) +void Battery::setRange(double minValue, double maxValue) { //如果最小值大于或者等于最大值则不设置 if (minValue >= maxValue) { @@ -240,20 +248,20 @@ void Battery::setRange(qreal minValue, qreal maxValue) void Battery::setRange(int minValue, int maxValue) { - setRange((qreal)minValue, (qreal)maxValue); + setRange((double)minValue, (double)maxValue); } -void Battery::setMinValue(qreal minValue) +void Battery::setMinValue(double minValue) { setRange(minValue, maxValue); } -void Battery::setMaxValue(qreal maxValue) +void Battery::setMaxValue(double maxValue) { setRange(minValue, maxValue); } -void Battery::setValue(qreal value) +void Battery::setValue(double value) { //值和当前值一致则无需处理 if (value == this->value) { @@ -272,21 +280,24 @@ void Battery::setValue(qreal value) } else if (value < currentValue) { isForward = true; } else { + this->value = value; + this->update(); return; } this->value = value; this->update(); emit valueChanged(value); + timer->stop(); timer->start(); } void Battery::setValue(int value) { - setValue((qreal)value); + setValue((double)value); } -void Battery::setAlarmValue(qreal alarmValue) +void Battery::setAlarmValue(double alarmValue) { if (this->alarmValue != alarmValue) { this->alarmValue = alarmValue; @@ -296,10 +307,10 @@ void Battery::setAlarmValue(qreal alarmValue) void Battery::setAlarmValue(int alarmValue) { - setAlarmValue((qreal)alarmValue); + setAlarmValue((double)alarmValue); } -void Battery::setStep(qreal step) +void Battery::setStep(double step) { if (this->step != step) { this->step = step; @@ -309,7 +320,15 @@ void Battery::setStep(qreal step) void Battery::setStep(int step) { - setStep((qreal)step); + setStep((double)step); +} + +void Battery::setBorderWidth(int borderWidth) +{ + if (this->borderWidth != borderWidth) { + this->borderWidth = borderWidth; + this->update(); + } } void Battery::setBorderRadius(int borderRadius) diff --git a/battery/battery.h b/battery/battery.h index 5f92fe5..7df5486 100644 --- a/battery/battery.h +++ b/battery/battery.h @@ -14,25 +14,20 @@ #include #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT Battery : public QWidget +class Q_DECL_EXPORT Battery : public QWidget #else class Battery : public QWidget #endif { Q_OBJECT - Q_PROPERTY(qreal minValue READ getMinValue WRITE setMinValue) - Q_PROPERTY(qreal maxValue READ getMaxValue WRITE setMaxValue) - Q_PROPERTY(qreal value READ getValue WRITE setValue) - Q_PROPERTY(qreal alarmValue READ getAlarmValue WRITE setAlarmValue) + Q_PROPERTY(double minValue READ getMinValue WRITE setMinValue) + Q_PROPERTY(double maxValue READ getMaxValue WRITE setMaxValue) + Q_PROPERTY(double value READ getValue WRITE setValue) + Q_PROPERTY(double alarmValue READ getAlarmValue WRITE setAlarmValue) - Q_PROPERTY(qreal step READ getStep WRITE setStep) + Q_PROPERTY(double step READ getStep WRITE setStep) + Q_PROPERTY(int borderWidth READ getBorderWidth WRITE setBorderWidth) Q_PROPERTY(int borderRadius READ getBorderRadius WRITE setBorderRadius) Q_PROPERTY(int bgRadius READ getBgRadius WRITE setBgRadius) Q_PROPERTY(int headRadius READ getHeadRadius WRITE setHeadRadius) @@ -60,74 +55,78 @@ private slots: void updateValue(); private: - qreal minValue; //最小值 - qreal maxValue; //最大值 - qreal value; //目标电量 - qreal alarmValue; //电池电量警戒值 + double minValue; //最小值 + double maxValue; //最大值 + double value; //目标电量 + double alarmValue; //电池电量警戒值 - qreal step; //每次移动的步长 - int borderRadius; //边框圆角角度 - int bgRadius; //背景进度圆角角度 - int headRadius; //头部圆角角度 + double step; //每次移动的步长 + int borderWidth; //边框粗细 + int borderRadius; //边框圆角角度 + int bgRadius; //背景进度圆角角度 + int headRadius; //头部圆角角度 - QColor borderColorStart; //边框渐变开始颜色 - QColor borderColorEnd; //边框渐变结束颜色 + QColor borderColorStart; //边框渐变开始颜色 + QColor borderColorEnd; //边框渐变结束颜色 - QColor alarmColorStart; //电池低电量时的渐变开始颜色 - QColor alarmColorEnd; //电池低电量时的渐变结束颜色 + QColor alarmColorStart; //电池低电量时的渐变开始颜色 + QColor alarmColorEnd; //电池低电量时的渐变结束颜色 - QColor normalColorStart; //电池正常电量时的渐变开始颜色 - QColor normalColorEnd; //电池正常电量时的渐变结束颜色 + QColor normalColorStart; //电池正常电量时的渐变开始颜色 + QColor normalColorEnd; //电池正常电量时的渐变结束颜色 - bool isForward; //是否往前移 - qreal currentValue; //当前电量 - QRectF batteryRect; //电池主体区域 - QTimer *timer; //绘制定时器 + bool isForward; //是否往前移 + double currentValue; //当前电量 + QRectF batteryRect; //电池主体区域 + QTimer *timer; //绘制定时器 public: - qreal getMinValue() const; - qreal getMaxValue() const; - qreal getValue() const; - qreal getAlarmValue() const; + double getMinValue() const; + double getMaxValue() const; + double getValue() const; + double getAlarmValue() const; - qreal getStep() const; - int getBorderRadius() const; - int getBgRadius() const; - int getHeadRadius() const; + double getStep() const; + int getBorderWidth() const; + int getBorderRadius() const; + int getBgRadius() const; + int getHeadRadius() const; - QColor getBorderColorStart()const; - QColor getBorderColorEnd() const; + QColor getBorderColorStart() const; + QColor getBorderColorEnd() const; - QColor getAlarmColorStart() const; - QColor getAlarmColorEnd() const; + QColor getAlarmColorStart() const; + QColor getAlarmColorEnd() const; - QColor getNormalColorStart()const; - QColor getNormalColorEnd() const; + QColor getNormalColorStart() const; + QColor getNormalColorEnd() const; - QSize sizeHint() const; - QSize minimumSizeHint() const; + QSize sizeHint() const; + QSize minimumSizeHint() const; public Q_SLOTS: //设置范围值 - void setRange(qreal minValue, qreal maxValue); + void setRange(double minValue, double maxValue); void setRange(int minValue, int maxValue); //设置最大最小值 - void setMinValue(qreal minValue); - void setMaxValue(qreal maxValue); + void setMinValue(double minValue); + void setMaxValue(double maxValue); //设置电池电量值 - void setValue(qreal value); + void setValue(double value); void setValue(int value); //设置电池电量警戒值 - void setAlarmValue(qreal alarmValue); + void setAlarmValue(double alarmValue); void setAlarmValue(int alarmValue); //设置步长 - void setStep(qreal step); + void setStep(double step); void setStep(int step); + //设置边框粗细 + void setBorderWidth(int borderWidth); //设置边框圆角角度 void setBorderRadius(int borderRadius); //设置背景圆角角度 @@ -148,7 +147,7 @@ public Q_SLOTS: void setNormalColorEnd(const QColor &normalColorEnd); Q_SIGNALS: - void valueChanged(qreal value); + void valueChanged(double value); }; #endif // BATTERY_H diff --git a/bgdemo/widget.cpp b/bgdemo/widget.cpp index fcf8c34..4ba1eab 100644 --- a/bgdemo/widget.cpp +++ b/bgdemo/widget.cpp @@ -2,8 +2,7 @@ #include "ui_widget.h" #include "qevent.h" #include "qdebug.h" -#include -#include + Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this); @@ -24,7 +23,6 @@ bool Widget::eventFilter(QObject *watched, QEvent *evt) static int index = 1; static QPoint mousePoint; static bool mousePressed = false; - static bool is_smooth_scrolling = false; QMouseEvent *event = static_cast(evt); if (event->type() == QEvent::MouseButtonPress) { @@ -54,29 +52,5 @@ bool Widget::eventFilter(QObject *watched, QEvent *evt) } } - if (event->type() == QEvent::Wheel) { - QWheelEvent *event = static_cast(evt); - if(is_smooth_scrolling == false) { - if (event->delta() > 0) { - is_smooth_scrolling = true; - if (index == 5) { - index = 1; - } else { - index++; - } - } else if (event->delta() < 0) { - is_smooth_scrolling = true; - if (index != 1) { - index--; - } else { - index =5; - } - } - ui->widget->setStyleSheet(QString("background-image:url(:/image/%1.png);").arg(index)); - QTimer::singleShot(400, [&]() { is_smooth_scrolling = false; }); - return true; - } - } - return QWidget::eventFilter(watched, event); } diff --git a/buttondefence/buttondefence.cpp b/buttondefence/buttondefence.cpp index 3d424e8..2abc2eb 100644 --- a/buttondefence/buttondefence.cpp +++ b/buttondefence/buttondefence.cpp @@ -180,7 +180,7 @@ void ButtonDefence::setButtonStyle(const ButtonDefence::ButtonStyle &buttonStyle } else if (buttonStyle == ButtonStyle_Msg2) { type = "msg2"; } else { - type = "custom"; + type = "circle"; } setButtonStatus(buttonStatus); diff --git a/buttondefence/buttondefence.h b/buttondefence/buttondefence.h index c52f103..8c300bc 100644 --- a/buttondefence/buttondefence.h +++ b/buttondefence/buttondefence.h @@ -14,13 +14,7 @@ #include #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT ButtonDefence : public QWidget +class Q_DECL_EXPORT ButtonDefence : public QWidget #else class ButtonDefence : public QWidget #endif @@ -37,16 +31,14 @@ class ButtonDefence : public QWidget Q_PROPERTY(ButtonStatus buttonStatus READ getButtonStatus WRITE setButtonStatus) public: - //防区样式 圆形、警察、气泡、气泡2、消息、消息2、自定义 - //如果设置的自定义的,则图片拓展名 btn_defence_alarm_custom + //防区样式 圆形、警察、气泡、气泡2、消息、消息2 enum ButtonStyle { ButtonStyle_Circle = 0, ButtonStyle_Police = 1, ButtonStyle_Bubble = 2, ButtonStyle_Bubble2 = 3, ButtonStyle_Msg = 4, - ButtonStyle_Msg2 = 5, - ButtonStyle_Custom = 6 + ButtonStyle_Msg2 = 5 }; //防区状态 布防、撤防、报警、旁路、故障 diff --git a/buttondefence/frmbuttondefence.cpp b/buttondefence/frmbuttondefence.cpp index 8b505b9..03cce01 100644 --- a/buttondefence/frmbuttondefence.cpp +++ b/buttondefence/frmbuttondefence.cpp @@ -31,7 +31,7 @@ void frmButtonDefence::initForm() btn3->setText("#3"); btn3->setGeometry(85, 5, 35, 35); - btnStyle << ui->btnCircle << ui->btnPolice << ui->btnBubble << ui->btnBubble2 << ui->btnMsg << ui->btnMsg2 << ui->btnCustom; + btnStyle << ui->btnCircle << ui->btnPolice << ui->btnBubble << ui->btnBubble2 << ui->btnMsg << ui->btnMsg2; foreach (QPushButton *btn, btnStyle) { connect(btn, SIGNAL(clicked(bool)), this, SLOT(changeStyle())); } @@ -50,16 +50,6 @@ void frmButtonDefence::changeStyle() btn1->setButtonStyle(style); btn2->setButtonStyle(style); btn3->setButtonStyle(style); - - if (index == 6) { - btn1->setText(""); - btn2->setText(""); - btn3->setText(""); - } else { - btn1->setText("#1"); - btn2->setText("#2"); - btn3->setText("#3"); - } } void frmButtonDefence::changeStatus() @@ -79,10 +69,3 @@ void frmButtonDefence::on_ckCanMove_stateChanged(int arg1) btn2->setCanMove(canMove); btn3->setCanMove(canMove); } - -void frmButtonDefence::on_btnPoint_clicked() -{ - qDebug() << "btn1" << "x" << btn1->geometry().x() << "y" << btn1->geometry().y(); - qDebug() << "btn2" << "x" << btn2->geometry().x() << "y" << btn2->geometry().y(); - qDebug() << "btn3" << "x" << btn3->geometry().x() << "y" << btn3->geometry().y(); -} diff --git a/buttondefence/frmbuttondefence.h b/buttondefence/frmbuttondefence.h index 0d27758..808eb22 100644 --- a/buttondefence/frmbuttondefence.h +++ b/buttondefence/frmbuttondefence.h @@ -25,8 +25,6 @@ private slots: void changeStatus(); void on_ckCanMove_stateChanged(int arg1); - void on_btnPoint_clicked(); - private: Ui::frmButtonDefence *ui; ButtonDefence *btn1; diff --git a/buttondefence/frmbuttondefence.ui b/buttondefence/frmbuttondefence.ui index 3d0af0d..5e914fc 100644 --- a/buttondefence/frmbuttondefence.ui +++ b/buttondefence/frmbuttondefence.ui @@ -87,13 +87,6 @@ - - - - 自定义 - - - @@ -136,13 +129,6 @@ - - - - Qt::Horizontal - - - @@ -150,13 +136,6 @@ - - - - 坐标 - - - @@ -176,21 +155,6 @@ - - btnCircle - btnPolice - btnBubble - btnBubble2 - btnMsg - btnMsg2 - btnCustom - btnArming - btnDisarming - btnAlarm - btnBypass - btnError - ckCanMove - diff --git a/buttondefence/main.qrc b/buttondefence/main.qrc index 2c02e87..562ef7e 100644 --- a/buttondefence/main.qrc +++ b/buttondefence/main.qrc @@ -31,10 +31,5 @@ image/btn_defence_error_msg2.png image/btn_defence_error_police.png image/bg_call.jpg - image/btn_defence_alarm_custom.png - image/btn_defence_arming_custom.png - image/btn_defence_bypass_custom.png - image/btn_defence_disarming_custom.png - image/btn_defence_error_custom.png diff --git a/colorwidget/colorwidget.cpp b/colorwidget/colorwidget.cpp index 192cadd..557f80e 100644 --- a/colorwidget/colorwidget.cpp +++ b/colorwidget/colorwidget.cpp @@ -105,7 +105,7 @@ ColorWidget::ColorWidget(QWidget *parent) : QWidget(parent) } ColorWidget::~ColorWidget() -{ +{ } void ColorWidget::mousePressEvent(QMouseEvent *e) @@ -128,10 +128,7 @@ void ColorWidget::showColorValue() int x = QCursor::pos().x(); int y = QCursor::pos().y(); - txtPoint->setText(tr("x:%1 y:%2").arg(x).arg(y)); - QString strDecimalValue, strHex, strTextColor; - int red, green, blue; #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) QPixmap pixmap = QPixmap::grabWindow(QApplication::desktop()->winId(), x, y, 2, 2); @@ -140,9 +137,10 @@ void ColorWidget::showColorValue() QPixmap pixmap = screen->grabWindow(QApplication::desktop()->winId(), x, y, 2, 2); #endif + int red, green, blue; + QString strDecimalValue, strHex; if (!pixmap.isNull()) { QImage image = pixmap.toImage(); - if (!image.isNull()) { if (image.valid(0, 0)) { QColor color = image.pixel(0, 0); @@ -159,13 +157,12 @@ void ColorWidget::showColorValue() } } - if (red > 200 && green > 200 && blue > 200) { - strTextColor = "10, 10, 10"; - } else { - strTextColor = "255, 255, 255"; - } + //根据背景色自动计算合适的前景色 + QColor color(red, green, blue); + double gray = (0.299 * color.red() + 0.587 * color.green() + 0.114 * color.blue()) / 255; + QColor textColor = gray > 0.5 ? Qt::black : Qt::white; - QString str = tr("background-color: rgb(%1);color: rgb(%2)").arg(strDecimalValue).arg(strTextColor); + QString str = tr("background:rgb(%1);color:%2").arg(strDecimalValue).arg(textColor.name()); labColor->setStyleSheet(str); txtRgb->setText(strDecimalValue); txtWeb->setText(strHex); diff --git a/colorwidget/colorwidget.h b/colorwidget/colorwidget.h index faa2934..bc6f927 100644 --- a/colorwidget/colorwidget.h +++ b/colorwidget/colorwidget.h @@ -9,13 +9,7 @@ class QLabel; class QLineEdit; #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT ColorWidget : public QWidget +class Q_DECL_EXPORT ColorWidget : public QWidget #else class ColorWidget : public QWidget #endif diff --git a/comtool/api/quiwidget.cpp b/comtool/api/quiwidget.cpp index 9949ecb..8adaa68 100644 --- a/comtool/api/quiwidget.cpp +++ b/comtool/api/quiwidget.cpp @@ -528,6 +528,11 @@ QUIMessageBox::~QUIMessageBox() delete widgetMain; } +void QUIMessageBox::showEvent(QShowEvent *) +{ + this->activateWindow(); +} + void QUIMessageBox::closeEvent(QCloseEvent *) { closeSec = 0; @@ -567,6 +572,7 @@ void QUIMessageBox::initControl() verticalLayout1->setSpacing(0); verticalLayout1->setObjectName(QString::fromUtf8("verticalLayout1")); verticalLayout1->setContentsMargins(1, 1, 1, 1); + widgetTitle = new QWidget(this); widgetTitle->setObjectName(QString::fromUtf8("widgetTitle")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); @@ -574,10 +580,12 @@ void QUIMessageBox::initControl() sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(widgetTitle->sizePolicy().hasHeightForWidth()); widgetTitle->setSizePolicy(sizePolicy); + horizontalLayout3 = new QHBoxLayout(widgetTitle); horizontalLayout3->setSpacing(0); horizontalLayout3->setObjectName(QString::fromUtf8("horizontalLayout3")); horizontalLayout3->setContentsMargins(0, 0, 0, 0); + labIco = new QLabel(widgetTitle); labIco->setObjectName(QString::fromUtf8("labIco")); QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Preferred); @@ -586,34 +594,33 @@ void QUIMessageBox::initControl() sizePolicy1.setHeightForWidth(labIco->sizePolicy().hasHeightForWidth()); labIco->setSizePolicy(sizePolicy1); labIco->setAlignment(Qt::AlignCenter); - horizontalLayout3->addWidget(labIco); labTitle = new QLabel(widgetTitle); labTitle->setObjectName(QString::fromUtf8("labTitle")); labTitle->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); - horizontalLayout3->addWidget(labTitle); - labTime = new QLabel(widgetTitle); - labTime->setObjectName(QString::fromUtf8("labTime")); + labCountDown = new QLabel(widgetTitle); + labCountDown->setObjectName(QString::fromUtf8("labCountDown")); QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Preferred); sizePolicy2.setHorizontalStretch(0); sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(labTime->sizePolicy().hasHeightForWidth()); - labTime->setSizePolicy(sizePolicy2); - labTime->setAlignment(Qt::AlignCenter); - - horizontalLayout3->addWidget(labTime); + sizePolicy2.setHeightForWidth(labCountDown->sizePolicy().hasHeightForWidth()); + labCountDown->setSizePolicy(sizePolicy2); + labCountDown->setAlignment(Qt::AlignCenter); + horizontalLayout3->addWidget(labCountDown); widgetMenu = new QWidget(widgetTitle); widgetMenu->setObjectName(QString::fromUtf8("widgetMenu")); sizePolicy1.setHeightForWidth(widgetMenu->sizePolicy().hasHeightForWidth()); widgetMenu->setSizePolicy(sizePolicy1); + horizontalLayout4 = new QHBoxLayout(widgetMenu); horizontalLayout4->setSpacing(0); horizontalLayout4->setObjectName(QString::fromUtf8("horizontalLayout4")); horizontalLayout4->setContentsMargins(0, 0, 0, 0); + btnMenu_Close = new QPushButton(widgetMenu); btnMenu_Close->setObjectName(QString::fromUtf8("btnMenu_Close")); QSizePolicy sizePolicy3(QSizePolicy::Minimum, QSizePolicy::Expanding); @@ -631,22 +638,27 @@ void QUIMessageBox::initControl() widgetMain = new QWidget(this); widgetMain->setObjectName(QString::fromUtf8("widgetMainQUI")); + verticalLayout2 = new QVBoxLayout(widgetMain); verticalLayout2->setSpacing(5); verticalLayout2->setObjectName(QString::fromUtf8("verticalLayout2")); verticalLayout2->setContentsMargins(5, 5, 5, 5); + frame = new QFrame(widgetMain); frame->setObjectName(QString::fromUtf8("frame")); frame->setFrameShape(QFrame::Box); frame->setFrameShadow(QFrame::Sunken); - verticalLayout4 = new QVBoxLayout(frame); - verticalLayout4->setObjectName(QString::fromUtf8("verticalLayout4")); - verticalLayout4->setContentsMargins(-1, 9, -1, -1); - horizontalLayout1 = new QHBoxLayout(); - horizontalLayout1->setObjectName(QString::fromUtf8("horizontalLayout1")); + labIcoMain = new QLabel(frame); labIcoMain->setObjectName(QString::fromUtf8("labIcoMain")); labIcoMain->setAlignment(Qt::AlignCenter); + + verticalLayout4 = new QVBoxLayout(frame); + verticalLayout4->setObjectName(QString::fromUtf8("verticalLayout4")); + verticalLayout4->setContentsMargins(-1, 9, -1, -1); + + horizontalLayout1 = new QHBoxLayout(); + horizontalLayout1->setObjectName(QString::fromUtf8("horizontalLayout1")); horizontalLayout1->addWidget(labIcoMain); horizontalSpacer1 = new QSpacerItem(5, 0, QSizePolicy::Minimum, QSizePolicy::Minimum); horizontalLayout1->addItem(horizontalSpacer1); @@ -673,14 +685,13 @@ void QUIMessageBox::initControl() btnOk->setObjectName(QString::fromUtf8("btnOk")); btnOk->setMinimumSize(QSize(85, 0)); btnOk->setFocusPolicy(Qt::StrongFocus); - btnOk->setIcon(QIcon(":/image/btn_ok.png")); horizontalLayout2->addWidget(btnOk); + btnOk->setDefault(true); btnCancel = new QPushButton(frame); btnCancel->setObjectName(QString::fromUtf8("btnCancel")); btnCancel->setMinimumSize(QSize(85, 0)); btnCancel->setFocusPolicy(Qt::StrongFocus); - btnCancel->setIcon(QIcon(":/image/btn_close.png")); horizontalLayout2->addWidget(btnCancel); verticalLayout4->addLayout(horizontalLayout2); @@ -693,6 +704,8 @@ void QUIMessageBox::initControl() btnOk->setText("确定"); btnCancel->setText("取消"); + QUIHelper::setIconBtn(btnOk, ":/image/btn_ok.png", 0xf00c); + QUIHelper::setIconBtn(btnCancel, ":/image/btn_close.png", 0xf00d); connect(btnOk, SIGNAL(clicked()), this, SLOT(on_btnOk_clicked())); connect(btnCancel, SIGNAL(clicked()), this, SLOT(on_btnMenu_Close_clicked())); @@ -746,7 +759,7 @@ void QUIMessageBox::checkSec() } QString str = QString("关闭倒计时 %1 s").arg(closeSec - currentSec + 1); - this->labTime->setText(str); + this->labCountDown->setText(str); } void QUIMessageBox::on_btnOk_clicked() @@ -766,40 +779,33 @@ void QUIMessageBox::setIconMain(const QChar &str, quint32 size) IconHelper::Instance()->setIcon(this->labIco, str, size); } +void QUIMessageBox::setIconMsg(const QString &png, const QChar &str) +{ + //图片存在则取图片,不存在则取图形字体 + int size = this->labIcoMain->size().height(); + if (QImage(png).isNull()) { + IconHelper::Instance()->setIcon(this->labIcoMain, str, size); + } else { + this->labIcoMain->setStyleSheet(QString("border-image:url(%1);").arg(png)); + } +} + void QUIMessageBox::setMessage(const QString &msg, int type, int closeSec) { this->closeSec = closeSec; this->currentSec = 0; - this->labTime->clear(); + this->labCountDown->clear(); checkSec(); - //图片存在则取图片,不存在则取图形字体 - int size = this->labIcoMain->size().height(); - bool exist = !QImage(":/image/msg_info.png").isNull(); if (type == 0) { - if (exist) { - this->labIcoMain->setStyleSheet("border-image: url(:/image/msg_info.png);"); - } else { - IconHelper::Instance()->setIcon(this->labIcoMain, 0xf05a, size); - } - + setIconMsg(":/image/msg_info.png", 0xf05a); this->btnCancel->setVisible(false); this->labTitle->setText("提示"); } else if (type == 1) { - if (exist) { - this->labIcoMain->setStyleSheet("border-image: url(:/image/msg_question.png);"); - } else { - IconHelper::Instance()->setIcon(this->labIcoMain, 0xf059, size); - } - + setIconMsg(":/image/msg_question.png", 0xf059); this->labTitle->setText("询问"); } else if (type == 2) { - if (exist) { - this->labIcoMain->setStyleSheet("border-image: url(:/image/msg_error.png);"); - } else { - IconHelper::Instance()->setIcon(this->labIcoMain, 0xf057, size); - } - + setIconMsg(":/image/msg_error.png", 0xf057); this->btnCancel->setVisible(false); this->labTitle->setText("错误"); } @@ -841,6 +847,11 @@ QUITipBox::~QUITipBox() delete widgetMain; } +void QUITipBox::showEvent(QShowEvent *) +{ + this->activateWindow(); +} + void QUITipBox::closeEvent(QCloseEvent *) { closeSec = 0; @@ -880,6 +891,7 @@ void QUITipBox::initControl() verticalLayout->setSpacing(0); verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); verticalLayout->setContentsMargins(1, 1, 1, 1); + widgetTitle = new QWidget(this); widgetTitle->setObjectName(QString::fromUtf8("widgetTitle")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); @@ -887,10 +899,12 @@ void QUITipBox::initControl() sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(widgetTitle->sizePolicy().hasHeightForWidth()); widgetTitle->setSizePolicy(sizePolicy); + horizontalLayout2 = new QHBoxLayout(widgetTitle); horizontalLayout2->setSpacing(0); horizontalLayout2->setObjectName(QString::fromUtf8("horizontalLayout2")); horizontalLayout2->setContentsMargins(0, 0, 0, 0); + labIco = new QLabel(widgetTitle); labIco->setObjectName(QString::fromUtf8("labIco")); labIco->setAlignment(Qt::AlignCenter); @@ -901,15 +915,15 @@ void QUITipBox::initControl() labTitle->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); horizontalLayout2->addWidget(labTitle); - labTime = new QLabel(widgetTitle); - labTime->setObjectName(QString::fromUtf8("labTime")); + labCountDown = new QLabel(widgetTitle); + labCountDown->setObjectName(QString::fromUtf8("labCountDown")); QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Preferred); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(labTime->sizePolicy().hasHeightForWidth()); - labTime->setSizePolicy(sizePolicy1); - labTime->setAlignment(Qt::AlignCenter); - horizontalLayout2->addWidget(labTime); + sizePolicy1.setHeightForWidth(labCountDown->sizePolicy().hasHeightForWidth()); + labCountDown->setSizePolicy(sizePolicy1); + labCountDown->setAlignment(Qt::AlignCenter); + horizontalLayout2->addWidget(labCountDown); widgetMenu = new QWidget(widgetTitle); widgetMenu->setObjectName(QString::fromUtf8("widgetMenu")); @@ -918,10 +932,12 @@ void QUITipBox::initControl() sizePolicy2.setVerticalStretch(0); sizePolicy2.setHeightForWidth(widgetMenu->sizePolicy().hasHeightForWidth()); widgetMenu->setSizePolicy(sizePolicy2); + horizontalLayout = new QHBoxLayout(widgetMenu); horizontalLayout->setSpacing(0); horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); horizontalLayout->setContentsMargins(0, 0, 0, 0); + btnMenu_Close = new QPushButton(widgetMenu); btnMenu_Close->setObjectName(QString::fromUtf8("btnMenu_Close")); QSizePolicy sizePolicy3(QSizePolicy::Minimum, QSizePolicy::Expanding); @@ -940,11 +956,14 @@ void QUITipBox::initControl() widgetMain = new QWidget(this); widgetMain->setObjectName(QString::fromUtf8("widgetMainQUI")); widgetMain->setAutoFillBackground(true); - verticalLayout2 = new QVBoxLayout(widgetMain); - verticalLayout2->setObjectName(QString::fromUtf8("verticalLayout2")); + labInfo = new QLabel(widgetMain); labInfo->setObjectName(QString::fromUtf8("labInfo")); labInfo->setScaledContents(true); + labInfo->setWordWrap(true); + + verticalLayout2 = new QVBoxLayout(widgetMain); + verticalLayout2->setObjectName(QString::fromUtf8("verticalLayout2")); verticalLayout2->addWidget(labInfo); verticalLayout->addWidget(widgetMain); @@ -997,7 +1016,7 @@ void QUITipBox::checkSec() } QString str = QString("关闭倒计时 %1 s").arg(closeSec - currentSec + 1); - this->labTime->setText(str); + this->labCountDown->setText(str); } void QUITipBox::on_btnMenu_Close_clicked() @@ -1015,7 +1034,7 @@ void QUITipBox::setTip(const QString &title, const QString &tip, bool fullScreen { this->closeSec = closeSec; this->currentSec = 0; - this->labTime->clear(); + this->labCountDown->clear(); checkSec(); this->fullScreen = fullScreen; @@ -1096,6 +1115,7 @@ void QUIInputBox::initControl() verticalLayout1->setSpacing(0); verticalLayout1->setObjectName(QString::fromUtf8("verticalLayout1")); verticalLayout1->setContentsMargins(1, 1, 1, 1); + widgetTitle = new QWidget(this); widgetTitle->setObjectName(QString::fromUtf8("widgetTitle")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); @@ -1103,10 +1123,12 @@ void QUIInputBox::initControl() sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(widgetTitle->sizePolicy().hasHeightForWidth()); widgetTitle->setSizePolicy(sizePolicy); + horizontalLayout1 = new QHBoxLayout(widgetTitle); horizontalLayout1->setSpacing(0); horizontalLayout1->setObjectName(QString::fromUtf8("horizontalLayout1")); horizontalLayout1->setContentsMargins(0, 0, 0, 0); + labIco = new QLabel(widgetTitle); labIco->setObjectName(QString::fromUtf8("labIco")); QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Preferred); @@ -1115,34 +1137,33 @@ void QUIInputBox::initControl() sizePolicy1.setHeightForWidth(labIco->sizePolicy().hasHeightForWidth()); labIco->setSizePolicy(sizePolicy1); labIco->setAlignment(Qt::AlignCenter); - horizontalLayout1->addWidget(labIco); labTitle = new QLabel(widgetTitle); labTitle->setObjectName(QString::fromUtf8("labTitle")); labTitle->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); - horizontalLayout1->addWidget(labTitle); - labTime = new QLabel(widgetTitle); - labTime->setObjectName(QString::fromUtf8("labTime")); + labCountDown = new QLabel(widgetTitle); + labCountDown->setObjectName(QString::fromUtf8("labCountDown")); QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Preferred); sizePolicy2.setHorizontalStretch(0); sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(labTime->sizePolicy().hasHeightForWidth()); - labTime->setSizePolicy(sizePolicy2); - labTime->setAlignment(Qt::AlignCenter); - - horizontalLayout1->addWidget(labTime); + sizePolicy2.setHeightForWidth(labCountDown->sizePolicy().hasHeightForWidth()); + labCountDown->setSizePolicy(sizePolicy2); + labCountDown->setAlignment(Qt::AlignCenter); + horizontalLayout1->addWidget(labCountDown); widgetMenu = new QWidget(widgetTitle); widgetMenu->setObjectName(QString::fromUtf8("widgetMenu")); sizePolicy1.setHeightForWidth(widgetMenu->sizePolicy().hasHeightForWidth()); widgetMenu->setSizePolicy(sizePolicy1); + horizontalLayout2 = new QHBoxLayout(widgetMenu); horizontalLayout2->setSpacing(0); horizontalLayout2->setObjectName(QString::fromUtf8("horizontalLayout2")); horizontalLayout2->setContentsMargins(0, 0, 0, 0); + btnMenu_Close = new QPushButton(widgetMenu); btnMenu_Close->setObjectName(QString::fromUtf8("btnMenu_Close")); QSizePolicy sizePolicy3(QSizePolicy::Minimum, QSizePolicy::Expanding); @@ -1160,20 +1181,24 @@ void QUIInputBox::initControl() widgetMain = new QWidget(this); widgetMain->setObjectName(QString::fromUtf8("widgetMainQUI")); + verticalLayout2 = new QVBoxLayout(widgetMain); verticalLayout2->setSpacing(5); verticalLayout2->setObjectName(QString::fromUtf8("verticalLayout2")); verticalLayout2->setContentsMargins(5, 5, 5, 5); + frame = new QFrame(widgetMain); frame->setObjectName(QString::fromUtf8("frame")); frame->setFrameShape(QFrame::Box); frame->setFrameShadow(QFrame::Sunken); - verticalLayout3 = new QVBoxLayout(frame); - verticalLayout3->setObjectName(QString::fromUtf8("verticalLayout3")); + labInfo = new QLabel(frame); labInfo->setObjectName(QString::fromUtf8("labInfo")); labInfo->setScaledContents(false); labInfo->setWordWrap(true); + + verticalLayout3 = new QVBoxLayout(frame); + verticalLayout3->setObjectName(QString::fromUtf8("verticalLayout3")); verticalLayout3->addWidget(labInfo); txtValue = new QLineEdit(frame); @@ -1192,13 +1217,12 @@ void QUIInputBox::initControl() btnOk = new QPushButton(frame); btnOk->setObjectName(QString::fromUtf8("btnOk")); btnOk->setMinimumSize(QSize(85, 0)); - btnOk->setIcon(QIcon(":/image/btn_ok.png")); lay->addWidget(btnOk); + btnOk->setDefault(true); btnCancel = new QPushButton(frame); btnCancel->setObjectName(QString::fromUtf8("btnCancel")); btnCancel->setMinimumSize(QSize(85, 0)); - btnCancel->setIcon(QIcon(":/image/btn_close.png")); lay->addWidget(btnCancel); verticalLayout3->addLayout(lay); @@ -1211,6 +1235,8 @@ void QUIInputBox::initControl() labTitle->setText("输入框"); btnOk->setText("确定"); btnCancel->setText("取消"); + QUIHelper::setIconBtn(btnOk, ":/image/btn_ok.png", 0xf00c); + QUIHelper::setIconBtn(btnCancel, ":/image/btn_close.png", 0xf00d); connect(btnOk, SIGNAL(clicked()), this, SLOT(on_btnOk_clicked())); connect(btnCancel, SIGNAL(clicked()), this, SLOT(on_btnMenu_Close_clicked())); @@ -1264,7 +1290,7 @@ void QUIInputBox::checkSec() } QString str = QString("关闭倒计时 %1 s").arg(closeSec - currentSec + 1); - this->labTime->setText(str); + this->labCountDown->setText(str); } void QUIInputBox::setParameter(const QString &title, int type, int closeSec, @@ -1273,7 +1299,7 @@ void QUIInputBox::setParameter(const QString &title, int type, int closeSec, { this->closeSec = closeSec; this->currentSec = 0; - this->labTime->clear(); + this->labCountDown->clear(); this->labInfo->setText(title); checkSec(); @@ -1377,6 +1403,11 @@ QUIDateSelect::~QUIDateSelect() delete widgetMain; } +void QUIDateSelect::showEvent(QShowEvent *) +{ + this->activateWindow(); +} + bool QUIDateSelect::eventFilter(QObject *watched, QEvent *event) { static QPoint mousePoint; @@ -1410,6 +1441,7 @@ void QUIDateSelect::initControl() verticalLayout->setSpacing(0); verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); verticalLayout->setContentsMargins(1, 1, 1, 1); + widgetTitle = new QWidget(this); widgetTitle->setObjectName(QString::fromUtf8("widgetTitle")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); @@ -1417,10 +1449,12 @@ void QUIDateSelect::initControl() sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(widgetTitle->sizePolicy().hasHeightForWidth()); widgetTitle->setSizePolicy(sizePolicy); + horizontalLayout1 = new QHBoxLayout(widgetTitle); horizontalLayout1->setSpacing(0); horizontalLayout1->setObjectName(QString::fromUtf8("horizontalLayout1")); horizontalLayout1->setContentsMargins(0, 0, 0, 0); + labIco = new QLabel(widgetTitle); labIco->setObjectName(QString::fromUtf8("labIco")); QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Preferred); @@ -1445,10 +1479,12 @@ void QUIDateSelect::initControl() widgetMenu->setObjectName(QString::fromUtf8("widgetMenu")); sizePolicy1.setHeightForWidth(widgetMenu->sizePolicy().hasHeightForWidth()); widgetMenu->setSizePolicy(sizePolicy1); + horizontalLayout = new QHBoxLayout(widgetMenu); horizontalLayout->setSpacing(0); horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); horizontalLayout->setContentsMargins(0, 0, 0, 0); + btnMenu_Close = new QPushButton(widgetMenu); btnMenu_Close->setObjectName(QString::fromUtf8("btnMenu_Close")); QSizePolicy sizePolicy3(QSizePolicy::Minimum, QSizePolicy::Expanding); @@ -1466,14 +1502,17 @@ void QUIDateSelect::initControl() widgetMain = new QWidget(this); widgetMain->setObjectName(QString::fromUtf8("widgetMainQUI")); + verticalLayout1 = new QVBoxLayout(widgetMain); verticalLayout1->setSpacing(6); verticalLayout1->setObjectName(QString::fromUtf8("verticalLayout1")); verticalLayout1->setContentsMargins(6, 6, 6, 6); + frame = new QFrame(widgetMain); frame->setObjectName(QString::fromUtf8("frame")); frame->setFrameShape(QFrame::Box); frame->setFrameShadow(QFrame::Sunken); + gridLayout = new QGridLayout(frame); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); labStart = new QLabel(frame); @@ -1486,8 +1525,8 @@ void QUIDateSelect::initControl() btnOk->setMinimumSize(QSize(85, 0)); btnOk->setCursor(QCursor(Qt::PointingHandCursor)); btnOk->setFocusPolicy(Qt::StrongFocus); - btnOk->setIcon(QIcon(":/image/btn_ok.png")); gridLayout->addWidget(btnOk, 0, 2, 1, 1); + btnOk->setDefault(true); labEnd = new QLabel(frame); labEnd->setObjectName(QString::fromUtf8("labEnd")); @@ -1499,7 +1538,6 @@ void QUIDateSelect::initControl() btnClose->setMinimumSize(QSize(85, 0)); btnClose->setCursor(QCursor(Qt::PointingHandCursor)); btnClose->setFocusPolicy(Qt::StrongFocus); - btnClose->setIcon(QIcon(":/image/btn_close.png")); gridLayout->addWidget(btnClose, 1, 2, 1, 1); dateStart = new QDateTimeEdit(frame); @@ -1533,6 +1571,8 @@ void QUIDateSelect::initControl() labEnd->setText("结束时间"); btnOk->setText("确定"); btnClose->setText("关闭"); + QUIHelper::setIconBtn(btnOk, ":/image/btn_ok.png", 0xf00c); + QUIHelper::setIconBtn(btnClose, ":/image/btn_close.png", 0xf00d); dateStart->setDate(QDate::currentDate()); dateEnd->setDate(QDate::currentDate().addDays(1)); @@ -2138,6 +2178,22 @@ void QUIHelper::initFile(const QString &sourceName, const QString &targetName) } } +void QUIHelper::setIconBtn(QAbstractButton *btn, const QString &png, const QChar &str) +{ + int size = 16; + int width = 18; + int height = 18; + QPixmap pix; + if (QPixmap(png).isNull()) { + pix = IconHelper::Instance()->getPixmap(QUIConfig::TextColor, str, size, width, height); + } else { + pix = QPixmap(png); + } + + btn->setIconSize(QSize(width, height)); + btn->setIcon(QIcon(pix)); +} + void QUIHelper::newDir(const QString &dirName) { QString strDir = dirName; @@ -2575,6 +2631,26 @@ bool QUIHelper::isEmail(const QString &email) return true; } +QString QUIHelper::ipv4IntToString(quint32 ip) +{ + QString result = QString("%1.%2.%3.%4").arg((ip >> 24) & 0xFF).arg((ip >> 16) & 0xFF).arg((ip >> 8) & 0xFF).arg(ip & 0xFF); + return result; +} + +quint32 QUIHelper::ipv4StringToInt(const QString &ip) +{ + int result = 0; + if (isIP(ip)) { + QStringList list = ip.split("."); + int ip0 = list.at(0).toInt(); + int ip1 = list.at(1).toInt(); + int ip2 = list.at(2).toInt(); + int ip3 = list.at(3).toInt(); + result = ip3 | ip2 << 8 | ip1 << 16 | ip0 << 24; + } + return result; +} + int QUIHelper::strHexToDecimal(const QString &strHex) { bool ok; @@ -3509,7 +3585,7 @@ bool QUIHelper::isWebOk() return ipLive("115.239.211.112", 80); } -void QUIHelper::initTableView(QTableView *tableView, int rowHeight, bool headVisible, bool edit) +void QUIHelper::initTableView(QTableView *tableView, int rowHeight, bool headVisible, bool edit, bool stretchLast) { //取消自动换行 tableView->setWordWrap(false); @@ -3522,7 +3598,7 @@ void QUIHelper::initTableView(QTableView *tableView, int rowHeight, bool headVis //选中一行表头是否加粗 tableView->horizontalHeader()->setHighlightSections(false); //最后一行拉伸填充 - tableView->horizontalHeader()->setStretchLastSection(true); + tableView->horizontalHeader()->setStretchLastSection(stretchLast); //行标题最小宽度尺寸 tableView->horizontalHeader()->setMinimumSectionSize(0); //行标题最大高度 diff --git a/comtool/api/quiwidget.h b/comtool/api/quiwidget.h index e660b01..f82981c 100644 --- a/comtool/api/quiwidget.h +++ b/comtool/api/quiwidget.h @@ -71,33 +71,33 @@ class QUIWidget : public QDialog public: //将部分对象作为枚举值暴露给外部 enum Widget { - Lab_Ico = 0, //左上角图标 - BtnMenu = 1, //下拉菜单按钮 - BtnMenu_Min = 2, //最小化按钮 - BtnMenu_Max = 3, //最大化按钮 - BtnMenu_Normal = 4, //还原按钮 - BtnMenu_Close = 5 //关闭按钮 + Lab_Ico = 0, //左上角图标 + BtnMenu = 1, //下拉菜单按钮 + BtnMenu_Min = 2, //最小化按钮 + BtnMenu_Max = 3, //最大化按钮 + BtnMenu_Normal = 4, //还原按钮 + BtnMenu_Close = 5 //关闭按钮 }; //样式枚举 enum Style { - Style_Silvery = 0, //银色样式 - Style_Blue = 1, //蓝色样式 - Style_LightBlue = 2, //淡蓝色样式 - Style_DarkBlue = 3, //深蓝色样式 - Style_Gray = 4, //灰色样式 - Style_LightGray = 5, //浅灰色样式 - Style_DarkGray = 6, //深灰色样式 - Style_Black = 7, //黑色样式 - Style_LightBlack = 8, //浅黑色样式 - Style_DarkBlack = 9, //深黑色样式 - Style_PSBlack = 10, //PS黑色样式 - Style_FlatBlack = 11, //黑色扁平样式 - Style_FlatWhite = 12, //白色扁平样式 - Style_FlatBlue = 13, //蓝色扁平样式 - Style_Purple = 14, //紫色样式 - Style_BlackBlue = 15, //黑蓝色样式 - Style_BlackVideo = 16 //视频监控黑色样式 + Style_Silvery = 0, //银色样式 + Style_Blue = 1, //蓝色样式 + Style_LightBlue = 2, //淡蓝色样式 + Style_DarkBlue = 3, //深蓝色样式 + Style_Gray = 4, //灰色样式 + Style_LightGray = 5, //浅灰色样式 + Style_DarkGray = 6, //深灰色样式 + Style_Black = 7, //黑色样式 + Style_LightBlack = 8, //浅黑色样式 + Style_DarkBlack = 9, //深黑色样式 + Style_PSBlack = 10, //PS黑色样式 + Style_FlatBlack = 11, //黑色扁平样式 + Style_FlatWhite = 12, //白色扁平样式 + Style_FlatBlue = 13, //蓝色扁平样式 + Style_Purple = 14, //紫色样式 + Style_BlackBlue = 15, //黑蓝色样式 + Style_BlackVideo = 16 //视频监控黑色样式 }; public: @@ -125,11 +125,11 @@ private: QVBoxLayout *verticalLayout3; private: - QString title; //标题 - Qt::Alignment alignment; //标题文本对齐 - bool minHide; //最小化隐藏 - bool exitAll; //退出整个程序 - QWidget *mainWidget; //主窗体对象 + QString title; //标题 + Qt::Alignment alignment;//标题文本对齐 + bool minHide; //最小化隐藏 + bool exitAll; //退出整个程序 + QWidget *mainWidget; //主窗体对象 public: QLabel *getLabIco() const; @@ -148,9 +148,9 @@ public: QSize minimumSizeHint() const; private slots: - void initControl(); //初始化控件 - void initForm(); //初始化窗体 - void changeStyle(); //更换样式 + void initControl(); //初始化控件 + void initForm(); //初始化窗体 + void changeStyle(); //更换样式 private slots: void on_btnMenu_Min_clicked(); @@ -202,6 +202,7 @@ public: ~QUIMessageBox(); protected: + void showEvent(QShowEvent *); void closeEvent(QCloseEvent *); bool eventFilter(QObject *watched, QEvent *event); @@ -213,7 +214,7 @@ private: QHBoxLayout *horizontalLayout3; QLabel *labIco; QLabel *labTitle; - QLabel *labTime; + QLabel *labCountDown; QWidget *widgetMenu; QHBoxLayout *horizontalLayout4; QPushButton *btnMenu_Close; @@ -231,13 +232,13 @@ private: QPushButton *btnCancel; private: - int closeSec; //总显示时间 - int currentSec; //当前已显示时间 + int closeSec; //总显示时间 + int currentSec; //当前已显示时间 private slots: - void initControl(); //初始化控件 - void initForm(); //初始化窗体 - void checkSec(); //校验倒计时 + void initControl(); //初始化控件 + void initForm(); //初始化窗体 + void checkSec(); //校验倒计时 private slots: void on_btnOk_clicked(); @@ -245,6 +246,7 @@ private slots: public Q_SLOTS: void setIconMain(const QChar &str, quint32 size = 12); + void setIconMsg(const QString &png, const QChar &str); void setMessage(const QString &msg, int type, int closeSec = 0); }; @@ -259,6 +261,7 @@ public: ~QUITipBox(); protected: + void showEvent(QShowEvent *); void closeEvent(QCloseEvent *); bool eventFilter(QObject *watched, QEvent *event); @@ -270,7 +273,7 @@ private: QHBoxLayout *horizontalLayout2; QLabel *labIco; QLabel *labTitle; - QLabel *labTime; + QLabel *labCountDown; QWidget *widgetMenu; QHBoxLayout *horizontalLayout; QPushButton *btnMenu_Close; @@ -282,13 +285,13 @@ private: bool fullScreen; private: - int closeSec; //总显示时间 - int currentSec; //当前已显示时间 + int closeSec; //总显示时间 + int currentSec; //当前已显示时间 private slots: - void initControl(); //初始化控件 - void initForm(); //初始化窗体 - void checkSec(); //校验倒计时 + void initControl(); //初始化控件 + void initForm(); //初始化窗体 + void checkSec(); //校验倒计时 private slots: void on_btnMenu_Close_clicked(); @@ -323,7 +326,7 @@ private: QHBoxLayout *horizontalLayout1; QLabel *labIco; QLabel *labTitle; - QLabel *labTime; + QLabel *labCountDown; QWidget *widgetMenu; QHBoxLayout *horizontalLayout2; QPushButton *btnMenu_Close; @@ -340,14 +343,14 @@ private: QPushButton *btnCancel; private: - int closeSec; //总显示时间 - int currentSec; //当前已显示时间 - QString value; //当前值 + int closeSec; //总显示时间 + int currentSec; //当前已显示时间 + QString value; //当前值 private slots: - void initControl(); //初始化控件 - void initForm(); //初始化窗体 - void checkSec(); //校验倒计时 + void initControl(); //初始化控件 + void initForm(); //初始化窗体 + void checkSec(); //校验倒计时 private slots: void on_btnOk_clicked(); @@ -375,6 +378,7 @@ public: ~QUIDateSelect(); protected: + void showEvent(QShowEvent *); bool eventFilter(QObject *watched, QEvent *event); private: @@ -400,13 +404,13 @@ private: QDateTimeEdit *dateEnd; private: - QString startDateTime; //开始时间 - QString endDateTime; //结束时间 - QString format; //日期时间格式 + QString startDateTime; //开始时间 + QString endDateTime; //结束时间 + QString format; //日期时间格式 private slots: - void initControl(); //初始化控件 - void initForm(); //初始化窗体 + void initControl(); //初始化控件 + void initForm(); //初始化窗体 private slots: void on_btnOk_clicked(); @@ -595,6 +599,9 @@ public: //初始化文件,不存在则拷贝 static void initFile(const QString &sourceName, const QString &targetName); + //设置图标到按钮 + static void setIconBtn(QAbstractButton *btn, const QString &png, const QChar &str); + //新建目录 static void newDir(const QString &dirName); @@ -653,6 +660,10 @@ public: //判断是否是合法的邮箱地址 static bool isEmail(const QString &email); + //IP地址字符串与整型转换 + static QString ipv4IntToString(quint32 ip); + static quint32 ipv4StringToInt(const QString &ip); + //16进制字符串转10进制 static int strHexToDecimal(const QString &strHex); //10进制字符串转10进制 @@ -755,7 +766,9 @@ public: static bool isWebOk(); //初始化表格 - static void initTableView(QTableView *tableView, int rowHeight = 25, bool headVisible = false, bool edit = false); + static void initTableView(QTableView *tableView, int rowHeight = 25, + bool headVisible = false, bool edit = false, + bool stretchLast = true); //弹出框 static int showMessageBox(const QString &info, int type = 0, int closeSec = 0, bool exec = false); diff --git a/countcode/frmcountcode.cpp b/countcode/frmcountcode.cpp index 10115f9..f850aaa 100644 --- a/countcode/frmcountcode.cpp +++ b/countcode/frmcountcode.cpp @@ -88,14 +88,15 @@ bool frmCountCode::checkFile(const QString &fileName) void frmCountCode::countCode(const QString &filePath) { QDir dir(filePath); - foreach (QFileInfo fileInfo , dir.entryInfoList()) { + QFileInfoList fileInfos = dir.entryInfoList(); + foreach (QFileInfo fileInfo, fileInfos) { + QString fileName = fileInfo.fileName(); if (fileInfo.isFile()) { - QString strFileName = fileInfo.fileName(); - if (checkFile(strFileName)) { + if (checkFile(fileName)) { listFile << fileInfo.filePath(); } } else { - if(fileInfo.fileName() == "." || fileInfo.fileName() == "..") { + if (fileName == "." || fileName == "..") { continue; } diff --git a/countcode/snap.png b/countcode/snap.png new file mode 100644 index 0000000..cc8c1e7 Binary files /dev/null and b/countcode/snap.png differ diff --git a/dbpage/main.cpp b/dbpage/main.cpp index adf036e..ea33e42 100644 --- a/dbpage/main.cpp +++ b/dbpage/main.cpp @@ -2,6 +2,7 @@ #include "qapplication.h" #include "qtextcodec.h" #include "qsqldatabase.h" +#include "qsqlquery.h" #include "qdebug.h" int main(int argc, char *argv[]) diff --git a/devicesizetable/devicesizetable.h b/devicesizetable/devicesizetable.h index 9c60881..4fb6057 100644 --- a/devicesizetable/devicesizetable.h +++ b/devicesizetable/devicesizetable.h @@ -3,10 +3,10 @@ /** * 本地存储空间大小控件 作者:feiyangqingyun(QQ:517216493) 2016-11-30 - * 1:可自动加载本地存储设备的总容量/已用容量 - * 2:进度条显示已用容量 - * 3:支持所有操作系统 - * 4:增加U盘或者SD卡到达信号 + * 1. 可自动加载本地存储设备的总容量/已用容量 + * 2. 进度条显示已用容量 + * 3. 支持所有操作系统 + * 4. 增加U盘或者SD卡到达信号 */ #include @@ -14,13 +14,7 @@ class QProcess; #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT DeviceSizeTable : public QTableWidget +class Q_DECL_EXPORT DeviceSizeTable : public QTableWidget #else class DeviceSizeTable : public QTableWidget #endif diff --git a/echartgauge/file/gauge.html b/echartgauge/file/gauge.html index 65a2ba1..5a90f2d 100644 --- a/echartgauge/file/gauge.html +++ b/echartgauge/file/gauge.html @@ -1,19 +1,15 @@ - - ECharts - - + + ECharts + - -
- + }; + myChart.setOption(option); + } + window.onresize = myChart.resize; + setGaugeValue(68); + \ No newline at end of file diff --git a/ffmpegdemo/readme.md b/ffmpegdemo/readme.md new file mode 100644 index 0000000..994fc00 --- /dev/null +++ b/ffmpegdemo/readme.md @@ -0,0 +1,11 @@ +### 特别说明 +1. 编译完成以后记得将dll文件复制到可执行文件同一目录。 +2. 动态库地址:[https://pan.baidu.com/s/13LDRu6mXC6gaADtrGprNVA](https://pan.baidu.com/s/13LDRu6mXC6gaADtrGprNVA) 提取码: ujm7 +3. 收费增强版:[https://qtchina.blog.csdn.net/article/details/103946731](https://qtchina.blog.csdn.net/article/details/103946731) + +### 其他说明 +1. 作品大全:[https://qtchina.blog.csdn.net/article/details/97565652](https://qtchina.blog.csdn.net/article/details/97565652) +2. 国内站点:[https://gitee.com/feiyangqingyun](https://gitee.com/feiyangqingyun) +3. 国际站点:[https://github.com/feiyangqingyun](https://github.com/feiyangqingyun) +4. 个人主页:[https://blog.csdn.net/feiyangqingyun](https://blog.csdn.net/feiyangqingyun) +5. 知乎主页:[https://www.zhihu.com/people/feiyangqingyun/](https://www.zhihu.com/people/feiyangqingyun/) \ No newline at end of file diff --git a/ffmpegdemo/readme.txt b/ffmpegdemo/readme.txt deleted file mode 100644 index e2ebc3e..0000000 --- a/ffmpegdemo/readme.txt +++ /dev/null @@ -1,9 +0,0 @@ -ԺǵýdllļƵִļͬһĿ¼ -Ӧ汾dllļصַhttps://pan.baidu.com/s/13LDRu6mXC6gaADtrGprNVA ȡ: ujm7 - -շǿ汾https://blog.csdn.net/feiyangqingyun/article/details/103946731 - -2. վ㣺[https://gitee.com/feiyangqingyun](https://gitee.com/feiyangqingyun) -3. վ㣺[https://github.com/feiyangqingyun](https://github.com/feiyangqingyun) -4. ҳ[https://blog.csdn.net/feiyangqingyun](https://blog.csdn.net/feiyangqingyun) -5. ֪ҳ[https://www.zhihu.com/people/feiyangqingyun/](https://www.zhihu.com/people/feiyangqingyun/) \ No newline at end of file diff --git a/flatui/flatui.h b/flatui/flatui.h index 8d1fdd8..ee8f7b9 100644 --- a/flatui/flatui.h +++ b/flatui/flatui.h @@ -3,14 +3,14 @@ /** * FlatUI辅助类 作者:feiyangqingyun(QQ:517216493) 2016-12-16 - * 1:按钮样式设置 - * 2:文本框样式设置 - * 3:进度条样式 - * 4:滑块条样式 - * 5:单选框样式 - * 6:滚动条样式 - * 7:可自由设置对象的高度宽度大小等 - * 8:自带默认参数值 + * 1. 按钮样式设置 + * 2. 文本框样式设置 + * 3. 进度条样式 + * 4. 滑块条样式 + * 5. 单选框样式 + * 6. 滚动条样式 + * 7. 可自由设置对象的高度宽度大小等 + * 8. 自带默认参数值 */ #include @@ -24,13 +24,7 @@ class QCheckBox; class QScrollBar; #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT FlatUI : public QObject +class Q_DECL_EXPORT FlatUI : public QObject #else class FlatUI : public QObject #endif diff --git a/framelesswidget/framelesswidget.h b/framelesswidget/framelesswidget.h index bdc59ee..59fea16 100644 --- a/framelesswidget/framelesswidget.h +++ b/framelesswidget/framelesswidget.h @@ -3,23 +3,17 @@ /** * 无边框窗体类 作者:feiyangqingyun(QQ:517216493) 2019-10-03 - * 1:可以指定需要无边框的widget - * 2:边框四周八个方位都可以自由拉伸 - * 3:可设置对应位置的边距,以便识别更大区域 - * 4:可设置是否允许拖动 - * 5:可设置是否允许拉伸 + * 1. 可以指定需要无边框的widget + * 2. 边框四周八个方位都可以自由拉伸 + * 3. 可设置对应位置的边距,以便识别更大区域 + * 4. 可设置是否允许拖动 + * 5. 可设置是否允许拉伸 */ #include #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT FramelessWidget : public QObject +class Q_DECL_EXPORT FramelessWidget : public QObject #else class FramelessWidget : public QObject #endif diff --git a/gifwidget/gifwidget.h b/gifwidget/gifwidget.h index 10b3269..38a8c89 100644 --- a/gifwidget/gifwidget.h +++ b/gifwidget/gifwidget.h @@ -3,11 +3,11 @@ /** * GIF录屏控件 作者:feiyangqingyun(QQ:517216493) 2019-4-3 - * 1:可设置要录制屏幕的宽高,支持右下角直接拉动改变. - * 2:可设置变宽的宽度 - * 3:可设置录屏控件的背景颜色 - * 4:可设置录制的帧数 - * 5:录制区域可自由拖动选择 + * 1. 可设置要录制屏幕的宽高,支持右下角直接拉动改变. + * 2. 可设置变宽的宽度 + * 3. 可设置录屏控件的背景颜色 + * 4. 可设置录制的帧数 + * 5. 录制区域可自由拖动选择 */ #include @@ -17,13 +17,7 @@ class QLineEdit; class QLabel; #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT GifWidget : public QDialog +class Q_DECL_EXPORT GifWidget : public QDialog #else class GifWidget : public QDialog #endif diff --git a/imageswitch/imageswitch.h b/imageswitch/imageswitch.h index 8a3de52..a07e81d 100644 --- a/imageswitch/imageswitch.h +++ b/imageswitch/imageswitch.h @@ -3,20 +3,14 @@ /** * 图片开关控件 作者:feiyangqingyun(QQ:517216493) 2016-11-25 - * 1:自带三种开关按钮样式 - * 2:可自定义开关图片 + * 1. 自带三种开关按钮样式 + * 2. 可自定义开关图片 */ #include #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT ImageSwitch : public QWidget +class Q_DECL_EXPORT ImageSwitch : public QWidget #else class ImageSwitch : public QWidget #endif diff --git a/ipaddress/ipaddress.cpp b/ipaddress/ipaddress.cpp index 0ed053e..2338ea6 100644 --- a/ipaddress/ipaddress.cpp +++ b/ipaddress/ipaddress.cpp @@ -4,10 +4,12 @@ #include "qlabel.h" #include "qlineedit.h" #include "qboxlayout.h" -#include "qregexp.h" #include "qvalidator.h" #include "qevent.h" #include "qdebug.h" +#if (QT_VERSION < QT_VERSION_CHECK(6,0,0)) +#include "qregexp.h" +#endif IPAddress::IPAddress(QWidget *parent) : QWidget(parent) { @@ -53,6 +55,7 @@ IPAddress::IPAddress(QWidget *parent) : QWidget(parent) txtIP4->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); connect(txtIP4, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString))); +#if (QT_VERSION < QT_VERSION_CHECK(6,0,0)) //设置IP地址校验过滤 QRegExp regExp("(2[0-5]{2}|2[0-4][0-9]|1?[0-9]{1,2})"); QRegExpValidator *validator = new QRegExpValidator(regExp, this); @@ -60,6 +63,7 @@ IPAddress::IPAddress(QWidget *parent) : QWidget(parent) txtIP2->setValidator(validator); txtIP3->setValidator(validator); txtIP4->setValidator(validator); +#endif //绑定事件过滤器,识别键盘按下 txtIP1->installEventFilter(this); @@ -79,13 +83,13 @@ IPAddress::IPAddress(QWidget *parent) : QWidget(parent) frame->setStyleSheet(qss.join("")); QVBoxLayout *verticalLayout = new QVBoxLayout(this); - verticalLayout->setMargin(0); + verticalLayout->setContentsMargins(0, 0, 0, 0); verticalLayout->setSpacing(0); verticalLayout->addWidget(frame); //将控件按照横向布局排列 QHBoxLayout *layout = new QHBoxLayout(frame); - layout->setMargin(0); + layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); layout->addWidget(txtIP1); layout->addWidget(labDot1); @@ -153,11 +157,13 @@ QSize IPAddress::minimumSizeHint() const void IPAddress::setIP(const QString &ip) { +#if (QT_VERSION < QT_VERSION_CHECK(6,0,0)) //先检测IP地址是否合法 QRegExp regExp("((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)"); if (!regExp.exactMatch(ip)) { return; } +#endif if (this->ip != ip) { this->ip = ip; diff --git a/ipaddress/ipaddress.h b/ipaddress/ipaddress.h index 0a48b85..cc95f4e 100644 --- a/ipaddress/ipaddress.h +++ b/ipaddress/ipaddress.h @@ -3,12 +3,12 @@ /** * IP地址输入框控件 作者:feiyangqingyun(QQ:517216493) 2017-8-11 - * 1:可设置IP地址,自动填入框 - * 2:可清空IP地址 - * 3:支持按下小圆点自动切换 - * 4:支持退格键自动切换 - * 5:支持IP地址过滤 - * 6:可设置背景色/边框颜色/边框圆角角度 + * 1. 可设置IP地址,自动填入框 + * 2. 可清空IP地址 + * 3. 支持按下小圆点自动切换 + * 4. 支持退格键自动切换 + * 5. 支持IP地址过滤 + * 6. 可设置背景色/边框颜色/边框圆角角度 */ #include @@ -17,13 +17,7 @@ class QLabel; class QLineEdit; #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT IPAddress : public QWidget +class Q_DECL_EXPORT IPAddress : public QWidget #else class IPAddress : public QWidget #endif diff --git a/lightbutton/lightbutton.h b/lightbutton/lightbutton.h index b4de392..269f06d 100644 --- a/lightbutton/lightbutton.h +++ b/lightbutton/lightbutton.h @@ -3,28 +3,22 @@ /** * 高亮发光按钮控件 作者:feiyangqingyun(QQ:517216493) 2016-10-16 - * 1:可设置文本,居中显示 - * 2:可设置文本颜色 - * 3:可设置外边框渐变颜色 - * 4:可设置里边框渐变颜色 - * 5:可设置背景色 - * 6:可直接调用内置的设置 绿色/红色/黄色/黑色/蓝色 等公有槽函数 - * 7:可设置是否在容器中可移动,当成一个对象使用 - * 8:可设置是否显示矩形 - * 9:可设置报警颜色+非报警颜色 - * 10:可控制启动报警和停止报警,报警时闪烁 + * 1. 可设置文本,居中显示 + * 2. 可设置文本颜色 + * 3. 可设置外边框渐变颜色 + * 4. 可设置里边框渐变颜色 + * 5. 可设置背景色 + * 6. 可直接调用内置的设置 绿色/红色/黄色/黑色/蓝色 等公有槽函数 + * 7. 可设置是否在容器中可移动,当成一个对象使用 + * 8. 可设置是否显示矩形 + * 9. 可设置报警颜色+非报警颜色 + * 10. 可控制启动报警和停止报警,报警时闪烁 */ #include #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT LightButton : public QWidget +class Q_DECL_EXPORT LightButton : public QWidget #else class LightButton : public QWidget #endif diff --git a/lunarcalendarwidget/lunarcalendarinfo.h b/lunarcalendarwidget/lunarcalendarinfo.h index 845ce03..da108b3 100644 --- a/lunarcalendarwidget/lunarcalendarinfo.h +++ b/lunarcalendarwidget/lunarcalendarinfo.h @@ -3,23 +3,17 @@ /** * 农历信息类 作者:倪大侠 整理:feiyangqingyun(QQ:517216493) 2016-12-10 - * 1:计算是否闰年 - * 2:计算国际节日 - * 3:计算二十四节气 - * 4:计算农历年 天干+地支+生肖 - * 5:计算指定年月日农历信息,包括公历节日和农历节日及二十四节气 + * 1. 计算是否闰年 + * 2. 计算国际节日 + * 3. 计算二十四节气 + * 4. 计算农历年 天干+地支+生肖 + * 5. 计算指定年月日农历信息,包括公历节日和农历节日及二十四节气 */ #include #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT LunarCalendarInfo : public QObject +class Q_DECL_EXPORT LunarCalendarInfo : public QObject #else class LunarCalendarInfo : public QObject #endif diff --git a/lunarcalendarwidget/lunarcalendaritem.h b/lunarcalendarwidget/lunarcalendaritem.h index 4060bee..de3e56e 100644 --- a/lunarcalendarwidget/lunarcalendaritem.h +++ b/lunarcalendarwidget/lunarcalendaritem.h @@ -5,13 +5,7 @@ #include #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT LunarCalendarItem : public QWidget +class Q_DECL_EXPORT LunarCalendarItem : public QWidget #else class LunarCalendarItem : public QWidget #endif diff --git a/lunarcalendarwidget/lunarcalendarwidget.cpp b/lunarcalendarwidget/lunarcalendarwidget.cpp index 7d1c7ae..147b7cd 100644 --- a/lunarcalendarwidget/lunarcalendarwidget.cpp +++ b/lunarcalendarwidget/lunarcalendarwidget.cpp @@ -159,7 +159,7 @@ void LunarCalendarWidget::initWidget() //星期布局 QHBoxLayout *layoutWeek = new QHBoxLayout(widgetWeek); - layoutWeek->setMargin(0); + layoutWeek->setContentsMargins(0, 0, 0, 0); layoutWeek->setSpacing(0); for (int i = 0; i < 7; i++) { @@ -177,7 +177,7 @@ void LunarCalendarWidget::initWidget() //日期标签布局 QGridLayout *layoutBody = new QGridLayout(widgetBody); - layoutBody->setMargin(1); + layoutBody->setContentsMargins(1, 1, 1, 1); layoutBody->setHorizontalSpacing(0); layoutBody->setVerticalSpacing(0); @@ -191,7 +191,7 @@ void LunarCalendarWidget::initWidget() //主布局 QVBoxLayout *verLayoutCalendar = new QVBoxLayout(this); - verLayoutCalendar->setMargin(0); + verLayoutCalendar->setContentsMargins(0, 0, 0, 0); verLayoutCalendar->setSpacing(0); verLayoutCalendar->addWidget(widgetTop); verLayoutCalendar->addWidget(widgetWeek); diff --git a/lunarcalendarwidget/lunarcalendarwidget.h b/lunarcalendarwidget/lunarcalendarwidget.h index b6e55ef..3043a2a 100644 --- a/lunarcalendarwidget/lunarcalendarwidget.h +++ b/lunarcalendarwidget/lunarcalendarwidget.h @@ -3,15 +3,15 @@ /** * 自定义农历控件 作者:倪大侠 整理:feiyangqingyun(QQ:517216493) 2017-11-17 - * 1:可设置边框颜色/周末颜色/角标颜色/农历节日颜色 - * 2:可设置当前月文字颜色/其他月文字颜色/选中日期文字颜色/悬停日期文字颜色 - * 3:可设置当前月农历文字颜色/其他月农历文字颜色/选中日期农历文字颜色/悬停日期农历文字颜色 - * 4:可设置当前月背景颜色/其他月背景颜色/选中日期背景颜色/悬停日期背景颜色 - * 5:可设置三种选中背景模式,矩形背景+圆形背景+图片背景 - * 6:可直接切换到上一年/下一年/上一月/下一月/转到今天 - * 7:可设置是否显示农历信息,不显示则当做正常的日历使用 - * 8:支持1901年-2099年范围 - * 9:很方便改成多选日期 + * 1. 可设置边框颜色/周末颜色/角标颜色/农历节日颜色 + * 2. 可设置当前月文字颜色/其他月文字颜色/选中日期文字颜色/悬停日期文字颜色 + * 3. 可设置当前月农历文字颜色/其他月农历文字颜色/选中日期农历文字颜色/悬停日期农历文字颜色 + * 4. 可设置当前月背景颜色/其他月背景颜色/选中日期背景颜色/悬停日期背景颜色 + * 5. 可设置三种选中背景模式,矩形背景+圆形背景+图片背景 + * 6. 可直接切换到上一年/下一年/上一月/下一月/转到今天 + * 7. 可设置是否显示农历信息,不显示则当做正常的日历使用 + * 8. 支持1901年-2099年范围 + * 9. 很方便改成多选日期 */ #include @@ -25,13 +25,7 @@ class QComboBox; class LunarCalendarItem; #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT LunarCalendarWidget : public QWidget +class Q_DECL_EXPORT LunarCalendarWidget : public QWidget #else class LunarCalendarWidget : public QWidget #endif diff --git a/maskwidget/maskwidget.cpp b/maskwidget/maskwidget.cpp index ca1a68c..0cf5ede 100644 --- a/maskwidget/maskwidget.cpp +++ b/maskwidget/maskwidget.cpp @@ -2,8 +2,8 @@ #include "maskwidget.h" #include "qmutex.h" -#include "qapplication.h" #include "qdesktopwidget.h" +#include "qapplication.h" #include "qdebug.h" QScopedPointer MaskWidget::self; @@ -56,7 +56,7 @@ void MaskWidget::setOpacity(double opacity) void MaskWidget::setBgColor(const QColor &bgColor) { QPalette palette = this->palette(); - palette.setBrush(QPalette::Background, bgColor); + palette.setBrush(QPalette::Window, bgColor); this->setPalette(palette); } diff --git a/maskwidget/maskwidget.h b/maskwidget/maskwidget.h index f3cc0ec..6e28ba4 100644 --- a/maskwidget/maskwidget.h +++ b/maskwidget/maskwidget.h @@ -3,23 +3,17 @@ /** * 弹窗遮罩层控件 作者:feiyangqingyun(QQ:517216493) 2016-12-26 - * 1:可设置需要遮罩的主窗体,自动跟随主窗体位置显示遮罩面积 - * 2:只需要将弹窗窗体的名称一开始传入队列即可,足够简单 - * 3:可设置透明度 - * 4:可设置遮罩层颜色 - * 5:不阻塞消息循坏 + * 1. 可设置需要遮罩的主窗体,自动跟随主窗体位置显示遮罩面积 + * 2. 只需要将弹窗窗体的名称一开始传入队列即可,足够简单 + * 3. 可设置透明度 + * 4. 可设置遮罩层颜色 + * 5. 不阻塞消息循坏 */ #include #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT MaskWidget : public QWidget +class Q_DECL_EXPORT MaskWidget : public QWidget #else class MaskWidget : public QWidget #endif diff --git a/movewidget/frmmovewidget.cpp b/movewidget/frmmovewidget.cpp index a74b5a6..6cc5cc4 100644 --- a/movewidget/frmmovewidget.cpp +++ b/movewidget/frmmovewidget.cpp @@ -24,29 +24,18 @@ void frmMoveWidget::initForm() btn1->setText("按住我拖动(仅限左键拖动)"); MoveWidget *moveWidget1 = new MoveWidget(this); moveWidget1->setWidget(btn1); - moveWidget1->setLeftButton(true); - moveWidget1->setRightButton(false); QPushButton *btn2 = new QPushButton(this); btn2->setGeometry(10, 40, 250, 25); - btn2->setText("按住我拖动(仅限右键拖动)"); + btn2->setText("按住我拖动(支持右键拖动)"); MoveWidget *moveWidget2 = new MoveWidget(this); moveWidget2->setWidget(btn2); moveWidget2->setLeftButton(false); - moveWidget2->setRightButton(true); - - QPushButton *btn3 = new QPushButton(this); - btn3->setGeometry(10, 70, 250, 25); - btn3->setText("按住我拖动(支持左右键拖动)"); - MoveWidget *moveWidget3 = new MoveWidget(this); - moveWidget3->setWidget(btn3); - moveWidget3->setLeftButton(true); - moveWidget3->setRightButton(true); QProgressBar *bar = new QProgressBar(this); - bar->setGeometry(10, 100, 250, 25); + bar->setGeometry(10, 70, 250, 25); bar->setRange(0, 0); bar->setTextVisible(false); - MoveWidget *moveWidget4 = new MoveWidget(this); - moveWidget4->setWidget(bar); -} + MoveWidget *moveWidget3 = new MoveWidget(this); + moveWidget3->setWidget(bar); +} \ No newline at end of file diff --git a/movewidget/movewidget.cpp b/movewidget/movewidget.cpp index 7151088..7f57248 100644 --- a/movewidget/movewidget.cpp +++ b/movewidget/movewidget.cpp @@ -6,8 +6,7 @@ MoveWidget::MoveWidget(QObject *parent) : QObject(parent) { lastPoint = QPoint(0, 0); pressed = false; - leftButton = false; - rightButton = false; + leftButton = true; inControl = true; widget = 0; } @@ -17,12 +16,8 @@ bool MoveWidget::eventFilter(QObject *watched, QEvent *event) if (widget != 0 && watched == widget) { QMouseEvent *mouseEvent = (QMouseEvent *)event; if (mouseEvent->type() == QEvent::MouseButtonPress) { - //如果鼠标左键和鼠标右键都可以拖动 - if (leftButton && rightButton) { - - } - //如果限定了只能鼠标左键拖动则判断当前是否是鼠标左键,如果限定了只能鼠标右键拖动则判断当前是否是鼠标右键 - else if ((leftButton && mouseEvent->button() != Qt::LeftButton) || (rightButton && mouseEvent->button() != Qt::RightButton)) { + //如果限定了只能鼠标左键拖动则判断当前是否是鼠标左键 + if (leftButton && mouseEvent->button() != Qt::LeftButton) { return false; } @@ -73,11 +68,6 @@ void MoveWidget::setLeftButton(bool leftButton) this->leftButton = leftButton; } -void MoveWidget::setRightButton(bool rightButton) -{ - this->rightButton = rightButton; -} - void MoveWidget::setInControl(bool inControl) { this->inControl = inControl; diff --git a/movewidget/movewidget.h b/movewidget/movewidget.h index 9dd6447..d39d917 100644 --- a/movewidget/movewidget.h +++ b/movewidget/movewidget.h @@ -34,15 +34,12 @@ private: QPoint lastPoint; //最后按下的坐标 bool pressed; //鼠标是否按下 bool leftButton; //限定鼠标左键 - bool rightButton; //限定鼠标右键 bool inControl; //限定在容器内 QWidget *widget; //移动的控件 public Q_SLOTS: //设置是否限定鼠标左键 void setLeftButton(bool leftButton); - //设置是否限定鼠标右键 - void setRightButton(bool rightButton); //设置是否限定不能移出容器外面 void setInControl(bool inControl); //设置要移动的控件 diff --git a/movewidget/movewidget.pro b/movewidget/movewidget.pro index 5fd1378..a9e719e 100644 --- a/movewidget/movewidget.pro +++ b/movewidget/movewidget.pro @@ -8,7 +8,7 @@ QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets -TARGET = lightbutton +TARGET = movewidget TEMPLATE = app DESTDIR = $$PWD/../bin CONFIG += warn_off diff --git a/mpvdemo/readme.md b/mpvdemo/readme.md new file mode 100644 index 0000000..15a7253 --- /dev/null +++ b/mpvdemo/readme.md @@ -0,0 +1,11 @@ +### 特别说明 +1. 编译完成以后记得将dll文件复制到可执行文件同一目录。 +2. 动态库地址:[https://pan.baidu.com/s/13LDRu6mXC6gaADtrGprNVA](https://pan.baidu.com/s/13LDRu6mXC6gaADtrGprNVA) 提取码: ujm7 +3. 收费增强版:[https://qtchina.blog.csdn.net/article/details/107972067](https://qtchina.blog.csdn.net/article/details/107972067) + +### 其他说明 +1. 作品大全:[https://qtchina.blog.csdn.net/article/details/97565652](https://qtchina.blog.csdn.net/article/details/97565652) +2. 国内站点:[https://gitee.com/feiyangqingyun](https://gitee.com/feiyangqingyun) +3. 国际站点:[https://github.com/feiyangqingyun](https://github.com/feiyangqingyun) +4. 个人主页:[https://blog.csdn.net/feiyangqingyun](https://blog.csdn.net/feiyangqingyun) +5. 知乎主页:[https://www.zhihu.com/people/feiyangqingyun/](https://www.zhihu.com/people/feiyangqingyun/) \ No newline at end of file diff --git a/mpvdemo/readme.txt b/mpvdemo/readme.txt deleted file mode 100644 index 4195b6d..0000000 --- a/mpvdemo/readme.txt +++ /dev/null @@ -1,9 +0,0 @@ -ԺǵýdllļƵִļͬһĿ¼ -Ӧ汾dllļصַhttps://pan.baidu.com/s/13LDRu6mXC6gaADtrGprNVA ȡ: ujm7 - -շǿ汾https://blog.csdn.net/feiyangqingyun/article/details/107972067 - -2. վ㣺[https://gitee.com/feiyangqingyun](https://gitee.com/feiyangqingyun) -3. վ㣺[https://github.com/feiyangqingyun](https://github.com/feiyangqingyun) -4. ҳ[https://blog.csdn.net/feiyangqingyun](https://blog.csdn.net/feiyangqingyun) -5. ֪ҳ[https://www.zhihu.com/people/feiyangqingyun/](https://www.zhihu.com/people/feiyangqingyun/) \ No newline at end of file diff --git a/navbutton/iconhelper.h b/navbutton/iconhelper.h index fb24137..992bc8d 100644 --- a/navbutton/iconhelper.h +++ b/navbutton/iconhelper.h @@ -7,8 +7,12 @@ #include #endif -//图形字体处理类 +#ifdef quc +class Q_DECL_EXPORT IconHelper : public QObject +#else class IconHelper : public QObject +#endif + { Q_OBJECT diff --git a/navbutton/navbutton.cpp b/navbutton/navbutton.cpp index 54b0910..d1000fb 100644 --- a/navbutton/navbutton.cpp +++ b/navbutton/navbutton.cpp @@ -43,6 +43,7 @@ NavButton::NavButton(QWidget *parent) : QPushButton(parent) hover = false; setCheckable(true); + setText("导航按钮"); } void NavButton::enterEvent(QEvent *) diff --git a/navbutton/navbutton.h b/navbutton/navbutton.h index fb8a671..69fc6f1 100644 --- a/navbutton/navbutton.h +++ b/navbutton/navbutton.h @@ -3,26 +3,20 @@ /** * 导航按钮控件 作者:feiyangqingyun(QQ:517216493) 2017-12-19 - * 1:可设置文字的左侧+右侧+顶部+底部间隔 - * 2:可设置文字对齐方式 - * 3:可设置显示倒三角/倒三角边长/倒三角位置/倒三角颜色 - * 4:可设置显示图标/图标间隔/图标尺寸/正常状态图标/悬停状态图标/选中状态图标 - * 5:可设置显示边框线条/线条宽度/线条间隔/线条位置/线条颜色 - * 6:可设置正常背景颜色/悬停背景颜色/选中背景颜色 - * 7:可设置正常文字颜色/悬停文字颜色/选中文字颜色 - * 8:可设置背景颜色为画刷颜色 + * 1. 可设置文字的左侧+右侧+顶部+底部间隔 + * 2. 可设置文字对齐方式 + * 3. 可设置显示倒三角/倒三角边长/倒三角位置/倒三角颜色 + * 4. 可设置显示图标/图标间隔/图标尺寸/正常状态图标/悬停状态图标/选中状态图标 + * 5. 可设置显示边框线条/线条宽度/线条间隔/线条位置/线条颜色 + * 6. 可设置正常背景颜色/悬停背景颜色/选中背景颜色 + * 7. 可设置正常文字颜色/悬停文字颜色/选中文字颜色 + * 8. 可设置背景颜色为画刷颜色 */ #include #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT NavButton : public QPushButton +class Q_DECL_EXPORT NavButton : public QPushButton #else class NavButton : public QPushButton #endif diff --git a/nettool/api/quiwidget.cpp b/nettool/api/quiwidget.cpp index 9949ecb..8adaa68 100644 --- a/nettool/api/quiwidget.cpp +++ b/nettool/api/quiwidget.cpp @@ -528,6 +528,11 @@ QUIMessageBox::~QUIMessageBox() delete widgetMain; } +void QUIMessageBox::showEvent(QShowEvent *) +{ + this->activateWindow(); +} + void QUIMessageBox::closeEvent(QCloseEvent *) { closeSec = 0; @@ -567,6 +572,7 @@ void QUIMessageBox::initControl() verticalLayout1->setSpacing(0); verticalLayout1->setObjectName(QString::fromUtf8("verticalLayout1")); verticalLayout1->setContentsMargins(1, 1, 1, 1); + widgetTitle = new QWidget(this); widgetTitle->setObjectName(QString::fromUtf8("widgetTitle")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); @@ -574,10 +580,12 @@ void QUIMessageBox::initControl() sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(widgetTitle->sizePolicy().hasHeightForWidth()); widgetTitle->setSizePolicy(sizePolicy); + horizontalLayout3 = new QHBoxLayout(widgetTitle); horizontalLayout3->setSpacing(0); horizontalLayout3->setObjectName(QString::fromUtf8("horizontalLayout3")); horizontalLayout3->setContentsMargins(0, 0, 0, 0); + labIco = new QLabel(widgetTitle); labIco->setObjectName(QString::fromUtf8("labIco")); QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Preferred); @@ -586,34 +594,33 @@ void QUIMessageBox::initControl() sizePolicy1.setHeightForWidth(labIco->sizePolicy().hasHeightForWidth()); labIco->setSizePolicy(sizePolicy1); labIco->setAlignment(Qt::AlignCenter); - horizontalLayout3->addWidget(labIco); labTitle = new QLabel(widgetTitle); labTitle->setObjectName(QString::fromUtf8("labTitle")); labTitle->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); - horizontalLayout3->addWidget(labTitle); - labTime = new QLabel(widgetTitle); - labTime->setObjectName(QString::fromUtf8("labTime")); + labCountDown = new QLabel(widgetTitle); + labCountDown->setObjectName(QString::fromUtf8("labCountDown")); QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Preferred); sizePolicy2.setHorizontalStretch(0); sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(labTime->sizePolicy().hasHeightForWidth()); - labTime->setSizePolicy(sizePolicy2); - labTime->setAlignment(Qt::AlignCenter); - - horizontalLayout3->addWidget(labTime); + sizePolicy2.setHeightForWidth(labCountDown->sizePolicy().hasHeightForWidth()); + labCountDown->setSizePolicy(sizePolicy2); + labCountDown->setAlignment(Qt::AlignCenter); + horizontalLayout3->addWidget(labCountDown); widgetMenu = new QWidget(widgetTitle); widgetMenu->setObjectName(QString::fromUtf8("widgetMenu")); sizePolicy1.setHeightForWidth(widgetMenu->sizePolicy().hasHeightForWidth()); widgetMenu->setSizePolicy(sizePolicy1); + horizontalLayout4 = new QHBoxLayout(widgetMenu); horizontalLayout4->setSpacing(0); horizontalLayout4->setObjectName(QString::fromUtf8("horizontalLayout4")); horizontalLayout4->setContentsMargins(0, 0, 0, 0); + btnMenu_Close = new QPushButton(widgetMenu); btnMenu_Close->setObjectName(QString::fromUtf8("btnMenu_Close")); QSizePolicy sizePolicy3(QSizePolicy::Minimum, QSizePolicy::Expanding); @@ -631,22 +638,27 @@ void QUIMessageBox::initControl() widgetMain = new QWidget(this); widgetMain->setObjectName(QString::fromUtf8("widgetMainQUI")); + verticalLayout2 = new QVBoxLayout(widgetMain); verticalLayout2->setSpacing(5); verticalLayout2->setObjectName(QString::fromUtf8("verticalLayout2")); verticalLayout2->setContentsMargins(5, 5, 5, 5); + frame = new QFrame(widgetMain); frame->setObjectName(QString::fromUtf8("frame")); frame->setFrameShape(QFrame::Box); frame->setFrameShadow(QFrame::Sunken); - verticalLayout4 = new QVBoxLayout(frame); - verticalLayout4->setObjectName(QString::fromUtf8("verticalLayout4")); - verticalLayout4->setContentsMargins(-1, 9, -1, -1); - horizontalLayout1 = new QHBoxLayout(); - horizontalLayout1->setObjectName(QString::fromUtf8("horizontalLayout1")); + labIcoMain = new QLabel(frame); labIcoMain->setObjectName(QString::fromUtf8("labIcoMain")); labIcoMain->setAlignment(Qt::AlignCenter); + + verticalLayout4 = new QVBoxLayout(frame); + verticalLayout4->setObjectName(QString::fromUtf8("verticalLayout4")); + verticalLayout4->setContentsMargins(-1, 9, -1, -1); + + horizontalLayout1 = new QHBoxLayout(); + horizontalLayout1->setObjectName(QString::fromUtf8("horizontalLayout1")); horizontalLayout1->addWidget(labIcoMain); horizontalSpacer1 = new QSpacerItem(5, 0, QSizePolicy::Minimum, QSizePolicy::Minimum); horizontalLayout1->addItem(horizontalSpacer1); @@ -673,14 +685,13 @@ void QUIMessageBox::initControl() btnOk->setObjectName(QString::fromUtf8("btnOk")); btnOk->setMinimumSize(QSize(85, 0)); btnOk->setFocusPolicy(Qt::StrongFocus); - btnOk->setIcon(QIcon(":/image/btn_ok.png")); horizontalLayout2->addWidget(btnOk); + btnOk->setDefault(true); btnCancel = new QPushButton(frame); btnCancel->setObjectName(QString::fromUtf8("btnCancel")); btnCancel->setMinimumSize(QSize(85, 0)); btnCancel->setFocusPolicy(Qt::StrongFocus); - btnCancel->setIcon(QIcon(":/image/btn_close.png")); horizontalLayout2->addWidget(btnCancel); verticalLayout4->addLayout(horizontalLayout2); @@ -693,6 +704,8 @@ void QUIMessageBox::initControl() btnOk->setText("确定"); btnCancel->setText("取消"); + QUIHelper::setIconBtn(btnOk, ":/image/btn_ok.png", 0xf00c); + QUIHelper::setIconBtn(btnCancel, ":/image/btn_close.png", 0xf00d); connect(btnOk, SIGNAL(clicked()), this, SLOT(on_btnOk_clicked())); connect(btnCancel, SIGNAL(clicked()), this, SLOT(on_btnMenu_Close_clicked())); @@ -746,7 +759,7 @@ void QUIMessageBox::checkSec() } QString str = QString("关闭倒计时 %1 s").arg(closeSec - currentSec + 1); - this->labTime->setText(str); + this->labCountDown->setText(str); } void QUIMessageBox::on_btnOk_clicked() @@ -766,40 +779,33 @@ void QUIMessageBox::setIconMain(const QChar &str, quint32 size) IconHelper::Instance()->setIcon(this->labIco, str, size); } +void QUIMessageBox::setIconMsg(const QString &png, const QChar &str) +{ + //图片存在则取图片,不存在则取图形字体 + int size = this->labIcoMain->size().height(); + if (QImage(png).isNull()) { + IconHelper::Instance()->setIcon(this->labIcoMain, str, size); + } else { + this->labIcoMain->setStyleSheet(QString("border-image:url(%1);").arg(png)); + } +} + void QUIMessageBox::setMessage(const QString &msg, int type, int closeSec) { this->closeSec = closeSec; this->currentSec = 0; - this->labTime->clear(); + this->labCountDown->clear(); checkSec(); - //图片存在则取图片,不存在则取图形字体 - int size = this->labIcoMain->size().height(); - bool exist = !QImage(":/image/msg_info.png").isNull(); if (type == 0) { - if (exist) { - this->labIcoMain->setStyleSheet("border-image: url(:/image/msg_info.png);"); - } else { - IconHelper::Instance()->setIcon(this->labIcoMain, 0xf05a, size); - } - + setIconMsg(":/image/msg_info.png", 0xf05a); this->btnCancel->setVisible(false); this->labTitle->setText("提示"); } else if (type == 1) { - if (exist) { - this->labIcoMain->setStyleSheet("border-image: url(:/image/msg_question.png);"); - } else { - IconHelper::Instance()->setIcon(this->labIcoMain, 0xf059, size); - } - + setIconMsg(":/image/msg_question.png", 0xf059); this->labTitle->setText("询问"); } else if (type == 2) { - if (exist) { - this->labIcoMain->setStyleSheet("border-image: url(:/image/msg_error.png);"); - } else { - IconHelper::Instance()->setIcon(this->labIcoMain, 0xf057, size); - } - + setIconMsg(":/image/msg_error.png", 0xf057); this->btnCancel->setVisible(false); this->labTitle->setText("错误"); } @@ -841,6 +847,11 @@ QUITipBox::~QUITipBox() delete widgetMain; } +void QUITipBox::showEvent(QShowEvent *) +{ + this->activateWindow(); +} + void QUITipBox::closeEvent(QCloseEvent *) { closeSec = 0; @@ -880,6 +891,7 @@ void QUITipBox::initControl() verticalLayout->setSpacing(0); verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); verticalLayout->setContentsMargins(1, 1, 1, 1); + widgetTitle = new QWidget(this); widgetTitle->setObjectName(QString::fromUtf8("widgetTitle")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); @@ -887,10 +899,12 @@ void QUITipBox::initControl() sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(widgetTitle->sizePolicy().hasHeightForWidth()); widgetTitle->setSizePolicy(sizePolicy); + horizontalLayout2 = new QHBoxLayout(widgetTitle); horizontalLayout2->setSpacing(0); horizontalLayout2->setObjectName(QString::fromUtf8("horizontalLayout2")); horizontalLayout2->setContentsMargins(0, 0, 0, 0); + labIco = new QLabel(widgetTitle); labIco->setObjectName(QString::fromUtf8("labIco")); labIco->setAlignment(Qt::AlignCenter); @@ -901,15 +915,15 @@ void QUITipBox::initControl() labTitle->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); horizontalLayout2->addWidget(labTitle); - labTime = new QLabel(widgetTitle); - labTime->setObjectName(QString::fromUtf8("labTime")); + labCountDown = new QLabel(widgetTitle); + labCountDown->setObjectName(QString::fromUtf8("labCountDown")); QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Preferred); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(labTime->sizePolicy().hasHeightForWidth()); - labTime->setSizePolicy(sizePolicy1); - labTime->setAlignment(Qt::AlignCenter); - horizontalLayout2->addWidget(labTime); + sizePolicy1.setHeightForWidth(labCountDown->sizePolicy().hasHeightForWidth()); + labCountDown->setSizePolicy(sizePolicy1); + labCountDown->setAlignment(Qt::AlignCenter); + horizontalLayout2->addWidget(labCountDown); widgetMenu = new QWidget(widgetTitle); widgetMenu->setObjectName(QString::fromUtf8("widgetMenu")); @@ -918,10 +932,12 @@ void QUITipBox::initControl() sizePolicy2.setVerticalStretch(0); sizePolicy2.setHeightForWidth(widgetMenu->sizePolicy().hasHeightForWidth()); widgetMenu->setSizePolicy(sizePolicy2); + horizontalLayout = new QHBoxLayout(widgetMenu); horizontalLayout->setSpacing(0); horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); horizontalLayout->setContentsMargins(0, 0, 0, 0); + btnMenu_Close = new QPushButton(widgetMenu); btnMenu_Close->setObjectName(QString::fromUtf8("btnMenu_Close")); QSizePolicy sizePolicy3(QSizePolicy::Minimum, QSizePolicy::Expanding); @@ -940,11 +956,14 @@ void QUITipBox::initControl() widgetMain = new QWidget(this); widgetMain->setObjectName(QString::fromUtf8("widgetMainQUI")); widgetMain->setAutoFillBackground(true); - verticalLayout2 = new QVBoxLayout(widgetMain); - verticalLayout2->setObjectName(QString::fromUtf8("verticalLayout2")); + labInfo = new QLabel(widgetMain); labInfo->setObjectName(QString::fromUtf8("labInfo")); labInfo->setScaledContents(true); + labInfo->setWordWrap(true); + + verticalLayout2 = new QVBoxLayout(widgetMain); + verticalLayout2->setObjectName(QString::fromUtf8("verticalLayout2")); verticalLayout2->addWidget(labInfo); verticalLayout->addWidget(widgetMain); @@ -997,7 +1016,7 @@ void QUITipBox::checkSec() } QString str = QString("关闭倒计时 %1 s").arg(closeSec - currentSec + 1); - this->labTime->setText(str); + this->labCountDown->setText(str); } void QUITipBox::on_btnMenu_Close_clicked() @@ -1015,7 +1034,7 @@ void QUITipBox::setTip(const QString &title, const QString &tip, bool fullScreen { this->closeSec = closeSec; this->currentSec = 0; - this->labTime->clear(); + this->labCountDown->clear(); checkSec(); this->fullScreen = fullScreen; @@ -1096,6 +1115,7 @@ void QUIInputBox::initControl() verticalLayout1->setSpacing(0); verticalLayout1->setObjectName(QString::fromUtf8("verticalLayout1")); verticalLayout1->setContentsMargins(1, 1, 1, 1); + widgetTitle = new QWidget(this); widgetTitle->setObjectName(QString::fromUtf8("widgetTitle")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); @@ -1103,10 +1123,12 @@ void QUIInputBox::initControl() sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(widgetTitle->sizePolicy().hasHeightForWidth()); widgetTitle->setSizePolicy(sizePolicy); + horizontalLayout1 = new QHBoxLayout(widgetTitle); horizontalLayout1->setSpacing(0); horizontalLayout1->setObjectName(QString::fromUtf8("horizontalLayout1")); horizontalLayout1->setContentsMargins(0, 0, 0, 0); + labIco = new QLabel(widgetTitle); labIco->setObjectName(QString::fromUtf8("labIco")); QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Preferred); @@ -1115,34 +1137,33 @@ void QUIInputBox::initControl() sizePolicy1.setHeightForWidth(labIco->sizePolicy().hasHeightForWidth()); labIco->setSizePolicy(sizePolicy1); labIco->setAlignment(Qt::AlignCenter); - horizontalLayout1->addWidget(labIco); labTitle = new QLabel(widgetTitle); labTitle->setObjectName(QString::fromUtf8("labTitle")); labTitle->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); - horizontalLayout1->addWidget(labTitle); - labTime = new QLabel(widgetTitle); - labTime->setObjectName(QString::fromUtf8("labTime")); + labCountDown = new QLabel(widgetTitle); + labCountDown->setObjectName(QString::fromUtf8("labCountDown")); QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Preferred); sizePolicy2.setHorizontalStretch(0); sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(labTime->sizePolicy().hasHeightForWidth()); - labTime->setSizePolicy(sizePolicy2); - labTime->setAlignment(Qt::AlignCenter); - - horizontalLayout1->addWidget(labTime); + sizePolicy2.setHeightForWidth(labCountDown->sizePolicy().hasHeightForWidth()); + labCountDown->setSizePolicy(sizePolicy2); + labCountDown->setAlignment(Qt::AlignCenter); + horizontalLayout1->addWidget(labCountDown); widgetMenu = new QWidget(widgetTitle); widgetMenu->setObjectName(QString::fromUtf8("widgetMenu")); sizePolicy1.setHeightForWidth(widgetMenu->sizePolicy().hasHeightForWidth()); widgetMenu->setSizePolicy(sizePolicy1); + horizontalLayout2 = new QHBoxLayout(widgetMenu); horizontalLayout2->setSpacing(0); horizontalLayout2->setObjectName(QString::fromUtf8("horizontalLayout2")); horizontalLayout2->setContentsMargins(0, 0, 0, 0); + btnMenu_Close = new QPushButton(widgetMenu); btnMenu_Close->setObjectName(QString::fromUtf8("btnMenu_Close")); QSizePolicy sizePolicy3(QSizePolicy::Minimum, QSizePolicy::Expanding); @@ -1160,20 +1181,24 @@ void QUIInputBox::initControl() widgetMain = new QWidget(this); widgetMain->setObjectName(QString::fromUtf8("widgetMainQUI")); + verticalLayout2 = new QVBoxLayout(widgetMain); verticalLayout2->setSpacing(5); verticalLayout2->setObjectName(QString::fromUtf8("verticalLayout2")); verticalLayout2->setContentsMargins(5, 5, 5, 5); + frame = new QFrame(widgetMain); frame->setObjectName(QString::fromUtf8("frame")); frame->setFrameShape(QFrame::Box); frame->setFrameShadow(QFrame::Sunken); - verticalLayout3 = new QVBoxLayout(frame); - verticalLayout3->setObjectName(QString::fromUtf8("verticalLayout3")); + labInfo = new QLabel(frame); labInfo->setObjectName(QString::fromUtf8("labInfo")); labInfo->setScaledContents(false); labInfo->setWordWrap(true); + + verticalLayout3 = new QVBoxLayout(frame); + verticalLayout3->setObjectName(QString::fromUtf8("verticalLayout3")); verticalLayout3->addWidget(labInfo); txtValue = new QLineEdit(frame); @@ -1192,13 +1217,12 @@ void QUIInputBox::initControl() btnOk = new QPushButton(frame); btnOk->setObjectName(QString::fromUtf8("btnOk")); btnOk->setMinimumSize(QSize(85, 0)); - btnOk->setIcon(QIcon(":/image/btn_ok.png")); lay->addWidget(btnOk); + btnOk->setDefault(true); btnCancel = new QPushButton(frame); btnCancel->setObjectName(QString::fromUtf8("btnCancel")); btnCancel->setMinimumSize(QSize(85, 0)); - btnCancel->setIcon(QIcon(":/image/btn_close.png")); lay->addWidget(btnCancel); verticalLayout3->addLayout(lay); @@ -1211,6 +1235,8 @@ void QUIInputBox::initControl() labTitle->setText("输入框"); btnOk->setText("确定"); btnCancel->setText("取消"); + QUIHelper::setIconBtn(btnOk, ":/image/btn_ok.png", 0xf00c); + QUIHelper::setIconBtn(btnCancel, ":/image/btn_close.png", 0xf00d); connect(btnOk, SIGNAL(clicked()), this, SLOT(on_btnOk_clicked())); connect(btnCancel, SIGNAL(clicked()), this, SLOT(on_btnMenu_Close_clicked())); @@ -1264,7 +1290,7 @@ void QUIInputBox::checkSec() } QString str = QString("关闭倒计时 %1 s").arg(closeSec - currentSec + 1); - this->labTime->setText(str); + this->labCountDown->setText(str); } void QUIInputBox::setParameter(const QString &title, int type, int closeSec, @@ -1273,7 +1299,7 @@ void QUIInputBox::setParameter(const QString &title, int type, int closeSec, { this->closeSec = closeSec; this->currentSec = 0; - this->labTime->clear(); + this->labCountDown->clear(); this->labInfo->setText(title); checkSec(); @@ -1377,6 +1403,11 @@ QUIDateSelect::~QUIDateSelect() delete widgetMain; } +void QUIDateSelect::showEvent(QShowEvent *) +{ + this->activateWindow(); +} + bool QUIDateSelect::eventFilter(QObject *watched, QEvent *event) { static QPoint mousePoint; @@ -1410,6 +1441,7 @@ void QUIDateSelect::initControl() verticalLayout->setSpacing(0); verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); verticalLayout->setContentsMargins(1, 1, 1, 1); + widgetTitle = new QWidget(this); widgetTitle->setObjectName(QString::fromUtf8("widgetTitle")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); @@ -1417,10 +1449,12 @@ void QUIDateSelect::initControl() sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(widgetTitle->sizePolicy().hasHeightForWidth()); widgetTitle->setSizePolicy(sizePolicy); + horizontalLayout1 = new QHBoxLayout(widgetTitle); horizontalLayout1->setSpacing(0); horizontalLayout1->setObjectName(QString::fromUtf8("horizontalLayout1")); horizontalLayout1->setContentsMargins(0, 0, 0, 0); + labIco = new QLabel(widgetTitle); labIco->setObjectName(QString::fromUtf8("labIco")); QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Preferred); @@ -1445,10 +1479,12 @@ void QUIDateSelect::initControl() widgetMenu->setObjectName(QString::fromUtf8("widgetMenu")); sizePolicy1.setHeightForWidth(widgetMenu->sizePolicy().hasHeightForWidth()); widgetMenu->setSizePolicy(sizePolicy1); + horizontalLayout = new QHBoxLayout(widgetMenu); horizontalLayout->setSpacing(0); horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); horizontalLayout->setContentsMargins(0, 0, 0, 0); + btnMenu_Close = new QPushButton(widgetMenu); btnMenu_Close->setObjectName(QString::fromUtf8("btnMenu_Close")); QSizePolicy sizePolicy3(QSizePolicy::Minimum, QSizePolicy::Expanding); @@ -1466,14 +1502,17 @@ void QUIDateSelect::initControl() widgetMain = new QWidget(this); widgetMain->setObjectName(QString::fromUtf8("widgetMainQUI")); + verticalLayout1 = new QVBoxLayout(widgetMain); verticalLayout1->setSpacing(6); verticalLayout1->setObjectName(QString::fromUtf8("verticalLayout1")); verticalLayout1->setContentsMargins(6, 6, 6, 6); + frame = new QFrame(widgetMain); frame->setObjectName(QString::fromUtf8("frame")); frame->setFrameShape(QFrame::Box); frame->setFrameShadow(QFrame::Sunken); + gridLayout = new QGridLayout(frame); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); labStart = new QLabel(frame); @@ -1486,8 +1525,8 @@ void QUIDateSelect::initControl() btnOk->setMinimumSize(QSize(85, 0)); btnOk->setCursor(QCursor(Qt::PointingHandCursor)); btnOk->setFocusPolicy(Qt::StrongFocus); - btnOk->setIcon(QIcon(":/image/btn_ok.png")); gridLayout->addWidget(btnOk, 0, 2, 1, 1); + btnOk->setDefault(true); labEnd = new QLabel(frame); labEnd->setObjectName(QString::fromUtf8("labEnd")); @@ -1499,7 +1538,6 @@ void QUIDateSelect::initControl() btnClose->setMinimumSize(QSize(85, 0)); btnClose->setCursor(QCursor(Qt::PointingHandCursor)); btnClose->setFocusPolicy(Qt::StrongFocus); - btnClose->setIcon(QIcon(":/image/btn_close.png")); gridLayout->addWidget(btnClose, 1, 2, 1, 1); dateStart = new QDateTimeEdit(frame); @@ -1533,6 +1571,8 @@ void QUIDateSelect::initControl() labEnd->setText("结束时间"); btnOk->setText("确定"); btnClose->setText("关闭"); + QUIHelper::setIconBtn(btnOk, ":/image/btn_ok.png", 0xf00c); + QUIHelper::setIconBtn(btnClose, ":/image/btn_close.png", 0xf00d); dateStart->setDate(QDate::currentDate()); dateEnd->setDate(QDate::currentDate().addDays(1)); @@ -2138,6 +2178,22 @@ void QUIHelper::initFile(const QString &sourceName, const QString &targetName) } } +void QUIHelper::setIconBtn(QAbstractButton *btn, const QString &png, const QChar &str) +{ + int size = 16; + int width = 18; + int height = 18; + QPixmap pix; + if (QPixmap(png).isNull()) { + pix = IconHelper::Instance()->getPixmap(QUIConfig::TextColor, str, size, width, height); + } else { + pix = QPixmap(png); + } + + btn->setIconSize(QSize(width, height)); + btn->setIcon(QIcon(pix)); +} + void QUIHelper::newDir(const QString &dirName) { QString strDir = dirName; @@ -2575,6 +2631,26 @@ bool QUIHelper::isEmail(const QString &email) return true; } +QString QUIHelper::ipv4IntToString(quint32 ip) +{ + QString result = QString("%1.%2.%3.%4").arg((ip >> 24) & 0xFF).arg((ip >> 16) & 0xFF).arg((ip >> 8) & 0xFF).arg(ip & 0xFF); + return result; +} + +quint32 QUIHelper::ipv4StringToInt(const QString &ip) +{ + int result = 0; + if (isIP(ip)) { + QStringList list = ip.split("."); + int ip0 = list.at(0).toInt(); + int ip1 = list.at(1).toInt(); + int ip2 = list.at(2).toInt(); + int ip3 = list.at(3).toInt(); + result = ip3 | ip2 << 8 | ip1 << 16 | ip0 << 24; + } + return result; +} + int QUIHelper::strHexToDecimal(const QString &strHex) { bool ok; @@ -3509,7 +3585,7 @@ bool QUIHelper::isWebOk() return ipLive("115.239.211.112", 80); } -void QUIHelper::initTableView(QTableView *tableView, int rowHeight, bool headVisible, bool edit) +void QUIHelper::initTableView(QTableView *tableView, int rowHeight, bool headVisible, bool edit, bool stretchLast) { //取消自动换行 tableView->setWordWrap(false); @@ -3522,7 +3598,7 @@ void QUIHelper::initTableView(QTableView *tableView, int rowHeight, bool headVis //选中一行表头是否加粗 tableView->horizontalHeader()->setHighlightSections(false); //最后一行拉伸填充 - tableView->horizontalHeader()->setStretchLastSection(true); + tableView->horizontalHeader()->setStretchLastSection(stretchLast); //行标题最小宽度尺寸 tableView->horizontalHeader()->setMinimumSectionSize(0); //行标题最大高度 diff --git a/nettool/api/quiwidget.h b/nettool/api/quiwidget.h index e660b01..f82981c 100644 --- a/nettool/api/quiwidget.h +++ b/nettool/api/quiwidget.h @@ -71,33 +71,33 @@ class QUIWidget : public QDialog public: //将部分对象作为枚举值暴露给外部 enum Widget { - Lab_Ico = 0, //左上角图标 - BtnMenu = 1, //下拉菜单按钮 - BtnMenu_Min = 2, //最小化按钮 - BtnMenu_Max = 3, //最大化按钮 - BtnMenu_Normal = 4, //还原按钮 - BtnMenu_Close = 5 //关闭按钮 + Lab_Ico = 0, //左上角图标 + BtnMenu = 1, //下拉菜单按钮 + BtnMenu_Min = 2, //最小化按钮 + BtnMenu_Max = 3, //最大化按钮 + BtnMenu_Normal = 4, //还原按钮 + BtnMenu_Close = 5 //关闭按钮 }; //样式枚举 enum Style { - Style_Silvery = 0, //银色样式 - Style_Blue = 1, //蓝色样式 - Style_LightBlue = 2, //淡蓝色样式 - Style_DarkBlue = 3, //深蓝色样式 - Style_Gray = 4, //灰色样式 - Style_LightGray = 5, //浅灰色样式 - Style_DarkGray = 6, //深灰色样式 - Style_Black = 7, //黑色样式 - Style_LightBlack = 8, //浅黑色样式 - Style_DarkBlack = 9, //深黑色样式 - Style_PSBlack = 10, //PS黑色样式 - Style_FlatBlack = 11, //黑色扁平样式 - Style_FlatWhite = 12, //白色扁平样式 - Style_FlatBlue = 13, //蓝色扁平样式 - Style_Purple = 14, //紫色样式 - Style_BlackBlue = 15, //黑蓝色样式 - Style_BlackVideo = 16 //视频监控黑色样式 + Style_Silvery = 0, //银色样式 + Style_Blue = 1, //蓝色样式 + Style_LightBlue = 2, //淡蓝色样式 + Style_DarkBlue = 3, //深蓝色样式 + Style_Gray = 4, //灰色样式 + Style_LightGray = 5, //浅灰色样式 + Style_DarkGray = 6, //深灰色样式 + Style_Black = 7, //黑色样式 + Style_LightBlack = 8, //浅黑色样式 + Style_DarkBlack = 9, //深黑色样式 + Style_PSBlack = 10, //PS黑色样式 + Style_FlatBlack = 11, //黑色扁平样式 + Style_FlatWhite = 12, //白色扁平样式 + Style_FlatBlue = 13, //蓝色扁平样式 + Style_Purple = 14, //紫色样式 + Style_BlackBlue = 15, //黑蓝色样式 + Style_BlackVideo = 16 //视频监控黑色样式 }; public: @@ -125,11 +125,11 @@ private: QVBoxLayout *verticalLayout3; private: - QString title; //标题 - Qt::Alignment alignment; //标题文本对齐 - bool minHide; //最小化隐藏 - bool exitAll; //退出整个程序 - QWidget *mainWidget; //主窗体对象 + QString title; //标题 + Qt::Alignment alignment;//标题文本对齐 + bool minHide; //最小化隐藏 + bool exitAll; //退出整个程序 + QWidget *mainWidget; //主窗体对象 public: QLabel *getLabIco() const; @@ -148,9 +148,9 @@ public: QSize minimumSizeHint() const; private slots: - void initControl(); //初始化控件 - void initForm(); //初始化窗体 - void changeStyle(); //更换样式 + void initControl(); //初始化控件 + void initForm(); //初始化窗体 + void changeStyle(); //更换样式 private slots: void on_btnMenu_Min_clicked(); @@ -202,6 +202,7 @@ public: ~QUIMessageBox(); protected: + void showEvent(QShowEvent *); void closeEvent(QCloseEvent *); bool eventFilter(QObject *watched, QEvent *event); @@ -213,7 +214,7 @@ private: QHBoxLayout *horizontalLayout3; QLabel *labIco; QLabel *labTitle; - QLabel *labTime; + QLabel *labCountDown; QWidget *widgetMenu; QHBoxLayout *horizontalLayout4; QPushButton *btnMenu_Close; @@ -231,13 +232,13 @@ private: QPushButton *btnCancel; private: - int closeSec; //总显示时间 - int currentSec; //当前已显示时间 + int closeSec; //总显示时间 + int currentSec; //当前已显示时间 private slots: - void initControl(); //初始化控件 - void initForm(); //初始化窗体 - void checkSec(); //校验倒计时 + void initControl(); //初始化控件 + void initForm(); //初始化窗体 + void checkSec(); //校验倒计时 private slots: void on_btnOk_clicked(); @@ -245,6 +246,7 @@ private slots: public Q_SLOTS: void setIconMain(const QChar &str, quint32 size = 12); + void setIconMsg(const QString &png, const QChar &str); void setMessage(const QString &msg, int type, int closeSec = 0); }; @@ -259,6 +261,7 @@ public: ~QUITipBox(); protected: + void showEvent(QShowEvent *); void closeEvent(QCloseEvent *); bool eventFilter(QObject *watched, QEvent *event); @@ -270,7 +273,7 @@ private: QHBoxLayout *horizontalLayout2; QLabel *labIco; QLabel *labTitle; - QLabel *labTime; + QLabel *labCountDown; QWidget *widgetMenu; QHBoxLayout *horizontalLayout; QPushButton *btnMenu_Close; @@ -282,13 +285,13 @@ private: bool fullScreen; private: - int closeSec; //总显示时间 - int currentSec; //当前已显示时间 + int closeSec; //总显示时间 + int currentSec; //当前已显示时间 private slots: - void initControl(); //初始化控件 - void initForm(); //初始化窗体 - void checkSec(); //校验倒计时 + void initControl(); //初始化控件 + void initForm(); //初始化窗体 + void checkSec(); //校验倒计时 private slots: void on_btnMenu_Close_clicked(); @@ -323,7 +326,7 @@ private: QHBoxLayout *horizontalLayout1; QLabel *labIco; QLabel *labTitle; - QLabel *labTime; + QLabel *labCountDown; QWidget *widgetMenu; QHBoxLayout *horizontalLayout2; QPushButton *btnMenu_Close; @@ -340,14 +343,14 @@ private: QPushButton *btnCancel; private: - int closeSec; //总显示时间 - int currentSec; //当前已显示时间 - QString value; //当前值 + int closeSec; //总显示时间 + int currentSec; //当前已显示时间 + QString value; //当前值 private slots: - void initControl(); //初始化控件 - void initForm(); //初始化窗体 - void checkSec(); //校验倒计时 + void initControl(); //初始化控件 + void initForm(); //初始化窗体 + void checkSec(); //校验倒计时 private slots: void on_btnOk_clicked(); @@ -375,6 +378,7 @@ public: ~QUIDateSelect(); protected: + void showEvent(QShowEvent *); bool eventFilter(QObject *watched, QEvent *event); private: @@ -400,13 +404,13 @@ private: QDateTimeEdit *dateEnd; private: - QString startDateTime; //开始时间 - QString endDateTime; //结束时间 - QString format; //日期时间格式 + QString startDateTime; //开始时间 + QString endDateTime; //结束时间 + QString format; //日期时间格式 private slots: - void initControl(); //初始化控件 - void initForm(); //初始化窗体 + void initControl(); //初始化控件 + void initForm(); //初始化窗体 private slots: void on_btnOk_clicked(); @@ -595,6 +599,9 @@ public: //初始化文件,不存在则拷贝 static void initFile(const QString &sourceName, const QString &targetName); + //设置图标到按钮 + static void setIconBtn(QAbstractButton *btn, const QString &png, const QChar &str); + //新建目录 static void newDir(const QString &dirName); @@ -653,6 +660,10 @@ public: //判断是否是合法的邮箱地址 static bool isEmail(const QString &email); + //IP地址字符串与整型转换 + static QString ipv4IntToString(quint32 ip); + static quint32 ipv4StringToInt(const QString &ip); + //16进制字符串转10进制 static int strHexToDecimal(const QString &strHex); //10进制字符串转10进制 @@ -755,7 +766,9 @@ public: static bool isWebOk(); //初始化表格 - static void initTableView(QTableView *tableView, int rowHeight = 25, bool headVisible = false, bool edit = false); + static void initTableView(QTableView *tableView, int rowHeight = 25, + bool headVisible = false, bool edit = false, + bool stretchLast = true); //弹出框 static int showMessageBox(const QString &info, int type = 0, int closeSec = 0, bool exec = false); diff --git a/ntpclient/frmntpclient.ui b/ntpclient/frmntpclient.ui index 9d069ce..ac6e8db 100644 --- a/ntpclient/frmntpclient.ui +++ b/ntpclient/frmntpclient.ui @@ -33,7 +33,7 @@ - ntp1.aliyun.com + 133.100.11.8 diff --git a/ntpclient/ntpclient.h b/ntpclient/ntpclient.h index 7f1e475..f270b03 100644 --- a/ntpclient/ntpclient.h +++ b/ntpclient/ntpclient.h @@ -3,8 +3,8 @@ /** * Ntp校时类 作者:feiyangqingyun(QQ:517216493) 2017-2-16 - * 1:可设置Ntp服务器IP地址 - * 2:收到时间信号发出 + * 1. 可设置Ntp服务器IP地址 + * 2. 收到时间信号发出 */ #include @@ -12,13 +12,7 @@ class QUdpSocket; #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT NtpClient : public QObject +class Q_DECL_EXPORT NtpClient : public QObject #else class NtpClient : public QObject #endif @@ -45,10 +39,8 @@ signals: public slots: //设置NTP服务器IP void setNtpIP(const QString &ntpIP); - //获取日期时间 void getDateTime(); - }; #endif // NTPCLIENT_H diff --git a/pressureconversioncalculator/api/api.pri b/pressureconversioncalculator/api/api.pri deleted file mode 100644 index fdc867f..0000000 --- a/pressureconversioncalculator/api/api.pri +++ /dev/null @@ -1,7 +0,0 @@ -HEADERS += \ - $$PWD/appinit.h \ - $$PWD/iconhelper.h - -SOURCES += \ - $$PWD/appinit.cpp \ - $$PWD/iconhelper.cpp diff --git a/pressureconversioncalculator/api/appinit.cpp b/pressureconversioncalculator/api/appinit.cpp deleted file mode 100644 index 749c987..0000000 --- a/pressureconversioncalculator/api/appinit.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include "appinit.h" -#include "qmutex.h" -#include "qapplication.h" -#include "qevent.h" -#include "qwidget.h" - -QScopedPointer AppInit::self; -AppInit *AppInit::Instance() -{ - if (self.isNull()) { - static QMutex mutex; - QMutexLocker locker(&mutex); - if (self.isNull()) { - self.reset(new AppInit); - } - } - - return self.data(); -} - -AppInit::AppInit(QObject *parent) : QObject(parent) -{ -} - -bool AppInit::eventFilter(QObject *watched, QEvent *event) -{ - QWidget *w = (QWidget *)watched; - if (!w->property("canMove").toBool()) { - return QObject::eventFilter(watched, event); - } - - static QPoint mousePoint; - static bool mousePressed = false; - - QMouseEvent *mouseEvent = static_cast(event); - if (mouseEvent->type() == QEvent::MouseButtonPress) { - if (mouseEvent->button() == Qt::LeftButton) { - mousePressed = true; - mousePoint = mouseEvent->globalPos() - w->pos(); - return true; - } - } else if (mouseEvent->type() == QEvent::MouseButtonRelease) { - mousePressed = false; - return true; - } else if (mouseEvent->type() == QEvent::MouseMove) { - if (mousePressed && (mouseEvent->buttons() && Qt::LeftButton)) { - w->move(mouseEvent->globalPos() - mousePoint); - return true; - } - } - - return QObject::eventFilter(watched, event); -} - -void AppInit::start() -{ - qApp->installEventFilter(this); -} diff --git a/pressureconversioncalculator/api/appinit.h b/pressureconversioncalculator/api/appinit.h deleted file mode 100644 index ce4a684..0000000 --- a/pressureconversioncalculator/api/appinit.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef APPINIT_H -#define APPINIT_H - -#include - -class AppInit : public QObject -{ - Q_OBJECT -public: - static AppInit *Instance(); - explicit AppInit(QObject *parent = 0); - -protected: - bool eventFilter(QObject *watched, QEvent *event); - -private: - static QScopedPointer self; - -signals: - -public slots: - void start(); -}; - -#endif // APPINIT_H diff --git a/pressureconversioncalculator/api/iconhelper.cpp b/pressureconversioncalculator/api/iconhelper.cpp deleted file mode 100644 index b9783a4..0000000 --- a/pressureconversioncalculator/api/iconhelper.cpp +++ /dev/null @@ -1,240 +0,0 @@ -#include "iconhelper.h" - -QScopedPointer IconHelper::self; -IconHelper *IconHelper::Instance() -{ - if (self.isNull()) { - static QMutex mutex; - QMutexLocker locker(&mutex); - if (self.isNull()) { - self.reset(new IconHelper); - } - } - - return self.data(); -} - -IconHelper::IconHelper(QObject *parent) : QObject(parent) -{ - //判断图形字体是否存在,不存在则加入 - QFontDatabase fontDb; - if (!fontDb.families().contains("FontAwesome")) { - int fontId = fontDb.addApplicationFont(":/image/fontawesome-webfont.ttf"); - QStringList fontName = fontDb.applicationFontFamilies(fontId); - if (fontName.count() == 0) { - qDebug() << "load fontawesome-webfont.ttf error"; - } - } - - if (fontDb.families().contains("FontAwesome")) { - iconFont = QFont("FontAwesome"); -#if (QT_VERSION >= QT_VERSION_CHECK(4,8,0)) - iconFont.setHintingPreference(QFont::PreferNoHinting); -#endif - } -} - -void IconHelper::setIcon(QLabel *lab, const QChar &str, quint32 size) -{ - iconFont.setPixelSize(size); - lab->setFont(iconFont); - lab->setText(str); -} - -void IconHelper::setIcon(QAbstractButton *btn, const QChar &str, quint32 size) -{ - iconFont.setPixelSize(size); - btn->setFont(iconFont); - btn->setText(str); -} - -QPixmap IconHelper::getPixmap(const QColor &color, const QChar &str, quint32 size, - quint32 pixWidth, quint32 pixHeight, int flags) -{ - QPixmap pix(pixWidth, pixHeight); - pix.fill(Qt::transparent); - - QPainter painter; - painter.begin(&pix); - painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing); - painter.setPen(color); - - iconFont.setPixelSize(size); - painter.setFont(iconFont); - painter.drawText(pix.rect(), flags, str); - painter.end(); - - return pix; -} - -QPixmap IconHelper::getPixmap(QToolButton *btn, bool normal) -{ - QPixmap pix; - int index = btns.indexOf(btn); - - if (index >= 0) { - if (normal) { - pix = pixNormal.at(index); - } else { - pix = pixDark.at(index); - } - } - - return pix; -} - -void IconHelper::setStyle(QWidget *widget, const QString &type, int borderWidth, const QString &borderColor, - const QString &normalBgColor, const QString &darkBgColor, - const QString &normalTextColor, const QString &darkTextColor) -{ - QString strBorder; - if (type == "top") { - strBorder = QString("border-width:%1px 0px 0px 0px;padding:%1px %2px %2px %2px;") - .arg(borderWidth).arg(borderWidth * 2); - } else if (type == "right") { - strBorder = QString("border-width:0px %1px 0px 0px;padding:%2px %1px %2px %2px;") - .arg(borderWidth).arg(borderWidth * 2); - } else if (type == "bottom") { - strBorder = QString("border-width:0px 0px %1px 0px;padding:%2px %2px %1px %2px;") - .arg(borderWidth).arg(borderWidth * 2); - } else if (type == "left") { - strBorder = QString("border-width:0px 0px 0px %1px;padding:%2px %2px %2px %1px;") - .arg(borderWidth).arg(borderWidth * 2); - } - - QStringList qss; - qss.append(QString("QWidget[flag=\"%1\"] QAbstractButton{border-style:none;border-radius:0px;padding:5px;color:%2;background:%3;}") - .arg(type).arg(normalTextColor).arg(normalBgColor)); - - qss.append(QString("QWidget[flag=\"%1\"] QAbstractButton:hover," - "QWidget[flag=\"%1\"] QAbstractButton:pressed," - "QWidget[flag=\"%1\"] QAbstractButton:checked{" - "border-style:solid;%2border-color:%3;color:%4;background:%5;}") - .arg(type).arg(strBorder).arg(borderColor).arg(darkTextColor).arg(darkBgColor)); - - widget->setStyleSheet(qss.join("")); -} - -void IconHelper::setStyle(QWidget *widget, QList btns, QList pixChar, - quint32 iconSize, quint32 iconWidth, quint32 iconHeight, - const QString &type, int borderWidth, const QString &borderColor, - const QString &normalBgColor, const QString &darkBgColor, - const QString &normalTextColor, const QString &darkTextColor) -{ - int btnCount = btns.count(); - int charCount = pixChar.count(); - if (btnCount <= 0 || charCount <= 0 || btnCount != charCount) { - return; - } - - QString strBorder; - if (type == "top") { - strBorder = QString("border-width:%1px 0px 0px 0px;padding:%1px %2px %2px %2px;") - .arg(borderWidth).arg(borderWidth * 2); - } else if (type == "right") { - strBorder = QString("border-width:0px %1px 0px 0px;padding:%2px %1px %2px %2px;") - .arg(borderWidth).arg(borderWidth * 2); - } else if (type == "bottom") { - strBorder = QString("border-width:0px 0px %1px 0px;padding:%2px %2px %1px %2px;") - .arg(borderWidth).arg(borderWidth * 2); - } else if (type == "left") { - strBorder = QString("border-width:0px 0px 0px %1px;padding:%2px %2px %2px %1px;") - .arg(borderWidth).arg(borderWidth * 2); - } - - //如果图标是左侧显示则需要让没有选中的按钮左侧也有加深的边框,颜色为背景颜色 - QStringList qss; - if (btns.at(0)->toolButtonStyle() == Qt::ToolButtonTextBesideIcon) { - qss.append(QString("QWidget[flag=\"%1\"] QAbstractButton{border-style:solid;border-radius:0px;%2border-color:%3;color:%4;background:%5;}") - .arg(type).arg(strBorder).arg(normalBgColor).arg(normalTextColor).arg(normalBgColor)); - } else { - qss.append(QString("QWidget[flag=\"%1\"] QAbstractButton{border-style:none;border-radius:0px;padding:5px;color:%2;background:%3;}") - .arg(type).arg(normalTextColor).arg(normalBgColor)); - } - - qss.append(QString("QWidget[flag=\"%1\"] QAbstractButton:hover," - "QWidget[flag=\"%1\"] QAbstractButton:pressed," - "QWidget[flag=\"%1\"] QAbstractButton:checked{" - "border-style:solid;%2border-color:%3;color:%4;background:%5;}") - .arg(type).arg(strBorder).arg(borderColor).arg(darkTextColor).arg(darkBgColor)); - - qss.append(QString("QWidget#%1{background:%2;}").arg(widget->objectName()).arg(normalBgColor)); - - qss.append(QString("QWidget>QToolButton{border-width:0px;}")); - qss.append(QString("QWidget>QToolButton{background-color:%1;color:%2;}") - .arg(normalBgColor).arg(normalTextColor)); - qss.append(QString("QWidget>QToolButton:hover,QWidget>QToolButton:pressed,QWidget>QToolButton:checked{background-color:%1;color:%2;}") - .arg(darkBgColor).arg(darkTextColor)); - - widget->setStyleSheet(qss.join("")); - - for (int i = 0; i < btnCount; i++) { - //存储对应按钮对象,方便鼠标移上去的时候切换图片 - QPixmap pixNormal = getPixmap(normalTextColor, QChar(pixChar.at(i)), iconSize, iconWidth, iconHeight); - QPixmap pixDark = getPixmap(darkTextColor, QChar(pixChar.at(i)), iconSize, iconWidth, iconHeight); - - btns.at(i)->setIcon(QIcon(pixNormal)); - btns.at(i)->setIconSize(QSize(iconWidth, iconHeight)); - btns.at(i)->installEventFilter(this); - - this->btns.append(btns.at(i)); - this->pixNormal.append(pixNormal); - this->pixDark.append(pixDark); - } -} - -void IconHelper::setStyle(QFrame *frame, QList btns, QList pixChar, - quint32 iconSize, quint32 iconWidth, quint32 iconHeight, - const QString &normalBgColor, const QString &darkBgColor, - const QString &normalTextColor, const QString &darkTextColor) -{ - int btnCount = btns.count(); - int charCount = pixChar.count(); - if (btnCount <= 0 || charCount <= 0 || btnCount != charCount) { - return; - } - - QStringList qss; - qss.append(QString("QFrame>QToolButton{border-style:none;border-width:0px;}")); - qss.append(QString("QFrame>QToolButton{background-color:%1;color:%2;}") - .arg(normalBgColor).arg(normalTextColor)); - qss.append(QString("QFrame>QToolButton:hover,QFrame>QToolButton:pressed,QFrame>QToolButton:checked{background-color:%1;color:%2;}") - .arg(darkBgColor).arg(darkTextColor)); - - frame->setStyleSheet(qss.join("")); - - for (int i = 0; i < btnCount; i++) { - //存储对应按钮对象,方便鼠标移上去的时候切换图片 - QPixmap pixNormal = getPixmap(normalTextColor, QChar(pixChar.at(i)), iconSize, iconWidth, iconHeight); - QPixmap pixDark = getPixmap(darkTextColor, QChar(pixChar.at(i)), iconSize, iconWidth, iconHeight); - - btns.at(i)->setIcon(QIcon(pixNormal)); - btns.at(i)->setIconSize(QSize(iconWidth, iconHeight)); - btns.at(i)->installEventFilter(this); - - this->btns.append(btns.at(i)); - this->pixNormal.append(pixNormal); - this->pixDark.append(pixDark); - } -} - -bool IconHelper::eventFilter(QObject *watched, QEvent *event) -{ - if (watched->inherits("QToolButton")) { - QToolButton *btn = (QToolButton *)watched; - int index = btns.indexOf(btn); - if (index >= 0) { - if (event->type() == QEvent::Enter) { - btn->setIcon(QIcon(pixDark.at(index))); - } else if (event->type() == QEvent::Leave) { - if (btn->isChecked()) { - btn->setIcon(QIcon(pixDark.at(index))); - } else { - btn->setIcon(QIcon(pixNormal.at(index))); - } - } - } - } - - return QObject::eventFilter(watched, event); -} diff --git a/pressureconversioncalculator/api/iconhelper.h b/pressureconversioncalculator/api/iconhelper.h deleted file mode 100644 index 95ce7bf..0000000 --- a/pressureconversioncalculator/api/iconhelper.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef ICONHELPER_H -#define ICONHELPER_H - -#include -#include -#if (QT_VERSION > QT_VERSION_CHECK(5,0,0)) -#include -#endif - -//图形字体处理类 -class IconHelper : public QObject -{ - Q_OBJECT - -public: - static IconHelper *Instance(); - explicit IconHelper(QObject *parent = 0); - - void setIcon(QLabel *lab, const QChar &str, quint32 size = 12); - void setIcon(QAbstractButton *btn, const QChar &str, quint32 size = 12); - QPixmap getPixmap(const QColor &color, const QChar &str, quint32 size = 12, - quint32 pixWidth = 15, quint32 pixHeight = 15, - int flags = Qt::AlignCenter); - - //根据按钮获取该按钮对应的图标 - QPixmap getPixmap(QToolButton *btn, bool normal); - - //指定导航面板样式,不带图标 - static void setStyle(QWidget *widget, const QString &type = "left", int borderWidth = 3, - const QString &borderColor = "#029FEA", - const QString &normalBgColor = "#292F38", - const QString &darkBgColor = "#1D2025", - const QString &normalTextColor = "#54626F", - const QString &darkTextColor = "#FDFDFD"); - - //指定导航面板样式,带图标和效果切换 - void setStyle(QWidget *widget, QList btns, QList pixChar, - quint32 iconSize = 12, quint32 iconWidth = 15, quint32 iconHeight = 15, - const QString &type = "left", int borderWidth = 3, - const QString &borderColor = "#029FEA", - const QString &normalBgColor = "#292F38", - const QString &darkBgColor = "#1D2025", - const QString &normalTextColor = "#54626F", - const QString &darkTextColor = "#FDFDFD"); - - //指定导航按钮样式,带图标和效果切换 - void setStyle(QFrame *frame, QList btns, QList pixChar, - quint32 iconSize = 12, quint32 iconWidth = 15, quint32 iconHeight = 15, - const QString &normalBgColor = "#2FC5A2", - const QString &darkBgColor = "#3EA7E9", - const QString &normalTextColor = "#EEEEEE", - const QString &darkTextColor = "#FFFFFF"); - -protected: - bool eventFilter(QObject *watched, QEvent *event); - -private: - static QScopedPointer self; - QFont iconFont; //图形字体 - QList btns; //按钮队列 - QList pixNormal; //正常图片队列 - QList pixDark; //加深图片队列 -}; -#endif // ICONHELPER_H diff --git a/pressureconversioncalculator/form/form.pri b/pressureconversioncalculator/form/form.pri deleted file mode 100644 index 1b1a664..0000000 --- a/pressureconversioncalculator/form/form.pri +++ /dev/null @@ -1,8 +0,0 @@ -FORMS += \ - $$PWD/frmmain.ui - -HEADERS += \ - $$PWD/frmmain.h - -SOURCES += \ - $$PWD/frmmain.cpp diff --git a/pressureconversioncalculator/form/frmmain.cpp b/pressureconversioncalculator/form/frmmain.cpp deleted file mode 100644 index 9de874c..0000000 --- a/pressureconversioncalculator/form/frmmain.cpp +++ /dev/null @@ -1,941 +0,0 @@ -#pragma execution_character_set("utf-8") - -#include "frmmain.h" -#include "ui_frmmain.h" -#include "iconhelper.h" -#include - -frmMain::frmMain(QWidget *parent) : QDialog(parent), ui(new Ui::frmMain) -{ - ui->setupUi(this); - this->initForm(); -} - -frmMain::~frmMain() -{ - delete ui; -} - -bool frmMain::eventFilter(QObject *watched, QEvent *event) -{ - if (event->type() == QEvent::MouseButtonDblClick) { - if (watched == ui->widgetTitle) { - on_btnMenu_Max_clicked(); - return true; - } - } - - return QWidget::eventFilter(watched, event); -} - -void frmMain::initForm() -{ - this->setProperty("form", true); - this->setProperty("canMove", true); - this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | - Qt::WindowMinMaxButtonsHint); - IconHelper::Instance()->setIcon(ui->btnMenu_Min, QChar(0xf068)); - IconHelper::Instance()->setIcon(ui->btnMenu_Max, QChar(0xf067)); - IconHelper::Instance()->setIcon(ui->btnMenu_Close, QChar(0xf00d)); - //ui->widgetMenu->setVisible(false); - ui->widgetTitle->installEventFilter(this); - ui->widgetTitle->setProperty("form", "title"); - ui->widgetTop->setProperty("nav", "top"); - ui->labTitle->setText("压力单位转换工具"); - ui->labTitle->setFont(QFont("Microsoft Yahei", 20)); - this->setWindowTitle(ui->labTitle->text()); - ui->stackedWidget->setStyleSheet("QLabel{font:20pt;}QLineEdit{font:20pt;}QPushButton{font:20pt;}QSpinBox{font:20pt;}"); - //单独设置指示器大小 - int addWidth = 20; - int addHeight = 10; - int rbtnWidth = 15; - int ckWidth = 13; - int scrWidth = 12; - int borderWidth = 3; - QStringList qss; - qss.append( - QString("QComboBox::drop-down,QDateEdit::drop-down,QTimeEdit::drop-down,QDateTimeEdit::drop-down{width:%1px;}").arg( - addWidth)); - qss.append( - QString("QComboBox::down-arrow,QDateEdit[calendarPopup=\"true\"]::down-arrow,QTimeEdit[calendarPopup=\"true\"]::down-arrow," - "QDateTimeEdit[calendarPopup=\"true\"]::down-arrow{width:%1px;height:%1px;right:2px;}").arg( - addHeight)); - qss.append(QString("QRadioButton::indicator{width:%1px;height:%1px;}").arg(rbtnWidth)); - qss.append( - QString("QCheckBox::indicator,QGroupBox::indicator,QTreeWidget::indicator,QListWidget::indicator{width:%1px;height:%1px;}").arg( - ckWidth)); - qss.append( - QString("QScrollBar:horizontal{min-height:%1px;border-radius:%2px;}QScrollBar::handle:horizontal{border-radius:%2px;}" - "QScrollBar:vertical{min-width:%1px;border-radius:%2px;}QScrollBar::handle:vertical{border-radius:%2px;}").arg( - scrWidth).arg(scrWidth / 2)); - qss.append(QString("QWidget#widget_top>QToolButton:pressed,QWidget#widget_top>QToolButton:hover," - "QWidget#widget_top>QToolButton:checked,QWidget#widget_top>QLabel:hover{" - "border-width:0px 0px %1px 0px;}").arg(borderWidth)); - qss.append(QString("QWidget#widgetleft>QPushButton:checked,QWidget#widgetleft>QToolButton:checked," - "QWidget#widgetleft>QPushButton:pressed,QWidget#widgetleft>QToolButton:pressed{" - "border-width:0px 0px 0px %1px;}").arg(borderWidth)); - this->setStyleSheet(qss.join("")); - QSize icoSize(32, 32); - int icoWidth = 85; - //设置顶部导航按钮 - QList tbtns = ui->widgetTop->findChildren(); - - foreach (QToolButton *btn, tbtns) { - btn->setIconSize(icoSize); - btn->setMinimumWidth(icoWidth); - btn->setCheckable(true); - connect(btn, SIGNAL(clicked()), this, SLOT(buttonClick())); - } - - QList ledits = ui->page1->findChildren(); - - foreach (QLineEdit *ledit, ledits) { - connect(ledit, SIGNAL(textEdited(const QString)), this, SLOT(doTextEdited(const QString))); - } - - ui->btnMain->click(); - on_spinBox_rbit_valueChanged(1); -} - -void frmMain::buttonClick() -{ - QToolButton *b = (QToolButton *)sender(); - QString name = b->text(); - QList tbtns = ui->widgetTop->findChildren(); - - foreach (QToolButton *btn, tbtns) { - if (btn == b) { - btn->setChecked(true); - } else { - btn->setChecked(false); - } - } - - if (name == "主界面") { - ui->stackedWidget->setCurrentIndex(0); - } else if (name == "用户退出") { - exit(0); - } -} - -void frmMain::doTextEdited(const QString str) -{ - QLineEdit *l = (QLineEdit *)sender(); - QList ledits = ui->page1->findChildren(); - //转换前单位 - QString beforeName = l->objectName(); - //转换前数值 - double beforeValue = l->text().toDouble(); - - foreach (QLineEdit *ledit, ledits) { - //转换后单位 - QString curName = ledit->objectName(); - - if (ledit == l) { - } else if (curName == "lineEdit_bar") { - //巴 (bar) - if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.01, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.001, 'f', numOfDecimalPoints); - qDebug() << outStr; - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到巴 (bar) - QString outStr = QString::number(beforeValue * 1.01325, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.0004788, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.03386388, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.00009807, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到巴 (bar) - QString outStr = QString::number(beforeValue * 10, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.001, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.00001, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.00133322, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.06894757, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.980665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.00009807, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_kpa") { - //千帕 (kPa) - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 100.0, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 0.1, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 101.325, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 0.04788026, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 3.38638816, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 0.00980665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 1000, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 0.1, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 0.001, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 0.13332237, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 6.894757, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 98.0665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 0.00980665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_mbar") { - //毫巴 (mbar) - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 1000.0, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 10, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 1013.25, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 0.47880257, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 33.86388158, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 0.0980665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 10000, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 1, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 0.01, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 1.33322368, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 68.94757, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 980.665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 0.0980665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_unit") { - //标准大气压 - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.98692327, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.00986923, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.00098692, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.00047254, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.03342105, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.00009678, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到标准大气压 - QString outStr = QString::number(beforeValue * 9.86923267, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.00098692, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.00000987, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.00131579, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.06804596, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.96784111, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.00009678, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_feet") { - //磅力/英尺2 - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 2088.54351212, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 20.88543512, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 2.08854351, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 2116.21671366, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 70.72619017, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 0.20481615, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 20885.43512121, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 2.08854351, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 0.02088544, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 2.78449568, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 144, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 2048.16152331, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 0.20481615, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_british_hg") { - //英吋汞柱 - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 29.52998751, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 0.29529988, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 0.02952999, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 29.92125984, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 0.01413903, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 0.0028959, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 295.29987508, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 0.02952999, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 0.0002953, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 0.03937008, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 2.03602088, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 28.9590252, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 0.0028959, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_kilogram_force") { - //公斤力/米2 - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 10197.16212978, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 101.9716213, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 10.19716213, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 10332.274528, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 4.88242743, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 345.3154908, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 101971.62129779, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 10.19716213, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 0.10197162, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 13.59509806, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 703.06954974, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 10000, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 1, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_mpa") { - //兆帕(MPa) - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.1, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.001, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.0001, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.101325, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.00004788, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.00338639, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.00000981, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.0001, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.000001, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.00013332, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.00689476, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.0980665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 1, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_hpa") { - //百帕 (hPa) - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到百帕 (hPa) - QString outStr = QString::number(beforeValue * 1000, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 10, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 1, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 1013.25, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 0.47880257, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 33.86388158, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 0.0980665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 10000, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 0.01, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 1.33322368, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 68.94757, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 980.665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 0.0980665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_pascal") { - //帕斯卡 - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到帕斯卡 - QString outStr = QString::number(beforeValue * 100000, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到帕斯卡 - QString outStr = QString::number(beforeValue * 1000, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到帕斯卡 - QString outStr = QString::number(beforeValue * 100, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到帕斯卡 - QString outStr = QString::number(beforeValue * 101325, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到帕斯卡 - QString outStr = QString::number(beforeValue * 47.88025694, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到帕斯卡 - QString outStr = QString::number(beforeValue * 3386.38815789, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到帕斯卡 - QString outStr = QString::number(beforeValue * 9.80665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到帕斯卡 - QString outStr = QString::number(beforeValue * 1000000, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到帕斯卡 - QString outStr = QString::number(beforeValue * 100, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到帕斯卡 - QString outStr = QString::number(beforeValue * 133.32236842, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到帕斯卡 - QString outStr = QString::number(beforeValue * 6894.757, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到帕斯卡 - QString outStr = QString::number(beforeValue * 98066.5, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到帕斯卡 - QString outStr = QString::number(beforeValue * 9.80665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_mmhg") { - //毫米汞柱 (托) - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到毫米汞柱 (托) - QString outStr = QString::number(beforeValue * 750.0616827, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到毫米汞柱 (托) - QString outStr = QString::number(beforeValue * 7.50061683, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到毫米汞柱 (托) - QString outStr = QString::number(beforeValue * 0.75006168, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到毫米汞柱 (托) - QString outStr = QString::number(beforeValue * 760, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到毫米汞柱(托) - QString outStr = QString::number(beforeValue * 0.35913146, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到毫米汞柱(托) - QString outStr = QString::number(beforeValue * 25.4, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到毫米汞柱(托) - QString outStr = QString::number(beforeValue * 0.07355592, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到毫米汞柱(托) - QString outStr = QString::number(beforeValue * 7500.61682704, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到毫米汞柱(托) - QString outStr = QString::number(beforeValue * 0.75006168, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到毫米汞柱(托) - QString outStr = QString::number(beforeValue * 0.00750062, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到毫米汞柱 (托) - QString outStr = QString::number(beforeValue * 51.71493037, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到毫米汞柱 (托) - QString outStr = QString::number(beforeValue * 735.55924007, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到毫米汞柱 (托) - QString outStr = QString::number(beforeValue * 0.07355592, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_cmz") { - //磅力/英寸2 - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 14.50377439, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 0.14503774, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 0.01450377, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 14.6959494, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 0.00694444, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 0.4911541, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 0.00142233, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 145.0377439, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 0.01450377, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 0.00014504, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 0.01933678, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 14.22334391, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 0.00142233, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_kgf_cm2") { - //公斤力/厘米2 - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 1.01971621, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.01019716, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.00101972, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 1.03322745, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.00048824, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.03453155, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.0001, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 10.19716213, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.00101972, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.0000102, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.00135951, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.07030695, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.0001, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_mm_water_column") { - //毫米水柱 - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 10197.16212978, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到毫米水柱 - QString outStr = QString::number(beforeValue * 101.9716213, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到毫米水柱 - QString outStr = QString::number(beforeValue * 10.19716213, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到毫米水柱 - QString outStr = QString::number(beforeValue * 10332.274528, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到毫米水柱 - QString outStr = QString::number(beforeValue * 4.88242743, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到毫米水柱 - QString outStr = QString::number(beforeValue * 345.3154908, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到毫米水柱 - QString outStr = QString::number(beforeValue * 1, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到毫米水柱 - QString outStr = QString::number(beforeValue * 101971.62129779, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到毫米水柱 - QString outStr = QString::number(beforeValue * 10.19716213, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到毫米水柱 - QString outStr = QString::number(beforeValue * 0.10197162, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到毫米水柱 - QString outStr = QString::number(beforeValue * 13.59509806, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到毫米水柱 - QString outStr = QString::number(beforeValue * 703.06954974, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到毫米水柱 - QString outStr = QString::number(beforeValue * 10000, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } - } -} - -void frmMain::on_btnMenu_Min_clicked() -{ - showMinimized(); -} -void frmMain::on_btnMenu_Max_clicked() -{ - static bool max = false; - static QRect location = this->geometry(); - - if (max) { - this->setGeometry(location); - } else { - location = this->geometry(); - this->setGeometry(qApp->desktop()->availableGeometry()); - } - - this->setProperty("canMove", max); - max = !max; -} -void frmMain::on_btnMenu_Close_clicked() -{ - close(); -} -void frmMain::on_spinBox_rbit_valueChanged(int arg1) -{ - numOfDecimalPoints = arg1; - QList ledits = ui->page1->findChildren(); - - foreach (QLineEdit *ledit, ledits) { - ledit->setValidator(new QDoubleValidator(0, __DBL_MAX__, arg1, this)); - } -} diff --git a/pressureconversioncalculator/form/frmmain.h b/pressureconversioncalculator/form/frmmain.h deleted file mode 100644 index 01ecb5e..0000000 --- a/pressureconversioncalculator/form/frmmain.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef FRMMAIN_H -#define FRMMAIN_H - -#include - -namespace Ui { -class frmMain; -} - -class frmMain : public QDialog -{ - Q_OBJECT - -public: - explicit frmMain(QWidget *parent = 0); - ~frmMain(); - -protected: - bool eventFilter(QObject *watched, QEvent *event); - -private: - Ui::frmMain *ui; - int numOfDecimalPoints; - -private slots: - void initForm(); - void buttonClick(); - void doTextEdited(const QString); - -private slots: - void on_btnMenu_Min_clicked(); - void on_btnMenu_Max_clicked(); - void on_btnMenu_Close_clicked(); - void on_spinBox_rbit_valueChanged(int arg1); -}; - -#endif // UIDEMO01_H diff --git a/pressureconversioncalculator/form/frmmain.ui b/pressureconversioncalculator/form/frmmain.ui deleted file mode 100644 index 30a21ba..0000000 --- a/pressureconversioncalculator/form/frmmain.ui +++ /dev/null @@ -1,506 +0,0 @@ - - - frmMain - - - - 0 - 0 - 800 - 600 - - - - Form - - - - - - - 0 - 0 - - - - - 10 - - - 10 - - - 0 - - - 0 - - - 0 - - - - - - - - :/image/logo.png - - - true - - - Qt::AlignCenter - - - - - - - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - 主界面 - - - - :/image/main_main.png:/image/main_main.png - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - - - 用户退出 - - - - :/image/main_exit.png:/image/main_exit.png - - - Qt::ToolButtonTextUnderIcon - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 0 - 0 - - - - - 30 - 30 - - - - ArrowCursor - - - Qt::NoFocus - - - 最小化 - - - - - - - - - - - 0 - 0 - - - - - 30 - 30 - - - - ArrowCursor - - - Qt::NoFocus - - - 关闭 - - - - - - - - - - - 0 - 0 - - - - - 30 - 30 - - - - Qt::NoFocus - - - - - - - - - - - - - - - - - - - 0 - - - - - - - Qt::Horizontal - - - - 104 - 20 - - - - - - - - - - 小数点保留位 - - - - - - - 巴 (bar) - - - - - - - 千帕 (kPa) - - - - - - - 毫巴 (mbar) - - - - - - - 标准大气压 - - - - - - - 磅力/英尺2 - - - - - - - 英吋汞柱 - - - - - - - 公斤力/米2 - - - - - - - - - - - 1 - - - 10 - - - 10 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 105 - 20 - - - - - - - - - - 兆帕 (MPa) - - - - - - - 百帕 (hPa) - - - - - - - 帕斯卡 - - - - - - - 毫米汞柱 (托) - - - - - - - 磅力/英寸2 - - - - - - - 公斤力/厘米2 - - - - - - - 毫米水柱 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 104 - 20 - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pressureconversioncalculator/main.cpp b/pressureconversioncalculator/main.cpp deleted file mode 100644 index 53fba84..0000000 --- a/pressureconversioncalculator/main.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "frmmain.h" -#include "appinit.h" -#include "qapplication.h" -#include "qtextcodec.h" -#include "qfile.h" -#include "qdebug.h" - -/* 压力单位转换工具 - * 10种以上不同压力单位间的快速转换(具有转换的单位,以及转换的系数) - * 实时单位转换 - * 小数点保留位可设(1-10) - * 所有压力单位同时显示在界面上 - * 不需要转换按钮输入时,输入实时转换 - * 检查输入是否合法 - */ -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - a.setFont(QFont("Microsoft Yahei", 9)); - AppInit::Instance()->start(); - -#if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) -#if _MSC_VER - QTextCodec *codec = QTextCodec::codecForName("gbk"); -#else - QTextCodec *codec = QTextCodec::codecForName("utf-8"); -#endif - QTextCodec::setCodecForLocale(codec); - QTextCodec::setCodecForCStrings(codec); - QTextCodec::setCodecForTr(codec); -#else - QTextCodec *codec = QTextCodec::codecForName("utf-8"); - QTextCodec::setCodecForLocale(codec); -#endif - - //加载样式表 - QFile file(":/qss/psblack.css"); - if (file.open(QFile::ReadOnly)) { - QString qss = QLatin1String(file.readAll()); - QString paletteColor = qss.mid(20, 7); - qApp->setPalette(QPalette(QColor(paletteColor))); - qApp->setStyleSheet(qss); - file.close(); - } - - frmMain w; - w.show(); - - return a.exec(); -} - diff --git a/pressureconversioncalculator/other/image/fontawesome-webfont.ttf b/pressureconversioncalculator/other/image/fontawesome-webfont.ttf deleted file mode 100644 index 35acda2..0000000 Binary files a/pressureconversioncalculator/other/image/fontawesome-webfont.ttf and /dev/null differ diff --git a/pressureconversioncalculator/other/image/logo.png b/pressureconversioncalculator/other/image/logo.png deleted file mode 100644 index 86b9d5a..0000000 Binary files a/pressureconversioncalculator/other/image/logo.png and /dev/null differ diff --git a/pressureconversioncalculator/other/image/main_exit.png b/pressureconversioncalculator/other/image/main_exit.png deleted file mode 100644 index d26ee30..0000000 Binary files a/pressureconversioncalculator/other/image/main_exit.png and /dev/null differ diff --git a/pressureconversioncalculator/other/image/main_main.png b/pressureconversioncalculator/other/image/main_main.png deleted file mode 100644 index 3273ada..0000000 Binary files a/pressureconversioncalculator/other/image/main_main.png and /dev/null differ diff --git a/pressureconversioncalculator/other/logo.ico b/pressureconversioncalculator/other/logo.ico deleted file mode 100644 index 4fcf2a5..0000000 Binary files a/pressureconversioncalculator/other/logo.ico and /dev/null differ diff --git a/pressureconversioncalculator/other/main.qrc b/pressureconversioncalculator/other/main.qrc deleted file mode 100644 index 84547eb..0000000 --- a/pressureconversioncalculator/other/main.qrc +++ /dev/null @@ -1,8 +0,0 @@ - - - image/fontawesome-webfont.ttf - image/main_exit.png - image/logo.png - image/main_main.png - - diff --git a/pressureconversioncalculator/other/qss.qrc b/pressureconversioncalculator/other/qss.qrc deleted file mode 100644 index bd531cf..0000000 --- a/pressureconversioncalculator/other/qss.qrc +++ /dev/null @@ -1,23 +0,0 @@ - - - qss/psblack.css - qss/psblack/add_bottom.png - qss/psblack/add_left.png - qss/psblack/add_right.png - qss/psblack/add_top.png - qss/psblack/branch_close.png - qss/psblack/branch_open.png - qss/psblack/calendar_nextmonth.png - qss/psblack/calendar_prevmonth.png - qss/psblack/checkbox_checked.png - qss/psblack/checkbox_checked_disable.png - qss/psblack/checkbox_parcial.png - qss/psblack/checkbox_parcial_disable.png - qss/psblack/checkbox_unchecked.png - qss/psblack/checkbox_unchecked_disable.png - qss/psblack/radiobutton_checked.png - qss/psblack/radiobutton_checked_disable.png - qss/psblack/radiobutton_unchecked.png - qss/psblack/radiobutton_unchecked_disable.png - - diff --git a/pressureconversioncalculator/other/qss/psblack.css b/pressureconversioncalculator/other/qss/psblack.css deleted file mode 100644 index be5d6d5..0000000 --- a/pressureconversioncalculator/other/qss/psblack.css +++ /dev/null @@ -1,657 +0,0 @@ -QPalette{background:#444444;}*{outline:0px;color:#DCDCDC;} - -QWidget[form="true"]{ -border:1px solid #242424; -border-radius:0px; -} - -QWidget[form="bottom"]{ -background:#484848; -} - -QWidget[form="bottom"] .QFrame{ -border:1px solid #DCDCDC; -} - -QWidget[form="bottom"] QLabel,QWidget[form="title"] QLabel{ -border-radius:0px; -color:#DCDCDC; -background:none; -border-style:none; -} - -QWidget[form="title"],QWidget[nav="left"],QWidget[nav="top"] QAbstractButton{ -border-style:none; -border-radius:0px; -padding:5px; -color:#DCDCDC; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); -} - -QWidget[nav="top"] QAbstractButton:hover,QWidget[nav="top"] QAbstractButton:pressed,QWidget[nav="top"] QAbstractButton:checked{ -border-style:solid; -border-width:0px 0px 2px 0px; -padding:4px 4px 2px 4px; -border-color:#00BB9E; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); -} - -QWidget[nav="left"] QAbstractButton{ -border-radius:0px; -color:#DCDCDC; -background:none; -border-style:none; -} - -QWidget[nav="left"] QAbstractButton:hover{ -color:#FFFFFF; -background-color:#00BB9E; -} - -QWidget[nav="left"] QAbstractButton:checked,QWidget[nav="left"] QAbstractButton:pressed{ -color:#DCDCDC; -border-style:solid; -border-width:0px 0px 0px 2px; -padding:4px 4px 4px 2px; -border-color:#00BB9E; -background-color:#444444; -} - -QWidget[video="true"] QLabel{ -color:#DCDCDC; -border:1px solid #242424; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); -} - -QWidget[video="true"] QLabel:focus{ -border:1px solid #00BB9E; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); -} - -QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QDoubleSpinBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit{ -border:1px solid #242424; -border-radius:3px; -padding:2px; -background:none; -selection-background-color:#00BB9E; -selection-color:#FFFFFF; -} - -QLineEdit:focus,QTextEdit:focus,QPlainTextEdit:focus,QSpinBox:focus,QDoubleSpinBox:focus,QComboBox:focus,QDateEdit:focus,QTimeEdit:focus,QDateTimeEdit:focus,QLineEdit:hover,QTextEdit:hover,QPlainTextEdit:hover,QSpinBox:hover,QDoubleSpinBox:hover,QComboBox:hover,QDateEdit:hover,QTimeEdit:hover,QDateTimeEdit:hover{ -border:1px solid #242424; -} - -QLineEdit[echoMode="2"]{ -lineedit-password-character:9679; -} - -.QFrame{ -border:1px solid #242424; -border-radius:3px; -} - -.QGroupBox{ -border:1px solid #242424; -border-radius:5px; -margin-top:3ex; -} - -.QGroupBox::title{ -subcontrol-origin:margin; -position:relative; -left:10px; -} - -.QPushButton,.QToolButton{ -border-style:none; -border:1px solid #242424; -color:#DCDCDC; -padding:5px; -min-height:15px; -border-radius:5px; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); -} - -.QPushButton:hover,.QToolButton:hover{ -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); -} - -.QPushButton:pressed,.QToolButton:pressed{ -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); -} - -.QToolButton::menu-indicator{ -image:None; -} - -QToolButton#btnMenu,QPushButton#btnMenu_Min,QPushButton#btnMenu_Max,QPushButton#btnMenu_Close{ -border-radius:3px; -color:#DCDCDC; -padding:3px; -margin:0px; -background:none; -border-style:none; -} - -QToolButton#btnMenu:hover,QPushButton#btnMenu_Min:hover,QPushButton#btnMenu_Max:hover{ -color:#FFFFFF; -margin:1px 1px 2px 1px; -background-color:rgba(51,127,209,230); -} - -QPushButton#btnMenu_Close:hover{ -color:#FFFFFF; -margin:1px 1px 2px 1px; -background-color:rgba(238,0,0,128); -} - -QRadioButton::indicator{ -width:15px; -height:15px; -} - -QRadioButton::indicator::unchecked{ -image:url(:/qss/psblack/radiobutton_unchecked.png); -} - -QRadioButton::indicator::unchecked:disabled{ -image:url(:/qss/psblack/radiobutton_unchecked_disable.png); -} - -QRadioButton::indicator::checked{ -image:url(:/qss/psblack/radiobutton_checked.png); -} - -QRadioButton::indicator::checked:disabled{ -image:url(:/qss/psblack/radiobutton_checked_disable.png); -} - -QGroupBox::indicator,QTreeWidget::indicator,QListWidget::indicator{ -padding:0px -3px 0px 0px; -} - -QCheckBox::indicator,QGroupBox::indicator,QTreeWidget::indicator,QListWidget::indicator{ -width:13px; -height:13px; -} - -QCheckBox::indicator:unchecked,QGroupBox::indicator:unchecked,QTreeWidget::indicator:unchecked,QListWidget::indicator:unchecked{ -image:url(:/qss/psblack/checkbox_unchecked.png); -} - -QCheckBox::indicator:unchecked:disabled,QGroupBox::indicator:unchecked:disabled,QTreeWidget::indicator:unchecked:disabled,QListWidget::indicator:disabled{ -image:url(:/qss/psblack/checkbox_unchecked_disable.png); -} - -QCheckBox::indicator:checked,QGroupBox::indicator:checked,QTreeWidget::indicator:checked,QListWidget::indicator:checked{ -image:url(:/qss/psblack/checkbox_checked.png); -} - -QCheckBox::indicator:checked:disabled,QGroupBox::indicator:checked:disabled,QTreeWidget::indicator:checked:disabled,QListWidget::indicator:checked:disabled{ -image:url(:/qss/psblack/checkbox_checked_disable.png); -} - -QCheckBox::indicator:indeterminate,QGroupBox::indicator:indeterminate,QTreeWidget::indicator:indeterminate,QListWidget::indicator:indeterminate{ -image:url(:/qss/psblack/checkbox_parcial.png); -} - -QCheckBox::indicator:indeterminate:disabled,QGroupBox::indicator:indeterminate:disabled,QTreeWidget::indicator:indeterminate:disabled,QListWidget::indicator:indeterminate:disabled{ -image:url(:/qss/psblack/checkbox_parcial_disable.png); -} - -QTimeEdit::up-button,QDateEdit::up-button,QDateTimeEdit::up-button,QDoubleSpinBox::up-button,QSpinBox::up-button{ -image:url(:/qss/psblack/add_top.png); -width:10px; -height:10px; -padding:2px 5px 0px 0px; -} - -QTimeEdit::down-button,QDateEdit::down-button,QDateTimeEdit::down-button,QDoubleSpinBox::down-button,QSpinBox::down-button{ -image:url(:/qss/psblack/add_bottom.png); -width:10px; -height:10px; -padding:0px 5px 2px 0px; -} - -QTimeEdit::up-button:pressed,QDateEdit::up-button:pressed,QDateTimeEdit::up-button:pressed,QDoubleSpinBox::up-button:pressed,QSpinBox::up-button:pressed{ -top:-2px; -} - -QTimeEdit::down-button:pressed,QDateEdit::down-button:pressed,QDateTimeEdit::down-button:pressed,QDoubleSpinBox::down-button:pressed,QSpinBox::down-button:pressed,QSpinBox::down-button:pressed{ -bottom:-2px; -} - -QComboBox::down-arrow,QDateEdit[calendarPopup="true"]::down-arrow,QTimeEdit[calendarPopup="true"]::down-arrow,QDateTimeEdit[calendarPopup="true"]::down-arrow{ -image:url(:/qss/psblack/add_bottom.png); -width:10px; -height:10px; -right:2px; -} - -QComboBox::drop-down,QDateEdit::drop-down,QTimeEdit::drop-down,QDateTimeEdit::drop-down{ -subcontrol-origin:padding; -subcontrol-position:top right; -width:15px; -border-left-width:0px; -border-left-style:solid; -border-top-right-radius:3px; -border-bottom-right-radius:3px; -border-left-color:#242424; -} - -QComboBox::drop-down:on{ -top:1px; -} - -QMenuBar::item{ -color:#DCDCDC; -background-color:#484848; -margin:0px; -padding:3px 10px; -} - -QMenu,QMenuBar,QMenu:disabled,QMenuBar:disabled{ -color:#DCDCDC; -background-color:#484848; -border:1px solid #242424; -margin:0px; -} - -QMenu::item{ -padding:3px 20px; -} - -QMenu::indicator{ -width:13px; -height:13px; -} - -QMenu::item:selected,QMenuBar::item:selected{ -color:#DCDCDC; -border:0px solid #242424; -background:#646464; -} - -QMenu::separator{ -height:1px; -background:#242424; -} - -QProgressBar{ -min-height:10px; -background:#484848; -border-radius:5px; -text-align:center; -border:1px solid #484848; -} - -QProgressBar:chunk{ -border-radius:5px; -background-color:#242424; -} - -QSlider::groove:horizontal{ -background:#484848; -height:8px; -border-radius:4px; -} - -QSlider::add-page:horizontal{ -background:#484848; -height:8px; -border-radius:4px; -} - -QSlider::sub-page:horizontal{ -background:#242424; -height:8px; -border-radius:4px; -} - -QSlider::handle:horizontal{ -width:13px; -margin-top:-3px; -margin-bottom:-3px; -border-radius:6px; -background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #444444,stop:0.8 #242424); -} - -QSlider::groove:vertical{ -width:8px; -border-radius:4px; -background:#484848; -} - -QSlider::add-page:vertical{ -width:8px; -border-radius:4px; -background:#484848; -} - -QSlider::sub-page:vertical{ -width:8px; -border-radius:4px; -background:#242424; -} - -QSlider::handle:vertical{ -height:14px; -margin-left:-3px; -margin-right:-3px; -border-radius:6px; -background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #444444,stop:0.8 #242424); -} - -QScrollBar:horizontal{ -background:#484848; -padding:0px; -border-radius:6px; -max-height:12px; -} - -QScrollBar::handle:horizontal{ -background:#242424; -min-width:50px; -border-radius:6px; -} - -QScrollBar::handle:horizontal:hover{ -background:#00BB9E; -} - -QScrollBar::handle:horizontal:pressed{ -background:#00BB9E; -} - -QScrollBar::add-page:horizontal{ -background:none; -} - -QScrollBar::sub-page:horizontal{ -background:none; -} - -QScrollBar::add-line:horizontal{ -background:none; -} - -QScrollBar::sub-line:horizontal{ -background:none; -} - -QScrollBar:vertical{ -background:#484848; -padding:0px; -border-radius:6px; -max-width:12px; -} - -QScrollBar::handle:vertical{ -background:#242424; -min-height:50px; -border-radius:6px; -} - -QScrollBar::handle:vertical:hover{ -background:#00BB9E; -} - -QScrollBar::handle:vertical:pressed{ -background:#00BB9E; -} - -QScrollBar::add-page:vertical{ -background:none; -} - -QScrollBar::sub-page:vertical{ -background:none; -} - -QScrollBar::add-line:vertical{ -background:none; -} - -QScrollBar::sub-line:vertical{ -background:none; -} - -QScrollArea{ -border:0px; -} - -QTreeView,QListView,QTableView,QTabWidget::pane{ -border:1px solid #242424; -selection-background-color:#646464; -selection-color:#DCDCDC; -alternate-background-color:#525252; -gridline-color:#242424; -} - -QTreeView::branch:closed:has-children{ -margin:4px; -border-image:url(:/qss/psblack/branch_open.png); -} - -QTreeView::branch:open:has-children{ -margin:4px; -border-image:url(:/qss/psblack/branch_close.png); -} - -QTreeView,QListView,QTableView,QSplitter::handle,QTreeView::branch{ -background:#444444; -} - -QTableView::item:selected,QListView::item:selected,QTreeView::item:selected{ -color:#DCDCDC; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); -} - -QTableView::item:hover,QListView::item:hover,QTreeView::item:hover,QHeaderView{ -color:#DCDCDC; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); -} - -QTableView::item,QListView::item,QTreeView::item{ -padding:1px; -margin:0px; -} - -QHeaderView::section,QTableCornerButton:section{ -padding:3px; -margin:0px; -color:#DCDCDC; -border:1px solid #242424; -border-left-width:0px; -border-right-width:1px; -border-top-width:0px; -border-bottom-width:1px; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); -} - -QTabBar::tab{ -border:1px solid #242424; -color:#DCDCDC; -margin:0px; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); -} - -QTabBar::tab:selected,QTabBar::tab:hover{ -border-style:solid; -border-color:#00BB9E; -background:#444444; -} - -QTabBar::tab:top,QTabBar::tab:bottom{ -padding:3px 8px 3px 8px; -} - -QTabBar::tab:left,QTabBar::tab:right{ -padding:8px 3px 8px 3px; -} - -QTabBar::tab:top:selected,QTabBar::tab:top:hover{ -border-width:2px 0px 0px 0px; -} - -QTabBar::tab:right:selected,QTabBar::tab:right:hover{ -border-width:0px 0px 0px 2px; -} - -QTabBar::tab:bottom:selected,QTabBar::tab:bottom:hover{ -border-width:0px 0px 2px 0px; -} - -QTabBar::tab:left:selected,QTabBar::tab:left:hover{ -border-width:0px 2px 0px 0px; -} - -QTabBar::tab:first:top:selected,QTabBar::tab:first:top:hover,QTabBar::tab:first:bottom:selected,QTabBar::tab:first:bottom:hover{ -border-left-width:1px; -border-left-color:#242424; -} - -QTabBar::tab:first:left:selected,QTabBar::tab:first:left:hover,QTabBar::tab:first:right:selected,QTabBar::tab:first:right:hover{ -border-top-width:1px; -border-top-color:#242424; -} - -QTabBar::tab:last:top:selected,QTabBar::tab:last:top:hover,QTabBar::tab:last:bottom:selected,QTabBar::tab:last:bottom:hover{ -border-right-width:1px; -border-right-color:#242424; -} - -QTabBar::tab:last:left:selected,QTabBar::tab:last:left:hover,QTabBar::tab:last:right:selected,QTabBar::tab:last:right:hover{ -border-bottom-width:1px; -border-bottom-color:#242424; -} - -QStatusBar::item{ -border:0px solid #484848; -border-radius:3px; -} - -QToolBox::tab,QGroupBox#gboxDevicePanel,QGroupBox#gboxDeviceTitle,QFrame#gboxDevicePanel,QFrame#gboxDeviceTitle{ -padding:3px; -border-radius:5px; -color:#DCDCDC; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); -} - -QToolTip{ -border:0px solid #DCDCDC; -padding:1px; -color:#DCDCDC; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); -} - -QToolBox::tab:selected{ -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); -} - -QPrintPreviewDialog QToolButton{ -border:0px solid #DCDCDC; -border-radius:0px; -margin:0px; -padding:3px; -background:none; -} - -QColorDialog QPushButton,QFileDialog QPushButton{ -min-width:80px; -} - -QToolButton#qt_calendar_prevmonth{ -icon-size:0px; -min-width:20px; -image:url(:/qss/psblack/calendar_prevmonth.png); -} - -QToolButton#qt_calendar_nextmonth{ -icon-size:0px; -min-width:20px; -image:url(:/qss/psblack/calendar_nextmonth.png); -} - -QToolButton#qt_calendar_prevmonth,QToolButton#qt_calendar_nextmonth,QToolButton#qt_calendar_monthbutton,QToolButton#qt_calendar_yearbutton{ -border:0px solid #DCDCDC; -border-radius:3px; -margin:3px 3px 3px 3px; -padding:3px; -background:none; -} - -QToolButton#qt_calendar_prevmonth:hover,QToolButton#qt_calendar_nextmonth:hover,QToolButton#qt_calendar_monthbutton:hover,QToolButton#qt_calendar_yearbutton:hover,QToolButton#qt_calendar_prevmonth:pressed,QToolButton#qt_calendar_nextmonth:pressed,QToolButton#qt_calendar_monthbutton:pressed,QToolButton#qt_calendar_yearbutton:pressed{ -border:1px solid #242424; -} - -QCalendarWidget QSpinBox#qt_calendar_yearedit{ -margin:2px; -} - -QCalendarWidget QToolButton::menu-indicator{ -image:None; -} - -QCalendarWidget QTableView{ -border-width:0px; -} - -QCalendarWidget QWidget#qt_calendar_navigationbar{ -border:1px solid #242424; -border-width:1px 1px 0px 1px; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); -} - -QComboBox QAbstractItemView::item{ -min-height:20px; -min-width:10px; -} - -QTableView[model="true"]::item{ -padding:0px; -margin:0px; -} - -QTableView QLineEdit,QTableView QComboBox,QTableView QSpinBox,QTableView QDoubleSpinBox,QTableView QDateEdit,QTableView QTimeEdit,QTableView QDateTimeEdit{ -border-width:0px; -border-radius:0px; -} - -QTableView QLineEdit:focus,QTableView QComboBox:focus,QTableView QSpinBox:focus,QTableView QDoubleSpinBox:focus,QTableView QDateEdit:focus,QTableView QTimeEdit:focus,QTableView QDateTimeEdit:focus{ -border-width:0px; -border-radius:0px; -} - -QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QDoubleSpinBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit{ -background:#444444; -} - -QTabWidget::pane:top{top:-1px;} -QTabWidget::pane:bottom{bottom:-1px;} -QTabWidget::pane:left{right:-1px;} -QTabWidget::pane:right{left:-1px;} - -QDialog { -background-color:#444444; -color:#DCDCDC; -} - -QDialogButtonBox > QPushButton { -min-width:50px; -} - -*:disabled,QMenu::item:disabled{ -background:#444444; -border-color:#484848; -color:#242424; -} - -/*TextColor:#DCDCDC*/ -/*PanelColor:#444444*/ -/*BorderColor:#242424*/ -/*NormalColorStart:#484848*/ -/*NormalColorEnd:#383838*/ -/*DarkColorStart:#646464*/ -/*DarkColorEnd:#525252*/ -/*HighColor:#00BB9E*/ \ No newline at end of file diff --git a/pressureconversioncalculator/other/qss/psblack/add_bottom.png b/pressureconversioncalculator/other/qss/psblack/add_bottom.png deleted file mode 100644 index 2f8c0f2..0000000 Binary files a/pressureconversioncalculator/other/qss/psblack/add_bottom.png and /dev/null differ diff --git a/pressureconversioncalculator/other/qss/psblack/add_left.png b/pressureconversioncalculator/other/qss/psblack/add_left.png deleted file mode 100644 index 7a23601..0000000 Binary files a/pressureconversioncalculator/other/qss/psblack/add_left.png and /dev/null differ diff --git a/pressureconversioncalculator/other/qss/psblack/add_right.png b/pressureconversioncalculator/other/qss/psblack/add_right.png deleted file mode 100644 index d01c2f7..0000000 Binary files a/pressureconversioncalculator/other/qss/psblack/add_right.png and /dev/null differ diff --git a/pressureconversioncalculator/other/qss/psblack/add_top.png b/pressureconversioncalculator/other/qss/psblack/add_top.png deleted file mode 100644 index a5ceb4f..0000000 Binary files a/pressureconversioncalculator/other/qss/psblack/add_top.png and /dev/null differ diff --git a/pressureconversioncalculator/other/qss/psblack/branch_close.png b/pressureconversioncalculator/other/qss/psblack/branch_close.png deleted file mode 100644 index 94511e5..0000000 Binary files a/pressureconversioncalculator/other/qss/psblack/branch_close.png and /dev/null differ diff --git a/pressureconversioncalculator/other/qss/psblack/branch_open.png b/pressureconversioncalculator/other/qss/psblack/branch_open.png deleted file mode 100644 index 533a63e..0000000 Binary files a/pressureconversioncalculator/other/qss/psblack/branch_open.png and /dev/null differ diff --git a/pressureconversioncalculator/other/qss/psblack/calendar_nextmonth.png b/pressureconversioncalculator/other/qss/psblack/calendar_nextmonth.png deleted file mode 100644 index c80aa2a..0000000 Binary files a/pressureconversioncalculator/other/qss/psblack/calendar_nextmonth.png and /dev/null differ diff --git a/pressureconversioncalculator/other/qss/psblack/calendar_prevmonth.png b/pressureconversioncalculator/other/qss/psblack/calendar_prevmonth.png deleted file mode 100644 index 421799e..0000000 Binary files a/pressureconversioncalculator/other/qss/psblack/calendar_prevmonth.png and /dev/null differ diff --git a/pressureconversioncalculator/other/qss/psblack/checkbox_checked.png b/pressureconversioncalculator/other/qss/psblack/checkbox_checked.png deleted file mode 100644 index 55a120c..0000000 Binary files a/pressureconversioncalculator/other/qss/psblack/checkbox_checked.png and /dev/null differ diff --git a/pressureconversioncalculator/other/qss/psblack/checkbox_checked_disable.png b/pressureconversioncalculator/other/qss/psblack/checkbox_checked_disable.png deleted file mode 100644 index fa51554..0000000 Binary files a/pressureconversioncalculator/other/qss/psblack/checkbox_checked_disable.png and /dev/null differ diff --git a/pressureconversioncalculator/other/qss/psblack/checkbox_parcial.png b/pressureconversioncalculator/other/qss/psblack/checkbox_parcial.png deleted file mode 100644 index e6ae0b8..0000000 Binary files a/pressureconversioncalculator/other/qss/psblack/checkbox_parcial.png and /dev/null differ diff --git a/pressureconversioncalculator/other/qss/psblack/checkbox_parcial_disable.png b/pressureconversioncalculator/other/qss/psblack/checkbox_parcial_disable.png deleted file mode 100644 index eca2c61..0000000 Binary files a/pressureconversioncalculator/other/qss/psblack/checkbox_parcial_disable.png and /dev/null differ diff --git a/pressureconversioncalculator/other/qss/psblack/checkbox_unchecked.png b/pressureconversioncalculator/other/qss/psblack/checkbox_unchecked.png deleted file mode 100644 index b06fd70..0000000 Binary files a/pressureconversioncalculator/other/qss/psblack/checkbox_unchecked.png and /dev/null differ diff --git a/pressureconversioncalculator/other/qss/psblack/checkbox_unchecked_disable.png b/pressureconversioncalculator/other/qss/psblack/checkbox_unchecked_disable.png deleted file mode 100644 index db00b2a..0000000 Binary files a/pressureconversioncalculator/other/qss/psblack/checkbox_unchecked_disable.png and /dev/null differ diff --git a/pressureconversioncalculator/other/qss/psblack/radiobutton_checked.png b/pressureconversioncalculator/other/qss/psblack/radiobutton_checked.png deleted file mode 100644 index 928307c..0000000 Binary files a/pressureconversioncalculator/other/qss/psblack/radiobutton_checked.png and /dev/null differ diff --git a/pressureconversioncalculator/other/qss/psblack/radiobutton_checked_disable.png b/pressureconversioncalculator/other/qss/psblack/radiobutton_checked_disable.png deleted file mode 100644 index 436b8ea..0000000 Binary files a/pressureconversioncalculator/other/qss/psblack/radiobutton_checked_disable.png and /dev/null differ diff --git a/pressureconversioncalculator/other/qss/psblack/radiobutton_unchecked.png b/pressureconversioncalculator/other/qss/psblack/radiobutton_unchecked.png deleted file mode 100644 index 3d1e440..0000000 Binary files a/pressureconversioncalculator/other/qss/psblack/radiobutton_unchecked.png and /dev/null differ diff --git a/pressureconversioncalculator/other/qss/psblack/radiobutton_unchecked_disable.png b/pressureconversioncalculator/other/qss/psblack/radiobutton_unchecked_disable.png deleted file mode 100644 index d291039..0000000 Binary files a/pressureconversioncalculator/other/qss/psblack/radiobutton_unchecked_disable.png and /dev/null differ diff --git a/pressureconversioncalculator/pressureconversioncalculator.pro b/pressureconversioncalculator/pressureconversioncalculator.pro deleted file mode 100644 index 6bc9b2b..0000000 --- a/pressureconversioncalculator/pressureconversioncalculator.pro +++ /dev/null @@ -1,31 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2020-04-23T17:38:15 -# -#------------------------------------------------- - -QT += core gui - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets - -TARGET = pressureconversioncalculator -RC_ICONS = other/logo.ico -TEMPLATE = app -MOC_DIR = temp/moc -RCC_DIR = temp/rcc -UI_DIR = temp/ui -OBJECTS_DIR = temp/obj -DESTDIR = $$PWD/../bin - -RESOURCES += other/main.qrc -RESOURCES += other/qss.qrc -CONFIG += warn_off - -SOURCES += main.cpp - -include ($$PWD/api/api.pri) -include ($$PWD/form/form.pri) - -INCLUDEPATH += $$PWD -INCLUDEPATH += $$PWD/api -INCLUDEPATH += $$PWD/form diff --git a/pressureconversioncalculator/snap.png b/pressureconversioncalculator/snap.png deleted file mode 100644 index bfa72f8..0000000 Binary files a/pressureconversioncalculator/snap.png and /dev/null differ diff --git a/savelog/savelog.h b/savelog/savelog.h index 1b91931..b9d3190 100644 --- a/savelog/savelog.h +++ b/savelog/savelog.h @@ -8,13 +8,7 @@ class QTcpSocket; class QTcpServer; #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT SaveLog : public QObject +class Q_DECL_EXPORT SaveLog : public QObject #else class SaveLog : public QObject #endif diff --git a/saveruntime/saveruntime.cpp b/saveruntime/saveruntime.cpp index d8ef753..5bfe6d2 100644 --- a/saveruntime/saveruntime.cpp +++ b/saveruntime/saveruntime.cpp @@ -5,7 +5,6 @@ #include "qfile.h" #include "qtextstream.h" #include "qstringlist.h" -#include "qdebug.h" #ifdef Q_OS_WIN #define NEWLINE "\r\n" @@ -37,6 +36,7 @@ SaveRunTime::SaveRunTime(QObject *parent) : QObject(parent) saveInterval = 1 * 60 * 1000; startTime = QDateTime::currentDateTime(); + //存储运行时间定时器 timerSave = new QTimer(this); timerSave->setInterval(saveInterval); connect(timerSave, SIGNAL(timeout()), this, SLOT(saveLog())); @@ -44,6 +44,9 @@ SaveRunTime::SaveRunTime(QObject *parent) : QObject(parent) void SaveRunTime::start() { + //开始时间变量必须在这,在部分嵌入式系统上开机后的时间不准确比如是1970,而后会变成1999或者其他时间 + //会在getDiffValue函数执行很久很久 + startTime = QDateTime::currentDateTime(); timerSave->start(); initLog(); @@ -104,19 +107,16 @@ void SaveRunTime::initLog() QTextStream stream(&file); stream << line << NEWLINE; file.close(); - lastID = 0; } } else { if (file.open(QFile::ReadOnly)) { QString lastLine; - while (!file.atEnd()) { lastLine = file.readLine(); } file.close(); - QStringList list = lastLine.split("\t"); lastID = list.at(0).toInt(); } @@ -169,7 +169,6 @@ void SaveRunTime::saveLog() //重新清空文件 file.resize(0); - //如果行数小于2则返回 if (content.count() < 2) { file.close(); diff --git a/saveruntime/saveruntime.h b/saveruntime/saveruntime.h index 060539d..61394fc 100644 --- a/saveruntime/saveruntime.h +++ b/saveruntime/saveruntime.h @@ -6,13 +6,7 @@ class QTimer; #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT SaveRunTime : public QObject +class Q_DECL_EXPORT SaveRunTime : public QObject #else class SaveRunTime : public QObject #endif diff --git a/screenwidget/screenwidget.h b/screenwidget/screenwidget.h index 2f2744e..8dbc0fa 100644 --- a/screenwidget/screenwidget.h +++ b/screenwidget/screenwidget.h @@ -3,9 +3,9 @@ /** * 全局截屏控件 作者:feiyangqingyun(QQ:517216493) 2016-11-11 - * 1:支持鼠标右键选择菜单 - * 2:支持全局截屏和局部截屏 - * 3:支持图片另存为 + * 1. 支持鼠标右键选择菜单 + * 2. 支持全局截屏和局部截屏 + * 3. 支持图片另存为 */ #include @@ -46,13 +46,7 @@ private: }; #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT ScreenWidget : public QWidget +class Q_DECL_EXPORT ScreenWidget : public QWidget #else class ScreenWidget : public QWidget #endif diff --git a/unitconversion/api/api.pri b/unitconversion/api/api.pri deleted file mode 100644 index fdc867f..0000000 --- a/unitconversion/api/api.pri +++ /dev/null @@ -1,7 +0,0 @@ -HEADERS += \ - $$PWD/appinit.h \ - $$PWD/iconhelper.h - -SOURCES += \ - $$PWD/appinit.cpp \ - $$PWD/iconhelper.cpp diff --git a/unitconversion/api/appinit.cpp b/unitconversion/api/appinit.cpp deleted file mode 100644 index 749c987..0000000 --- a/unitconversion/api/appinit.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include "appinit.h" -#include "qmutex.h" -#include "qapplication.h" -#include "qevent.h" -#include "qwidget.h" - -QScopedPointer AppInit::self; -AppInit *AppInit::Instance() -{ - if (self.isNull()) { - static QMutex mutex; - QMutexLocker locker(&mutex); - if (self.isNull()) { - self.reset(new AppInit); - } - } - - return self.data(); -} - -AppInit::AppInit(QObject *parent) : QObject(parent) -{ -} - -bool AppInit::eventFilter(QObject *watched, QEvent *event) -{ - QWidget *w = (QWidget *)watched; - if (!w->property("canMove").toBool()) { - return QObject::eventFilter(watched, event); - } - - static QPoint mousePoint; - static bool mousePressed = false; - - QMouseEvent *mouseEvent = static_cast(event); - if (mouseEvent->type() == QEvent::MouseButtonPress) { - if (mouseEvent->button() == Qt::LeftButton) { - mousePressed = true; - mousePoint = mouseEvent->globalPos() - w->pos(); - return true; - } - } else if (mouseEvent->type() == QEvent::MouseButtonRelease) { - mousePressed = false; - return true; - } else if (mouseEvent->type() == QEvent::MouseMove) { - if (mousePressed && (mouseEvent->buttons() && Qt::LeftButton)) { - w->move(mouseEvent->globalPos() - mousePoint); - return true; - } - } - - return QObject::eventFilter(watched, event); -} - -void AppInit::start() -{ - qApp->installEventFilter(this); -} diff --git a/unitconversion/api/appinit.h b/unitconversion/api/appinit.h deleted file mode 100644 index ce4a684..0000000 --- a/unitconversion/api/appinit.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef APPINIT_H -#define APPINIT_H - -#include - -class AppInit : public QObject -{ - Q_OBJECT -public: - static AppInit *Instance(); - explicit AppInit(QObject *parent = 0); - -protected: - bool eventFilter(QObject *watched, QEvent *event); - -private: - static QScopedPointer self; - -signals: - -public slots: - void start(); -}; - -#endif // APPINIT_H diff --git a/unitconversion/api/iconhelper.cpp b/unitconversion/api/iconhelper.cpp deleted file mode 100644 index b9783a4..0000000 --- a/unitconversion/api/iconhelper.cpp +++ /dev/null @@ -1,240 +0,0 @@ -#include "iconhelper.h" - -QScopedPointer IconHelper::self; -IconHelper *IconHelper::Instance() -{ - if (self.isNull()) { - static QMutex mutex; - QMutexLocker locker(&mutex); - if (self.isNull()) { - self.reset(new IconHelper); - } - } - - return self.data(); -} - -IconHelper::IconHelper(QObject *parent) : QObject(parent) -{ - //判断图形字体是否存在,不存在则加入 - QFontDatabase fontDb; - if (!fontDb.families().contains("FontAwesome")) { - int fontId = fontDb.addApplicationFont(":/image/fontawesome-webfont.ttf"); - QStringList fontName = fontDb.applicationFontFamilies(fontId); - if (fontName.count() == 0) { - qDebug() << "load fontawesome-webfont.ttf error"; - } - } - - if (fontDb.families().contains("FontAwesome")) { - iconFont = QFont("FontAwesome"); -#if (QT_VERSION >= QT_VERSION_CHECK(4,8,0)) - iconFont.setHintingPreference(QFont::PreferNoHinting); -#endif - } -} - -void IconHelper::setIcon(QLabel *lab, const QChar &str, quint32 size) -{ - iconFont.setPixelSize(size); - lab->setFont(iconFont); - lab->setText(str); -} - -void IconHelper::setIcon(QAbstractButton *btn, const QChar &str, quint32 size) -{ - iconFont.setPixelSize(size); - btn->setFont(iconFont); - btn->setText(str); -} - -QPixmap IconHelper::getPixmap(const QColor &color, const QChar &str, quint32 size, - quint32 pixWidth, quint32 pixHeight, int flags) -{ - QPixmap pix(pixWidth, pixHeight); - pix.fill(Qt::transparent); - - QPainter painter; - painter.begin(&pix); - painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing); - painter.setPen(color); - - iconFont.setPixelSize(size); - painter.setFont(iconFont); - painter.drawText(pix.rect(), flags, str); - painter.end(); - - return pix; -} - -QPixmap IconHelper::getPixmap(QToolButton *btn, bool normal) -{ - QPixmap pix; - int index = btns.indexOf(btn); - - if (index >= 0) { - if (normal) { - pix = pixNormal.at(index); - } else { - pix = pixDark.at(index); - } - } - - return pix; -} - -void IconHelper::setStyle(QWidget *widget, const QString &type, int borderWidth, const QString &borderColor, - const QString &normalBgColor, const QString &darkBgColor, - const QString &normalTextColor, const QString &darkTextColor) -{ - QString strBorder; - if (type == "top") { - strBorder = QString("border-width:%1px 0px 0px 0px;padding:%1px %2px %2px %2px;") - .arg(borderWidth).arg(borderWidth * 2); - } else if (type == "right") { - strBorder = QString("border-width:0px %1px 0px 0px;padding:%2px %1px %2px %2px;") - .arg(borderWidth).arg(borderWidth * 2); - } else if (type == "bottom") { - strBorder = QString("border-width:0px 0px %1px 0px;padding:%2px %2px %1px %2px;") - .arg(borderWidth).arg(borderWidth * 2); - } else if (type == "left") { - strBorder = QString("border-width:0px 0px 0px %1px;padding:%2px %2px %2px %1px;") - .arg(borderWidth).arg(borderWidth * 2); - } - - QStringList qss; - qss.append(QString("QWidget[flag=\"%1\"] QAbstractButton{border-style:none;border-radius:0px;padding:5px;color:%2;background:%3;}") - .arg(type).arg(normalTextColor).arg(normalBgColor)); - - qss.append(QString("QWidget[flag=\"%1\"] QAbstractButton:hover," - "QWidget[flag=\"%1\"] QAbstractButton:pressed," - "QWidget[flag=\"%1\"] QAbstractButton:checked{" - "border-style:solid;%2border-color:%3;color:%4;background:%5;}") - .arg(type).arg(strBorder).arg(borderColor).arg(darkTextColor).arg(darkBgColor)); - - widget->setStyleSheet(qss.join("")); -} - -void IconHelper::setStyle(QWidget *widget, QList btns, QList pixChar, - quint32 iconSize, quint32 iconWidth, quint32 iconHeight, - const QString &type, int borderWidth, const QString &borderColor, - const QString &normalBgColor, const QString &darkBgColor, - const QString &normalTextColor, const QString &darkTextColor) -{ - int btnCount = btns.count(); - int charCount = pixChar.count(); - if (btnCount <= 0 || charCount <= 0 || btnCount != charCount) { - return; - } - - QString strBorder; - if (type == "top") { - strBorder = QString("border-width:%1px 0px 0px 0px;padding:%1px %2px %2px %2px;") - .arg(borderWidth).arg(borderWidth * 2); - } else if (type == "right") { - strBorder = QString("border-width:0px %1px 0px 0px;padding:%2px %1px %2px %2px;") - .arg(borderWidth).arg(borderWidth * 2); - } else if (type == "bottom") { - strBorder = QString("border-width:0px 0px %1px 0px;padding:%2px %2px %1px %2px;") - .arg(borderWidth).arg(borderWidth * 2); - } else if (type == "left") { - strBorder = QString("border-width:0px 0px 0px %1px;padding:%2px %2px %2px %1px;") - .arg(borderWidth).arg(borderWidth * 2); - } - - //如果图标是左侧显示则需要让没有选中的按钮左侧也有加深的边框,颜色为背景颜色 - QStringList qss; - if (btns.at(0)->toolButtonStyle() == Qt::ToolButtonTextBesideIcon) { - qss.append(QString("QWidget[flag=\"%1\"] QAbstractButton{border-style:solid;border-radius:0px;%2border-color:%3;color:%4;background:%5;}") - .arg(type).arg(strBorder).arg(normalBgColor).arg(normalTextColor).arg(normalBgColor)); - } else { - qss.append(QString("QWidget[flag=\"%1\"] QAbstractButton{border-style:none;border-radius:0px;padding:5px;color:%2;background:%3;}") - .arg(type).arg(normalTextColor).arg(normalBgColor)); - } - - qss.append(QString("QWidget[flag=\"%1\"] QAbstractButton:hover," - "QWidget[flag=\"%1\"] QAbstractButton:pressed," - "QWidget[flag=\"%1\"] QAbstractButton:checked{" - "border-style:solid;%2border-color:%3;color:%4;background:%5;}") - .arg(type).arg(strBorder).arg(borderColor).arg(darkTextColor).arg(darkBgColor)); - - qss.append(QString("QWidget#%1{background:%2;}").arg(widget->objectName()).arg(normalBgColor)); - - qss.append(QString("QWidget>QToolButton{border-width:0px;}")); - qss.append(QString("QWidget>QToolButton{background-color:%1;color:%2;}") - .arg(normalBgColor).arg(normalTextColor)); - qss.append(QString("QWidget>QToolButton:hover,QWidget>QToolButton:pressed,QWidget>QToolButton:checked{background-color:%1;color:%2;}") - .arg(darkBgColor).arg(darkTextColor)); - - widget->setStyleSheet(qss.join("")); - - for (int i = 0; i < btnCount; i++) { - //存储对应按钮对象,方便鼠标移上去的时候切换图片 - QPixmap pixNormal = getPixmap(normalTextColor, QChar(pixChar.at(i)), iconSize, iconWidth, iconHeight); - QPixmap pixDark = getPixmap(darkTextColor, QChar(pixChar.at(i)), iconSize, iconWidth, iconHeight); - - btns.at(i)->setIcon(QIcon(pixNormal)); - btns.at(i)->setIconSize(QSize(iconWidth, iconHeight)); - btns.at(i)->installEventFilter(this); - - this->btns.append(btns.at(i)); - this->pixNormal.append(pixNormal); - this->pixDark.append(pixDark); - } -} - -void IconHelper::setStyle(QFrame *frame, QList btns, QList pixChar, - quint32 iconSize, quint32 iconWidth, quint32 iconHeight, - const QString &normalBgColor, const QString &darkBgColor, - const QString &normalTextColor, const QString &darkTextColor) -{ - int btnCount = btns.count(); - int charCount = pixChar.count(); - if (btnCount <= 0 || charCount <= 0 || btnCount != charCount) { - return; - } - - QStringList qss; - qss.append(QString("QFrame>QToolButton{border-style:none;border-width:0px;}")); - qss.append(QString("QFrame>QToolButton{background-color:%1;color:%2;}") - .arg(normalBgColor).arg(normalTextColor)); - qss.append(QString("QFrame>QToolButton:hover,QFrame>QToolButton:pressed,QFrame>QToolButton:checked{background-color:%1;color:%2;}") - .arg(darkBgColor).arg(darkTextColor)); - - frame->setStyleSheet(qss.join("")); - - for (int i = 0; i < btnCount; i++) { - //存储对应按钮对象,方便鼠标移上去的时候切换图片 - QPixmap pixNormal = getPixmap(normalTextColor, QChar(pixChar.at(i)), iconSize, iconWidth, iconHeight); - QPixmap pixDark = getPixmap(darkTextColor, QChar(pixChar.at(i)), iconSize, iconWidth, iconHeight); - - btns.at(i)->setIcon(QIcon(pixNormal)); - btns.at(i)->setIconSize(QSize(iconWidth, iconHeight)); - btns.at(i)->installEventFilter(this); - - this->btns.append(btns.at(i)); - this->pixNormal.append(pixNormal); - this->pixDark.append(pixDark); - } -} - -bool IconHelper::eventFilter(QObject *watched, QEvent *event) -{ - if (watched->inherits("QToolButton")) { - QToolButton *btn = (QToolButton *)watched; - int index = btns.indexOf(btn); - if (index >= 0) { - if (event->type() == QEvent::Enter) { - btn->setIcon(QIcon(pixDark.at(index))); - } else if (event->type() == QEvent::Leave) { - if (btn->isChecked()) { - btn->setIcon(QIcon(pixDark.at(index))); - } else { - btn->setIcon(QIcon(pixNormal.at(index))); - } - } - } - } - - return QObject::eventFilter(watched, event); -} diff --git a/unitconversion/api/iconhelper.h b/unitconversion/api/iconhelper.h deleted file mode 100644 index 95ce7bf..0000000 --- a/unitconversion/api/iconhelper.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef ICONHELPER_H -#define ICONHELPER_H - -#include -#include -#if (QT_VERSION > QT_VERSION_CHECK(5,0,0)) -#include -#endif - -//图形字体处理类 -class IconHelper : public QObject -{ - Q_OBJECT - -public: - static IconHelper *Instance(); - explicit IconHelper(QObject *parent = 0); - - void setIcon(QLabel *lab, const QChar &str, quint32 size = 12); - void setIcon(QAbstractButton *btn, const QChar &str, quint32 size = 12); - QPixmap getPixmap(const QColor &color, const QChar &str, quint32 size = 12, - quint32 pixWidth = 15, quint32 pixHeight = 15, - int flags = Qt::AlignCenter); - - //根据按钮获取该按钮对应的图标 - QPixmap getPixmap(QToolButton *btn, bool normal); - - //指定导航面板样式,不带图标 - static void setStyle(QWidget *widget, const QString &type = "left", int borderWidth = 3, - const QString &borderColor = "#029FEA", - const QString &normalBgColor = "#292F38", - const QString &darkBgColor = "#1D2025", - const QString &normalTextColor = "#54626F", - const QString &darkTextColor = "#FDFDFD"); - - //指定导航面板样式,带图标和效果切换 - void setStyle(QWidget *widget, QList btns, QList pixChar, - quint32 iconSize = 12, quint32 iconWidth = 15, quint32 iconHeight = 15, - const QString &type = "left", int borderWidth = 3, - const QString &borderColor = "#029FEA", - const QString &normalBgColor = "#292F38", - const QString &darkBgColor = "#1D2025", - const QString &normalTextColor = "#54626F", - const QString &darkTextColor = "#FDFDFD"); - - //指定导航按钮样式,带图标和效果切换 - void setStyle(QFrame *frame, QList btns, QList pixChar, - quint32 iconSize = 12, quint32 iconWidth = 15, quint32 iconHeight = 15, - const QString &normalBgColor = "#2FC5A2", - const QString &darkBgColor = "#3EA7E9", - const QString &normalTextColor = "#EEEEEE", - const QString &darkTextColor = "#FFFFFF"); - -protected: - bool eventFilter(QObject *watched, QEvent *event); - -private: - static QScopedPointer self; - QFont iconFont; //图形字体 - QList btns; //按钮队列 - QList pixNormal; //正常图片队列 - QList pixDark; //加深图片队列 -}; -#endif // ICONHELPER_H diff --git a/unitconversion/form/form.pri b/unitconversion/form/form.pri deleted file mode 100644 index 1b1a664..0000000 --- a/unitconversion/form/form.pri +++ /dev/null @@ -1,8 +0,0 @@ -FORMS += \ - $$PWD/frmmain.ui - -HEADERS += \ - $$PWD/frmmain.h - -SOURCES += \ - $$PWD/frmmain.cpp diff --git a/unitconversion/form/frmmain.cpp b/unitconversion/form/frmmain.cpp deleted file mode 100644 index 83a9f54..0000000 --- a/unitconversion/form/frmmain.cpp +++ /dev/null @@ -1,941 +0,0 @@ -#pragma execution_character_set("utf-8") - -#include "frmmain.h" -#include "ui_frmmain.h" -#include "iconhelper.h" -#include - -frmMain::frmMain(QWidget *parent) : QDialog(parent), ui(new Ui::frmMain) -{ - ui->setupUi(this); - this->initForm(); -} - -frmMain::~frmMain() -{ - delete ui; -} - -bool frmMain::eventFilter(QObject *watched, QEvent *event) -{ - if (event->type() == QEvent::MouseButtonDblClick) { - if (watched == ui->widgetTitle) { - on_btnMenu_Max_clicked(); - return true; - } - } - - return QWidget::eventFilter(watched, event); -} - -void frmMain::initForm() -{ - this->setProperty("form", true); - this->setProperty("canMove", true); - this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | - Qt::WindowMinMaxButtonsHint); - IconHelper::Instance()->setIcon(ui->btnMenu_Min, QChar(0xf068)); - IconHelper::Instance()->setIcon(ui->btnMenu_Max, QChar(0xf067)); - IconHelper::Instance()->setIcon(ui->btnMenu_Close, QChar(0xf00d)); - //ui->widgetMenu->setVisible(false); - ui->widgetTitle->installEventFilter(this); - ui->widgetTitle->setProperty("form", "title"); - ui->widgetTop->setProperty("nav", "top"); - ui->labTitle->setText("压力单位转换工具"); - ui->labTitle->setFont(QFont("Microsoft Yahei", 20)); - this->setWindowTitle(ui->labTitle->text()); - ui->stackedWidget->setStyleSheet("QLabel{font:20pt;}QLineEdit{font:20pt;}QPushButton{font:20pt;}QSpinBox{font:20pt;}"); - //单独设置指示器大小 - int addWidth = 20; - int addHeight = 10; - int rbtnWidth = 15; - int ckWidth = 13; - int scrWidth = 12; - int borderWidth = 3; - QStringList qss; - qss.append( - QString("QComboBox::drop-down,QDateEdit::drop-down,QTimeEdit::drop-down,QDateTimeEdit::drop-down{width:%1px;}").arg( - addWidth)); - qss.append( - QString("QComboBox::down-arrow,QDateEdit[calendarPopup=\"true\"]::down-arrow,QTimeEdit[calendarPopup=\"true\"]::down-arrow," - "QDateTimeEdit[calendarPopup=\"true\"]::down-arrow{width:%1px;height:%1px;right:2px;}").arg( - addHeight)); - qss.append(QString("QRadioButton::indicator{width:%1px;height:%1px;}").arg(rbtnWidth)); - qss.append( - QString("QCheckBox::indicator,QGroupBox::indicator,QTreeWidget::indicator,QListWidget::indicator{width:%1px;height:%1px;}").arg( - ckWidth)); - qss.append( - QString("QScrollBar:horizontal{min-height:%1px;border-radius:%2px;}QScrollBar::handle:horizontal{border-radius:%2px;}" - "QScrollBar:vertical{min-width:%1px;border-radius:%2px;}QScrollBar::handle:vertical{border-radius:%2px;}").arg( - scrWidth).arg(scrWidth / 2)); - qss.append(QString("QWidget#widget_top>QToolButton:pressed,QWidget#widget_top>QToolButton:hover," - "QWidget#widget_top>QToolButton:checked,QWidget#widget_top>QLabel:hover{" - "border-width:0px 0px %1px 0px;}").arg(borderWidth)); - qss.append(QString("QWidget#widgetleft>QPushButton:checked,QWidget#widgetleft>QToolButton:checked," - "QWidget#widgetleft>QPushButton:pressed,QWidget#widgetleft>QToolButton:pressed{" - "border-width:0px 0px 0px %1px;}").arg(borderWidth)); - this->setStyleSheet(qss.join("")); - QSize icoSize(32, 32); - int icoWidth = 85; - //设置顶部导航按钮 - QList tbtns = ui->widgetTop->findChildren(); - - foreach (QToolButton *btn, tbtns) { - btn->setIconSize(icoSize); - btn->setMinimumWidth(icoWidth); - btn->setCheckable(true); - connect(btn, SIGNAL(clicked()), this, SLOT(buttonClick())); - } - - QList ledits = ui->page1->findChildren(); - - foreach (QLineEdit *ledit, ledits) { - connect(ledit, SIGNAL(textEdited(const QString)), this, SLOT(doTextEdited(const QString))); - } - - ui->btnMain->click(); - on_spinBox_rbit_valueChanged(1); -} - -void frmMain::buttonClick() -{ - QToolButton *b = (QToolButton *)sender(); - QString name = b->text(); - QList tbtns = ui->widgetTop->findChildren(); - - foreach (QToolButton *btn, tbtns) { - if (btn == b) { - btn->setChecked(true); - } else { - btn->setChecked(false); - } - } - - if (name == "主界面") { - ui->stackedWidget->setCurrentIndex(0); - } else if (name == "用户退出") { - exit(0); - } -} - -void frmMain::doTextEdited(const QString str) -{ - QLineEdit *l = (QLineEdit *)sender(); - QList ledits = ui->page1->findChildren(); - //转换前单位 - QString beforeName = l->objectName(); - //转换前数值 - double beforeValue = l->text().toDouble(); - - foreach (QLineEdit *ledit, ledits) { - //转换后单位 - QString curName = ledit->objectName(); - - if (ledit == l) { - } else if (curName == "lineEdit_bar") { - //巴 (bar) - if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.01, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.001, 'f', numOfDecimalPoints); - qDebug() << outStr; - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到巴 (bar) - QString outStr = QString::number(beforeValue * 1.01325, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.0004788, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.03386388, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.00009807, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到巴 (bar) - QString outStr = QString::number(beforeValue * 10, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.001, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.00001, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.00133322, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.06894757, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.980665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到巴 (bar) - QString outStr = QString::number(beforeValue * 0.00009807, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_kpa") { - //千帕 (kPa) - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 100.0, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 0.1, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 101.325, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 0.04788026, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 3.38638816, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 0.00980665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 1000, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 0.1, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 0.001, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 0.13332237, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 6.894757, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 98.0665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到千帕 (kPa) - QString outStr = QString::number(beforeValue * 0.00980665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_mbar") { - //毫巴 (mbar) - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 1000.0, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 10, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 1013.25, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 0.47880257, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 33.86388158, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 0.0980665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 10000, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 1, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 0.01, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 1.33322368, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 68.94757, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 980.665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到毫巴(mbar) - QString outStr = QString::number(beforeValue * 0.0980665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_unit") { - //标准大气压 - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.98692327, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.00986923, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.00098692, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.00047254, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.03342105, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.00009678, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到标准大气压 - QString outStr = QString::number(beforeValue * 9.86923267, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.00098692, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.00000987, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.00131579, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.06804596, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.96784111, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到标准大气压 - QString outStr = QString::number(beforeValue * 0.00009678, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_feet") { - //磅力/英尺2 - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 2088.54351212, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 20.88543512, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 2.08854351, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 2116.21671366, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 70.72619017, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 0.20481615, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 20885.43512121, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 2.08854351, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 0.02088544, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 2.78449568, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 144, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 2048.16152331, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到磅力/英尺2 - QString outStr = QString::number(beforeValue * 0.20481615, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_british_hg") { - //英吋汞柱 - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 29.52998751, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 0.29529988, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 0.02952999, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 29.92125984, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 0.01413903, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 0.0028959, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 295.29987508, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 0.02952999, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 0.0002953, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 0.03937008, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 2.03602088, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 28.9590252, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 0.0028959, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_kilogram_force") { - //公斤力/米2 - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 10197.16212978, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 101.9716213, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 10.19716213, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 10332.274528, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 4.88242743, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 345.3154908, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 101971.62129779, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 10.19716213, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 0.10197162, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 13.59509806, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 703.06954974, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到公斤力/米2 - QString outStr = QString::number(beforeValue * 10000, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到英吋汞柱 - QString outStr = QString::number(beforeValue * 1, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_mpa") { - //兆帕(MPa) - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.1, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.001, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.0001, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.101325, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.00004788, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.00338639, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.00000981, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.0001, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.000001, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.00013332, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.00689476, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 0.0980665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到兆帕(MPa) - QString outStr = QString::number(beforeValue * 1, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_hpa") { - //百帕 (hPa) - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到百帕 (hPa) - QString outStr = QString::number(beforeValue * 1000, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 10, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 1, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 1013.25, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 0.47880257, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 33.86388158, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 0.0980665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 10000, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 0.01, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 1.33322368, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 68.94757, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 980.665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到百帕(hPa) - QString outStr = QString::number(beforeValue * 0.0980665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_pascal") { - //帕斯卡 - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到帕斯卡 - QString outStr = QString::number(beforeValue * 100000, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到帕斯卡 - QString outStr = QString::number(beforeValue * 1000, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到帕斯卡 - QString outStr = QString::number(beforeValue * 100, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到帕斯卡 - QString outStr = QString::number(beforeValue * 101325, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到帕斯卡 - QString outStr = QString::number(beforeValue * 47.88025694, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到帕斯卡 - QString outStr = QString::number(beforeValue * 3386.38815789, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到帕斯卡 - QString outStr = QString::number(beforeValue * 9.80665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到帕斯卡 - QString outStr = QString::number(beforeValue * 1000000, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到帕斯卡 - QString outStr = QString::number(beforeValue * 100, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到帕斯卡 - QString outStr = QString::number(beforeValue * 133.32236842, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到帕斯卡 - QString outStr = QString::number(beforeValue * 6894.757, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到帕斯卡 - QString outStr = QString::number(beforeValue * 98066.5, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到帕斯卡 - QString outStr = QString::number(beforeValue * 9.80665, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_mmhg") { - //毫米汞柱 (托) - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到毫米汞柱 (托) - QString outStr = QString::number(beforeValue * 750.0616827, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到毫米汞柱 (托) - QString outStr = QString::number(beforeValue * 7.50061683, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到毫米汞柱 (托) - QString outStr = QString::number(beforeValue * 0.75006168, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到毫米汞柱 (托) - QString outStr = QString::number(beforeValue * 760, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到毫米汞柱(托) - QString outStr = QString::number(beforeValue * 0.35913146, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到毫米汞柱(托) - QString outStr = QString::number(beforeValue * 25.4, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到毫米汞柱(托) - QString outStr = QString::number(beforeValue * 0.07355592, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到毫米汞柱(托) - QString outStr = QString::number(beforeValue * 7500.61682704, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到毫米汞柱(托) - QString outStr = QString::number(beforeValue * 0.75006168, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到毫米汞柱(托) - QString outStr = QString::number(beforeValue * 0.00750062, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到毫米汞柱 (托) - QString outStr = QString::number(beforeValue * 51.71493037, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到毫米汞柱 (托) - QString outStr = QString::number(beforeValue * 735.55924007, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到毫米汞柱 (托) - QString outStr = QString::number(beforeValue * 0.07355592, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_cmz") { - //磅力/英寸2 - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 14.50377439, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 0.14503774, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 0.01450377, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 14.6959494, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 0.00694444, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 0.4911541, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 0.00142233, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 145.0377439, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 0.01450377, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 0.00014504, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 0.01933678, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 14.22334391, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 0.00142233, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_kgf_cm2") { - //公斤力/厘米2 - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 1.01971621, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.01019716, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.00101972, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 1.03322745, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.00048824, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.03453155, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.0001, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 10.19716213, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.00101972, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.0000102, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.00135951, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.07030695, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mm_water_column") { - //毫米水柱装换到公斤力/厘米2 - QString outStr = QString::number(beforeValue * 0.0001, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } else if (curName == "lineEdit_mm_water_column") { - //毫米水柱 - if (beforeName == "lineEdit_bar") { - //从巴 (bar)装换到磅力/英寸2 - QString outStr = QString::number(beforeValue * 10197.16212978, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kpa") { - //从千帕 (kPa)装换到毫米水柱 - QString outStr = QString::number(beforeValue * 101.9716213, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mbar") { - //从毫巴 (mbar)装换到毫米水柱 - QString outStr = QString::number(beforeValue * 10.19716213, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_unit") { - //从标准大气压装换到毫米水柱 - QString outStr = QString::number(beforeValue * 10332.274528, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_feet") { - //从磅力/英尺2装换到毫米水柱 - QString outStr = QString::number(beforeValue * 4.88242743, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_british_hg") { - //英吋汞柱装换到毫米水柱 - QString outStr = QString::number(beforeValue * 345.3154908, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kilogram_force") { - //公斤力/米2装换到毫米水柱 - QString outStr = QString::number(beforeValue * 1, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mpa") { - //兆帕(MPa)装换到毫米水柱 - QString outStr = QString::number(beforeValue * 101971.62129779, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_hpa") { - //百帕(hPa)装换到毫米水柱 - QString outStr = QString::number(beforeValue * 10.19716213, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_pascal") { - //帕斯卡装换到毫米水柱 - QString outStr = QString::number(beforeValue * 0.10197162, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_mmhg") { - //毫米汞柱 (托)装换到毫米水柱 - QString outStr = QString::number(beforeValue * 13.59509806, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_cmz") { - //磅力/英寸2装换到毫米水柱 - QString outStr = QString::number(beforeValue * 703.06954974, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } else if (beforeName == "lineEdit_kgf_cm2") { - //公斤力/厘米2装换到毫米水柱 - QString outStr = QString::number(beforeValue * 10000, 'f', numOfDecimalPoints); - ledit->setText(outStr); - } - } - } -} - -void frmMain::on_btnMenu_Min_clicked() -{ - showMinimized(); -} -void frmMain::on_btnMenu_Max_clicked() -{ - static bool max = false; - static QRect location = this->geometry(); - - if (max) { - this->setGeometry(location); - } else { - location = this->geometry(); - this->setGeometry(qApp->desktop()->availableGeometry()); - } - - this->setProperty("canMove", max); - max = !max; -} -void frmMain::on_btnMenu_Close_clicked() -{ - close(); -} -void frmMain::on_spinBox_rbit_valueChanged(int arg1) -{ - numOfDecimalPoints = arg1; - QList ledits = ui->page1->findChildren(); - - foreach (QLineEdit *ledit, ledits) { - ledit->setValidator(new QDoubleValidator(0, DBL_MAX, arg1, this)); - } -} diff --git a/unitconversion/form/frmmain.h b/unitconversion/form/frmmain.h deleted file mode 100644 index 01ecb5e..0000000 --- a/unitconversion/form/frmmain.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef FRMMAIN_H -#define FRMMAIN_H - -#include - -namespace Ui { -class frmMain; -} - -class frmMain : public QDialog -{ - Q_OBJECT - -public: - explicit frmMain(QWidget *parent = 0); - ~frmMain(); - -protected: - bool eventFilter(QObject *watched, QEvent *event); - -private: - Ui::frmMain *ui; - int numOfDecimalPoints; - -private slots: - void initForm(); - void buttonClick(); - void doTextEdited(const QString); - -private slots: - void on_btnMenu_Min_clicked(); - void on_btnMenu_Max_clicked(); - void on_btnMenu_Close_clicked(); - void on_spinBox_rbit_valueChanged(int arg1); -}; - -#endif // UIDEMO01_H diff --git a/unitconversion/form/frmmain.ui b/unitconversion/form/frmmain.ui deleted file mode 100644 index d8db6c6..0000000 --- a/unitconversion/form/frmmain.ui +++ /dev/null @@ -1,506 +0,0 @@ - - - frmMain - - - - 0 - 0 - 800 - 600 - - - - Form - - - - - - - 0 - 0 - - - - - 10 - - - 10 - - - 0 - - - 0 - - - 0 - - - - - - - - :/image/logo.png - - - true - - - Qt::AlignCenter - - - - - - - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - 主界面 - - - - :/image/main_main.png:/image/main_main.png - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - - - 用户退出 - - - - :/image/main_exit.png:/image/main_exit.png - - - Qt::ToolButtonTextUnderIcon - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 0 - 0 - - - - - 30 - 30 - - - - ArrowCursor - - - Qt::NoFocus - - - 最小化 - - - - - - - - - - - 0 - 0 - - - - - 30 - 30 - - - - ArrowCursor - - - Qt::NoFocus - - - 关闭 - - - - - - - - - - - 0 - 0 - - - - - 30 - 30 - - - - Qt::NoFocus - - - - - - - - - - - - - - - - - - - 0 - - - - - - - Qt::Horizontal - - - - 104 - 20 - - - - - - - - - - 小数点保留位 - - - - - - - 巴 (bar) - - - - - - - 千帕 (kPa) - - - - - - - 毫巴 (mbar) - - - - - - - 标准大气压 - - - - - - - 磅力/英尺2 - - - - - - - 英吋汞柱 - - - - - - - 公斤力/米2 - - - - - - - - - - - 1 - - - 10 - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 105 - 20 - - - - - - - - - - 兆帕 (MPa) - - - - - - - 百帕 (hPa) - - - - - - - 帕斯卡 - - - - - - - 毫米汞柱 (托) - - - - - - - 磅力/英寸2 - - - - - - - 公斤力/厘米2 - - - - - - - 毫米水柱 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 104 - 20 - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/unitconversion/main.cpp b/unitconversion/main.cpp deleted file mode 100644 index 3ffdfee..0000000 --- a/unitconversion/main.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "frmmain.h" -#include "appinit.h" -#include "qapplication.h" -#include "qtextcodec.h" -#include "qfile.h" -#include "qdebug.h" - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - a.setFont(QFont("Microsoft Yahei", 9)); - AppInit::Instance()->start(); - -#if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) -#if _MSC_VER - QTextCodec *codec = QTextCodec::codecForName("gbk"); -#else - QTextCodec *codec = QTextCodec::codecForName("utf-8"); -#endif - QTextCodec::setCodecForLocale(codec); - QTextCodec::setCodecForCStrings(codec); - QTextCodec::setCodecForTr(codec); -#else - QTextCodec *codec = QTextCodec::codecForName("utf-8"); - QTextCodec::setCodecForLocale(codec); -#endif - - //加载样式表 - QFile file(":/qss/psblack.css"); - if (file.open(QFile::ReadOnly)) { - QString qss = QLatin1String(file.readAll()); - QString paletteColor = qss.mid(20, 7); - qApp->setPalette(QPalette(QColor(paletteColor))); - qApp->setStyleSheet(qss); - file.close(); - } - - frmMain w; - w.show(); - - return a.exec(); -} diff --git a/unitconversion/other/image/fontawesome-webfont.ttf b/unitconversion/other/image/fontawesome-webfont.ttf deleted file mode 100644 index 35acda2..0000000 Binary files a/unitconversion/other/image/fontawesome-webfont.ttf and /dev/null differ diff --git a/unitconversion/other/image/logo.png b/unitconversion/other/image/logo.png deleted file mode 100644 index 86b9d5a..0000000 Binary files a/unitconversion/other/image/logo.png and /dev/null differ diff --git a/unitconversion/other/image/main_exit.png b/unitconversion/other/image/main_exit.png deleted file mode 100644 index d26ee30..0000000 Binary files a/unitconversion/other/image/main_exit.png and /dev/null differ diff --git a/unitconversion/other/image/main_main.png b/unitconversion/other/image/main_main.png deleted file mode 100644 index 3273ada..0000000 Binary files a/unitconversion/other/image/main_main.png and /dev/null differ diff --git a/unitconversion/other/logo.ico b/unitconversion/other/logo.ico deleted file mode 100644 index 4fcf2a5..0000000 Binary files a/unitconversion/other/logo.ico and /dev/null differ diff --git a/unitconversion/other/main.qrc b/unitconversion/other/main.qrc deleted file mode 100644 index 84547eb..0000000 --- a/unitconversion/other/main.qrc +++ /dev/null @@ -1,8 +0,0 @@ - - - image/fontawesome-webfont.ttf - image/main_exit.png - image/logo.png - image/main_main.png - - diff --git a/unitconversion/other/qss.qrc b/unitconversion/other/qss.qrc deleted file mode 100644 index bd531cf..0000000 --- a/unitconversion/other/qss.qrc +++ /dev/null @@ -1,23 +0,0 @@ - - - qss/psblack.css - qss/psblack/add_bottom.png - qss/psblack/add_left.png - qss/psblack/add_right.png - qss/psblack/add_top.png - qss/psblack/branch_close.png - qss/psblack/branch_open.png - qss/psblack/calendar_nextmonth.png - qss/psblack/calendar_prevmonth.png - qss/psblack/checkbox_checked.png - qss/psblack/checkbox_checked_disable.png - qss/psblack/checkbox_parcial.png - qss/psblack/checkbox_parcial_disable.png - qss/psblack/checkbox_unchecked.png - qss/psblack/checkbox_unchecked_disable.png - qss/psblack/radiobutton_checked.png - qss/psblack/radiobutton_checked_disable.png - qss/psblack/radiobutton_unchecked.png - qss/psblack/radiobutton_unchecked_disable.png - - diff --git a/unitconversion/other/qss/psblack.css b/unitconversion/other/qss/psblack.css deleted file mode 100644 index be5d6d5..0000000 --- a/unitconversion/other/qss/psblack.css +++ /dev/null @@ -1,657 +0,0 @@ -QPalette{background:#444444;}*{outline:0px;color:#DCDCDC;} - -QWidget[form="true"]{ -border:1px solid #242424; -border-radius:0px; -} - -QWidget[form="bottom"]{ -background:#484848; -} - -QWidget[form="bottom"] .QFrame{ -border:1px solid #DCDCDC; -} - -QWidget[form="bottom"] QLabel,QWidget[form="title"] QLabel{ -border-radius:0px; -color:#DCDCDC; -background:none; -border-style:none; -} - -QWidget[form="title"],QWidget[nav="left"],QWidget[nav="top"] QAbstractButton{ -border-style:none; -border-radius:0px; -padding:5px; -color:#DCDCDC; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); -} - -QWidget[nav="top"] QAbstractButton:hover,QWidget[nav="top"] QAbstractButton:pressed,QWidget[nav="top"] QAbstractButton:checked{ -border-style:solid; -border-width:0px 0px 2px 0px; -padding:4px 4px 2px 4px; -border-color:#00BB9E; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); -} - -QWidget[nav="left"] QAbstractButton{ -border-radius:0px; -color:#DCDCDC; -background:none; -border-style:none; -} - -QWidget[nav="left"] QAbstractButton:hover{ -color:#FFFFFF; -background-color:#00BB9E; -} - -QWidget[nav="left"] QAbstractButton:checked,QWidget[nav="left"] QAbstractButton:pressed{ -color:#DCDCDC; -border-style:solid; -border-width:0px 0px 0px 2px; -padding:4px 4px 4px 2px; -border-color:#00BB9E; -background-color:#444444; -} - -QWidget[video="true"] QLabel{ -color:#DCDCDC; -border:1px solid #242424; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); -} - -QWidget[video="true"] QLabel:focus{ -border:1px solid #00BB9E; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); -} - -QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QDoubleSpinBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit{ -border:1px solid #242424; -border-radius:3px; -padding:2px; -background:none; -selection-background-color:#00BB9E; -selection-color:#FFFFFF; -} - -QLineEdit:focus,QTextEdit:focus,QPlainTextEdit:focus,QSpinBox:focus,QDoubleSpinBox:focus,QComboBox:focus,QDateEdit:focus,QTimeEdit:focus,QDateTimeEdit:focus,QLineEdit:hover,QTextEdit:hover,QPlainTextEdit:hover,QSpinBox:hover,QDoubleSpinBox:hover,QComboBox:hover,QDateEdit:hover,QTimeEdit:hover,QDateTimeEdit:hover{ -border:1px solid #242424; -} - -QLineEdit[echoMode="2"]{ -lineedit-password-character:9679; -} - -.QFrame{ -border:1px solid #242424; -border-radius:3px; -} - -.QGroupBox{ -border:1px solid #242424; -border-radius:5px; -margin-top:3ex; -} - -.QGroupBox::title{ -subcontrol-origin:margin; -position:relative; -left:10px; -} - -.QPushButton,.QToolButton{ -border-style:none; -border:1px solid #242424; -color:#DCDCDC; -padding:5px; -min-height:15px; -border-radius:5px; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); -} - -.QPushButton:hover,.QToolButton:hover{ -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); -} - -.QPushButton:pressed,.QToolButton:pressed{ -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); -} - -.QToolButton::menu-indicator{ -image:None; -} - -QToolButton#btnMenu,QPushButton#btnMenu_Min,QPushButton#btnMenu_Max,QPushButton#btnMenu_Close{ -border-radius:3px; -color:#DCDCDC; -padding:3px; -margin:0px; -background:none; -border-style:none; -} - -QToolButton#btnMenu:hover,QPushButton#btnMenu_Min:hover,QPushButton#btnMenu_Max:hover{ -color:#FFFFFF; -margin:1px 1px 2px 1px; -background-color:rgba(51,127,209,230); -} - -QPushButton#btnMenu_Close:hover{ -color:#FFFFFF; -margin:1px 1px 2px 1px; -background-color:rgba(238,0,0,128); -} - -QRadioButton::indicator{ -width:15px; -height:15px; -} - -QRadioButton::indicator::unchecked{ -image:url(:/qss/psblack/radiobutton_unchecked.png); -} - -QRadioButton::indicator::unchecked:disabled{ -image:url(:/qss/psblack/radiobutton_unchecked_disable.png); -} - -QRadioButton::indicator::checked{ -image:url(:/qss/psblack/radiobutton_checked.png); -} - -QRadioButton::indicator::checked:disabled{ -image:url(:/qss/psblack/radiobutton_checked_disable.png); -} - -QGroupBox::indicator,QTreeWidget::indicator,QListWidget::indicator{ -padding:0px -3px 0px 0px; -} - -QCheckBox::indicator,QGroupBox::indicator,QTreeWidget::indicator,QListWidget::indicator{ -width:13px; -height:13px; -} - -QCheckBox::indicator:unchecked,QGroupBox::indicator:unchecked,QTreeWidget::indicator:unchecked,QListWidget::indicator:unchecked{ -image:url(:/qss/psblack/checkbox_unchecked.png); -} - -QCheckBox::indicator:unchecked:disabled,QGroupBox::indicator:unchecked:disabled,QTreeWidget::indicator:unchecked:disabled,QListWidget::indicator:disabled{ -image:url(:/qss/psblack/checkbox_unchecked_disable.png); -} - -QCheckBox::indicator:checked,QGroupBox::indicator:checked,QTreeWidget::indicator:checked,QListWidget::indicator:checked{ -image:url(:/qss/psblack/checkbox_checked.png); -} - -QCheckBox::indicator:checked:disabled,QGroupBox::indicator:checked:disabled,QTreeWidget::indicator:checked:disabled,QListWidget::indicator:checked:disabled{ -image:url(:/qss/psblack/checkbox_checked_disable.png); -} - -QCheckBox::indicator:indeterminate,QGroupBox::indicator:indeterminate,QTreeWidget::indicator:indeterminate,QListWidget::indicator:indeterminate{ -image:url(:/qss/psblack/checkbox_parcial.png); -} - -QCheckBox::indicator:indeterminate:disabled,QGroupBox::indicator:indeterminate:disabled,QTreeWidget::indicator:indeterminate:disabled,QListWidget::indicator:indeterminate:disabled{ -image:url(:/qss/psblack/checkbox_parcial_disable.png); -} - -QTimeEdit::up-button,QDateEdit::up-button,QDateTimeEdit::up-button,QDoubleSpinBox::up-button,QSpinBox::up-button{ -image:url(:/qss/psblack/add_top.png); -width:10px; -height:10px; -padding:2px 5px 0px 0px; -} - -QTimeEdit::down-button,QDateEdit::down-button,QDateTimeEdit::down-button,QDoubleSpinBox::down-button,QSpinBox::down-button{ -image:url(:/qss/psblack/add_bottom.png); -width:10px; -height:10px; -padding:0px 5px 2px 0px; -} - -QTimeEdit::up-button:pressed,QDateEdit::up-button:pressed,QDateTimeEdit::up-button:pressed,QDoubleSpinBox::up-button:pressed,QSpinBox::up-button:pressed{ -top:-2px; -} - -QTimeEdit::down-button:pressed,QDateEdit::down-button:pressed,QDateTimeEdit::down-button:pressed,QDoubleSpinBox::down-button:pressed,QSpinBox::down-button:pressed,QSpinBox::down-button:pressed{ -bottom:-2px; -} - -QComboBox::down-arrow,QDateEdit[calendarPopup="true"]::down-arrow,QTimeEdit[calendarPopup="true"]::down-arrow,QDateTimeEdit[calendarPopup="true"]::down-arrow{ -image:url(:/qss/psblack/add_bottom.png); -width:10px; -height:10px; -right:2px; -} - -QComboBox::drop-down,QDateEdit::drop-down,QTimeEdit::drop-down,QDateTimeEdit::drop-down{ -subcontrol-origin:padding; -subcontrol-position:top right; -width:15px; -border-left-width:0px; -border-left-style:solid; -border-top-right-radius:3px; -border-bottom-right-radius:3px; -border-left-color:#242424; -} - -QComboBox::drop-down:on{ -top:1px; -} - -QMenuBar::item{ -color:#DCDCDC; -background-color:#484848; -margin:0px; -padding:3px 10px; -} - -QMenu,QMenuBar,QMenu:disabled,QMenuBar:disabled{ -color:#DCDCDC; -background-color:#484848; -border:1px solid #242424; -margin:0px; -} - -QMenu::item{ -padding:3px 20px; -} - -QMenu::indicator{ -width:13px; -height:13px; -} - -QMenu::item:selected,QMenuBar::item:selected{ -color:#DCDCDC; -border:0px solid #242424; -background:#646464; -} - -QMenu::separator{ -height:1px; -background:#242424; -} - -QProgressBar{ -min-height:10px; -background:#484848; -border-radius:5px; -text-align:center; -border:1px solid #484848; -} - -QProgressBar:chunk{ -border-radius:5px; -background-color:#242424; -} - -QSlider::groove:horizontal{ -background:#484848; -height:8px; -border-radius:4px; -} - -QSlider::add-page:horizontal{ -background:#484848; -height:8px; -border-radius:4px; -} - -QSlider::sub-page:horizontal{ -background:#242424; -height:8px; -border-radius:4px; -} - -QSlider::handle:horizontal{ -width:13px; -margin-top:-3px; -margin-bottom:-3px; -border-radius:6px; -background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #444444,stop:0.8 #242424); -} - -QSlider::groove:vertical{ -width:8px; -border-radius:4px; -background:#484848; -} - -QSlider::add-page:vertical{ -width:8px; -border-radius:4px; -background:#484848; -} - -QSlider::sub-page:vertical{ -width:8px; -border-radius:4px; -background:#242424; -} - -QSlider::handle:vertical{ -height:14px; -margin-left:-3px; -margin-right:-3px; -border-radius:6px; -background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #444444,stop:0.8 #242424); -} - -QScrollBar:horizontal{ -background:#484848; -padding:0px; -border-radius:6px; -max-height:12px; -} - -QScrollBar::handle:horizontal{ -background:#242424; -min-width:50px; -border-radius:6px; -} - -QScrollBar::handle:horizontal:hover{ -background:#00BB9E; -} - -QScrollBar::handle:horizontal:pressed{ -background:#00BB9E; -} - -QScrollBar::add-page:horizontal{ -background:none; -} - -QScrollBar::sub-page:horizontal{ -background:none; -} - -QScrollBar::add-line:horizontal{ -background:none; -} - -QScrollBar::sub-line:horizontal{ -background:none; -} - -QScrollBar:vertical{ -background:#484848; -padding:0px; -border-radius:6px; -max-width:12px; -} - -QScrollBar::handle:vertical{ -background:#242424; -min-height:50px; -border-radius:6px; -} - -QScrollBar::handle:vertical:hover{ -background:#00BB9E; -} - -QScrollBar::handle:vertical:pressed{ -background:#00BB9E; -} - -QScrollBar::add-page:vertical{ -background:none; -} - -QScrollBar::sub-page:vertical{ -background:none; -} - -QScrollBar::add-line:vertical{ -background:none; -} - -QScrollBar::sub-line:vertical{ -background:none; -} - -QScrollArea{ -border:0px; -} - -QTreeView,QListView,QTableView,QTabWidget::pane{ -border:1px solid #242424; -selection-background-color:#646464; -selection-color:#DCDCDC; -alternate-background-color:#525252; -gridline-color:#242424; -} - -QTreeView::branch:closed:has-children{ -margin:4px; -border-image:url(:/qss/psblack/branch_open.png); -} - -QTreeView::branch:open:has-children{ -margin:4px; -border-image:url(:/qss/psblack/branch_close.png); -} - -QTreeView,QListView,QTableView,QSplitter::handle,QTreeView::branch{ -background:#444444; -} - -QTableView::item:selected,QListView::item:selected,QTreeView::item:selected{ -color:#DCDCDC; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); -} - -QTableView::item:hover,QListView::item:hover,QTreeView::item:hover,QHeaderView{ -color:#DCDCDC; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); -} - -QTableView::item,QListView::item,QTreeView::item{ -padding:1px; -margin:0px; -} - -QHeaderView::section,QTableCornerButton:section{ -padding:3px; -margin:0px; -color:#DCDCDC; -border:1px solid #242424; -border-left-width:0px; -border-right-width:1px; -border-top-width:0px; -border-bottom-width:1px; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); -} - -QTabBar::tab{ -border:1px solid #242424; -color:#DCDCDC; -margin:0px; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); -} - -QTabBar::tab:selected,QTabBar::tab:hover{ -border-style:solid; -border-color:#00BB9E; -background:#444444; -} - -QTabBar::tab:top,QTabBar::tab:bottom{ -padding:3px 8px 3px 8px; -} - -QTabBar::tab:left,QTabBar::tab:right{ -padding:8px 3px 8px 3px; -} - -QTabBar::tab:top:selected,QTabBar::tab:top:hover{ -border-width:2px 0px 0px 0px; -} - -QTabBar::tab:right:selected,QTabBar::tab:right:hover{ -border-width:0px 0px 0px 2px; -} - -QTabBar::tab:bottom:selected,QTabBar::tab:bottom:hover{ -border-width:0px 0px 2px 0px; -} - -QTabBar::tab:left:selected,QTabBar::tab:left:hover{ -border-width:0px 2px 0px 0px; -} - -QTabBar::tab:first:top:selected,QTabBar::tab:first:top:hover,QTabBar::tab:first:bottom:selected,QTabBar::tab:first:bottom:hover{ -border-left-width:1px; -border-left-color:#242424; -} - -QTabBar::tab:first:left:selected,QTabBar::tab:first:left:hover,QTabBar::tab:first:right:selected,QTabBar::tab:first:right:hover{ -border-top-width:1px; -border-top-color:#242424; -} - -QTabBar::tab:last:top:selected,QTabBar::tab:last:top:hover,QTabBar::tab:last:bottom:selected,QTabBar::tab:last:bottom:hover{ -border-right-width:1px; -border-right-color:#242424; -} - -QTabBar::tab:last:left:selected,QTabBar::tab:last:left:hover,QTabBar::tab:last:right:selected,QTabBar::tab:last:right:hover{ -border-bottom-width:1px; -border-bottom-color:#242424; -} - -QStatusBar::item{ -border:0px solid #484848; -border-radius:3px; -} - -QToolBox::tab,QGroupBox#gboxDevicePanel,QGroupBox#gboxDeviceTitle,QFrame#gboxDevicePanel,QFrame#gboxDeviceTitle{ -padding:3px; -border-radius:5px; -color:#DCDCDC; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); -} - -QToolTip{ -border:0px solid #DCDCDC; -padding:1px; -color:#DCDCDC; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); -} - -QToolBox::tab:selected{ -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); -} - -QPrintPreviewDialog QToolButton{ -border:0px solid #DCDCDC; -border-radius:0px; -margin:0px; -padding:3px; -background:none; -} - -QColorDialog QPushButton,QFileDialog QPushButton{ -min-width:80px; -} - -QToolButton#qt_calendar_prevmonth{ -icon-size:0px; -min-width:20px; -image:url(:/qss/psblack/calendar_prevmonth.png); -} - -QToolButton#qt_calendar_nextmonth{ -icon-size:0px; -min-width:20px; -image:url(:/qss/psblack/calendar_nextmonth.png); -} - -QToolButton#qt_calendar_prevmonth,QToolButton#qt_calendar_nextmonth,QToolButton#qt_calendar_monthbutton,QToolButton#qt_calendar_yearbutton{ -border:0px solid #DCDCDC; -border-radius:3px; -margin:3px 3px 3px 3px; -padding:3px; -background:none; -} - -QToolButton#qt_calendar_prevmonth:hover,QToolButton#qt_calendar_nextmonth:hover,QToolButton#qt_calendar_monthbutton:hover,QToolButton#qt_calendar_yearbutton:hover,QToolButton#qt_calendar_prevmonth:pressed,QToolButton#qt_calendar_nextmonth:pressed,QToolButton#qt_calendar_monthbutton:pressed,QToolButton#qt_calendar_yearbutton:pressed{ -border:1px solid #242424; -} - -QCalendarWidget QSpinBox#qt_calendar_yearedit{ -margin:2px; -} - -QCalendarWidget QToolButton::menu-indicator{ -image:None; -} - -QCalendarWidget QTableView{ -border-width:0px; -} - -QCalendarWidget QWidget#qt_calendar_navigationbar{ -border:1px solid #242424; -border-width:1px 1px 0px 1px; -background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); -} - -QComboBox QAbstractItemView::item{ -min-height:20px; -min-width:10px; -} - -QTableView[model="true"]::item{ -padding:0px; -margin:0px; -} - -QTableView QLineEdit,QTableView QComboBox,QTableView QSpinBox,QTableView QDoubleSpinBox,QTableView QDateEdit,QTableView QTimeEdit,QTableView QDateTimeEdit{ -border-width:0px; -border-radius:0px; -} - -QTableView QLineEdit:focus,QTableView QComboBox:focus,QTableView QSpinBox:focus,QTableView QDoubleSpinBox:focus,QTableView QDateEdit:focus,QTableView QTimeEdit:focus,QTableView QDateTimeEdit:focus{ -border-width:0px; -border-radius:0px; -} - -QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QDoubleSpinBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit{ -background:#444444; -} - -QTabWidget::pane:top{top:-1px;} -QTabWidget::pane:bottom{bottom:-1px;} -QTabWidget::pane:left{right:-1px;} -QTabWidget::pane:right{left:-1px;} - -QDialog { -background-color:#444444; -color:#DCDCDC; -} - -QDialogButtonBox > QPushButton { -min-width:50px; -} - -*:disabled,QMenu::item:disabled{ -background:#444444; -border-color:#484848; -color:#242424; -} - -/*TextColor:#DCDCDC*/ -/*PanelColor:#444444*/ -/*BorderColor:#242424*/ -/*NormalColorStart:#484848*/ -/*NormalColorEnd:#383838*/ -/*DarkColorStart:#646464*/ -/*DarkColorEnd:#525252*/ -/*HighColor:#00BB9E*/ \ No newline at end of file diff --git a/unitconversion/other/qss/psblack/add_bottom.png b/unitconversion/other/qss/psblack/add_bottom.png deleted file mode 100644 index 2f8c0f2..0000000 Binary files a/unitconversion/other/qss/psblack/add_bottom.png and /dev/null differ diff --git a/unitconversion/other/qss/psblack/add_left.png b/unitconversion/other/qss/psblack/add_left.png deleted file mode 100644 index 7a23601..0000000 Binary files a/unitconversion/other/qss/psblack/add_left.png and /dev/null differ diff --git a/unitconversion/other/qss/psblack/add_right.png b/unitconversion/other/qss/psblack/add_right.png deleted file mode 100644 index d01c2f7..0000000 Binary files a/unitconversion/other/qss/psblack/add_right.png and /dev/null differ diff --git a/unitconversion/other/qss/psblack/add_top.png b/unitconversion/other/qss/psblack/add_top.png deleted file mode 100644 index a5ceb4f..0000000 Binary files a/unitconversion/other/qss/psblack/add_top.png and /dev/null differ diff --git a/unitconversion/other/qss/psblack/branch_close.png b/unitconversion/other/qss/psblack/branch_close.png deleted file mode 100644 index 94511e5..0000000 Binary files a/unitconversion/other/qss/psblack/branch_close.png and /dev/null differ diff --git a/unitconversion/other/qss/psblack/branch_open.png b/unitconversion/other/qss/psblack/branch_open.png deleted file mode 100644 index 533a63e..0000000 Binary files a/unitconversion/other/qss/psblack/branch_open.png and /dev/null differ diff --git a/unitconversion/other/qss/psblack/calendar_nextmonth.png b/unitconversion/other/qss/psblack/calendar_nextmonth.png deleted file mode 100644 index c80aa2a..0000000 Binary files a/unitconversion/other/qss/psblack/calendar_nextmonth.png and /dev/null differ diff --git a/unitconversion/other/qss/psblack/calendar_prevmonth.png b/unitconversion/other/qss/psblack/calendar_prevmonth.png deleted file mode 100644 index 421799e..0000000 Binary files a/unitconversion/other/qss/psblack/calendar_prevmonth.png and /dev/null differ diff --git a/unitconversion/other/qss/psblack/checkbox_checked.png b/unitconversion/other/qss/psblack/checkbox_checked.png deleted file mode 100644 index 55a120c..0000000 Binary files a/unitconversion/other/qss/psblack/checkbox_checked.png and /dev/null differ diff --git a/unitconversion/other/qss/psblack/checkbox_checked_disable.png b/unitconversion/other/qss/psblack/checkbox_checked_disable.png deleted file mode 100644 index fa51554..0000000 Binary files a/unitconversion/other/qss/psblack/checkbox_checked_disable.png and /dev/null differ diff --git a/unitconversion/other/qss/psblack/checkbox_parcial.png b/unitconversion/other/qss/psblack/checkbox_parcial.png deleted file mode 100644 index e6ae0b8..0000000 Binary files a/unitconversion/other/qss/psblack/checkbox_parcial.png and /dev/null differ diff --git a/unitconversion/other/qss/psblack/checkbox_parcial_disable.png b/unitconversion/other/qss/psblack/checkbox_parcial_disable.png deleted file mode 100644 index eca2c61..0000000 Binary files a/unitconversion/other/qss/psblack/checkbox_parcial_disable.png and /dev/null differ diff --git a/unitconversion/other/qss/psblack/checkbox_unchecked.png b/unitconversion/other/qss/psblack/checkbox_unchecked.png deleted file mode 100644 index b06fd70..0000000 Binary files a/unitconversion/other/qss/psblack/checkbox_unchecked.png and /dev/null differ diff --git a/unitconversion/other/qss/psblack/checkbox_unchecked_disable.png b/unitconversion/other/qss/psblack/checkbox_unchecked_disable.png deleted file mode 100644 index db00b2a..0000000 Binary files a/unitconversion/other/qss/psblack/checkbox_unchecked_disable.png and /dev/null differ diff --git a/unitconversion/other/qss/psblack/radiobutton_checked.png b/unitconversion/other/qss/psblack/radiobutton_checked.png deleted file mode 100644 index 928307c..0000000 Binary files a/unitconversion/other/qss/psblack/radiobutton_checked.png and /dev/null differ diff --git a/unitconversion/other/qss/psblack/radiobutton_checked_disable.png b/unitconversion/other/qss/psblack/radiobutton_checked_disable.png deleted file mode 100644 index 436b8ea..0000000 Binary files a/unitconversion/other/qss/psblack/radiobutton_checked_disable.png and /dev/null differ diff --git a/unitconversion/other/qss/psblack/radiobutton_unchecked.png b/unitconversion/other/qss/psblack/radiobutton_unchecked.png deleted file mode 100644 index 3d1e440..0000000 Binary files a/unitconversion/other/qss/psblack/radiobutton_unchecked.png and /dev/null differ diff --git a/unitconversion/other/qss/psblack/radiobutton_unchecked_disable.png b/unitconversion/other/qss/psblack/radiobutton_unchecked_disable.png deleted file mode 100644 index d291039..0000000 Binary files a/unitconversion/other/qss/psblack/radiobutton_unchecked_disable.png and /dev/null differ diff --git a/unitconversion/snap.png b/unitconversion/snap.png deleted file mode 100644 index bfa72f8..0000000 Binary files a/unitconversion/snap.png and /dev/null differ diff --git a/unitconversion/unitconversion.pro b/unitconversion/unitconversion.pro deleted file mode 100644 index 0ecc707..0000000 --- a/unitconversion/unitconversion.pro +++ /dev/null @@ -1,33 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2020-07-16T17:38:15 -# -#------------------------------------------------- - -QT += core gui - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets - -TARGET = unitConversionOfPressure - -RC_ICONS = other/logo.ico - -TEMPLATE = app -MOC_DIR = temp/moc -RCC_DIR = temp/rcc -UI_DIR = temp/ui -OBJECTS_DIR = temp/obj -DESTDIR = $$PWD/../bin - -RESOURCES += other/main.qrc -RESOURCES += other/qss.qrc -CONFIG += warn_off - -SOURCES += main.cpp - -include ($$PWD/api/api.pri) -include ($$PWD/form/form.pri) - -INCLUDEPATH += $$PWD -INCLUDEPATH += $$PWD/api -INCLUDEPATH += $$PWD/form diff --git a/videopanel/videopanel.cpp b/videopanel/videopanel.cpp index 61f46fe..f07c459 100644 --- a/videopanel/videopanel.cpp +++ b/videopanel/videopanel.cpp @@ -56,7 +56,7 @@ void VideoPanel::initControl() { gridLayout = new QGridLayout; gridLayout->setSpacing(1); - gridLayout->setMargin(0); + gridLayout->setContentsMargins(0, 0, 0, 0); gridLayout->setObjectName("gridLayout"); this->setLayout(gridLayout); } @@ -214,13 +214,11 @@ void VideoPanel::show_video_all() void VideoPanel::show_video_4() { - videoMax = false; - QString videoType; - int index = 0; - QAction *action = (QAction *)sender(); QString name = action->text(); + int index = 0; + QString videoType; if (name == "通道1-通道4") { index = 0; videoType = "1_4"; @@ -237,19 +235,18 @@ void VideoPanel::show_video_4() if (this->videoType != videoType) { this->videoType = videoType; + this->videoMax = false; change_video_4(index); } } void VideoPanel::show_video_6() { - videoMax = false; - QString videoType; - int index = 0; - QAction *action = (QAction *)sender(); QString name = action->text(); + int index = 0; + QString videoType; if (name == "通道1-通道6") { index = 0; videoType = "1_6"; @@ -263,19 +260,18 @@ void VideoPanel::show_video_6() if (this->videoType != videoType) { this->videoType = videoType; + this->videoMax = false; change_video_6(index); } } void VideoPanel::show_video_8() { - videoMax = false; - QString videoType; - int index = 0; - QAction *action = (QAction *)sender(); QString name = action->text(); + int index = 0; + QString videoType; if (name == "通道1-通道8") { index = 0; videoType = "1_8"; @@ -286,19 +282,18 @@ void VideoPanel::show_video_8() if (this->videoType != videoType) { this->videoType = videoType; + this->videoMax = false; change_video_8(index); } } void VideoPanel::show_video_9() { - videoMax = false; - QString videoType; - int index = 0; - QAction *action = (QAction *)sender(); QString name = action->text(); + int index = 0; + QString videoType; if (name == "通道1-通道9") { index = 0; videoType = "1_9"; @@ -309,18 +304,18 @@ void VideoPanel::show_video_9() if (this->videoType != videoType) { this->videoType = videoType; + this->videoMax = false; change_video_9(index); } } void VideoPanel::show_video_13() { - QString videoType; - int index = 0; - QAction *action = (QAction *)sender(); QString name = action->text(); + int index = 0; + QString videoType; if (name == "通道1-通道13") { index = 0; videoType = "1_13"; @@ -331,58 +326,51 @@ void VideoPanel::show_video_13() if (this->videoType != videoType) { this->videoType = videoType; + this->videoMax = false; change_video_13(index); } } void VideoPanel::show_video_16() { - videoMax = false; - QString videoType; int index = 0; - videoType = "1_16"; - + QString videoType = "1_16"; if (this->videoType != videoType) { this->videoType = videoType; + this->videoMax = false; change_video_16(index); } } void VideoPanel::show_video_25() { - videoMax = false; - QString videoType; int index = 0; - videoType = "1_25"; - + QString videoType = "1_25"; if (this->videoType != videoType) { this->videoType = videoType; + this->videoMax = false; change_video_25(index); } } void VideoPanel::show_video_36() { - videoMax = false; - QString videoType; int index = 0; - videoType = "1_36"; - + QString videoType = "1_36"; if (this->videoType != videoType) { this->videoType = videoType; + this->videoMax = false; change_video_36(index); } } void VideoPanel::show_video_64() { - videoMax = false; - QString videoType; int index = 0; - videoType = "1_64"; - + QString videoType = "1_64"; if (this->videoType != videoType) { this->videoType = videoType; + this->videoMax = false; change_video_64(index); } } @@ -401,6 +389,8 @@ void VideoPanel::change_video(int index, int flag) int row = 0; int column = 0; + //行列数一致的比如 2*2 3*4 4*4 5*5 等可以直接套用通用的公式 + //按照这个函数还可以非常容易的拓展出 10*10 16*16=256 通道界面 for (int i = 0; i < videoCount; i++) { if (i >= index) { gridLayout->addWidget(widgets.at(i), row, column); @@ -426,42 +416,51 @@ void VideoPanel::change_video_4(int index) change_video(index, 2); } +void VideoPanel::change_video_6(const QList &indexs) +{ + gridLayout->addWidget(widgets.at(indexs.at(0)), 0, 0, 2, 2); + gridLayout->addWidget(widgets.at(indexs.at(1)), 0, 2, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(2)), 1, 2, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(3)), 2, 2, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(4)), 2, 1, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(5)), 2, 0, 1, 1); + + for (int i = indexs.first(); i <= indexs.last(); i++) { + widgets.at(i)->setVisible(true); + } +} + void VideoPanel::change_video_6(int index) { hide_video_all(); if (index == 0) { - gridLayout->addWidget(widgets.at(0), 0, 0, 2, 2); - gridLayout->addWidget(widgets.at(1), 0, 2, 1, 1); - gridLayout->addWidget(widgets.at(2), 1, 2, 1, 1); - gridLayout->addWidget(widgets.at(3), 2, 2, 1, 1); - gridLayout->addWidget(widgets.at(4), 2, 1, 1, 1); - gridLayout->addWidget(widgets.at(5), 2, 0, 1, 1); - - for (int i = 0; i < 6; i++) { - widgets.at(i)->setVisible(true); - } + QList indexs; + indexs << 0 << 1 << 2 << 3 << 4 << 5; + change_video_6(indexs); } else if (index == 5) { - gridLayout->addWidget(widgets.at(5), 0, 0, 2, 2); - gridLayout->addWidget(widgets.at(6), 0, 2, 1, 1); - gridLayout->addWidget(widgets.at(7), 1, 2, 1, 1); - gridLayout->addWidget(widgets.at(8), 2, 2, 1, 1); - gridLayout->addWidget(widgets.at(9), 2, 1, 1, 1); - gridLayout->addWidget(widgets.at(10), 2, 0, 1, 1); - - for (int i = 5; i < 11; i++) { - widgets.at(i)->setVisible(true); - } + QList indexs; + indexs << 5 << 6 << 7 << 8 << 9 << 10; + change_video_6(indexs); } else if (index == 10) { - gridLayout->addWidget(widgets.at(10), 0, 0, 2, 2); - gridLayout->addWidget(widgets.at(11), 0, 2, 1, 1); - gridLayout->addWidget(widgets.at(12), 1, 2, 1, 1); - gridLayout->addWidget(widgets.at(13), 2, 2, 1, 1); - gridLayout->addWidget(widgets.at(14), 2, 1, 1, 1); - gridLayout->addWidget(widgets.at(15), 2, 0, 1, 1); + QList indexs; + indexs << 10 << 11 << 12 << 13 << 14 << 15; + change_video_6(indexs); + } +} - for (int i = 10; i < 16; i++) { - widgets.at(i)->setVisible(true); - } +void VideoPanel::change_video_8(const QList &indexs) +{ + gridLayout->addWidget(widgets.at(indexs.at(0)), 0, 0, 3, 3); + gridLayout->addWidget(widgets.at(indexs.at(1)), 0, 3, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(2)), 1, 3, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(3)), 2, 3, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(4)), 3, 3, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(5)), 3, 2, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(6)), 3, 1, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(7)), 3, 0, 1, 1); + + for (int i = indexs.first(); i <= indexs.last(); i++) { + widgets.at(i)->setVisible(true); } } @@ -469,31 +468,13 @@ void VideoPanel::change_video_8(int index) { hide_video_all(); if (index == 0) { - gridLayout->addWidget(widgets.at(0), 0, 0, 3, 3); - gridLayout->addWidget(widgets.at(1), 0, 3, 1, 1); - gridLayout->addWidget(widgets.at(2), 1, 3, 1, 1); - gridLayout->addWidget(widgets.at(3), 2, 3, 1, 1); - gridLayout->addWidget(widgets.at(4), 3, 3, 1, 1); - gridLayout->addWidget(widgets.at(5), 3, 2, 1, 1); - gridLayout->addWidget(widgets.at(6), 3, 1, 1, 1); - gridLayout->addWidget(widgets.at(7), 3, 0, 1, 1); - - for (int i = 0; i < 8; i++) { - widgets.at(i)->setVisible(true); - } + QList indexs; + indexs << 0 << 1 << 2 << 3 << 4 << 5 << 6 << 7; + change_video_8(indexs); } else if (index == 8) { - gridLayout->addWidget(widgets.at(8), 0, 0, 3, 3); - gridLayout->addWidget(widgets.at(9), 0, 3, 1, 1); - gridLayout->addWidget(widgets.at(10), 1, 3, 1, 1); - gridLayout->addWidget(widgets.at(11), 2, 3, 1, 1); - gridLayout->addWidget(widgets.at(12), 3, 3, 1, 1); - gridLayout->addWidget(widgets.at(13), 3, 2, 1, 1); - gridLayout->addWidget(widgets.at(14), 3, 1, 1, 1); - gridLayout->addWidget(widgets.at(15), 3, 0, 1, 1); - - for (int i = 8; i < 16; i++) { - widgets.at(i)->setVisible(true); - } + QList indexs; + indexs << 8 << 9 << 10 << 11 << 12 << 13 << 14 << 15; + change_video_8(indexs); } } @@ -503,45 +484,38 @@ void VideoPanel::change_video_9(int index) change_video(index, 3); } +void VideoPanel::change_video_13(const QList &indexs) +{ + gridLayout->addWidget(widgets.at(indexs.at(0)), 0, 0, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(1)), 0, 1, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(2)), 0, 2, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(3)), 0, 3, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(4)), 1, 0, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(5)), 2, 0, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(6)), 1, 1, 2, 2); + gridLayout->addWidget(widgets.at(indexs.at(7)), 1, 3, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(8)), 2, 3, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(9)), 3, 0, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(10)), 3, 1, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(11)), 3, 2, 1, 1); + gridLayout->addWidget(widgets.at(indexs.at(12)), 3, 3, 1, 1); + + for (int i = indexs.first(); i <= indexs.last(); i++) { + widgets.at(i)->setVisible(true); + } +} + void VideoPanel::change_video_13(int index) { hide_video_all(); if (index == 0) { - gridLayout->addWidget(widgets.at(0), 0, 0, 1, 1); - gridLayout->addWidget(widgets.at(1), 0, 1, 1, 1); - gridLayout->addWidget(widgets.at(2), 0, 2, 1, 1); - gridLayout->addWidget(widgets.at(3), 0, 3, 1, 1); - gridLayout->addWidget(widgets.at(4), 1, 0, 1, 1); - gridLayout->addWidget(widgets.at(5), 2, 0, 1, 1); - gridLayout->addWidget(widgets.at(6), 1, 1, 2, 2); - gridLayout->addWidget(widgets.at(7), 1, 3, 1, 1); - gridLayout->addWidget(widgets.at(8), 2, 3, 1, 1); - gridLayout->addWidget(widgets.at(9), 3, 0, 1, 1); - gridLayout->addWidget(widgets.at(10), 3, 1, 1, 1); - gridLayout->addWidget(widgets.at(11), 3, 2, 1, 1); - gridLayout->addWidget(widgets.at(12), 3, 3, 1, 1); - - for (int i = 0; i < 13; i++) { - widgets.at(i)->setVisible(true); - } + QList indexs; + indexs << 0 << 1 << 2 << 3 << 4 << 5 << 6 << 7 << 8 << 9 << 10 << 11 << 12; + change_video_13(indexs); } else if (index == 3) { - gridLayout->addWidget(widgets.at(3), 0, 0, 1, 1); - gridLayout->addWidget(widgets.at(4), 0, 1, 1, 1); - gridLayout->addWidget(widgets.at(5), 0, 2, 1, 1); - gridLayout->addWidget(widgets.at(6), 0, 3, 1, 1); - gridLayout->addWidget(widgets.at(7), 1, 0, 1, 1); - gridLayout->addWidget(widgets.at(8), 2, 0, 1, 1); - gridLayout->addWidget(widgets.at(9), 1, 1, 2, 2); - gridLayout->addWidget(widgets.at(10), 1, 3, 1, 1); - gridLayout->addWidget(widgets.at(11), 2, 3, 1, 1); - gridLayout->addWidget(widgets.at(12), 3, 0, 1, 1); - gridLayout->addWidget(widgets.at(13), 3, 1, 1, 1); - gridLayout->addWidget(widgets.at(14), 3, 2, 1, 1); - gridLayout->addWidget(widgets.at(15), 3, 3, 1, 1); - - for (int i = 3; i < 16; i++) { - widgets.at(i)->setVisible(true); - } + QList indexs; + indexs << 3 << 4 << 5 << 6 << 7 << 8 << 9 << 10 << 11 << 12 << 13 << 14 << 15; + change_video_13(indexs); } } diff --git a/videopanel/videopanel.h b/videopanel/videopanel.h index 3dd335e..5064d90 100644 --- a/videopanel/videopanel.h +++ b/videopanel/videopanel.h @@ -3,7 +3,7 @@ /** * 视频监控画面控件 整理:feiyangqingyun(QQ:517216493) 2019-4-11 - * 1:目前颜色都写死在样式表,可自行更改或者拓展属性设置 + * 1. 目前颜色都写死在样式表,可自行更改或者拓展属性设置 */ #include @@ -13,13 +13,7 @@ class QLabel; class QGridLayout; #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT VideoPanel : public QWidget +class Q_DECL_EXPORT VideoPanel : public QWidget #else class VideoPanel : public QWidget #endif @@ -73,9 +67,12 @@ private slots: void hide_video_all(); void change_video(int index, int flag); void change_video_4(int index); + void change_video_6(const QList &indexs); void change_video_6(int index); + void change_video_8(const QList &indexs); void change_video_8(int index); void change_video_9(int index); + void change_video_13(const QList &indexs); void change_video_13(int index); void change_video_16(int index); void change_video_25(int index); diff --git a/videowidget/videowidget.cpp b/videowidget/videowidget.cpp index a2580c8..db4e01f 100644 --- a/videowidget/videowidget.cpp +++ b/videowidget/videowidget.cpp @@ -81,7 +81,7 @@ void VideoWidget::initFlowPanel() //用布局顶住,左侧弹簧 QHBoxLayout *layout = new QHBoxLayout; layout->setSpacing(2); - layout->setMargin(0); + layout->setContentsMargins(0, 0, 0, 0); layout->addStretch(); flowPanel->setLayout(layout); @@ -100,7 +100,7 @@ void VideoWidget::initFlowPanel() icons << QApplication::style()->standardIcon(QStyle::SP_DialogCancelButton); #else QList chars; - chars << 0xe68d << 0xe672 << 0xe674 << 0xea36 << 0xe74c; + chars << QChar(0xe68d) << QChar(0xe672) << QChar(0xe674) << QChar(0xea36) << QChar(0xe74c); //判断图形字体是否存在,不存在则加入 QFont iconFont; @@ -277,7 +277,7 @@ void VideoWidget::drawBg(QPainter *painter) //背景图片为空则绘制文字,否则绘制背景图片 if (bgImage.isNull()) { painter->setFont(this->font()); - painter->setPen(palette().foreground().color()); + painter->setPen(palette().windowText().color()); painter->drawText(rect(), Qt::AlignCenter, bgText); } else { //居中绘制 @@ -583,26 +583,6 @@ void VideoWidget::btnClicked() emit btnClicked(btn->objectName()); } -void VideoWidget::setVideoWidth(int videoWidth) -{ - -} - -void VideoWidget::setVideoHeight(int videoHeight) -{ - -} - -void VideoWidget::setBufferWidth(int bufferWidth) -{ - -} - -void VideoWidget::setBufferHeight(int bufferHeight) -{ - -} - uint VideoWidget::getLength() { return 0; @@ -848,6 +828,26 @@ void VideoWidget::setOSD2Position(const VideoWidget::OSDPosition &osdPosition) this->osd2Position = osdPosition; } +void VideoWidget::setOSD1Format(quint8 osdFormat) +{ + setOSD1Format((VideoWidget::OSDFormat)osdFormat); +} + +void VideoWidget::setOSD2Format(quint8 osdFormat) +{ + setOSD2Format((VideoWidget::OSDFormat)osdFormat); +} + +void VideoWidget::setOSD1Position(quint8 osdPosition) +{ + setOSD1Position((VideoWidget::OSDPosition)osdPosition); +} + +void VideoWidget::setOSD2Position(quint8 osdPosition) +{ + setOSD2Position((VideoWidget::OSDPosition)osdPosition); +} + void VideoWidget::setFaceBorder(int faceBorder) { this->faceBorder = faceBorder; diff --git a/videowidget/videowidget.h b/videowidget/videowidget.h index 36d92b2..071b2d3 100644 --- a/videowidget/videowidget.h +++ b/videowidget/videowidget.h @@ -23,13 +23,7 @@ class QTimer; #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT VideoWidget : public QWidget +class Q_DECL_EXPORT VideoWidget : public QWidget #else class VideoWidget : public QWidget #endif @@ -223,6 +217,11 @@ signals: //播放结束 void receivePlayFinsh(); + //总时长 + void fileLengthReceive(qint64 length); + //当前播放时长 + void filePositionReceive(qint64 position); + //收到图片信号 void receiveImage(const QImage &image); @@ -233,16 +232,6 @@ signals: void btnClicked(const QString &objName); public slots: - //设置视频宽度 - void setVideoWidth(int videoWidth); - //设置视频高度 - void setVideoHeight(int videoHeight); - - //设置缓存图片宽度 - void setBufferWidth(int bufferWidth); - //设置缓存图片高度 - void setBufferHeight(int bufferHeight); - //获取长度 uint getLength(); //获取当前播放位置 @@ -348,6 +337,12 @@ public slots: //设置标签2位置 void setOSD2Position(const OSDPosition &osdPosition); + //设置值自动进行枚举转换 + void setOSD1Format(quint8 osdFormat); + void setOSD2Format(quint8 osdFormat); + void setOSD1Position(quint8 osdPosition); + void setOSD2Position(quint8 osdPosition); + //设置人脸框粗细 void setFaceBorder(int faceBorder); //设置人脸框颜色 diff --git a/vlcdemo/readme.md b/vlcdemo/readme.md new file mode 100644 index 0000000..d65e1a8 --- /dev/null +++ b/vlcdemo/readme.md @@ -0,0 +1,11 @@ +### 特别说明 +1. 编译完成以后记得将dll文件复制到可执行文件同一目录。 +2. 动态库地址:[https://pan.baidu.com/s/13LDRu6mXC6gaADtrGprNVA](https://pan.baidu.com/s/13LDRu6mXC6gaADtrGprNVA) 提取码: ujm7 +3. 收费增强版:[https://qtchina.blog.csdn.net/article/details/103946067](https://qtchina.blog.csdn.net/article/details/103946067) + +### 其他说明 +1. 作品大全:[https://qtchina.blog.csdn.net/article/details/97565652](https://qtchina.blog.csdn.net/article/details/97565652) +2. 国内站点:[https://gitee.com/feiyangqingyun](https://gitee.com/feiyangqingyun) +3. 国际站点:[https://github.com/feiyangqingyun](https://github.com/feiyangqingyun) +4. 个人主页:[https://blog.csdn.net/feiyangqingyun](https://blog.csdn.net/feiyangqingyun) +5. 知乎主页:[https://www.zhihu.com/people/feiyangqingyun/](https://www.zhihu.com/people/feiyangqingyun/) \ No newline at end of file diff --git a/vlcdemo/readme.txt b/vlcdemo/readme.txt deleted file mode 100644 index f58b6ae..0000000 --- a/vlcdemo/readme.txt +++ /dev/null @@ -1,9 +0,0 @@ -ԺǵýdllļƵִļͬһĿ¼ -Ӧ汾dllļصַhttps://pan.baidu.com/s/13LDRu6mXC6gaADtrGprNVA ȡ: ujm7 - -շǿ汾https://blog.csdn.net/feiyangqingyun/article/details/103946067 - -2. վ㣺[https://gitee.com/feiyangqingyun](https://gitee.com/feiyangqingyun) -3. վ㣺[https://github.com/feiyangqingyun](https://github.com/feiyangqingyun) -4. ҳ[https://blog.csdn.net/feiyangqingyun](https://blog.csdn.net/feiyangqingyun) -5. ֪ҳ[https://www.zhihu.com/people/feiyangqingyun/](https://www.zhihu.com/people/feiyangqingyun/) \ No newline at end of file diff --git a/web/examples.js b/web/examples.js new file mode 100644 index 0000000..d6465e9 --- /dev/null +++ b/web/examples.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_NODE=ENVIRONMENT_HAS_NODE&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){scriptDirectory=__dirname+"/";read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function dynamicAlloc(size){var ret=HEAP32[DYNAMICTOP_PTR>>2];var end=ret+size+15&-16;if(end>_emscripten_get_heap_size()){abort()}HEAP32[DYNAMICTOP_PTR>>2]=end;return ret}function getNativeTypeSize(type){switch(type){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(type[type.length-1]==="*"){return 4}else if(type[0]==="i"){var bits=parseInt(type.substr(1));assert(bits%8===0,"getNativeTypeSize invalid bits "+bits+", type "+type);return bits/8}else{return 0}}}}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}function convertJsFunctionToWasm(func,sig){if(typeof WebAssembly.Function==="function"){var typeNames={"i":"i32","j":"i64","f":"f32","d":"f64"};var type={parameters:[],results:sig[0]=="v"?[]:[typeNames[sig[0]]]};for(var i=1;i>>0)+ +(high>>>0)*4294967296:+(low>>>0)+ +(high|0)*4294967296}function dynCall(sig,ptr,args){if(args&&args.length){return Module["dynCall_"+sig].apply(null,[ptr].concat(args))}else{return Module["dynCall_"+sig].call(null,ptr)}}var tempRet0=0;var setTempRet0=function(value){tempRet0=value};var getTempRet0=function(){return tempRet0};var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(typeof WebAssembly!=="object"){err("no native wasm support detected")}function setValue(ptr,value,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":HEAP8[ptr>>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":10544,"maximum":10544+0,"element":"anyfunc"});var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i>2]=0}stop=ret+size;while(ptr>0]=0}return ret}if(singleType==="i8"){if(slab.subarray||slab.slice){HEAPU8.set(slab,ret)}else{HEAPU8.set(new Uint8Array(slab),ret)}return ret}var i=0,type,typeSize,previousType;while(i=endIdx))++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else{var str="";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function UTF16ToString(ptr){var endPtr=ptr;var idx=endPtr>>1;while(HEAP16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder){return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr))}else{var i=0;var str="";while(1){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)return str;++i;str+=String.fromCharCode(codeUnit)}}}function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}function allocateUTF8OnStack(str){var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8Array(str,HEAP8,ret,size);return ret}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var WASM_PAGE_SIZE=65536;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var STACK_BASE=13481664,DYNAMIC_BASE=13481664,DYNAMICTOP_PTR=8238608;var INITIAL_TOTAL_MEMORY=Module["TOTAL_MEMORY"]||16777216;if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_TOTAL_MEMORY/WASM_PAGE_SIZE})}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_TOTAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE;function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__);FS.quit();TTY.shutdown();runtimeExited=true}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}function unSign(value,bits,ignore){if(value>=0){return value}return bits<=32?2*Math.abs(1<=half&&(bits<=32||value>half)){value=-2*half+value}return value}var Math_abs=Math.abs;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_min=Math.min;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";out(what);err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";throw new WebAssembly.RuntimeError(what)}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}var wasmBinaryFile="examples.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(){var info={"env":asmLibraryArg,"wasi_snapshot_preview1":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiatedSource(output){receiveInstance(output["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;__ATINIT__.push({func:function(){___wasm_call_ctors()}});function demangle(func){return func}function demangleAll(text){var regex=/\b_Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error}catch(e){err=e}if(!err.stack){return"(no stack trace available)"}}return err.stack.toString()}function stackTrace(){var js=jsStackTrace();if(Module["extraStackTrace"])js+="\n"+Module["extraStackTrace"]();return demangleAll(js)}function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___cxa_allocate_exception(size){return _malloc(size)}function _atexit(func,arg){__ATEXIT__.unshift({func:func,arg:arg})}function ___cxa_atexit(){return _atexit.apply(null,arguments)}function ___cxa_thread_atexit(){return _atexit.apply(null,arguments)}var ___exception_infos={};var ___exception_last=0;function ___cxa_throw(ptr,type,destructor){___exception_infos[ptr]={ptr:ptr,adjusted:[ptr],type:type,destructor:destructor,refcount:0,caught:false,rethrown:false};___exception_last=ptr;if(!("uncaught_exception"in __ZSt18uncaught_exceptionv)){__ZSt18uncaught_exceptionv.uncaught_exceptions=1}else{__ZSt18uncaught_exceptionv.uncaught_exceptions++}throw ptr}function ___lock(){}function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;return value}function ___map_file(pathname,size){___setErrNo(63);return-1}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};var MEMFS={ops_table:null,mount:function(mount){return MEMFS.createNode(null,"/",16384|511,0)},createNode:function(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(63)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}}}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node}return node},getFileDataAsRegularArray:function(node){if(node.contents&&node.contents.subarray){var arr=[];for(var i=0;i=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);return},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0;return}if(!node.contents||node.contents.subarray){var oldContents=node.contents;node.contents=new Uint8Array(new ArrayBuffer(newSize));if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize;return}if(!node.contents)node.contents=[];if(node.contents.length>newSize)node.contents.length=newSize;else while(node.contents.length=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){if(!FS.FSNode){FS.FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};FS.FSNode.prototype={};var readMode=292|73;var writeMode=146;Object.defineProperties(FS.FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}})}var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"rs":1052672,"r+":2,"w":577,"wx":705,"xw":705,"w+":578,"wx+":706,"xw+":706,"a":1089,"ax":1217,"xa":1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.indexOf("r")!==-1&&!(node.mode&292)){return 2}else if(perms.indexOf("w")!==-1&&!(node.mode&146)){return 2}else if(perms.indexOf("x")!==-1&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}})}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.indexOf(current.mount)!==-1){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(29)}return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(29)}var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=new Uint8Array(HEAPU8.subarray(addr,addr+len));FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:0,get:function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(){var ret=UTF8ToString(SYSCALLS.get());return ret},getStreamFromFD:function(fd){if(fd===undefined)fd=SYSCALLS.get();var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(){var low=SYSCALLS.get(),high=SYSCALLS.get();return low},getZero:function(){SYSCALLS.get()}};function ___syscall10(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr();FS.unlink(path);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall122(which,varargs){SYSCALLS.varargs=varargs;try{var buf=SYSCALLS.get();if(!buf)return-21;var layout={"__size__":390,"sysname":0,"nodename":65,"release":130,"version":195,"machine":260,"domainname":325};var copyString=function(element,value){var offset=layout[element];writeAsciiToMemory(value,buf+offset)};copyString("sysname","Emscripten");copyString("nodename","emscripten");copyString("release","1.0");copyString("version","#1");copyString("machine","x86-JS");return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall15(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),mode=SYSCALLS.get();FS.chmod(path,mode);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall168(which,varargs){SYSCALLS.varargs=varargs;try{var fds=SYSCALLS.get(),nfds=SYSCALLS.get(),timeout=SYSCALLS.get();var nonzero=0;for(var i=0;i>2];var events=HEAP16[pollfd+4>>1];var mask=32;var stream=FS.getStream(fd);if(stream){mask=SYSCALLS.DEFAULT_POLLMASK;if(stream.stream_ops.poll){mask=stream.stream_ops.poll(stream)}}mask&=events|8|16;if(mask)nonzero++;HEAP16[pollfd+6>>1]=mask}return nonzero}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall183(which,varargs){SYSCALLS.varargs=varargs;try{var buf=SYSCALLS.get(),size=SYSCALLS.get();if(size===0)return-28;var cwd=FS.cwd();var cwdLengthInBytes=lengthBytesUTF8(cwd);if(size=67){while((ptr&3)!=0){HEAP8[ptr>>0]=value;ptr=ptr+1|0}aligned_end=end&-4|0;value4=value|value<<8|value<<16|value<<24;block_aligned_end=aligned_end-64|0;while((ptr|0)<=(block_aligned_end|0)){HEAP32[ptr>>2]=value4;HEAP32[ptr+4>>2]=value4;HEAP32[ptr+8>>2]=value4;HEAP32[ptr+12>>2]=value4;HEAP32[ptr+16>>2]=value4;HEAP32[ptr+20>>2]=value4;HEAP32[ptr+24>>2]=value4;HEAP32[ptr+28>>2]=value4;HEAP32[ptr+32>>2]=value4;HEAP32[ptr+36>>2]=value4;HEAP32[ptr+40>>2]=value4;HEAP32[ptr+44>>2]=value4;HEAP32[ptr+48>>2]=value4;HEAP32[ptr+52>>2]=value4;HEAP32[ptr+56>>2]=value4;HEAP32[ptr+60>>2]=value4;ptr=ptr+64|0}while((ptr|0)<(aligned_end|0)){HEAP32[ptr>>2]=value4;ptr=ptr+4|0}}while((ptr|0)<(end|0)){HEAP8[ptr>>0]=value;ptr=ptr+1|0}return end-num|0}function __emscripten_syscall_mmap2(addr,len,prot,flags,fd,off){off<<=12;var ptr;var allocated=false;if((flags&16)!==0&&addr%16384!==0){return-28}if((flags&32)!==0){ptr=_memalign(16384,len);if(!ptr)return-48;_memset(ptr,0,len);allocated=true}else{var info=FS.getStream(fd);if(!info)return-8;var res=FS.mmap(info,HEAPU8,addr,len,off,prot,flags);ptr=res.ptr;allocated=res.allocated}SYSCALLS.mappings[ptr]={malloc:ptr,len:len,allocated:allocated,fd:fd,flags:flags,offset:off};return ptr}function ___syscall192(which,varargs){SYSCALLS.varargs=varargs;try{var addr=SYSCALLS.get(),len=SYSCALLS.get(),prot=SYSCALLS.get(),flags=SYSCALLS.get(),fd=SYSCALLS.get(),off=SYSCALLS.get();return __emscripten_syscall_mmap2(addr,len,prot,flags,fd,off)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall193(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),zero=SYSCALLS.getZero(),length=SYSCALLS.get64();FS.truncate(path,length);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall194(which,varargs){SYSCALLS.varargs=varargs;try{var fd=SYSCALLS.get(),zero=SYSCALLS.getZero(),length=SYSCALLS.get64();FS.ftruncate(fd,length);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall195(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),buf=SYSCALLS.get();return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall196(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),buf=SYSCALLS.get();return SYSCALLS.doStat(FS.lstat,path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall197(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get();return SYSCALLS.doStat(FS.stat,stream.path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall202(which,varargs){SYSCALLS.varargs=varargs;try{return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall199(a0,a1){return ___syscall202(a0,a1)}var PROCINFO={ppid:1,pid:42,sid:42,pgid:42};function ___syscall20(which,varargs){SYSCALLS.varargs=varargs;try{return PROCINFO.pid}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall201(a0,a1){return ___syscall202(a0,a1)}function ___syscall220(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),dirp=SYSCALLS.get(),count=SYSCALLS.get();if(!stream.getdents){stream.getdents=FS.readdir(stream.path)}var struct_size=280;var pos=0;var off=FS.llseek(stream,0,1);var idx=Math.floor(off/struct_size);while(idx>>0,(tempDouble=id,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos>>2]=tempI64[0],HEAP32[dirp+pos+4>>2]=tempI64[1];tempI64=[(idx+1)*struct_size>>>0,(tempDouble=(idx+1)*struct_size,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos+8>>2]=tempI64[0],HEAP32[dirp+pos+12>>2]=tempI64[1];HEAP16[dirp+pos+16>>1]=280;HEAP8[dirp+pos+18>>0]=type;stringToUTF8(name,dirp+pos+19,256);pos+=struct_size;idx+=1}FS.llseek(stream,idx*struct_size,0);return pos}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),cmd=SYSCALLS.get();switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 13:case 14:return 0;case 16:case 8:return-28;case 9:___setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall3(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get(),count=SYSCALLS.get();return FS.read(stream,HEAP8,buf,count)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall320(which,varargs){SYSCALLS.varargs=varargs;try{var dirfd=SYSCALLS.get(),path=SYSCALLS.getStr(),times=SYSCALLS.get(),flags=SYSCALLS.get();path=SYSCALLS.calculateAt(dirfd,path);var seconds=HEAP32[times>>2];var nanoseconds=HEAP32[times+4>>2];var atime=seconds*1e3+nanoseconds/(1e3*1e3);times+=8;seconds=HEAP32[times>>2];nanoseconds=HEAP32[times+4>>2];var mtime=seconds*1e3+nanoseconds/(1e3*1e3);FS.utime(path,atime,mtime);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall33(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),amode=SYSCALLS.get();return SYSCALLS.doAccess(path,amode)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall38(which,varargs){SYSCALLS.varargs=varargs;try{var old_path=SYSCALLS.getStr(),new_path=SYSCALLS.getStr();FS.rename(old_path,new_path);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall39(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),mode=SYSCALLS.get();return SYSCALLS.doMkdir(path,mode)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall4(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get(),count=SYSCALLS.get();return FS.write(stream,HEAP8,buf,count)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall40(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr();FS.rmdir(path);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall5(which,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(),flags=SYSCALLS.get(),mode=SYSCALLS.get();var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall83(which,varargs){SYSCALLS.varargs=varargs;try{var target=SYSCALLS.getStr(),linkpath=SYSCALLS.getStr();FS.symlink(target,linkpath);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall85(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),buf=SYSCALLS.get(),bufsize=SYSCALLS.get();return SYSCALLS.doReadlink(path,buf,bufsize)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall9(which,varargs){SYSCALLS.varargs=varargs;try{var oldpath=SYSCALLS.get(),newpath=SYSCALLS.get();return-34}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_syscall_munmap(addr,len){if(addr===-1||len===0){return-28}var info=SYSCALLS.mappings[addr];if(!info)return 0;if(len===info.len){var stream=FS.getStream(info.fd);SYSCALLS.doMsync(addr,stream,len,info.flags,info.offset);FS.munmap(stream);SYSCALLS.mappings[addr]=null;if(info.allocated){_free(info.malloc)}}return 0}function ___syscall91(which,varargs){SYSCALLS.varargs=varargs;try{var addr=SYSCALLS.get(),len=SYSCALLS.get();return __emscripten_syscall_munmap(addr,len)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall94(which,varargs){SYSCALLS.varargs=varargs;try{var fd=SYSCALLS.get(),mode=SYSCALLS.get();FS.fchmod(fd,mode);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___unlock(){}function getShiftFromSize(size){switch(size){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+size)}}function embind_init_charCodes(){var codes=new Array(256);for(var i=0;i<256;++i){codes[i]=String.fromCharCode(i)}embind_charCodes=codes}var embind_charCodes=undefined;function readLatin1String(ptr){var ret="";var c=ptr;while(HEAPU8[c]){ret+=embind_charCodes[HEAPU8[c++]]}return ret}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return"_"+name}else{return name}}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}};return errorClass}var BindingError=undefined;function throwBindingError(message){throw new BindingError(message)}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i>shift])},destructorFunction:null})}var emval_free_list=[];var emval_handle_array=[{},{value:undefined},{value:null},{value:true},{value:false}];function __emval_decref(handle){if(handle>4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i>2])}function __embind_register_emval(rawType,name){name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(handle){var rv=emval_handle_array[handle].value;__emval_decref(handle);return rv},"toWireType":function(destructors,value){return __emval_register(value)},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:null})}function _embind_repr(v){if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}}function floatReadValueFromPointer(name,shift){switch(shift){case 2:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function new_(constructor,argumentList){if(!(constructor instanceof Function)){throw new TypeError("new_ called with constructor type "+typeof constructor+" which is not a function")}var dummy=createNamedFunction(constructor.name||"unknownFunctionName",function(){});dummy.prototype=constructor.prototype;var obj=new dummy;var r=constructor.apply(obj,argumentList);return r instanceof Object?r:obj}function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}}function craftInvokerFunction(humanName,argTypes,classType,cppInvokerFunc,cppTargetFunc){var argCount=argTypes.length;if(argCount<2){throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!")}var isClassMethodFunc=argTypes[1]!==null&&classType!==null;var needsDestructorStack=false;for(var i=1;i0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i>2)+i])}return array}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}function embind__requireFunction(signature,rawFunction){signature=readLatin1String(signature);function makeDynCaller(dynCall){var args=[];for(var i=1;i>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=function(value){return value};if(minRange===0){var bitshift=32-8*size;fromWireType=function(value){return value<>>bitshift}}var isUnsignedType=name.indexOf("unsigned")!=-1;registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}if(valuemaxRange){throw new TypeError('Passing a number "'+_embind_repr(value)+'" from JS side to C/C++ side to an argument of type "'+name+'", which is outside the valid range ['+minRange+", "+maxRange+"]!")}return isUnsignedType?value>>>0:value|0},"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(heap["buffer"],data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var str;if(stdStringIsUTF8){var endChar=HEAPU8[value+4+length];var endCharSwap=0;if(endChar!=0){endCharSwap=endChar;HEAPU8[value+4+length]=0}var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i;if(HEAPU8[currentBytePtr]==0){var stringSegment=UTF8ToString(decodeStartPtr);if(str===undefined)str=stringSegment;else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}if(endCharSwap!=0)HEAPU8[value+4+length]=endCharSwap}else{var a=new Array(length);for(var i=0;i>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr+4,length+1)}else{if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+4+i]=charCode}}else{for(var i=0;i>2];var a=new Array(length);var start=value+4>>shift;for(var i=0;i>2]=length;var start=ptr+4>>shift;for(var i=0;i>2]=rd;return returnType["toWireType"](destructors,handle)}function __emval_lookupTypes(argCount,argTypes,argWireTypes){var a=new Array(argCount);for(var i=0;i>2)+i],"parameter "+i)}return a}function __emval_call(handle,argCount,argTypes,argv){handle=requireHandle(handle);var types=__emval_lookupTypes(argCount,argTypes);var args=new Array(argCount);for(var i=0;i>2]=__emval_register(destructors);return destructors}var emval_symbols={};function getStringOrSymbol(address){var symbol=emval_symbols[address];if(symbol===undefined){return readLatin1String(address)}else{return symbol}}var emval_methodCallers=[];function __emval_call_method(caller,handle,methodName,destructorsRef,args){caller=emval_methodCallers[caller];handle=requireHandle(handle);methodName=getStringOrSymbol(methodName);return caller(handle,methodName,__emval_allocateDestructors(destructorsRef),args)}function __emval_call_void_method(caller,handle,methodName,args){caller=emval_methodCallers[caller];handle=requireHandle(handle);methodName=getStringOrSymbol(methodName);caller(handle,methodName,null,args)}function __emval_equals(first,second){first=requireHandle(first);second=requireHandle(second);return first==second}function emval_get_global(){if(typeof globalThis==="object"){return globalThis}return function(){return Function}()("return this")()}function __emval_get_global(name){if(name===0){return __emval_register(emval_get_global())}else{name=getStringOrSymbol(name);return __emval_register(emval_get_global()[name])}}function __emval_addMethodCaller(caller){var id=emval_methodCallers.length;emval_methodCallers.push(caller);return id}function __emval_get_method_caller(argCount,argTypes){var types=__emval_lookupTypes(argCount,argTypes);var retType=types[0];var signatureName=retType.name+"_$"+types.slice(1).map(function(t){return t.name}).join("_")+"$";var params=["retType"];var args=[retType];var argsList="";for(var i=0;i4){emval_handle_array[handle].refcount+=1}}function __emval_is_string(handle){handle=requireHandle(handle);return typeof handle==="string"}function craftEmvalAllocator(argCount){var argsList="";for(var i=0;i> 2) + "+i+'], "parameter '+i+'");\n'+"var arg"+i+" = argType"+i+".readValueFromPointer(args);\n"+"args += argType"+i+"['argPackAdvance'];\n"}functionBody+="var obj = new constructor("+argsList+");\n"+"return __emval_register(obj);\n"+"}\n";return new Function("requireRegisteredType","Module","__emval_register",functionBody)(requireRegisteredType,Module,__emval_register)}var emval_newers={};function __emval_new(handle,argCount,argTypes,args){handle=requireHandle(handle);var newer=emval_newers[argCount];if(!newer){newer=craftEmvalAllocator(argCount);emval_newers[argCount]=newer}return newer(handle,argTypes,args)}function __emval_new_cstring(v){return __emval_register(getStringOrSymbol(v))}function __emval_new_object(){return __emval_register({})}function __emval_run_destructors(handle){var destructors=emval_handle_array[handle].value;runDestructors(destructors);__emval_decref(handle)}function __emval_set_property(handle,key,value){handle=requireHandle(handle);key=requireHandle(key);value=requireHandle(value);handle[key]=value}function __emval_take_value(type,argv){type=requireRegisteredType(type,"_emval_take_value");var v=type["readValueFromPointer"](argv);return __emval_register(v)}function _abort(){abort()}function _emscripten_get_now(){abort()}var _emscripten_get_now_is_monotonic=0||ENVIRONMENT_IS_NODE||typeof dateNow!=="undefined"||1;function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if(clk_id===1&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{___setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}function _dlopen(){abort("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function _dlclose(){return _dlopen.apply(null,arguments)}function _dlerror(){return _dlopen.apply(null,arguments)}function _dlsym(){return _dlopen.apply(null,arguments)}function _emscripten_set_main_loop_timing(mode,value){Browser.mainLoop.timingMode=mode;Browser.mainLoop.timingValue=value;if(!Browser.mainLoop.func){return 1}if(mode==0){Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_setTimeout(){var timeUntilNextTick=Math.max(0,Browser.mainLoop.tickStartTime+value-_emscripten_get_now())|0;setTimeout(Browser.mainLoop.runner,timeUntilNextTick)};Browser.mainLoop.method="timeout"}else if(mode==1){Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_rAF(){Browser.requestAnimationFrame(Browser.mainLoop.runner)};Browser.mainLoop.method="rAF"}else if(mode==2){if(typeof setImmediate==="undefined"){var setImmediates=[];var emscriptenMainLoopMessageId="setimmediate";var Browser_setImmediate_messageHandler=function(event){if(event.data===emscriptenMainLoopMessageId||event.data.target===emscriptenMainLoopMessageId){event.stopPropagation();setImmediates.shift()()}};addEventListener("message",Browser_setImmediate_messageHandler,true);setImmediate=function Browser_emulated_setImmediate(func){setImmediates.push(func);if(ENVIRONMENT_IS_WORKER){if(Module["setImmediates"]===undefined)Module["setImmediates"]=[];Module["setImmediates"].push(func);postMessage({target:emscriptenMainLoopMessageId})}else postMessage(emscriptenMainLoopMessageId,"*")}}Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_setImmediate(){setImmediate(Browser.mainLoop.runner)};Browser.mainLoop.method="immediate"}return 0}function _emscripten_set_main_loop(func,fps,simulateInfiniteLoop,arg,noSetTiming){noExitRuntime=true;assert(!Browser.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters.");Browser.mainLoop.func=func;Browser.mainLoop.arg=arg;var browserIterationFunc;if(typeof arg!=="undefined"){browserIterationFunc=function(){Module["dynCall_vi"](func,arg)}}else{browserIterationFunc=function(){Module["dynCall_v"](func)}}var thisMainLoopId=Browser.mainLoop.currentlyRunningMainloop;Browser.mainLoop.runner=function Browser_mainLoop_runner(){if(ABORT)return;if(Browser.mainLoop.queue.length>0){var start=Date.now();var blocker=Browser.mainLoop.queue.shift();blocker.func(blocker.arg);if(Browser.mainLoop.remainingBlockers){var remaining=Browser.mainLoop.remainingBlockers;var next=remaining%1==0?remaining-1:Math.floor(remaining);if(blocker.counted){Browser.mainLoop.remainingBlockers=next}else{next=next+.5;Browser.mainLoop.remainingBlockers=(8*remaining+next)/9}}console.log('main loop blocker "'+blocker.name+'" took '+(Date.now()-start)+" ms");Browser.mainLoop.updateStatus();if(thisMainLoopId1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0){Browser.mainLoop.scheduler();return}else if(Browser.mainLoop.timingMode==0){Browser.mainLoop.tickStartTime=_emscripten_get_now()}GL.newRenderingFrameStarted();Browser.mainLoop.runIter(browserIterationFunc);if(thisMainLoopId0)_emscripten_set_main_loop_timing(0,1e3/fps);else _emscripten_set_main_loop_timing(1,1);Browser.mainLoop.scheduler()}if(simulateInfiniteLoop){throw"unwind"}}var Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null;Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var timingMode=Browser.mainLoop.timingMode;var timingValue=Browser.mainLoop.timingValue;var func=Browser.mainLoop.func;Browser.mainLoop.func=null;_emscripten_set_main_loop(func,0,false,Browser.mainLoop.arg,true);_emscripten_set_main_loop_timing(timingMode,timingValue);Browser.mainLoop.scheduler()},updateStatus:function(){if(Module["setStatus"]){var message=Module["statusMessage"]||"Please wait...";var remaining=Browser.mainLoop.remainingBlockers;var expected=Browser.mainLoop.expectedBlockers;if(remaining){if(remaining=6){var curr=leftchar>>leftbits-6&63;leftbits-=6;ret+=BASE[curr]}}if(leftbits==2){ret+=BASE[(leftchar&3)<<4];ret+=PAD+PAD}else if(leftbits==4){ret+=BASE[(leftchar&15)<<2];ret+=PAD}return ret}audio.src="data:audio/x-"+name.substr(-3)+";base64,"+encode64(byteArray);finish(audio)};audio.src=url;Browser.safeSetTimeout(function(){finish(audio)},1e4)}else{return fail()}};Module["preloadPlugins"].push(audioPlugin);function pointerLockChange(){Browser.pointerLock=document["pointerLockElement"]===Module["canvas"]||document["mozPointerLockElement"]===Module["canvas"]||document["webkitPointerLockElement"]===Module["canvas"]||document["msPointerLockElement"]===Module["canvas"]}var canvas=Module["canvas"];if(canvas){canvas.requestPointerLock=canvas["requestPointerLock"]||canvas["mozRequestPointerLock"]||canvas["webkitRequestPointerLock"]||canvas["msRequestPointerLock"]||function(){};canvas.exitPointerLock=document["exitPointerLock"]||document["mozExitPointerLock"]||document["webkitExitPointerLock"]||document["msExitPointerLock"]||function(){};canvas.exitPointerLock=canvas.exitPointerLock.bind(document);document.addEventListener("pointerlockchange",pointerLockChange,false);document.addEventListener("mozpointerlockchange",pointerLockChange,false);document.addEventListener("webkitpointerlockchange",pointerLockChange,false);document.addEventListener("mspointerlockchange",pointerLockChange,false);if(Module["elementPointerLock"]){canvas.addEventListener("click",function(ev){if(!Browser.pointerLock&&Module["canvas"].requestPointerLock){Module["canvas"].requestPointerLock();ev.preventDefault()}},false)}}},createContext:function(canvas,useWebGL,setInModule,webGLContextAttributes){if(useWebGL&&Module.ctx&&canvas==Module.canvas)return Module.ctx;var ctx;var contextHandle;if(useWebGL){var contextAttributes={antialias:false,alpha:false,majorVersion:typeof WebGL2RenderingContext!=="undefined"?2:1};if(webGLContextAttributes){for(var attribute in webGLContextAttributes){contextAttributes[attribute]=webGLContextAttributes[attribute]}}if(typeof GL!=="undefined"){contextHandle=GL.createContext(canvas,contextAttributes);if(contextHandle){ctx=GL.getContext(contextHandle).GLctx}}}else{ctx=canvas.getContext("2d")}if(!ctx)return null;if(setInModule){if(!useWebGL)assert(typeof GLctx==="undefined","cannot set in module if GLctx is used, but we are a non-GL context that would replace it");Module.ctx=ctx;if(useWebGL)GL.makeContextCurrent(contextHandle);Module.useWebGL=useWebGL;Browser.moduleContextCreatedCallbacks.forEach(function(callback){callback()});Browser.init()}return ctx},destroyContext:function(canvas,useWebGL,setInModule){},fullscreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullscreen:function(lockPointer,resizeCanvas,vrDevice){Browser.lockPointer=lockPointer;Browser.resizeCanvas=resizeCanvas;Browser.vrDevice=vrDevice;if(typeof Browser.lockPointer==="undefined")Browser.lockPointer=true;if(typeof Browser.resizeCanvas==="undefined")Browser.resizeCanvas=false;if(typeof Browser.vrDevice==="undefined")Browser.vrDevice=null;var canvas=Module["canvas"];function fullscreenChange(){Browser.isFullscreen=false;var canvasContainer=canvas.parentNode;if((document["fullscreenElement"]||document["mozFullScreenElement"]||document["msFullscreenElement"]||document["webkitFullscreenElement"]||document["webkitCurrentFullScreenElement"])===canvasContainer){canvas.exitFullscreen=Browser.exitFullscreen;if(Browser.lockPointer)canvas.requestPointerLock();Browser.isFullscreen=true;if(Browser.resizeCanvas){Browser.setFullscreenCanvasSize()}else{Browser.updateCanvasDimensions(canvas)}}else{canvasContainer.parentNode.insertBefore(canvas,canvasContainer);canvasContainer.parentNode.removeChild(canvasContainer);if(Browser.resizeCanvas){Browser.setWindowedCanvasSize()}else{Browser.updateCanvasDimensions(canvas)}}if(Module["onFullScreen"])Module["onFullScreen"](Browser.isFullscreen);if(Module["onFullscreen"])Module["onFullscreen"](Browser.isFullscreen)}if(!Browser.fullscreenHandlersInstalled){Browser.fullscreenHandlersInstalled=true;document.addEventListener("fullscreenchange",fullscreenChange,false);document.addEventListener("mozfullscreenchange",fullscreenChange,false);document.addEventListener("webkitfullscreenchange",fullscreenChange,false);document.addEventListener("MSFullscreenChange",fullscreenChange,false)}var canvasContainer=document.createElement("div");canvas.parentNode.insertBefore(canvasContainer,canvas);canvasContainer.appendChild(canvas);canvasContainer.requestFullscreen=canvasContainer["requestFullscreen"]||canvasContainer["mozRequestFullScreen"]||canvasContainer["msRequestFullscreen"]||(canvasContainer["webkitRequestFullscreen"]?function(){canvasContainer["webkitRequestFullscreen"](Element["ALLOW_KEYBOARD_INPUT"])}:null)||(canvasContainer["webkitRequestFullScreen"]?function(){canvasContainer["webkitRequestFullScreen"](Element["ALLOW_KEYBOARD_INPUT"])}:null);if(vrDevice){canvasContainer.requestFullscreen({vrDisplay:vrDevice})}else{canvasContainer.requestFullscreen()}},exitFullscreen:function(){if(!Browser.isFullscreen){return false}var CFS=document["exitFullscreen"]||document["cancelFullScreen"]||document["mozCancelFullScreen"]||document["msExitFullscreen"]||document["webkitCancelFullScreen"]||function(){};CFS.apply(document,[]);return true},nextRAF:0,fakeRequestAnimationFrame:function(func){var now=Date.now();if(Browser.nextRAF===0){Browser.nextRAF=now+1e3/60}else{while(now+2>=Browser.nextRAF){Browser.nextRAF+=1e3/60}}var delay=Math.max(Browser.nextRAF-now,0);setTimeout(func,delay)},requestAnimationFrame:function(func){if(typeof requestAnimationFrame==="function"){requestAnimationFrame(func);return}var RAF=Browser.fakeRequestAnimationFrame;RAF(func)},safeCallback:function(func){return function(){if(!ABORT)return func.apply(null,arguments)}},allowAsyncCallbacks:true,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=false},resumeAsyncCallbacks:function(){Browser.allowAsyncCallbacks=true;if(Browser.queuedAsyncCallbacks.length>0){var callbacks=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[];callbacks.forEach(function(func){func()})}},safeRequestAnimationFrame:function(func){return Browser.requestAnimationFrame(function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}else{Browser.queuedAsyncCallbacks.push(func)}})},safeSetTimeout:function(func,timeout){noExitRuntime=true;return setTimeout(function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}else{Browser.queuedAsyncCallbacks.push(func)}},timeout)},safeSetInterval:function(func,timeout){noExitRuntime=true;return setInterval(function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}},timeout)},getMimetype:function(name){return{"jpg":"image/jpeg","jpeg":"image/jpeg","png":"image/png","bmp":"image/bmp","ogg":"audio/ogg","wav":"audio/wav","mp3":"audio/mpeg"}[name.substr(name.lastIndexOf(".")+1)]},getUserMedia:function(func){if(!window.getUserMedia){window.getUserMedia=navigator["getUserMedia"]||navigator["mozGetUserMedia"]}window.getUserMedia(func)},getMovementX:function(event){return event["movementX"]||event["mozMovementX"]||event["webkitMovementX"]||0},getMovementY:function(event){return event["movementY"]||event["mozMovementY"]||event["webkitMovementY"]||0},getMouseWheelDelta:function(event){var delta=0;switch(event.type){case"DOMMouseScroll":delta=event.detail/3;break;case"mousewheel":delta=event.wheelDelta/120;break;case"wheel":delta=event.deltaY;switch(event.deltaMode){case 0:delta/=100;break;case 1:delta/=3;break;case 2:delta*=80;break;default:throw"unrecognized mouse wheel delta mode: "+event.deltaMode}break;default:throw"unrecognized mouse wheel event: "+event.type}return delta},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(event){if(Browser.pointerLock){if(event.type!="mousemove"&&"mozMovementX"in event){Browser.mouseMovementX=Browser.mouseMovementY=0}else{Browser.mouseMovementX=Browser.getMovementX(event);Browser.mouseMovementY=Browser.getMovementY(event)}if(typeof SDL!="undefined"){Browser.mouseX=SDL.mouseX+Browser.mouseMovementX;Browser.mouseY=SDL.mouseY+Browser.mouseMovementY}else{Browser.mouseX+=Browser.mouseMovementX;Browser.mouseY+=Browser.mouseMovementY}}else{var rect=Module["canvas"].getBoundingClientRect();var cw=Module["canvas"].width;var ch=Module["canvas"].height;var scrollX=typeof window.scrollX!=="undefined"?window.scrollX:window.pageXOffset;var scrollY=typeof window.scrollY!=="undefined"?window.scrollY:window.pageYOffset;if(event.type==="touchstart"||event.type==="touchend"||event.type==="touchmove"){var touch=event.touch;if(touch===undefined){return}var adjustedX=touch.pageX-(scrollX+rect.left);var adjustedY=touch.pageY-(scrollY+rect.top);adjustedX=adjustedX*(cw/rect.width);adjustedY=adjustedY*(ch/rect.height);var coords={x:adjustedX,y:adjustedY};if(event.type==="touchstart"){Browser.lastTouches[touch.identifier]=coords;Browser.touches[touch.identifier]=coords}else if(event.type==="touchend"||event.type==="touchmove"){var last=Browser.touches[touch.identifier];if(!last)last=coords;Browser.lastTouches[touch.identifier]=last;Browser.touches[touch.identifier]=coords}return}var x=event.pageX-(scrollX+rect.left);var y=event.pageY-(scrollY+rect.top);x=x*(cw/rect.width);y=y*(ch/rect.height);Browser.mouseMovementX=x-Browser.mouseX;Browser.mouseMovementY=y-Browser.mouseY;Browser.mouseX=x;Browser.mouseY=y}},asyncLoad:function(url,onload,onerror,noRunDep){var dep=!noRunDep?getUniqueRunDependency("al "+url):"";readAsync(url,function(arrayBuffer){assert(arrayBuffer,'Loading data file "'+url+'" failed (no arrayBuffer).');onload(new Uint8Array(arrayBuffer));if(dep)removeRunDependency(dep)},function(event){if(onerror){onerror()}else{throw'Loading data file "'+url+'" failed.'}});if(dep)addRunDependency(dep)},resizeListeners:[],updateResizeListeners:function(){var canvas=Module["canvas"];Browser.resizeListeners.forEach(function(listener){listener(canvas.width,canvas.height)})},setCanvasSize:function(width,height,noUpdates){var canvas=Module["canvas"];Browser.updateCanvasDimensions(canvas,width,height);if(!noUpdates)Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen>>2];flags=flags|8388608;HEAP32[SDL.screen>>2]=flags}Browser.updateCanvasDimensions(Module["canvas"]);Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen>>2];flags=flags&~8388608;HEAP32[SDL.screen>>2]=flags}Browser.updateCanvasDimensions(Module["canvas"]);Browser.updateResizeListeners()},updateCanvasDimensions:function(canvas,wNative,hNative){if(wNative&&hNative){canvas.widthNative=wNative;canvas.heightNative=hNative}else{wNative=canvas.widthNative;hNative=canvas.heightNative}var w=wNative;var h=hNative;if(Module["forcedAspectRatio"]&&Module["forcedAspectRatio"]>0){if(w/h>2];if(param==12321){var alphaSize=HEAP32[attribList+4>>2];EGL.contextAttributes.alpha=alphaSize>0}else if(param==12325){var depthSize=HEAP32[attribList+4>>2];EGL.contextAttributes.depth=depthSize>0}else if(param==12326){var stencilSize=HEAP32[attribList+4>>2];EGL.contextAttributes.stencil=stencilSize>0}else if(param==12337){var samples=HEAP32[attribList+4>>2];EGL.contextAttributes.antialias=samples>0}else if(param==12338){var samples=HEAP32[attribList+4>>2];EGL.contextAttributes.antialias=samples==1}else if(param==12544){var requestedPriority=HEAP32[attribList+4>>2];EGL.contextAttributes.lowLatency=requestedPriority!=12547}else if(param==12344){break}attribList+=8}}if((!config||!config_size)&&!numConfigs){EGL.setErrorCode(12300);return 0}if(numConfigs){HEAP32[numConfigs>>2]=1}if(config&&config_size>0){HEAP32[config>>2]=62002}EGL.setErrorCode(12288);return 1}};function _eglGetProcAddress(name_){return _emscripten_GetProcAddress(name_)}function _emscripten_async_call(func,arg,millis){noExitRuntime=true;function wrapper(){getFuncWrapper(func,"vi")(arg)}if(millis>=0){Browser.safeSetTimeout(wrapper,millis)}else{Browser.safeRequestAnimationFrame(wrapper)}}function _emscripten_date_now(){return Date.now()}function _emscripten_force_exit(status){noExitRuntime=false;exit(status)}var JSEvents={keyEvent:0,mouseEvent:0,wheelEvent:0,uiEvent:0,focusEvent:0,deviceOrientationEvent:0,deviceMotionEvent:0,fullscreenChangeEvent:0,pointerlockChangeEvent:0,visibilityChangeEvent:0,touchEvent:0,previousFullscreenElement:null,previousScreenX:null,previousScreenY:null,removeEventListenersRegistered:false,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>3]=rect.width;HEAPF64[height>>3]=rect.height;return 0}function _emscripten_get_heap_size(){return HEAP8.length}function _emscripten_get_sbrk_ptr(){return 8238608}function __webgl_acquireInstancedArraysExtension(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)}}}function __webgl_acquireVertexArrayObjectExtension(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)}}}function __webgl_acquireDrawBuffersExtension(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)}}}var GL={counter:1,lastError:0,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},currentContext:null,offscreenCanvases:{},timerQueriesEXT:[],queries:[],samplers:[],transformFeedbacks:[],syncs:[],currArrayBuffer:0,currElementArrayBuffer:0,byteSizeByTypeRoot:5120,byteSizeByType:[1,1,2,2,4,4,4,2,3,4,8],programInfos:{},stringCache:{},stringiCache:{},unpackAlignment:4,init:function(){var miniTempFloatBuffer=new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);for(var i=0;i>1;var quadIndexes=new Uint16Array(numIndexes);var i=0,v=0;while(1){quadIndexes[i++]=v;if(i>=numIndexes)break;quadIndexes[i++]=v+1;if(i>=numIndexes)break;quadIndexes[i++]=v+2;if(i>=numIndexes)break;quadIndexes[i++]=v;if(i>=numIndexes)break;quadIndexes[i++]=v+2;if(i>=numIndexes)break;quadIndexes[i++]=v+3;if(i>=numIndexes)break;v+=4}context.GLctx.bufferData(34963,quadIndexes,35044);context.GLctx.bindBuffer(34963,null)}},getTempVertexBuffer:function getTempVertexBuffer(sizeBytes){var idx=GL.log2ceilLookup(sizeBytes);var ringbuffer=GL.currentContext.tempVertexBuffers1[idx];var nextFreeBufferIndex=GL.currentContext.tempVertexBufferCounters1[idx];GL.currentContext.tempVertexBufferCounters1[idx]=GL.currentContext.tempVertexBufferCounters1[idx]+1&GL.numTempVertexBuffersPerSize-1;var vbo=ringbuffer[nextFreeBufferIndex];if(vbo){return vbo}var prevVBO=GLctx.getParameter(34964);ringbuffer[nextFreeBufferIndex]=GLctx.createBuffer();GLctx.bindBuffer(34962,ringbuffer[nextFreeBufferIndex]);GLctx.bufferData(34962,1<>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},calcBufLength:function calcBufLength(size,type,stride,count){if(stride>0){return count*stride}var typeSize=GL.byteSizeByType[type-GL.byteSizeByTypeRoot];return size*typeSize*count},usedTempBuffers:[],preDrawHandleClientVertexAttribBindings:function preDrawHandleClientVertexAttribBindings(count){GL.resetBufferBinding=false;for(var i=0;i1?canvas.getContext("webgl2",webGLContextAttributes):canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}context.maxVertexAttribs=context.GLctx.getParameter(34921);context.clientBuffers=[];for(var i=0;i=2){if(data){GLctx.bufferData(target,HEAPU8,usage,data,size)}else{GLctx.bufferData(target,size,usage)}}else{GLctx.bufferData(target,data?HEAPU8.subarray(data,data+size):size,usage)}}function _emscripten_glBufferSubData(target,offset,size,data){if(GL.currentContext.version>=2){GLctx.bufferSubData(target,offset,HEAPU8,data,size);return}GLctx.bufferSubData(target,offset,HEAPU8.subarray(data,data+size))}function _emscripten_glCheckFramebufferStatus(x0){return GLctx["checkFramebufferStatus"](x0)}function _emscripten_glClear(x0){GLctx["clear"](x0)}function _emscripten_glClearBufferfi(x0,x1,x2,x3){GLctx["clearBufferfi"](x0,x1,x2,x3)}function _emscripten_glClearBufferfv(buffer,drawbuffer,value){GLctx["clearBufferfv"](buffer,drawbuffer,HEAPF32,value>>2)}function _emscripten_glClearBufferiv(buffer,drawbuffer,value){GLctx["clearBufferiv"](buffer,drawbuffer,HEAP32,value>>2)}function _emscripten_glClearBufferuiv(buffer,drawbuffer,value){GLctx["clearBufferuiv"](buffer,drawbuffer,HEAPU32,value>>2)}function _emscripten_glClearColor(x0,x1,x2,x3){GLctx["clearColor"](x0,x1,x2,x3)}function _emscripten_glClearDepthf(x0){GLctx["clearDepth"](x0)}function _emscripten_glClearStencil(x0){GLctx["clearStencil"](x0)}function _emscripten_glClientWaitSync(sync,flags,timeoutLo,timeoutHi){timeoutLo=timeoutLo>>>0;timeoutHi=timeoutHi>>>0;var timeout=timeoutLo==4294967295&&timeoutHi==4294967295?-1:makeBigInt(timeoutLo,timeoutHi,true);return GLctx.clientWaitSync(GL.syncs[sync],flags,timeout)}function _emscripten_glColorMask(red,green,blue,alpha){GLctx.colorMask(!!red,!!green,!!blue,!!alpha)}function _emscripten_glCompileShader(shader){GLctx.compileShader(GL.shaders[shader])}function _emscripten_glCompressedTexImage2D(target,level,internalFormat,width,height,border,imageSize,data){if(GL.currentContext.version>=2){if(GLctx.currentPixelUnpackBufferBinding){GLctx["compressedTexImage2D"](target,level,internalFormat,width,height,border,imageSize,data)}else{GLctx["compressedTexImage2D"](target,level,internalFormat,width,height,border,HEAPU8,data,imageSize)}return}GLctx["compressedTexImage2D"](target,level,internalFormat,width,height,border,data?HEAPU8.subarray(data,data+imageSize):null)}function _emscripten_glCompressedTexImage3D(target,level,internalFormat,width,height,depth,border,imageSize,data){if(GLctx.currentPixelUnpackBufferBinding){GLctx["compressedTexImage3D"](target,level,internalFormat,width,height,depth,border,imageSize,data)}else{GLctx["compressedTexImage3D"](target,level,internalFormat,width,height,depth,border,HEAPU8,data,imageSize)}}function _emscripten_glCompressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,imageSize,data){if(GL.currentContext.version>=2){if(GLctx.currentPixelUnpackBufferBinding){GLctx["compressedTexSubImage2D"](target,level,xoffset,yoffset,width,height,format,imageSize,data)}else{GLctx["compressedTexSubImage2D"](target,level,xoffset,yoffset,width,height,format,HEAPU8,data,imageSize)}return}GLctx["compressedTexSubImage2D"](target,level,xoffset,yoffset,width,height,format,data?HEAPU8.subarray(data,data+imageSize):null)}function _emscripten_glCompressedTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,imageSize,data){if(GLctx.currentPixelUnpackBufferBinding){GLctx["compressedTexSubImage3D"](target,level,xoffset,yoffset,zoffset,width,height,depth,format,imageSize,data)}else{GLctx["compressedTexSubImage3D"](target,level,xoffset,yoffset,zoffset,width,height,depth,format,HEAPU8,data,imageSize)}}function _emscripten_glCopyBufferSubData(x0,x1,x2,x3,x4){GLctx["copyBufferSubData"](x0,x1,x2,x3,x4)}function _emscripten_glCopyTexImage2D(x0,x1,x2,x3,x4,x5,x6,x7){GLctx["copyTexImage2D"](x0,x1,x2,x3,x4,x5,x6,x7)}function _emscripten_glCopyTexSubImage2D(x0,x1,x2,x3,x4,x5,x6,x7){GLctx["copyTexSubImage2D"](x0,x1,x2,x3,x4,x5,x6,x7)}function _emscripten_glCopyTexSubImage3D(x0,x1,x2,x3,x4,x5,x6,x7,x8){GLctx["copyTexSubImage3D"](x0,x1,x2,x3,x4,x5,x6,x7,x8)}function _emscripten_glCreateProgram(){var id=GL.getNewId(GL.programs);var program=GLctx.createProgram();program.name=id;GL.programs[id]=program;return id}function _emscripten_glCreateShader(shaderType){var id=GL.getNewId(GL.shaders);GL.shaders[id]=GLctx.createShader(shaderType);return id}function _emscripten_glCullFace(x0){GLctx["cullFace"](x0)}function _emscripten_glDeleteBuffers(n,buffers){for(var i=0;i>2];var buffer=GL.buffers[id];if(!buffer)continue;GLctx.deleteBuffer(buffer);buffer.name=0;GL.buffers[id]=null;if(id==GL.currArrayBuffer)GL.currArrayBuffer=0;if(id==GL.currElementArrayBuffer)GL.currElementArrayBuffer=0;if(id==GLctx.currentPixelPackBufferBinding)GLctx.currentPixelPackBufferBinding=0;if(id==GLctx.currentPixelUnpackBufferBinding)GLctx.currentPixelUnpackBufferBinding=0}}function _emscripten_glDeleteFramebuffers(n,framebuffers){for(var i=0;i>2];var framebuffer=GL.framebuffers[id];if(!framebuffer)continue;GLctx.deleteFramebuffer(framebuffer);framebuffer.name=0;GL.framebuffers[id]=null}}function _emscripten_glDeleteProgram(id){if(!id)return;var program=GL.programs[id];if(!program){GL.recordError(1281);return}GLctx.deleteProgram(program);program.name=0;GL.programs[id]=null;GL.programInfos[id]=null}function _emscripten_glDeleteQueries(n,ids){for(var i=0;i>2];var query=GL.queries[id];if(!query)continue;GLctx["deleteQuery"](query);GL.queries[id]=null}}function _emscripten_glDeleteQueriesEXT(n,ids){for(var i=0;i>2];var query=GL.timerQueriesEXT[id];if(!query)continue;GLctx.disjointTimerQueryExt["deleteQueryEXT"](query);GL.timerQueriesEXT[id]=null}}function _emscripten_glDeleteRenderbuffers(n,renderbuffers){for(var i=0;i>2];var renderbuffer=GL.renderbuffers[id];if(!renderbuffer)continue;GLctx.deleteRenderbuffer(renderbuffer);renderbuffer.name=0;GL.renderbuffers[id]=null}}function _emscripten_glDeleteSamplers(n,samplers){for(var i=0;i>2];var sampler=GL.samplers[id];if(!sampler)continue;GLctx["deleteSampler"](sampler);sampler.name=0;GL.samplers[id]=null}}function _emscripten_glDeleteShader(id){if(!id)return;var shader=GL.shaders[id];if(!shader){GL.recordError(1281);return}GLctx.deleteShader(shader);GL.shaders[id]=null}function _emscripten_glDeleteSync(id){if(!id)return;var sync=GL.syncs[id];if(!sync){GL.recordError(1281);return}GLctx.deleteSync(sync);sync.name=0;GL.syncs[id]=null}function _emscripten_glDeleteTextures(n,textures){for(var i=0;i>2];var texture=GL.textures[id];if(!texture)continue;GLctx.deleteTexture(texture);texture.name=0;GL.textures[id]=null}}function _emscripten_glDeleteTransformFeedbacks(n,ids){for(var i=0;i>2];var transformFeedback=GL.transformFeedbacks[id];if(!transformFeedback)continue;GLctx["deleteTransformFeedback"](transformFeedback);transformFeedback.name=0;GL.transformFeedbacks[id]=null}}function _emscripten_glDeleteVertexArrays(n,vaos){for(var i=0;i>2];GLctx["deleteVertexArray"](GL.vaos[id]);GL.vaos[id]=null}}function _emscripten_glDeleteVertexArraysOES(n,vaos){for(var i=0;i>2];GLctx["deleteVertexArray"](GL.vaos[id]);GL.vaos[id]=null}}function _emscripten_glDepthFunc(x0){GLctx["depthFunc"](x0)}function _emscripten_glDepthMask(flag){GLctx.depthMask(!!flag)}function _emscripten_glDepthRangef(x0,x1){GLctx["depthRange"](x0,x1)}function _emscripten_glDetachShader(program,shader){GLctx.detachShader(GL.programs[program],GL.shaders[shader])}function _emscripten_glDisable(x0){GLctx["disable"](x0)}function _emscripten_glDisableVertexAttribArray(index){var cb=GL.currentContext.clientBuffers[index];cb.enabled=false;GLctx.disableVertexAttribArray(index)}function _emscripten_glDrawArrays(mode,first,count){GL.preDrawHandleClientVertexAttribBindings(first+count);GLctx.drawArrays(mode,first,count);GL.postDrawHandleClientVertexAttribBindings()}function _emscripten_glDrawArraysInstanced(mode,first,count,primcount){GLctx["drawArraysInstanced"](mode,first,count,primcount)}function _emscripten_glDrawArraysInstancedANGLE(mode,first,count,primcount){GLctx["drawArraysInstanced"](mode,first,count,primcount)}function _emscripten_glDrawArraysInstancedARB(mode,first,count,primcount){GLctx["drawArraysInstanced"](mode,first,count,primcount)}function _emscripten_glDrawArraysInstancedEXT(mode,first,count,primcount){GLctx["drawArraysInstanced"](mode,first,count,primcount)}function _emscripten_glDrawArraysInstancedNV(mode,first,count,primcount){GLctx["drawArraysInstanced"](mode,first,count,primcount)}var __tempFixedLengthArray=[];function _emscripten_glDrawBuffers(n,bufs){var bufArray=__tempFixedLengthArray[n];for(var i=0;i>2]}GLctx["drawBuffers"](bufArray)}function _emscripten_glDrawBuffersEXT(n,bufs){var bufArray=__tempFixedLengthArray[n];for(var i=0;i>2]}GLctx["drawBuffers"](bufArray)}function _emscripten_glDrawBuffersWEBGL(n,bufs){var bufArray=__tempFixedLengthArray[n];for(var i=0;i>2]}GLctx["drawBuffers"](bufArray)}function _emscripten_glDrawElements(mode,count,type,indices){var buf;if(!GL.currElementArrayBuffer){var size=GL.calcBufLength(1,type,0,count);buf=GL.getTempIndexBuffer(size);GLctx.bindBuffer(34963,buf);GLctx.bufferSubData(34963,0,HEAPU8.subarray(indices,indices+size));indices=0}GL.preDrawHandleClientVertexAttribBindings(count);GLctx.drawElements(mode,count,type,indices);GL.postDrawHandleClientVertexAttribBindings(count);if(!GL.currElementArrayBuffer){GLctx.bindBuffer(34963,null)}}function _emscripten_glDrawElementsInstanced(mode,count,type,indices,primcount){GLctx["drawElementsInstanced"](mode,count,type,indices,primcount)}function _emscripten_glDrawElementsInstancedANGLE(mode,count,type,indices,primcount){GLctx["drawElementsInstanced"](mode,count,type,indices,primcount)}function _emscripten_glDrawElementsInstancedARB(mode,count,type,indices,primcount){GLctx["drawElementsInstanced"](mode,count,type,indices,primcount)}function _emscripten_glDrawElementsInstancedEXT(mode,count,type,indices,primcount){GLctx["drawElementsInstanced"](mode,count,type,indices,primcount)}function _emscripten_glDrawElementsInstancedNV(mode,count,type,indices,primcount){GLctx["drawElementsInstanced"](mode,count,type,indices,primcount)}function _glDrawElements(mode,count,type,indices){var buf;if(!GL.currElementArrayBuffer){var size=GL.calcBufLength(1,type,0,count);buf=GL.getTempIndexBuffer(size);GLctx.bindBuffer(34963,buf);GLctx.bufferSubData(34963,0,HEAPU8.subarray(indices,indices+size));indices=0}GL.preDrawHandleClientVertexAttribBindings(count);GLctx.drawElements(mode,count,type,indices);GL.postDrawHandleClientVertexAttribBindings(count);if(!GL.currElementArrayBuffer){GLctx.bindBuffer(34963,null)}}function _emscripten_glDrawRangeElements(mode,start,end,count,type,indices){_glDrawElements(mode,count,type,indices)}function _emscripten_glEnable(x0){GLctx["enable"](x0)}function _emscripten_glEnableVertexAttribArray(index){var cb=GL.currentContext.clientBuffers[index];cb.enabled=true;GLctx.enableVertexAttribArray(index)}function _emscripten_glEndQuery(x0){GLctx["endQuery"](x0)}function _emscripten_glEndQueryEXT(target){GLctx.disjointTimerQueryExt["endQueryEXT"](target)}function _emscripten_glEndTransformFeedback(){GLctx["endTransformFeedback"]()}function _emscripten_glFenceSync(condition,flags){var sync=GLctx.fenceSync(condition,flags);if(sync){var id=GL.getNewId(GL.syncs);sync.name=id;GL.syncs[id]=sync;return id}else{return 0}}function _emscripten_glFinish(){GLctx["finish"]()}function _emscripten_glFlush(){GLctx["flush"]()}function emscriptenWebGLGetBufferBinding(target){switch(target){case 34962:target=34964;break;case 34963:target=34965;break;case 35051:target=35053;break;case 35052:target=35055;break;case 35982:target=35983;break;case 36662:target=36662;break;case 36663:target=36663;break;case 35345:target=35368;break}var buffer=GLctx.getParameter(target);if(buffer)return buffer.name|0;else return 0}function emscriptenWebGLValidateMapBufferTarget(target){switch(target){case 34962:case 34963:case 36662:case 36663:case 35051:case 35052:case 35882:case 35982:case 35345:return true;default:return false}}function _emscripten_glFlushMappedBufferRange(target,offset,length){if(!emscriptenWebGLValidateMapBufferTarget(target)){GL.recordError(1280);err("GL_INVALID_ENUM in glFlushMappedBufferRange");return}var mapping=GL.mappedBuffers[emscriptenWebGLGetBufferBinding(target)];if(!mapping){GL.recordError(1282);Module.printError("buffer was never mapped in glFlushMappedBufferRange");return}if(!(mapping.access&16)){GL.recordError(1282);Module.printError("buffer was not mapped with GL_MAP_FLUSH_EXPLICIT_BIT in glFlushMappedBufferRange");return}if(offset<0||length<0||offset+length>mapping.length){GL.recordError(1281);Module.printError("invalid range in glFlushMappedBufferRange");return}GLctx.bufferSubData(target,mapping.offset,HEAPU8.subarray(mapping.mem+offset,mapping.mem+offset+length))}function _emscripten_glFramebufferRenderbuffer(target,attachment,renderbuffertarget,renderbuffer){GLctx.framebufferRenderbuffer(target,attachment,renderbuffertarget,GL.renderbuffers[renderbuffer])}function _emscripten_glFramebufferTexture2D(target,attachment,textarget,texture,level){GLctx.framebufferTexture2D(target,attachment,textarget,GL.textures[texture],level)}function _emscripten_glFramebufferTextureLayer(target,attachment,texture,level,layer){GLctx.framebufferTextureLayer(target,attachment,GL.textures[texture],level,layer)}function _emscripten_glFrontFace(x0){GLctx["frontFace"](x0)}function __glGenObject(n,buffers,createFunction,objectTable){for(var i=0;i>2]=id}}function _emscripten_glGenBuffers(n,buffers){__glGenObject(n,buffers,"createBuffer",GL.buffers)}function _emscripten_glGenFramebuffers(n,ids){__glGenObject(n,ids,"createFramebuffer",GL.framebuffers)}function _emscripten_glGenQueries(n,ids){__glGenObject(n,ids,"createQuery",GL.queries)}function _emscripten_glGenQueriesEXT(n,ids){for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.timerQueriesEXT);query.name=id;GL.timerQueriesEXT[id]=query;HEAP32[ids+i*4>>2]=id}}function _emscripten_glGenRenderbuffers(n,renderbuffers){__glGenObject(n,renderbuffers,"createRenderbuffer",GL.renderbuffers)}function _emscripten_glGenSamplers(n,samplers){__glGenObject(n,samplers,"createSampler",GL.samplers)}function _emscripten_glGenTextures(n,textures){__glGenObject(n,textures,"createTexture",GL.textures)}function _emscripten_glGenTransformFeedbacks(n,ids){__glGenObject(n,ids,"createTransformFeedback",GL.transformFeedbacks)}function _emscripten_glGenVertexArrays(n,arrays){__glGenObject(n,arrays,"createVertexArray",GL.vaos)}function _emscripten_glGenVertexArraysOES(n,arrays){__glGenObject(n,arrays,"createVertexArray",GL.vaos)}function _emscripten_glGenerateMipmap(x0){GLctx["generateMipmap"](x0)}function _emscripten_glGetActiveAttrib(program,index,bufSize,length,size,type,name){program=GL.programs[program];var info=GLctx.getActiveAttrib(program,index);if(!info)return;var numBytesWrittenExclNull=bufSize>0&&name?stringToUTF8(info.name,name,bufSize):0;if(length)HEAP32[length>>2]=numBytesWrittenExclNull;if(size)HEAP32[size>>2]=info.size;if(type)HEAP32[type>>2]=info.type}function _emscripten_glGetActiveUniform(program,index,bufSize,length,size,type,name){program=GL.programs[program];var info=GLctx.getActiveUniform(program,index);if(!info)return;var numBytesWrittenExclNull=bufSize>0&&name?stringToUTF8(info.name,name,bufSize):0;if(length)HEAP32[length>>2]=numBytesWrittenExclNull;if(size)HEAP32[size>>2]=info.size;if(type)HEAP32[type>>2]=info.type}function _emscripten_glGetActiveUniformBlockName(program,uniformBlockIndex,bufSize,length,uniformBlockName){program=GL.programs[program];var result=GLctx["getActiveUniformBlockName"](program,uniformBlockIndex);if(!result)return;if(uniformBlockName&&bufSize>0){var numBytesWrittenExclNull=stringToUTF8(result,uniformBlockName,bufSize);if(length)HEAP32[length>>2]=numBytesWrittenExclNull}else{if(length)HEAP32[length>>2]=0}}function _emscripten_glGetActiveUniformBlockiv(program,uniformBlockIndex,pname,params){if(!params){GL.recordError(1281);return}program=GL.programs[program];switch(pname){case 35393:var name=GLctx["getActiveUniformBlockName"](program,uniformBlockIndex);HEAP32[params>>2]=name.length+1;return;default:var result=GLctx["getActiveUniformBlockParameter"](program,uniformBlockIndex,pname);if(!result)return;if(typeof result=="number"){HEAP32[params>>2]=result}else{for(var i=0;i>2]=result[i]}}}}function _emscripten_glGetActiveUniformsiv(program,uniformCount,uniformIndices,pname,params){if(!params){GL.recordError(1281);return}if(uniformCount>0&&uniformIndices==0){GL.recordError(1281);return}program=GL.programs[program];var ids=[];for(var i=0;i>2])}var result=GLctx["getActiveUniforms"](program,ids,pname);if(!result)return;var len=result.length;for(var i=0;i>2]=result[i]}}function _emscripten_glGetAttachedShaders(program,maxCount,count,shaders){var result=GLctx.getAttachedShaders(GL.programs[program]);var len=result.length;if(len>maxCount){len=maxCount}HEAP32[count>>2]=len;for(var i=0;i>2]=id}}function _emscripten_glGetAttribLocation(program,name){return GLctx.getAttribLocation(GL.programs[program],UTF8ToString(name))}function emscriptenWebGLGet(name_,p,type){if(!p){GL.recordError(1281);return}var ret=undefined;switch(name_){case 36346:ret=1;break;case 36344:if(type!=0&&type!=1){GL.recordError(1280)}return;case 34814:case 36345:ret=0;break;case 34466:var formats=GLctx.getParameter(34467);ret=formats?formats.length:0;break;case 33309:if(GL.currentContext.version<2){GL.recordError(1282);return}var exts=GLctx.getSupportedExtensions()||[];ret=2*exts.length;break;case 33307:case 33308:if(GL.currentContext.version<2){GL.recordError(1280);return}ret=name_==33307?3:0;break}if(ret===undefined){var result=GLctx.getParameter(name_);switch(typeof result){case"number":ret=result;break;case"boolean":ret=result?1:0;break;case"string":GL.recordError(1280);return;case"object":if(result===null){switch(name_){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 35097:case 36389:case 34068:{ret=0;break}default:{GL.recordError(1280);return}}}else if(result instanceof Float32Array||result instanceof Uint32Array||result instanceof Int32Array||result instanceof Array){for(var i=0;i>2]=result[i];break;case 2:HEAPF32[p+i*4>>2]=result[i];break;case 4:HEAP8[p+i>>0]=result[i]?1:0;break}}return}else{try{ret=result.name|0}catch(e){GL.recordError(1280);err("GL_INVALID_ENUM in glGet"+type+"v: Unknown object returned from WebGL getParameter("+name_+")! (error: "+e+")");return}}break;default:GL.recordError(1280);err("GL_INVALID_ENUM in glGet"+type+"v: Native code calling glGet"+type+"v("+name_+") and it returns "+result+" of type "+typeof result+"!");return}}switch(type){case 1:tempI64=[ret>>>0,(tempDouble=ret,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[p>>2]=tempI64[0],HEAP32[p+4>>2]=tempI64[1];break;case 0:HEAP32[p>>2]=ret;break;case 2:HEAPF32[p>>2]=ret;break;case 4:HEAP8[p>>0]=ret?1:0;break}}function _emscripten_glGetBooleanv(name_,p){emscriptenWebGLGet(name_,p,4)}function _emscripten_glGetBufferParameteri64v(target,value,data){if(!data){GL.recordError(1281);return}tempI64=[GLctx.getBufferParameter(target,value)>>>0,(tempDouble=GLctx.getBufferParameter(target,value),+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[data>>2]=tempI64[0],HEAP32[data+4>>2]=tempI64[1]}function _emscripten_glGetBufferParameteriv(target,value,data){if(!data){GL.recordError(1281);return}HEAP32[data>>2]=GLctx.getBufferParameter(target,value)}function _emscripten_glGetBufferPointerv(target,pname,params){if(pname==35005){var ptr=0;var mappedBuffer=GL.mappedBuffers[emscriptenWebGLGetBufferBinding(target)];if(mappedBuffer){ptr=mappedBuffer.mem}HEAP32[params>>2]=ptr}else{GL.recordError(1280);err("GL_INVALID_ENUM in glGetBufferPointerv")}}function _emscripten_glGetError(){var error=GLctx.getError()||GL.lastError;GL.lastError=0;return error}function _emscripten_glGetFloatv(name_,p){emscriptenWebGLGet(name_,p,2)}function _emscripten_glGetFragDataLocation(program,name){return GLctx["getFragDataLocation"](GL.programs[program],UTF8ToString(name))}function _emscripten_glGetFramebufferAttachmentParameteriv(target,attachment,pname,params){var result=GLctx.getFramebufferAttachmentParameter(target,attachment,pname);if(result instanceof WebGLRenderbuffer||result instanceof WebGLTexture){result=result.name|0}HEAP32[params>>2]=result}function emscriptenWebGLGetIndexed(target,index,data,type){if(!data){GL.recordError(1281);return}var result=GLctx["getIndexedParameter"](target,index);var ret;switch(typeof result){case"boolean":ret=result?1:0;break;case"number":ret=result;break;case"object":if(result===null){switch(target){case 35983:case 35368:ret=0;break;default:{GL.recordError(1280);return}}}else if(result instanceof WebGLBuffer){ret=result.name|0}else{GL.recordError(1280);return}break;default:GL.recordError(1280);return}switch(type){case 1:tempI64=[ret>>>0,(tempDouble=ret,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[data>>2]=tempI64[0],HEAP32[data+4>>2]=tempI64[1];break;case 0:HEAP32[data>>2]=ret;break;case 2:HEAPF32[data>>2]=ret;break;case 4:HEAP8[data>>0]=ret?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+type}}function _emscripten_glGetInteger64i_v(target,index,data){emscriptenWebGLGetIndexed(target,index,data,1)}function _emscripten_glGetInteger64v(name_,p){emscriptenWebGLGet(name_,p,1)}function _emscripten_glGetIntegeri_v(target,index,data){emscriptenWebGLGetIndexed(target,index,data,0)}function _emscripten_glGetIntegerv(name_,p){emscriptenWebGLGet(name_,p,0)}function _emscripten_glGetInternalformativ(target,internalformat,pname,bufSize,params){if(bufSize<0){GL.recordError(1281);return}if(!params){GL.recordError(1281);return}var ret=GLctx["getInternalformatParameter"](target,internalformat,pname);if(ret===null)return;for(var i=0;i>2]=ret[i]}}function _emscripten_glGetProgramBinary(program,bufSize,length,binaryFormat,binary){GL.recordError(1282)}function _emscripten_glGetProgramInfoLog(program,maxLength,length,infoLog){var log=GLctx.getProgramInfoLog(GL.programs[program]);if(log===null)log="(unknown error)";var numBytesWrittenExclNull=maxLength>0&&infoLog?stringToUTF8(log,infoLog,maxLength):0;if(length)HEAP32[length>>2]=numBytesWrittenExclNull}function _emscripten_glGetProgramiv(program,pname,p){if(!p){GL.recordError(1281);return}if(program>=GL.counter){GL.recordError(1281);return}var ptable=GL.programInfos[program];if(!ptable){GL.recordError(1282);return}if(pname==35716){var log=GLctx.getProgramInfoLog(GL.programs[program]);if(log===null)log="(unknown error)";HEAP32[p>>2]=log.length+1}else if(pname==35719){HEAP32[p>>2]=ptable.maxUniformLength}else if(pname==35722){if(ptable.maxAttributeLength==-1){program=GL.programs[program];var numAttribs=GLctx.getProgramParameter(program,35721);ptable.maxAttributeLength=0;for(var i=0;i>2]=ptable.maxAttributeLength}else if(pname==35381){if(ptable.maxUniformBlockNameLength==-1){program=GL.programs[program];var numBlocks=GLctx.getProgramParameter(program,35382);ptable.maxUniformBlockNameLength=0;for(var i=0;i>2]=ptable.maxUniformBlockNameLength}else{HEAP32[p>>2]=GLctx.getProgramParameter(GL.programs[program],pname)}}function _emscripten_glGetQueryObjecti64vEXT(id,pname,params){if(!params){GL.recordError(1281);return}var query=GL.timerQueriesEXT[id];var param=GLctx.disjointTimerQueryExt["getQueryObjectEXT"](query,pname);var ret;if(typeof param=="boolean"){ret=param?1:0}else{ret=param}tempI64=[ret>>>0,(tempDouble=ret,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[params>>2]=tempI64[0],HEAP32[params+4>>2]=tempI64[1]}function _emscripten_glGetQueryObjectivEXT(id,pname,params){if(!params){GL.recordError(1281);return}var query=GL.timerQueriesEXT[id];var param=GLctx.disjointTimerQueryExt["getQueryObjectEXT"](query,pname);var ret;if(typeof param=="boolean"){ret=param?1:0}else{ret=param}HEAP32[params>>2]=ret}function _emscripten_glGetQueryObjectui64vEXT(id,pname,params){if(!params){GL.recordError(1281);return}var query=GL.timerQueriesEXT[id];var param=GLctx.disjointTimerQueryExt["getQueryObjectEXT"](query,pname);var ret;if(typeof param=="boolean"){ret=param?1:0}else{ret=param}tempI64=[ret>>>0,(tempDouble=ret,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[params>>2]=tempI64[0],HEAP32[params+4>>2]=tempI64[1]}function _emscripten_glGetQueryObjectuiv(id,pname,params){if(!params){GL.recordError(1281);return}var query=GL.queries[id];var param=GLctx["getQueryParameter"](query,pname);var ret;if(typeof param=="boolean"){ret=param?1:0}else{ret=param}HEAP32[params>>2]=ret}function _emscripten_glGetQueryObjectuivEXT(id,pname,params){if(!params){GL.recordError(1281);return}var query=GL.timerQueriesEXT[id];var param=GLctx.disjointTimerQueryExt["getQueryObjectEXT"](query,pname);var ret;if(typeof param=="boolean"){ret=param?1:0}else{ret=param}HEAP32[params>>2]=ret}function _emscripten_glGetQueryiv(target,pname,params){if(!params){GL.recordError(1281);return}HEAP32[params>>2]=GLctx["getQuery"](target,pname)}function _emscripten_glGetQueryivEXT(target,pname,params){if(!params){GL.recordError(1281);return}HEAP32[params>>2]=GLctx.disjointTimerQueryExt["getQueryEXT"](target,pname)}function _emscripten_glGetRenderbufferParameteriv(target,pname,params){if(!params){GL.recordError(1281);return}HEAP32[params>>2]=GLctx.getRenderbufferParameter(target,pname)}function _emscripten_glGetSamplerParameterfv(sampler,pname,params){if(!params){GL.recordError(1281);return}sampler=GL.samplers[sampler];HEAPF32[params>>2]=GLctx["getSamplerParameter"](sampler,pname)}function _emscripten_glGetSamplerParameteriv(sampler,pname,params){if(!params){GL.recordError(1281);return}sampler=GL.samplers[sampler];HEAP32[params>>2]=GLctx["getSamplerParameter"](sampler,pname)}function _emscripten_glGetShaderInfoLog(shader,maxLength,length,infoLog){var log=GLctx.getShaderInfoLog(GL.shaders[shader]);if(log===null)log="(unknown error)";var numBytesWrittenExclNull=maxLength>0&&infoLog?stringToUTF8(log,infoLog,maxLength):0;if(length)HEAP32[length>>2]=numBytesWrittenExclNull}function _emscripten_glGetShaderPrecisionFormat(shaderType,precisionType,range,precision){var result=GLctx.getShaderPrecisionFormat(shaderType,precisionType);HEAP32[range>>2]=result.rangeMin;HEAP32[range+4>>2]=result.rangeMax;HEAP32[precision>>2]=result.precision}function _emscripten_glGetShaderSource(shader,bufSize,length,source){var result=GLctx.getShaderSource(GL.shaders[shader]);if(!result)return;var numBytesWrittenExclNull=bufSize>0&&source?stringToUTF8(result,source,bufSize):0;if(length)HEAP32[length>>2]=numBytesWrittenExclNull}function _emscripten_glGetShaderiv(shader,pname,p){if(!p){GL.recordError(1281);return}if(pname==35716){var log=GLctx.getShaderInfoLog(GL.shaders[shader]);if(log===null)log="(unknown error)";HEAP32[p>>2]=log.length+1}else if(pname==35720){var source=GLctx.getShaderSource(GL.shaders[shader]);var sourceLength=source===null||source.length==0?0:source.length+1;HEAP32[p>>2]=sourceLength}else{HEAP32[p>>2]=GLctx.getShaderParameter(GL.shaders[shader],pname)}}function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_glGetString(name_){if(GL.stringCache[name_])return GL.stringCache[name_];var ret;switch(name_){case 7939:var exts=GLctx.getSupportedExtensions()||[];exts=exts.concat(exts.map(function(e){return"GL_"+e}));ret=stringToNewUTF8(exts.join(" "));break;case 7936:case 7937:case 37445:case 37446:var s=GLctx.getParameter(name_);if(!s){GL.recordError(1280)}ret=stringToNewUTF8(s);break;case 7938:var glVersion=GLctx.getParameter(7938);if(GL.currentContext.version>=2)glVersion="OpenGL ES 3.0 ("+glVersion+")";else{glVersion="OpenGL ES 2.0 ("+glVersion+")"}ret=stringToNewUTF8(glVersion);break;case 35724:var glslVersion=GLctx.getParameter(35724);var ver_re=/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/;var ver_num=glslVersion.match(ver_re);if(ver_num!==null){if(ver_num[1].length==3)ver_num[1]=ver_num[1]+"0";glslVersion="OpenGL ES GLSL ES "+ver_num[1]+" ("+glslVersion+")"}ret=stringToNewUTF8(glslVersion);break;default:GL.recordError(1280);return 0}GL.stringCache[name_]=ret;return ret}function _emscripten_glGetStringi(name,index){if(GL.currentContext.version<2){GL.recordError(1282);return 0}var stringiCache=GL.stringiCache[name];if(stringiCache){if(index<0||index>=stringiCache.length){GL.recordError(1281);return 0}return stringiCache[index]}switch(name){case 7939:var exts=GLctx.getSupportedExtensions()||[];exts=exts.concat(exts.map(function(e){return"GL_"+e}));exts=exts.map(function(e){return stringToNewUTF8(e)});stringiCache=GL.stringiCache[name]=exts;if(index<0||index>=stringiCache.length){GL.recordError(1281);return 0}return stringiCache[index];default:GL.recordError(1280);return 0}}function _emscripten_glGetSynciv(sync,pname,bufSize,length,values){if(bufSize<0){GL.recordError(1281);return}if(!values){GL.recordError(1281);return}var ret=GLctx.getSyncParameter(GL.syncs[sync],pname);HEAP32[length>>2]=ret;if(ret!==null&&length)HEAP32[length>>2]=1}function _emscripten_glGetTexParameterfv(target,pname,params){if(!params){GL.recordError(1281);return}HEAPF32[params>>2]=GLctx.getTexParameter(target,pname)}function _emscripten_glGetTexParameteriv(target,pname,params){if(!params){GL.recordError(1281);return}HEAP32[params>>2]=GLctx.getTexParameter(target,pname)}function _emscripten_glGetTransformFeedbackVarying(program,index,bufSize,length,size,type,name){program=GL.programs[program];var info=GLctx["getTransformFeedbackVarying"](program,index);if(!info)return;if(name&&bufSize>0){var numBytesWrittenExclNull=stringToUTF8(info.name,name,bufSize);if(length)HEAP32[length>>2]=numBytesWrittenExclNull}else{if(length)HEAP32[length>>2]=0}if(size)HEAP32[size>>2]=info.size;if(type)HEAP32[type>>2]=info.type}function _emscripten_glGetUniformBlockIndex(program,uniformBlockName){return GLctx["getUniformBlockIndex"](GL.programs[program],UTF8ToString(uniformBlockName))}function _emscripten_glGetUniformIndices(program,uniformCount,uniformNames,uniformIndices){if(!uniformIndices){GL.recordError(1281);return}if(uniformCount>0&&(uniformNames==0||uniformIndices==0)){GL.recordError(1281);return}program=GL.programs[program];var names=[];for(var i=0;i>2]));var result=GLctx["getUniformIndices"](program,names);if(!result)return;var len=result.length;for(var i=0;i>2]=result[i]}}function _emscripten_glGetUniformLocation(program,name){name=UTF8ToString(name);var arrayIndex=0;if(name[name.length-1]=="]"){var leftBrace=name.lastIndexOf("[");arrayIndex=name[leftBrace+1]!="]"?parseInt(name.slice(leftBrace+1)):0;name=name.slice(0,leftBrace)}var uniformInfo=GL.programInfos[program]&&GL.programInfos[program].uniforms[name];if(uniformInfo&&arrayIndex>=0&&arrayIndex>2]=data;break;case 2:HEAPF32[params>>2]=data;break;default:throw"internal emscriptenWebGLGetUniform() error, bad type: "+type}}else{for(var i=0;i>2]=data[i];break;case 2:HEAPF32[params+i*4>>2]=data[i];break;default:throw"internal emscriptenWebGLGetUniform() error, bad type: "+type}}}}function _emscripten_glGetUniformfv(program,location,params){emscriptenWebGLGetUniform(program,location,params,2)}function _emscripten_glGetUniformiv(program,location,params){emscriptenWebGLGetUniform(program,location,params,0)}function _emscripten_glGetUniformuiv(program,location,params){emscriptenWebGLGetUniform(program,location,params,0)}function emscriptenWebGLGetVertexAttrib(index,pname,params,type){if(!params){GL.recordError(1281);return}if(GL.currentContext.clientBuffers[index].enabled){err("glGetVertexAttrib*v on client-side array: not supported, bad data returned")}var data=GLctx.getVertexAttrib(index,pname);if(pname==34975){HEAP32[params>>2]=data["name"]}else if(typeof data=="number"||typeof data=="boolean"){switch(type){case 0:HEAP32[params>>2]=data;break;case 2:HEAPF32[params>>2]=data;break;case 5:HEAP32[params>>2]=Math.fround(data);break;default:throw"internal emscriptenWebGLGetVertexAttrib() error, bad type: "+type}}else{for(var i=0;i>2]=data[i];break;case 2:HEAPF32[params+i*4>>2]=data[i];break;case 5:HEAP32[params+i*4>>2]=Math.fround(data[i]);break;default:throw"internal emscriptenWebGLGetVertexAttrib() error, bad type: "+type}}}}function _emscripten_glGetVertexAttribIiv(index,pname,params){emscriptenWebGLGetVertexAttrib(index,pname,params,0)}function _emscripten_glGetVertexAttribIuiv(index,pname,params){emscriptenWebGLGetVertexAttrib(index,pname,params,0)}function _emscripten_glGetVertexAttribPointerv(index,pname,pointer){if(!pointer){GL.recordError(1281);return}if(GL.currentContext.clientBuffers[index].enabled){err("glGetVertexAttribPointer on client-side array: not supported, bad data returned")}HEAP32[pointer>>2]=GLctx.getVertexAttribOffset(index,pname)}function _emscripten_glGetVertexAttribfv(index,pname,params){emscriptenWebGLGetVertexAttrib(index,pname,params,2)}function _emscripten_glGetVertexAttribiv(index,pname,params){emscriptenWebGLGetVertexAttrib(index,pname,params,5)}function _emscripten_glHint(x0,x1){GLctx["hint"](x0,x1)}function _emscripten_glInvalidateFramebuffer(target,numAttachments,attachments){var list=__tempFixedLengthArray[numAttachments];for(var i=0;i>2]}GLctx["invalidateFramebuffer"](target,list)}function _emscripten_glInvalidateSubFramebuffer(target,numAttachments,attachments,x,y,width,height){var list=__tempFixedLengthArray[numAttachments];for(var i=0;i>2]}GLctx["invalidateSubFramebuffer"](target,list,x,y,width,height)}function _emscripten_glIsBuffer(buffer){var b=GL.buffers[buffer];if(!b)return 0;return GLctx.isBuffer(b)}function _emscripten_glIsEnabled(x0){return GLctx["isEnabled"](x0)}function _emscripten_glIsFramebuffer(framebuffer){var fb=GL.framebuffers[framebuffer];if(!fb)return 0;return GLctx.isFramebuffer(fb)}function _emscripten_glIsProgram(program){program=GL.programs[program];if(!program)return 0;return GLctx.isProgram(program)}function _emscripten_glIsQuery(id){var query=GL.queries[id];if(!query)return 0;return GLctx["isQuery"](query)}function _emscripten_glIsQueryEXT(id){var query=GL.timerQueriesEXT[id];if(!query)return 0;return GLctx.disjointTimerQueryExt["isQueryEXT"](query)}function _emscripten_glIsRenderbuffer(renderbuffer){var rb=GL.renderbuffers[renderbuffer];if(!rb)return 0;return GLctx.isRenderbuffer(rb)}function _emscripten_glIsSampler(id){var sampler=GL.samplers[id];if(!sampler)return 0;return GLctx["isSampler"](sampler)}function _emscripten_glIsShader(shader){var s=GL.shaders[shader];if(!s)return 0;return GLctx.isShader(s)}function _emscripten_glIsSync(sync){var sync=GL.syncs[sync];if(!sync)return 0;return GLctx.isSync(sync)}function _emscripten_glIsTexture(id){var texture=GL.textures[id];if(!texture)return 0;return GLctx.isTexture(texture)}function _emscripten_glIsTransformFeedback(id){return GLctx["isTransformFeedback"](GL.transformFeedbacks[id])}function _emscripten_glIsVertexArray(array){var vao=GL.vaos[array];if(!vao)return 0;return GLctx["isVertexArray"](vao)}function _emscripten_glIsVertexArrayOES(array){var vao=GL.vaos[array];if(!vao)return 0;return GLctx["isVertexArray"](vao)}function _emscripten_glLineWidth(x0){GLctx["lineWidth"](x0)}function _emscripten_glLinkProgram(program){GLctx.linkProgram(GL.programs[program]);GL.populateUniformTable(program)}function _emscripten_glMapBufferRange(target,offset,length,access){if(access!=26&&access!=10){err("glMapBufferRange is only supported when access is MAP_WRITE|INVALIDATE_BUFFER");return 0}if(!emscriptenWebGLValidateMapBufferTarget(target)){GL.recordError(1280);err("GL_INVALID_ENUM in glMapBufferRange");return 0}var mem=_malloc(length);if(!mem)return 0;GL.mappedBuffers[emscriptenWebGLGetBufferBinding(target)]={offset:offset,length:length,mem:mem,access:access};return mem}function _emscripten_glPauseTransformFeedback(){GLctx["pauseTransformFeedback"]()}function _emscripten_glPixelStorei(pname,param){if(pname==3317){GL.unpackAlignment=param}GLctx.pixelStorei(pname,param)}function _emscripten_glPolygonOffset(x0,x1){GLctx["polygonOffset"](x0,x1)}function _emscripten_glProgramBinary(program,binaryFormat,binary,length){GL.recordError(1280)}function _emscripten_glProgramParameteri(program,pname,value){GL.recordError(1280)}function _emscripten_glQueryCounterEXT(id,target){GLctx.disjointTimerQueryExt["queryCounterEXT"](GL.timerQueriesEXT[id],target)}function _emscripten_glReadBuffer(x0){GLctx["readBuffer"](x0)}function __computeUnpackAlignedImageSize(width,height,sizePerPixel,alignment){function roundedToNextMultipleOf(x,y){return x+y-1&-y}var plainRowSize=width*sizePerPixel;var alignedRowSize=roundedToNextMultipleOf(plainRowSize,alignment);return height*alignedRowSize}function __colorChannelsInGlTextureFormat(format){var colorChannels={5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4};return colorChannels[format-6402]||1}function __heapObjectForWebGLType(type){type-=5120;if(type==0)return HEAP8;if(type==1)return HEAPU8;if(type==2)return HEAP16;if(type==4)return HEAP32;if(type==6)return HEAPF32;if(type==5||type==28922||type==28520||type==30779||type==30782)return HEAPU32;return HEAPU16}function __heapAccessShiftForWebGLHeap(heap){return 31-Math.clz32(heap.BYTES_PER_ELEMENT)}function emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,internalFormat){var heap=__heapObjectForWebGLType(type);var shift=__heapAccessShiftForWebGLHeap(heap);var byteSize=1<>shift,pixels+bytes>>shift)}function _emscripten_glReadPixels(x,y,width,height,format,type,pixels){if(GL.currentContext.version>=2){if(GLctx.currentPixelPackBufferBinding){GLctx.readPixels(x,y,width,height,format,type,pixels)}else{var heap=__heapObjectForWebGLType(type);GLctx.readPixels(x,y,width,height,format,type,heap,pixels>>__heapAccessShiftForWebGLHeap(heap))}return}var pixelData=emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,format);if(!pixelData){GL.recordError(1280);return}GLctx.readPixels(x,y,width,height,format,type,pixelData)}function _emscripten_glReleaseShaderCompiler(){}function _emscripten_glRenderbufferStorage(x0,x1,x2,x3){GLctx["renderbufferStorage"](x0,x1,x2,x3)}function _emscripten_glRenderbufferStorageMultisample(x0,x1,x2,x3,x4){GLctx["renderbufferStorageMultisample"](x0,x1,x2,x3,x4)}function _emscripten_glResumeTransformFeedback(){GLctx["resumeTransformFeedback"]()}function _emscripten_glSampleCoverage(value,invert){GLctx.sampleCoverage(value,!!invert)}function _emscripten_glSamplerParameterf(sampler,pname,param){GLctx["samplerParameterf"](GL.samplers[sampler],pname,param)}function _emscripten_glSamplerParameterfv(sampler,pname,params){var param=HEAPF32[params>>2];GLctx["samplerParameterf"](GL.samplers[sampler],pname,param)}function _emscripten_glSamplerParameteri(sampler,pname,param){GLctx["samplerParameteri"](GL.samplers[sampler],pname,param)}function _emscripten_glSamplerParameteriv(sampler,pname,params){var param=HEAP32[params>>2];GLctx["samplerParameteri"](GL.samplers[sampler],pname,param)}function _emscripten_glScissor(x0,x1,x2,x3){GLctx["scissor"](x0,x1,x2,x3)}function _emscripten_glShaderBinary(){GL.recordError(1280)}function _emscripten_glShaderSource(shader,count,string,length){var source=GL.getSource(shader,count,string,length);GLctx.shaderSource(GL.shaders[shader],source)}function _emscripten_glStencilFunc(x0,x1,x2){GLctx["stencilFunc"](x0,x1,x2)}function _emscripten_glStencilFuncSeparate(x0,x1,x2,x3){GLctx["stencilFuncSeparate"](x0,x1,x2,x3)}function _emscripten_glStencilMask(x0){GLctx["stencilMask"](x0)}function _emscripten_glStencilMaskSeparate(x0,x1){GLctx["stencilMaskSeparate"](x0,x1)}function _emscripten_glStencilOp(x0,x1,x2){GLctx["stencilOp"](x0,x1,x2)}function _emscripten_glStencilOpSeparate(x0,x1,x2,x3){GLctx["stencilOpSeparate"](x0,x1,x2,x3)}function _emscripten_glTexImage2D(target,level,internalFormat,width,height,border,format,type,pixels){if(GL.currentContext.version>=2){if(GLctx.currentPixelUnpackBufferBinding){GLctx.texImage2D(target,level,internalFormat,width,height,border,format,type,pixels)}else if(pixels){var heap=__heapObjectForWebGLType(type);GLctx.texImage2D(target,level,internalFormat,width,height,border,format,type,heap,pixels>>__heapAccessShiftForWebGLHeap(heap))}else{GLctx.texImage2D(target,level,internalFormat,width,height,border,format,type,null)}return}GLctx.texImage2D(target,level,internalFormat,width,height,border,format,type,pixels?emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,internalFormat):null)}function _emscripten_glTexImage3D(target,level,internalFormat,width,height,depth,border,format,type,pixels){if(GLctx.currentPixelUnpackBufferBinding){GLctx["texImage3D"](target,level,internalFormat,width,height,depth,border,format,type,pixels)}else if(pixels){var heap=__heapObjectForWebGLType(type);GLctx["texImage3D"](target,level,internalFormat,width,height,depth,border,format,type,heap,pixels>>__heapAccessShiftForWebGLHeap(heap))}else{GLctx["texImage3D"](target,level,internalFormat,width,height,depth,border,format,type,null)}}function _emscripten_glTexParameterf(x0,x1,x2){GLctx["texParameterf"](x0,x1,x2)}function _emscripten_glTexParameterfv(target,pname,params){var param=HEAPF32[params>>2];GLctx.texParameterf(target,pname,param)}function _emscripten_glTexParameteri(x0,x1,x2){GLctx["texParameteri"](x0,x1,x2)}function _emscripten_glTexParameteriv(target,pname,params){var param=HEAP32[params>>2];GLctx.texParameteri(target,pname,param)}function _emscripten_glTexStorage2D(x0,x1,x2,x3,x4){GLctx["texStorage2D"](x0,x1,x2,x3,x4)}function _emscripten_glTexStorage3D(x0,x1,x2,x3,x4,x5){GLctx["texStorage3D"](x0,x1,x2,x3,x4,x5)}function _emscripten_glTexSubImage2D(target,level,xoffset,yoffset,width,height,format,type,pixels){if(GL.currentContext.version>=2){if(GLctx.currentPixelUnpackBufferBinding){GLctx.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,pixels)}else if(pixels){var heap=__heapObjectForWebGLType(type);GLctx.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,heap,pixels>>__heapAccessShiftForWebGLHeap(heap))}else{GLctx.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,null)}return}var pixelData=null;if(pixels)pixelData=emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,0);GLctx.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,pixelData)}function _emscripten_glTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,pixels){if(GLctx.currentPixelUnpackBufferBinding){GLctx["texSubImage3D"](target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,pixels)}else if(pixels){var heap=__heapObjectForWebGLType(type);GLctx["texSubImage3D"](target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,heap,pixels>>__heapAccessShiftForWebGLHeap(heap))}else{GLctx["texSubImage3D"](target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,null)}}function _emscripten_glTransformFeedbackVaryings(program,count,varyings,bufferMode){program=GL.programs[program];var vars=[];for(var i=0;i>2]));GLctx["transformFeedbackVaryings"](program,vars,bufferMode)}function _emscripten_glUniform1f(location,v0){GLctx.uniform1f(GL.uniforms[location],v0)}function _emscripten_glUniform1fv(location,count,value){if(GL.currentContext.version>=2){GLctx.uniform1fv(GL.uniforms[location],HEAPF32,value>>2,count);return}if(count<=GL.MINI_TEMP_BUFFER_SIZE){var view=GL.miniTempBufferFloatViews[count-1];for(var i=0;i>2]}}else{var view=HEAPF32.subarray(value>>2,value+count*4>>2)}GLctx.uniform1fv(GL.uniforms[location],view)}function _emscripten_glUniform1i(location,v0){GLctx.uniform1i(GL.uniforms[location],v0)}function _emscripten_glUniform1iv(location,count,value){if(GL.currentContext.version>=2){GLctx.uniform1iv(GL.uniforms[location],HEAP32,value>>2,count);return}if(count<=GL.MINI_TEMP_BUFFER_SIZE){var view=GL.miniTempBufferIntViews[count-1];for(var i=0;i>2]}}else{var view=HEAP32.subarray(value>>2,value+count*4>>2)}GLctx.uniform1iv(GL.uniforms[location],view)}function _emscripten_glUniform1ui(location,v0){GLctx.uniform1ui(GL.uniforms[location],v0)}function _emscripten_glUniform1uiv(location,count,value){GLctx.uniform1uiv(GL.uniforms[location],HEAPU32,value>>2,count)}function _emscripten_glUniform2f(location,v0,v1){GLctx.uniform2f(GL.uniforms[location],v0,v1)}function _emscripten_glUniform2fv(location,count,value){if(GL.currentContext.version>=2){GLctx.uniform2fv(GL.uniforms[location],HEAPF32,value>>2,count*2);return}if(2*count<=GL.MINI_TEMP_BUFFER_SIZE){var view=GL.miniTempBufferFloatViews[2*count-1];for(var i=0;i<2*count;i+=2){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2]}}else{var view=HEAPF32.subarray(value>>2,value+count*8>>2)}GLctx.uniform2fv(GL.uniforms[location],view)}function _emscripten_glUniform2i(location,v0,v1){GLctx.uniform2i(GL.uniforms[location],v0,v1)}function _emscripten_glUniform2iv(location,count,value){if(GL.currentContext.version>=2){GLctx.uniform2iv(GL.uniforms[location],HEAP32,value>>2,count*2);return}if(2*count<=GL.MINI_TEMP_BUFFER_SIZE){var view=GL.miniTempBufferIntViews[2*count-1];for(var i=0;i<2*count;i+=2){view[i]=HEAP32[value+4*i>>2];view[i+1]=HEAP32[value+(4*i+4)>>2]}}else{var view=HEAP32.subarray(value>>2,value+count*8>>2)}GLctx.uniform2iv(GL.uniforms[location],view)}function _emscripten_glUniform2ui(location,v0,v1){GLctx.uniform2ui(GL.uniforms[location],v0,v1)}function _emscripten_glUniform2uiv(location,count,value){GLctx.uniform2uiv(GL.uniforms[location],HEAPU32,value>>2,count*2)}function _emscripten_glUniform3f(location,v0,v1,v2){GLctx.uniform3f(GL.uniforms[location],v0,v1,v2)}function _emscripten_glUniform3fv(location,count,value){if(GL.currentContext.version>=2){GLctx.uniform3fv(GL.uniforms[location],HEAPF32,value>>2,count*3);return}if(3*count<=GL.MINI_TEMP_BUFFER_SIZE){var view=GL.miniTempBufferFloatViews[3*count-1];for(var i=0;i<3*count;i+=3){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2];view[i+2]=HEAPF32[value+(4*i+8)>>2]}}else{var view=HEAPF32.subarray(value>>2,value+count*12>>2)}GLctx.uniform3fv(GL.uniforms[location],view)}function _emscripten_glUniform3i(location,v0,v1,v2){GLctx.uniform3i(GL.uniforms[location],v0,v1,v2)}function _emscripten_glUniform3iv(location,count,value){if(GL.currentContext.version>=2){GLctx.uniform3iv(GL.uniforms[location],HEAP32,value>>2,count*3);return}if(3*count<=GL.MINI_TEMP_BUFFER_SIZE){var view=GL.miniTempBufferIntViews[3*count-1];for(var i=0;i<3*count;i+=3){view[i]=HEAP32[value+4*i>>2];view[i+1]=HEAP32[value+(4*i+4)>>2];view[i+2]=HEAP32[value+(4*i+8)>>2]}}else{var view=HEAP32.subarray(value>>2,value+count*12>>2)}GLctx.uniform3iv(GL.uniforms[location],view)}function _emscripten_glUniform3ui(location,v0,v1,v2){GLctx.uniform3ui(GL.uniforms[location],v0,v1,v2)}function _emscripten_glUniform3uiv(location,count,value){GLctx.uniform3uiv(GL.uniforms[location],HEAPU32,value>>2,count*3)}function _emscripten_glUniform4f(location,v0,v1,v2,v3){GLctx.uniform4f(GL.uniforms[location],v0,v1,v2,v3)}function _emscripten_glUniform4fv(location,count,value){if(GL.currentContext.version>=2){GLctx.uniform4fv(GL.uniforms[location],HEAPF32,value>>2,count*4);return}if(4*count<=GL.MINI_TEMP_BUFFER_SIZE){var view=GL.miniTempBufferFloatViews[4*count-1];for(var i=0;i<4*count;i+=4){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2];view[i+2]=HEAPF32[value+(4*i+8)>>2];view[i+3]=HEAPF32[value+(4*i+12)>>2]}}else{var view=HEAPF32.subarray(value>>2,value+count*16>>2)}GLctx.uniform4fv(GL.uniforms[location],view)}function _emscripten_glUniform4i(location,v0,v1,v2,v3){GLctx.uniform4i(GL.uniforms[location],v0,v1,v2,v3)}function _emscripten_glUniform4iv(location,count,value){if(GL.currentContext.version>=2){GLctx.uniform4iv(GL.uniforms[location],HEAP32,value>>2,count*4);return}if(4*count<=GL.MINI_TEMP_BUFFER_SIZE){var view=GL.miniTempBufferIntViews[4*count-1];for(var i=0;i<4*count;i+=4){view[i]=HEAP32[value+4*i>>2];view[i+1]=HEAP32[value+(4*i+4)>>2];view[i+2]=HEAP32[value+(4*i+8)>>2];view[i+3]=HEAP32[value+(4*i+12)>>2]}}else{var view=HEAP32.subarray(value>>2,value+count*16>>2)}GLctx.uniform4iv(GL.uniforms[location],view)}function _emscripten_glUniform4ui(location,v0,v1,v2,v3){GLctx.uniform4ui(GL.uniforms[location],v0,v1,v2,v3)}function _emscripten_glUniform4uiv(location,count,value){GLctx.uniform4uiv(GL.uniforms[location],HEAPU32,value>>2,count*4)}function _emscripten_glUniformBlockBinding(program,uniformBlockIndex,uniformBlockBinding){program=GL.programs[program];GLctx["uniformBlockBinding"](program,uniformBlockIndex,uniformBlockBinding)}function _emscripten_glUniformMatrix2fv(location,count,transpose,value){if(GL.currentContext.version>=2){GLctx.uniformMatrix2fv(GL.uniforms[location],!!transpose,HEAPF32,value>>2,count*4);return}if(4*count<=GL.MINI_TEMP_BUFFER_SIZE){var view=GL.miniTempBufferFloatViews[4*count-1];for(var i=0;i<4*count;i+=4){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2];view[i+2]=HEAPF32[value+(4*i+8)>>2];view[i+3]=HEAPF32[value+(4*i+12)>>2]}}else{var view=HEAPF32.subarray(value>>2,value+count*16>>2)}GLctx.uniformMatrix2fv(GL.uniforms[location],!!transpose,view)}function _emscripten_glUniformMatrix2x3fv(location,count,transpose,value){GLctx.uniformMatrix2x3fv(GL.uniforms[location],!!transpose,HEAPF32,value>>2,count*6)}function _emscripten_glUniformMatrix2x4fv(location,count,transpose,value){GLctx.uniformMatrix2x4fv(GL.uniforms[location],!!transpose,HEAPF32,value>>2,count*8)}function _emscripten_glUniformMatrix3fv(location,count,transpose,value){if(GL.currentContext.version>=2){GLctx.uniformMatrix3fv(GL.uniforms[location],!!transpose,HEAPF32,value>>2,count*9);return}if(9*count<=GL.MINI_TEMP_BUFFER_SIZE){var view=GL.miniTempBufferFloatViews[9*count-1];for(var i=0;i<9*count;i+=9){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2];view[i+2]=HEAPF32[value+(4*i+8)>>2];view[i+3]=HEAPF32[value+(4*i+12)>>2];view[i+4]=HEAPF32[value+(4*i+16)>>2];view[i+5]=HEAPF32[value+(4*i+20)>>2];view[i+6]=HEAPF32[value+(4*i+24)>>2];view[i+7]=HEAPF32[value+(4*i+28)>>2];view[i+8]=HEAPF32[value+(4*i+32)>>2]}}else{var view=HEAPF32.subarray(value>>2,value+count*36>>2)}GLctx.uniformMatrix3fv(GL.uniforms[location],!!transpose,view)}function _emscripten_glUniformMatrix3x2fv(location,count,transpose,value){GLctx.uniformMatrix3x2fv(GL.uniforms[location],!!transpose,HEAPF32,value>>2,count*6)}function _emscripten_glUniformMatrix3x4fv(location,count,transpose,value){GLctx.uniformMatrix3x4fv(GL.uniforms[location],!!transpose,HEAPF32,value>>2,count*12)}function _emscripten_glUniformMatrix4fv(location,count,transpose,value){if(GL.currentContext.version>=2){GLctx.uniformMatrix4fv(GL.uniforms[location],!!transpose,HEAPF32,value>>2,count*16);return}if(16*count<=GL.MINI_TEMP_BUFFER_SIZE){var view=GL.miniTempBufferFloatViews[16*count-1];for(var i=0;i<16*count;i+=16){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2];view[i+2]=HEAPF32[value+(4*i+8)>>2];view[i+3]=HEAPF32[value+(4*i+12)>>2];view[i+4]=HEAPF32[value+(4*i+16)>>2];view[i+5]=HEAPF32[value+(4*i+20)>>2];view[i+6]=HEAPF32[value+(4*i+24)>>2];view[i+7]=HEAPF32[value+(4*i+28)>>2];view[i+8]=HEAPF32[value+(4*i+32)>>2];view[i+9]=HEAPF32[value+(4*i+36)>>2];view[i+10]=HEAPF32[value+(4*i+40)>>2];view[i+11]=HEAPF32[value+(4*i+44)>>2];view[i+12]=HEAPF32[value+(4*i+48)>>2];view[i+13]=HEAPF32[value+(4*i+52)>>2];view[i+14]=HEAPF32[value+(4*i+56)>>2];view[i+15]=HEAPF32[value+(4*i+60)>>2]}}else{var view=HEAPF32.subarray(value>>2,value+count*64>>2)}GLctx.uniformMatrix4fv(GL.uniforms[location],!!transpose,view)}function _emscripten_glUniformMatrix4x2fv(location,count,transpose,value){GLctx.uniformMatrix4x2fv(GL.uniforms[location],!!transpose,HEAPF32,value>>2,count*8)}function _emscripten_glUniformMatrix4x3fv(location,count,transpose,value){GLctx.uniformMatrix4x3fv(GL.uniforms[location],!!transpose,HEAPF32,value>>2,count*12)}function _emscripten_glUnmapBuffer(target){if(!emscriptenWebGLValidateMapBufferTarget(target)){GL.recordError(1280);err("GL_INVALID_ENUM in glUnmapBuffer");return 0}var buffer=emscriptenWebGLGetBufferBinding(target);var mapping=GL.mappedBuffers[buffer];if(!mapping){GL.recordError(1282);Module.printError("buffer was never mapped in glUnmapBuffer");return 0}GL.mappedBuffers[buffer]=null;if(!(mapping.access&16))if(GL.currentContext.version>=2){GLctx.bufferSubData(target,mapping.offset,HEAPU8,mapping.mem,mapping.length)}else{GLctx.bufferSubData(target,mapping.offset,HEAPU8.subarray(mapping.mem,mapping.mem+mapping.length))}_free(mapping.mem);return 1}function _emscripten_glUseProgram(program){GLctx.useProgram(GL.programs[program])}function _emscripten_glValidateProgram(program){GLctx.validateProgram(GL.programs[program])}function _emscripten_glVertexAttrib1f(x0,x1){GLctx["vertexAttrib1f"](x0,x1)}function _emscripten_glVertexAttrib1fv(index,v){GLctx.vertexAttrib1f(index,HEAPF32[v>>2])}function _emscripten_glVertexAttrib2f(x0,x1,x2){GLctx["vertexAttrib2f"](x0,x1,x2)}function _emscripten_glVertexAttrib2fv(index,v){GLctx.vertexAttrib2f(index,HEAPF32[v>>2],HEAPF32[v+4>>2])}function _emscripten_glVertexAttrib3f(x0,x1,x2,x3){GLctx["vertexAttrib3f"](x0,x1,x2,x3)}function _emscripten_glVertexAttrib3fv(index,v){GLctx.vertexAttrib3f(index,HEAPF32[v>>2],HEAPF32[v+4>>2],HEAPF32[v+8>>2])}function _emscripten_glVertexAttrib4f(x0,x1,x2,x3,x4){GLctx["vertexAttrib4f"](x0,x1,x2,x3,x4)}function _emscripten_glVertexAttrib4fv(index,v){GLctx.vertexAttrib4f(index,HEAPF32[v>>2],HEAPF32[v+4>>2],HEAPF32[v+8>>2],HEAPF32[v+12>>2])}function _emscripten_glVertexAttribDivisor(index,divisor){GLctx["vertexAttribDivisor"](index,divisor)}function _emscripten_glVertexAttribDivisorANGLE(index,divisor){GLctx["vertexAttribDivisor"](index,divisor)}function _emscripten_glVertexAttribDivisorARB(index,divisor){GLctx["vertexAttribDivisor"](index,divisor)}function _emscripten_glVertexAttribDivisorEXT(index,divisor){GLctx["vertexAttribDivisor"](index,divisor)}function _emscripten_glVertexAttribDivisorNV(index,divisor){GLctx["vertexAttribDivisor"](index,divisor)}function _emscripten_glVertexAttribI4i(x0,x1,x2,x3,x4){GLctx["vertexAttribI4i"](x0,x1,x2,x3,x4)}function _emscripten_glVertexAttribI4iv(index,v){GLctx.vertexAttribI4i(index,HEAP32[v>>2],HEAP32[v+4>>2],HEAP32[v+8>>2],HEAP32[v+12>>2])}function _emscripten_glVertexAttribI4ui(x0,x1,x2,x3,x4){GLctx["vertexAttribI4ui"](x0,x1,x2,x3,x4)}function _emscripten_glVertexAttribI4uiv(index,v){GLctx.vertexAttribI4ui(index,HEAPU32[v>>2],HEAPU32[v+4>>2],HEAPU32[v+8>>2],HEAPU32[v+12>>2])}function _emscripten_glVertexAttribIPointer(index,size,type,stride,ptr){var cb=GL.currentContext.clientBuffers[index];if(!GL.currArrayBuffer){cb.size=size;cb.type=type;cb.normalized=false;cb.stride=stride;cb.ptr=ptr;cb.clientside=true;cb.vertexAttribPointerAdaptor=function(index,size,type,normalized,stride,ptr){this.vertexAttribIPointer(index,size,type,stride,ptr)};return}cb.clientside=false;GLctx["vertexAttribIPointer"](index,size,type,stride,ptr)}function _emscripten_glVertexAttribPointer(index,size,type,normalized,stride,ptr){var cb=GL.currentContext.clientBuffers[index];if(!GL.currArrayBuffer){cb.size=size;cb.type=type;cb.normalized=normalized;cb.stride=stride;cb.ptr=ptr;cb.clientside=true;cb.vertexAttribPointerAdaptor=function(index,size,type,normalized,stride,ptr){this.vertexAttribPointer(index,size,type,normalized,stride,ptr)};return}cb.clientside=false;GLctx.vertexAttribPointer(index,size,type,!!normalized,stride,ptr)}function _emscripten_glViewport(x0,x1,x2,x3){GLctx["viewport"](x0,x1,x2,x3)}function _emscripten_glWaitSync(sync,flags,timeoutLo,timeoutHi){timeoutLo=timeoutLo>>>0;timeoutHi=timeoutHi>>>0;var timeout=timeoutLo==4294967295&&timeoutHi==4294967295?-1:makeBigInt(timeoutLo,timeoutHi,true);GLctx.waitSync(GL.syncs[sync],flags,timeout)}var IDBStore={indexedDB:function(){if(typeof indexedDB!=="undefined")return indexedDB;var ret=null;if(typeof window==="object")ret=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;assert(ret,"IDBStore used, but indexedDB not supported");return ret},DB_VERSION:22,DB_STORE_NAME:"FILE_DATA",dbs:{},blobs:[0],getDB:function(name,callback){var db=IDBStore.dbs[name];if(db){return callback(null,db)}var req;try{req=IDBStore.indexedDB().open(name,IDBStore.DB_VERSION)}catch(e){return callback(e)}req.onupgradeneeded=function(e){var db=e.target.result;var transaction=e.target.transaction;var fileStore;if(db.objectStoreNames.contains(IDBStore.DB_STORE_NAME)){fileStore=transaction.objectStore(IDBStore.DB_STORE_NAME)}else{fileStore=db.createObjectStore(IDBStore.DB_STORE_NAME)}};req.onsuccess=function(){db=req.result;IDBStore.dbs[name]=db;callback(null,db)};req.onerror=function(e){callback(this.error);e.preventDefault()}},getStore:function(dbName,type,callback){IDBStore.getDB(dbName,function(error,db){if(error)return callback(error);var transaction=db.transaction([IDBStore.DB_STORE_NAME],type);transaction.onerror=function(e){callback(this.error||"unknown error");e.preventDefault()};var store=transaction.objectStore(IDBStore.DB_STORE_NAME);callback(null,store)})},getFile:function(dbName,id,callback){IDBStore.getStore(dbName,"readonly",function(err,store){if(err)return callback(err);var req=store.get(id);req.onsuccess=function(event){var result=event.target.result;if(!result){return callback("file "+id+" not found")}else{return callback(null,result)}};req.onerror=function(error){callback(error)}})},setFile:function(dbName,id,data,callback){IDBStore.getStore(dbName,"readwrite",function(err,store){if(err)return callback(err);var req=store.put(data,id);req.onsuccess=function(event){callback()};req.onerror=function(error){callback(error)}})},deleteFile:function(dbName,id,callback){IDBStore.getStore(dbName,"readwrite",function(err,store){if(err)return callback(err);var req=store.delete(id);req.onsuccess=function(event){callback()};req.onerror=function(error){callback(error)}})},existsFile:function(dbName,id,callback){IDBStore.getStore(dbName,"readonly",function(err,store){if(err)return callback(err);var req=store.count(id);req.onsuccess=function(event){callback(null,event.target.result>0)};req.onerror=function(error){callback(error)}})}};function _emscripten_idb_async_delete(db,id,arg,ondelete,onerror){IDBStore.deleteFile(UTF8ToString(db),UTF8ToString(id),function(error){if(error){if(onerror)dynCall_vi(onerror,arg);return}if(ondelete)dynCall_vi(ondelete,arg)})}function _emscripten_idb_async_exists(db,id,arg,oncheck,onerror){IDBStore.existsFile(UTF8ToString(db),UTF8ToString(id),function(error,exists){if(error){if(onerror)dynCall_vi(onerror,arg);return}if(oncheck)dynCall_vii(oncheck,arg,exists)})}function _emscripten_idb_async_load(db,id,arg,onload,onerror){IDBStore.getFile(UTF8ToString(db),UTF8ToString(id),function(error,byteArray){if(error){if(onerror)dynCall_vi(onerror,arg);return}var buffer=_malloc(byteArray.length);HEAPU8.set(byteArray,buffer);dynCall_viii(onload,arg,buffer,byteArray.length);_free(buffer)})}function _emscripten_idb_async_store(db,id,ptr,num,arg,onstore,onerror){IDBStore.setFile(UTF8ToString(db),UTF8ToString(id),new Uint8Array(HEAPU8.subarray(ptr,ptr+num)),function(error){if(error){if(onerror)dynCall_vi(onerror,arg);return}if(onstore)dynCall_vi(onstore,arg)})}function _emscripten_is_webgl_context_lost(target){return!GL.contexts[target]||GL.contexts[target].GLctx.isContextLost()}function __reallyNegative(x){return x<0||x===0&&1/x===-Infinity}function __formatString(format,varargs){assert((varargs&3)===0);var textIndex=format;var argIndex=varargs;function prepVararg(ptr,type){if(type==="double"||type==="i64"){if(ptr&7){assert((ptr&7)===4);ptr+=4}}else{assert((ptr&3)===0)}return ptr}function getNextArg(type){var ret;argIndex=prepVararg(argIndex,type);if(type==="double"){ret=HEAPF64[argIndex>>3];argIndex+=8}else if(type=="i64"){ret=[HEAP32[argIndex>>2],HEAP32[argIndex+4>>2]];argIndex+=8}else{assert((argIndex&3)===0);type="i32";ret=HEAP32[argIndex>>2];argIndex+=4}return ret}var ret=[];var curr,next,currArg;while(1){var startTextIndex=textIndex;curr=HEAP8[textIndex>>0];if(curr===0)break;next=HEAP8[textIndex+1>>0];if(curr==37){var flagAlwaysSigned=false;var flagLeftAlign=false;var flagAlternative=false;var flagZeroPad=false;var flagPadSign=false;flagsLoop:while(1){switch(next){case 43:flagAlwaysSigned=true;break;case 45:flagLeftAlign=true;break;case 35:flagAlternative=true;break;case 48:if(flagZeroPad){break flagsLoop}else{flagZeroPad=true;break}case 32:flagPadSign=true;break;default:break flagsLoop}textIndex++;next=HEAP8[textIndex+1>>0]}var width=0;if(next==42){width=getNextArg("i32");textIndex++;next=HEAP8[textIndex+1>>0]}else{while(next>=48&&next<=57){width=width*10+(next-48);textIndex++;next=HEAP8[textIndex+1>>0]}}var precisionSet=false,precision=-1;if(next==46){precision=0;precisionSet=true;textIndex++;next=HEAP8[textIndex+1>>0];if(next==42){precision=getNextArg("i32");textIndex++}else{while(1){var precisionChr=HEAP8[textIndex+1>>0];if(precisionChr<48||precisionChr>57)break;precision=precision*10+(precisionChr-48);textIndex++}}next=HEAP8[textIndex+1>>0]}if(precision<0){precision=6;precisionSet=false}var argSize;switch(String.fromCharCode(next)){case"h":var nextNext=HEAP8[textIndex+2>>0];if(nextNext==104){textIndex++;argSize=1}else{argSize=2}break;case"l":var nextNext=HEAP8[textIndex+2>>0];if(nextNext==108){textIndex++;argSize=8}else{argSize=4}break;case"L":case"q":case"j":argSize=8;break;case"z":case"t":case"I":argSize=4;break;default:argSize=null}if(argSize)textIndex++;next=HEAP8[textIndex+1>>0];switch(String.fromCharCode(next)){case"d":case"i":case"u":case"o":case"x":case"X":case"p":{var signed=next==100||next==105;argSize=argSize||4;currArg=getNextArg("i"+argSize*8);var argText;if(argSize==8){currArg=makeBigInt(currArg[0],currArg[1],next==117)}if(argSize<=4){var limit=Math.pow(256,argSize)-1;currArg=(signed?reSign:unSign)(currArg&limit,argSize*8)}var currAbsArg=Math.abs(currArg);var prefix="";if(next==100||next==105){argText=reSign(currArg,8*argSize,1).toString(10)}else if(next==117){argText=unSign(currArg,8*argSize,1).toString(10);currArg=Math.abs(currArg)}else if(next==111){argText=(flagAlternative?"0":"")+currAbsArg.toString(8)}else if(next==120||next==88){prefix=flagAlternative&&currArg!=0?"0x":"";if(currArg<0){currArg=-currArg;argText=(currAbsArg-1).toString(16);var buffer=[];for(var i=0;i=0){if(flagAlwaysSigned){prefix="+"+prefix}else if(flagPadSign){prefix=" "+prefix}}if(argText.charAt(0)=="-"){prefix="-"+prefix;argText=argText.substr(1)}while(prefix.length+argText.lengthexponent&&exponent>=-4){next=(next==103?"f":"F").charCodeAt(0);precision-=exponent+1}else{next=(next==103?"e":"E").charCodeAt(0);precision--}effectivePrecision=Math.min(precision,20)}if(next==101||next==69){argText=currArg.toExponential(effectivePrecision);if(/[eE][-+]\d$/.test(argText)){argText=argText.slice(0,-1)+"0"+argText.slice(-1)}}else if(next==102||next==70){argText=currArg.toFixed(effectivePrecision);if(currArg===0&&__reallyNegative(currArg)){argText="-"+argText}}var parts=argText.split("e");if(isGeneral&&!flagAlternative){while(parts[0].length>1&&parts[0].indexOf(".")!=-1&&(parts[0].slice(-1)=="0"||parts[0].slice(-1)==".")){parts[0]=parts[0].slice(0,-1)}}else{if(flagAlternative&&argText.indexOf(".")==-1)parts[0]+=".";while(precision>effectivePrecision++)parts[0]+="0"}argText=parts[0]+(parts.length>1?"e"+parts[1]:"");if(next==69)argText=argText.toUpperCase();if(currArg>=0){if(flagAlwaysSigned){argText="+"+argText}else if(flagPadSign){argText=" "+argText}}}while(argText.length>0])}}else{ret=ret.concat(intArrayFromString("(null)".substr(0,argLength),true))}if(flagLeftAlign){while(argLength0){ret.push(32)}if(!flagLeftAlign)ret.push(getNextArg("i8"));break}case"n":{var ptr=getNextArg("i32*");HEAP32[ptr>>2]=ret.length;break}case"%":{ret.push(curr);break}default:{for(var i=startTextIndex;i>0])}}}textIndex+=2}else{ret.push(curr);textIndex+=1}}return ret}function __emscripten_traverse_stack(args){if(!args||!args.callee||!args.callee.name){return[null,"",""]}var funstr=args.callee.toString();var funcname=args.callee.name;var str="(";var first=true;for(var i in args){var a=args[i];if(!first){str+=", "}first=false;if(typeof a==="number"||typeof a==="string"){str+=a}else{str+="("+typeof a+")"}}str+=")";var caller=args.callee.caller;args=caller?caller.arguments:[];if(first)str="";return[args,funcname,str]}function _emscripten_get_callstack_js(flags){var callstack=jsStackTrace();var iThisFunc=callstack.lastIndexOf("_emscripten_log");var iThisFunc2=callstack.lastIndexOf("_emscripten_get_callstack");var iNextLine=callstack.indexOf("\n",Math.max(iThisFunc,iThisFunc2))+1;callstack=callstack.slice(iNextLine);if(flags&8&&typeof emscripten_source_map==="undefined"){warnOnce('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.');flags^=8;flags|=16}var stack_args=null;if(flags&128){stack_args=__emscripten_traverse_stack(arguments);while(stack_args[1].indexOf("_emscripten_")>=0)stack_args=__emscripten_traverse_stack(stack_args[0])}var lines=callstack.split("\n");callstack="";var newFirefoxRe=new RegExp("\\s*(.*?)@(.*?):([0-9]+):([0-9]+)");var firefoxRe=new RegExp("\\s*(.*?)@(.*):(.*)(:(.*))?");var chromeRe=new RegExp("\\s*at (.*?) \\((.*):(.*):(.*)\\)");for(var l in lines){var line=lines[l];var jsSymbolName="";var file="";var lineno=0;var column=0;var parts=chromeRe.exec(line);if(parts&&parts.length==5){jsSymbolName=parts[1];file=parts[2];lineno=parts[3];column=parts[4]}else{parts=newFirefoxRe.exec(line);if(!parts)parts=firefoxRe.exec(line);if(parts&&parts.length>=4){jsSymbolName=parts[1];file=parts[2];lineno=parts[3];column=parts[4]|0}else{callstack+=line+"\n";continue}}var cSymbolName=flags&32?demangle(jsSymbolName):jsSymbolName;if(!cSymbolName){cSymbolName=jsSymbolName}var haveSourceMap=false;if(flags&8){var orig=emscripten_source_map.originalPositionFor({line:lineno,column:column});haveSourceMap=orig&&orig.source;if(haveSourceMap){if(flags&64){orig.source=orig.source.substring(orig.source.replace(/\\/g,"/").lastIndexOf("/")+1)}callstack+=" at "+cSymbolName+" ("+orig.source+":"+orig.line+":"+orig.column+")\n"}}if(flags&16||!haveSourceMap){if(flags&64){file=file.substring(file.replace(/\\/g,"/").lastIndexOf("/")+1)}callstack+=(haveSourceMap?" = "+jsSymbolName:" at "+cSymbolName)+" ("+file+":"+lineno+":"+column+")\n"}if(flags&128&&stack_args[0]){if(stack_args[1]==jsSymbolName&&stack_args[2].length>0){callstack=callstack.replace(/\s+$/,"");callstack+=" with values: "+stack_args[1]+stack_args[2]+"\n"}stack_args=__emscripten_traverse_stack(stack_args[0])}}callstack=callstack.replace(/\s+$/,"");return callstack}function _emscripten_log_js(flags,str){if(flags&24){str=str.replace(/\s+$/,"");str+=(str.length>0?"\n":"")+_emscripten_get_callstack_js(flags)}if(flags&1){if(flags&4){console.error(str)}else if(flags&2){console.warn(str)}else{console.log(str)}}else if(flags&6){err(str)}else{out(str)}}function _emscripten_log(flags,varargs){var format=HEAP32[varargs>>2];varargs+=4;var str="";if(format){var result=__formatString(format,varargs);for(var i=0;i>2]=setjmpId;while((i|0)<(size|0)){if((HEAP32[table+(i<<3)>>2]|0)==0){HEAP32[table+(i<<3)>>2]=setjmpId;HEAP32[table+((i<<3)+4)>>2]=label;HEAP32[table+((i<<3)+8)>>2]=0;setTempRet0(size|0);return table|0}i=i+1|0}size=size*2|0;table=_realloc(table|0,8*(size+1|0)|0)|0;table=_saveSetjmp(env|0,label|0,table|0,size|0)|0;setTempRet0(size|0);return table|0}function _testSetjmp(id,table,size){id=id|0;table=table|0;size=size|0;var i=0,curr=0;while((i|0)<(size|0)){curr=HEAP32[table+(i<<3)>>2]|0;if((curr|0)==0)break;if((curr|0)==(id|0)){return HEAP32[table+((i<<3)+4)>>2]|0}i=i+1|0}return 0}function _longjmp(env,value){_setThrew(env,value||1);throw"longjmp"}function _emscripten_longjmp(env,value){_longjmp(env,value)}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest)}function _emscripten_pause_main_loop(){Browser.mainLoop.pause()}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();var PAGE_MULTIPLE=65536;var maxHeapSize=2147483648-PAGE_MULTIPLE;if(requestedSize>maxHeapSize){return false}var minHeapSize=16777216;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(minHeapSize,requestedSize,overGrownHeapSize),PAGE_MULTIPLE));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}function _emscripten_resume_main_loop(){Browser.mainLoop.resume()}function __registerFocusEventCallback(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.focusEvent)JSEvents.focusEvent=_malloc(256);var focusEventHandlerFunc=function(ev){var e=ev||event;var nodeName=JSEvents.getNodeNameForTarget(e.target);var id=e.target.id?e.target.id:"";var focusEvent=JSEvents.focusEvent;stringToUTF8(nodeName,focusEvent+0,128);stringToUTF8(id,focusEvent+128,128);if(dynCall_iiii(callbackfunc,eventTypeId,focusEvent,userData))e.preventDefault()};var eventHandler={target:__findEventTarget(target),eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:focusEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}function _emscripten_set_focus_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){__registerFocusEventCallback(target,userData,useCapture,callbackfunc,13,"focus",targetThread);return 0}function __registerKeyEventCallback(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.keyEvent)JSEvents.keyEvent=_malloc(164);var keyEventHandlerFunc=function(ev){var e=ev||event;var keyEventData=JSEvents.keyEvent;stringToUTF8(e.key?e.key:"",keyEventData+0,32);stringToUTF8(e.code?e.code:"",keyEventData+32,32);HEAP32[keyEventData+64>>2]=e.location;HEAP32[keyEventData+68>>2]=e.ctrlKey;HEAP32[keyEventData+72>>2]=e.shiftKey;HEAP32[keyEventData+76>>2]=e.altKey;HEAP32[keyEventData+80>>2]=e.metaKey;HEAP32[keyEventData+84>>2]=e.repeat;stringToUTF8(e.locale?e.locale:"",keyEventData+88,32);stringToUTF8(e.char?e.char:"",keyEventData+120,32);HEAP32[keyEventData+152>>2]=e.charCode;HEAP32[keyEventData+156>>2]=e.keyCode;HEAP32[keyEventData+160>>2]=e.which;if(dynCall_iiii(callbackfunc,eventTypeId,keyEventData,userData))e.preventDefault()};var eventHandler={target:__findEventTarget(target),allowsDeferredCalls:true,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:keyEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}function _emscripten_set_keydown_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){__registerKeyEventCallback(target,userData,useCapture,callbackfunc,2,"keydown",targetThread);return 0}function _emscripten_set_keyup_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){__registerKeyEventCallback(target,userData,useCapture,callbackfunc,3,"keyup",targetThread);return 0}function _emscripten_set_main_loop_arg(func,arg,fps,simulateInfiniteLoop){_emscripten_set_main_loop(func,fps,simulateInfiniteLoop,arg)}function __fillMouseEventData(eventStruct,e,target){HEAP32[eventStruct>>2]=e.screenX;HEAP32[eventStruct+4>>2]=e.screenY;HEAP32[eventStruct+8>>2]=e.clientX;HEAP32[eventStruct+12>>2]=e.clientY;HEAP32[eventStruct+16>>2]=e.ctrlKey;HEAP32[eventStruct+20>>2]=e.shiftKey;HEAP32[eventStruct+24>>2]=e.altKey;HEAP32[eventStruct+28>>2]=e.metaKey;HEAP16[eventStruct+32>>1]=e.button;HEAP16[eventStruct+34>>1]=e.buttons;var movementX=e["movementX"]||e.screenX-JSEvents.previousScreenX;var movementY=e["movementY"]||e.screenY-JSEvents.previousScreenY;HEAP32[eventStruct+36>>2]=movementX;HEAP32[eventStruct+40>>2]=movementY;var rect=__specialEventTargets.indexOf(target)<0?__getBoundingClientRect(target):{"left":0,"top":0};HEAP32[eventStruct+44>>2]=e.clientX-rect.left;HEAP32[eventStruct+48>>2]=e.clientY-rect.top;if(e.type!=="wheel"&&e.type!=="mousewheel"){JSEvents.previousScreenX=e.screenX;JSEvents.previousScreenY=e.screenY}}function __registerMouseEventCallback(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.mouseEvent)JSEvents.mouseEvent=_malloc(64);target=__findEventTarget(target);var mouseEventHandlerFunc=function(ev){var e=ev||event;__fillMouseEventData(JSEvents.mouseEvent,e,target);if(dynCall_iiii(callbackfunc,eventTypeId,JSEvents.mouseEvent,userData))e.preventDefault()};var eventHandler={target:target,allowsDeferredCalls:eventTypeString!="mousemove"&&eventTypeString!="mouseenter"&&eventTypeString!="mouseleave",eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:mouseEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}function _emscripten_set_mousedown_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){__registerMouseEventCallback(target,userData,useCapture,callbackfunc,5,"mousedown",targetThread);return 0}function _emscripten_set_mousemove_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){__registerMouseEventCallback(target,userData,useCapture,callbackfunc,8,"mousemove",targetThread);return 0}function _emscripten_set_mouseup_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){__registerMouseEventCallback(target,userData,useCapture,callbackfunc,6,"mouseup",targetThread);return 0}function __registerUiEventCallback(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.uiEvent)JSEvents.uiEvent=_malloc(36);target=__findEventTarget(target);var uiEventHandlerFunc=function(ev){var e=ev||event;if(e.target!=target){return}var uiEvent=JSEvents.uiEvent;var b=document.body;HEAP32[uiEvent>>2]=e.detail;HEAP32[uiEvent+4>>2]=b.clientWidth;HEAP32[uiEvent+8>>2]=b.clientHeight;HEAP32[uiEvent+12>>2]=innerWidth;HEAP32[uiEvent+16>>2]=innerHeight;HEAP32[uiEvent+20>>2]=outerWidth;HEAP32[uiEvent+24>>2]=outerHeight;HEAP32[uiEvent+28>>2]=pageXOffset;HEAP32[uiEvent+32>>2]=pageYOffset;if(dynCall_iiii(callbackfunc,eventTypeId,uiEvent,userData))e.preventDefault()};var eventHandler={target:target,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:uiEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}function _emscripten_set_resize_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){__registerUiEventCallback(target,userData,useCapture,callbackfunc,10,"resize",targetThread);return 0}function __registerTouchEventCallback(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.touchEvent)JSEvents.touchEvent=_malloc(1684);target=__findEventTarget(target);var touchEventHandlerFunc=function(ev){var e=ev||event;var touches={};for(var i=0;i>2]=e.ctrlKey;HEAP32[ptr+8>>2]=e.shiftKey;HEAP32[ptr+12>>2]=e.altKey;HEAP32[ptr+16>>2]=e.metaKey;ptr+=20;var targetRect=__getBoundingClientRect(target);var numTouches=0;for(var i in touches){var t=touches[i];HEAP32[ptr>>2]=t.identifier;HEAP32[ptr+4>>2]=t.screenX;HEAP32[ptr+8>>2]=t.screenY;HEAP32[ptr+12>>2]=t.clientX;HEAP32[ptr+16>>2]=t.clientY;HEAP32[ptr+20>>2]=t.pageX;HEAP32[ptr+24>>2]=t.pageY;HEAP32[ptr+28>>2]=t.changed;HEAP32[ptr+32>>2]=t.onTarget;HEAP32[ptr+36>>2]=t.clientX-targetRect.left;HEAP32[ptr+40>>2]=t.clientY-targetRect.top;ptr+=52;if(++numTouches>=32){break}}HEAP32[touchEvent>>2]=numTouches;if(dynCall_iiii(callbackfunc,eventTypeId,touchEvent,userData))e.preventDefault()};var eventHandler={target:target,allowsDeferredCalls:eventTypeString=="touchstart"||eventTypeString=="touchend",eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:touchEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}function _emscripten_set_touchcancel_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){__registerTouchEventCallback(target,userData,useCapture,callbackfunc,25,"touchcancel",targetThread);return 0}function _emscripten_set_touchend_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){__registerTouchEventCallback(target,userData,useCapture,callbackfunc,23,"touchend",targetThread);return 0}function _emscripten_set_touchmove_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){__registerTouchEventCallback(target,userData,useCapture,callbackfunc,24,"touchmove",targetThread);return 0}function _emscripten_set_touchstart_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){__registerTouchEventCallback(target,userData,useCapture,callbackfunc,22,"touchstart",targetThread);return 0}function __registerWheelEventCallback(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.wheelEvent)JSEvents.wheelEvent=_malloc(96);var wheelHandlerFunc=function(ev){var e=ev||event;var wheelEvent=JSEvents.wheelEvent;__fillMouseEventData(wheelEvent,e,target);HEAPF64[wheelEvent+64>>3]=e["deltaX"];HEAPF64[wheelEvent+72>>3]=e["deltaY"];HEAPF64[wheelEvent+80>>3]=e["deltaZ"];HEAP32[wheelEvent+88>>2]=e["deltaMode"];if(dynCall_iiii(callbackfunc,eventTypeId,wheelEvent,userData))e.preventDefault()};var mouseWheelHandlerFunc=function(ev){var e=ev||event;__fillMouseEventData(JSEvents.wheelEvent,e,target);HEAPF64[JSEvents.wheelEvent+64>>3]=e["wheelDeltaX"]||0;var wheelDeltaY=-(e["wheelDeltaY"]||e["wheelDelta"]);HEAPF64[JSEvents.wheelEvent+72>>3]=wheelDeltaY;HEAPF64[JSEvents.wheelEvent+80>>3]=0;HEAP32[JSEvents.wheelEvent+88>>2]=0;var shouldCancel=dynCall_iiii(callbackfunc,eventTypeId,JSEvents.wheelEvent,userData);if(shouldCancel){e.preventDefault()}};var eventHandler={target:target,allowsDeferredCalls:true,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:eventTypeString=="wheel"?wheelHandlerFunc:mouseWheelHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}function _emscripten_set_wheel_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){target=__findEventTarget(target);if(typeof target.onwheel!=="undefined"){__registerWheelEventCallback(target,userData,useCapture,callbackfunc,9,"wheel",targetThread);return 0}else if(typeof target.onmousewheel!=="undefined"){__registerWheelEventCallback(target,userData,useCapture,callbackfunc,9,"mousewheel",targetThread);return 0}else{return-1}}function _emscripten_sleep(){throw"Please compile your program with async support in order to use asynchronous operations like emscripten_sleep"}var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function __findCanvasEventTarget(target){return __findEventTarget(target)}function _emscripten_webgl_do_create_context(target,attributes){var contextAttributes={};var a=attributes>>2;contextAttributes["alpha"]=!!HEAP32[a+(0>>2)];contextAttributes["depth"]=!!HEAP32[a+(4>>2)];contextAttributes["stencil"]=!!HEAP32[a+(8>>2)];contextAttributes["antialias"]=!!HEAP32[a+(12>>2)];contextAttributes["premultipliedAlpha"]=!!HEAP32[a+(16>>2)];contextAttributes["preserveDrawingBuffer"]=!!HEAP32[a+(20>>2)];var powerPreference=HEAP32[a+(24>>2)];contextAttributes["powerPreference"]=__emscripten_webgl_power_preferences[powerPreference];contextAttributes["failIfMajorPerformanceCaveat"]=!!HEAP32[a+(28>>2)];contextAttributes.majorVersion=HEAP32[a+(32>>2)];contextAttributes.minorVersion=HEAP32[a+(36>>2)];contextAttributes.enableExtensionsByDefault=HEAP32[a+(40>>2)];contextAttributes.explicitSwapControl=HEAP32[a+(44>>2)];contextAttributes.proxyContextToMainThread=HEAP32[a+(48>>2)];contextAttributes.renderViaOffscreenBackBuffer=HEAP32[a+(52>>2)];var canvas=__findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}function _emscripten_webgl_destroy_context_calling_thread(contextHandle){if(GL.currentContext==contextHandle)GL.currentContext=0;GL.deleteContext(contextHandle)}function _emscripten_webgl_destroy_context(a0){return _emscripten_webgl_destroy_context_calling_thread(a0)}function _emscripten_webgl_init_context_attributes(attributes){var a=attributes>>2;for(var i=0;i<56>>2;++i){HEAP32[a+i]=0}HEAP32[a+(0>>2)]=HEAP32[a+(4>>2)]=HEAP32[a+(12>>2)]=HEAP32[a+(16>>2)]=HEAP32[a+(32>>2)]=HEAP32[a+(40>>2)]=1}function _emscripten_webgl_make_context_current(contextHandle){var success=GL.makeContextCurrent(contextHandle);return success?0:-5}Module["_emscripten_webgl_make_context_current"]=_emscripten_webgl_make_context_current;var ENV={};function _emscripten_get_environ(){if(!_emscripten_get_environ.strings){var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8","_":thisProgram};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}_emscripten_get_environ.strings=strings}return _emscripten_get_environ.strings}function _environ_get(__environ,environ_buf){var strings=_emscripten_get_environ();var bufSize=0;strings.forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}function _environ_sizes_get(penviron_count,penviron_buf_size){var strings=_emscripten_get_environ();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}function _exit(status){exit(status)}function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_fdstat_get(fd,pbuf){try{var stream=SYSCALLS.getStreamFromFD(fd);var type=stream.tty?2:FS.isDir(stream.mode)?3:FS.isLink(stream.mode)?7:4;HEAP8[pbuf>>0]=type;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_sync(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);if(stream.stream_ops&&stream.stream_ops.fsync){return-stream.stream_ops.fsync(stream)}return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _flock(fd,operation){return 0}function _getTempRet0(){return getTempRet0()|0}function _getpagesize(){return 16384}function _getpwnam(){throw"getpwnam: TODO"}function _gettimeofday(ptr){var now=Date.now();HEAP32[ptr>>2]=now/1e3|0;HEAP32[ptr+4>>2]=now%1e3*1e3|0;return 0}function _glActiveTexture(x0){GLctx["activeTexture"](x0)}function _glCompressedTexImage2D(target,level,internalFormat,width,height,border,imageSize,data){if(GL.currentContext.version>=2){if(GLctx.currentPixelUnpackBufferBinding){GLctx["compressedTexImage2D"](target,level,internalFormat,width,height,border,imageSize,data)}else{GLctx["compressedTexImage2D"](target,level,internalFormat,width,height,border,HEAPU8,data,imageSize)}return}GLctx["compressedTexImage2D"](target,level,internalFormat,width,height,border,data?HEAPU8.subarray(data,data+imageSize):null)}function _glCompressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,imageSize,data){if(GL.currentContext.version>=2){if(GLctx.currentPixelUnpackBufferBinding){GLctx["compressedTexSubImage2D"](target,level,xoffset,yoffset,width,height,format,imageSize,data)}else{GLctx["compressedTexSubImage2D"](target,level,xoffset,yoffset,width,height,format,HEAPU8,data,imageSize)}return}GLctx["compressedTexSubImage2D"](target,level,xoffset,yoffset,width,height,format,data?HEAPU8.subarray(data,data+imageSize):null)}function _glGenerateMipmap(x0){GLctx["generateMipmap"](x0)}function _glTexSubImage2D(target,level,xoffset,yoffset,width,height,format,type,pixels){if(GL.currentContext.version>=2){if(GLctx.currentPixelUnpackBufferBinding){GLctx.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,pixels)}else if(pixels){var heap=__heapObjectForWebGLType(type);GLctx.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,heap,pixels>>__heapAccessShiftForWebGLHeap(heap))}else{GLctx.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,null)}return}var pixelData=null;if(pixels)pixelData=emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,0);GLctx.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,pixelData)}function _glViewport(x0,x1,x2,x3){GLctx["viewport"](x0,x1,x2,x3)}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _kill(pid,sig){___setErrNo(ERRNO_CODES.EPERM);return-1}var ___tm_current=8238624;var ___tm_timezone=(stringToUTF8("GMT",8238672,4),8238672);function _tzset(){if(_tzset.called)return;_tzset.called=true;HEAP32[__get_timezone()>>2]=(new Date).getTimezoneOffset()*60;var currentYear=(new Date).getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);HEAP32[__get_daylight()>>2]=Number(winter.getTimezoneOffset()!=summer.getTimezoneOffset());function extractZone(date){var match=date.toTimeString().match(/\(([A-Za-z ]+)\)$/);return match?match[1]:"GMT"}var winterName=extractZone(winter);var summerName=extractZone(summer);var winterNamePtr=allocate(intArrayFromString(winterName),"i8",ALLOC_NORMAL);var summerNamePtr=allocate(intArrayFromString(summerName),"i8",ALLOC_NORMAL);if(summer.getTimezoneOffset()>2]=winterNamePtr;HEAP32[__get_tzname()+4>>2]=summerNamePtr}else{HEAP32[__get_tzname()>>2]=summerNamePtr;HEAP32[__get_tzname()+4>>2]=winterNamePtr}}function _localtime_r(time,tmPtr){_tzset();var date=new Date(HEAP32[time>>2]*1e3);HEAP32[tmPtr>>2]=date.getSeconds();HEAP32[tmPtr+4>>2]=date.getMinutes();HEAP32[tmPtr+8>>2]=date.getHours();HEAP32[tmPtr+12>>2]=date.getDate();HEAP32[tmPtr+16>>2]=date.getMonth();HEAP32[tmPtr+20>>2]=date.getFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getDay();var start=new Date(date.getFullYear(),0,1);var yday=(date.getTime()-start.getTime())/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr+36>>2]=-(date.getTimezoneOffset()*60);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=(summerOffset!=winterOffset&&date.getTimezoneOffset()==Math.min(winterOffset,summerOffset))|0;HEAP32[tmPtr+32>>2]=dst;var zonePtr=HEAP32[__get_tzname()+(dst?4:0)>>2];HEAP32[tmPtr+40>>2]=zonePtr;return tmPtr}function _localtime(time){return _localtime_r(time,___tm_current)}function _mktime(tmPtr){_tzset();var date=new Date(HEAP32[tmPtr+20>>2]+1900,HEAP32[tmPtr+16>>2],HEAP32[tmPtr+12>>2],HEAP32[tmPtr+8>>2],HEAP32[tmPtr+4>>2],HEAP32[tmPtr>>2],0);var dst=HEAP32[tmPtr+32>>2];var guessedOffset=date.getTimezoneOffset();var start=new Date(date.getFullYear(),0,1);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dstOffset=Math.min(winterOffset,summerOffset);if(dst<0){HEAP32[tmPtr+32>>2]=Number(summerOffset!=winterOffset&&dstOffset==guessedOffset)}else if(dst>0!=(dstOffset==guessedOffset)){var nonDstOffset=Math.max(winterOffset,summerOffset);var trueOffset=dst>0?dstOffset:nonDstOffset;date.setTime(date.getTime()+(trueOffset-guessedOffset)*6e4)}HEAP32[tmPtr+24>>2]=date.getDay();var yday=(date.getTime()-start.getTime())/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday;return date.getTime()/1e3|0}function _usleep(useconds){var msec=useconds/1e3;if((ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&self["performance"]&&self["performance"]["now"]){var start=self["performance"]["now"]();while(self["performance"]["now"]()-start>2];var nanoseconds=HEAP32[rqtp+4>>2];if(nanoseconds<0||nanoseconds>999999999||seconds<0){___setErrNo(28);return-1}if(rmtp!==0){HEAP32[rmtp>>2]=0;HEAP32[rmtp+4>>2]=0}return _usleep(seconds*1e6+nanoseconds/1e3)}function _fpathconf(fildes,name){switch(name){case 0:return 32e3;case 1:case 2:case 3:return 255;case 4:case 5:case 16:case 17:case 18:return 4096;case 6:case 7:case 20:return 1;case 8:return 0;case 9:case 10:case 11:case 12:case 14:case 15:case 19:return-1;case 13:return 64}___setErrNo(28);return-1}function _pathconf(){return _fpathconf.apply(null,arguments)}function _round(d){d=+d;return d>=+0?+Math_floor(d+ +.5):+Math_ceil(d-+.5)}function _setTempRet0($i){setTempRet0($i|0)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]);return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.indexOf(rule)>=0){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}function _system(command){___setErrNo(6);return-1}FS.staticInit();embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");InternalError=Module["InternalError"]=extendError(Error,"InternalError");init_emval();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function _emscripten_get_now_actual(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance["now"]()};Module["requestFullscreen"]=function Module_requestFullscreen(lockPointer,resizeCanvas,vrDevice){Browser.requestFullscreen(lockPointer,resizeCanvas,vrDevice)};Module["requestAnimationFrame"]=function Module_requestAnimationFrame(func){Browser.requestAnimationFrame(func)};Module["setCanvasSize"]=function Module_setCanvasSize(width,height,noUpdates){Browser.setCanvasSize(width,height,noUpdates)};Module["pauseMainLoop"]=function Module_pauseMainLoop(){Browser.mainLoop.pause()};Module["resumeMainLoop"]=function Module_resumeMainLoop(){Browser.mainLoop.resume()};Module["getUserMedia"]=function Module_getUserMedia(){Browser.getUserMedia()};Module["createContext"]=function Module_createContext(canvas,useWebGL,setInModule,webGLContextAttributes){return Browser.createContext(canvas,useWebGL,setInModule,webGLContextAttributes)};var GLctx;GL.init();for(var i=0;i<32;i++)__tempFixedLengthArray.push(new Array(i));var ASSERTIONS=false;function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"__assert_fail":___assert_fail,"__cxa_allocate_exception":___cxa_allocate_exception,"__cxa_atexit":___cxa_atexit,"__cxa_thread_atexit":___cxa_thread_atexit,"__cxa_throw":___cxa_throw,"__lock":___lock,"__map_file":___map_file,"__syscall10":___syscall10,"__syscall122":___syscall122,"__syscall15":___syscall15,"__syscall168":___syscall168,"__syscall183":___syscall183,"__syscall192":___syscall192,"__syscall193":___syscall193,"__syscall194":___syscall194,"__syscall195":___syscall195,"__syscall196":___syscall196,"__syscall197":___syscall197,"__syscall199":___syscall199,"__syscall20":___syscall20,"__syscall201":___syscall201,"__syscall220":___syscall220,"__syscall221":___syscall221,"__syscall3":___syscall3,"__syscall320":___syscall320,"__syscall33":___syscall33,"__syscall38":___syscall38,"__syscall39":___syscall39,"__syscall4":___syscall4,"__syscall40":___syscall40,"__syscall5":___syscall5,"__syscall83":___syscall83,"__syscall85":___syscall85,"__syscall9":___syscall9,"__syscall91":___syscall91,"__syscall94":___syscall94,"__unlock":___unlock,"_embind_register_bool":__embind_register_bool,"_embind_register_emval":__embind_register_emval,"_embind_register_float":__embind_register_float,"_embind_register_function":__embind_register_function,"_embind_register_integer":__embind_register_integer,"_embind_register_memory_view":__embind_register_memory_view,"_embind_register_std_string":__embind_register_std_string,"_embind_register_std_wstring":__embind_register_std_wstring,"_embind_register_void":__embind_register_void,"_emval_as":__emval_as,"_emval_call":__emval_call,"_emval_call_method":__emval_call_method,"_emval_call_void_method":__emval_call_void_method,"_emval_decref":__emval_decref,"_emval_equals":__emval_equals,"_emval_get_global":__emval_get_global,"_emval_get_method_caller":__emval_get_method_caller,"_emval_get_module_property":__emval_get_module_property,"_emval_get_property":__emval_get_property,"_emval_incref":__emval_incref,"_emval_is_string":__emval_is_string,"_emval_new":__emval_new,"_emval_new_cstring":__emval_new_cstring,"_emval_new_object":__emval_new_object,"_emval_run_destructors":__emval_run_destructors,"_emval_set_property":__emval_set_property,"_emval_take_value":__emval_take_value,"abort":_abort,"clock_gettime":_clock_gettime,"dlclose":_dlclose,"dlerror":_dlerror,"dlopen":_dlopen,"dlsym":_dlsym,"eglGetProcAddress":_eglGetProcAddress,"emscripten_async_call":_emscripten_async_call,"emscripten_date_now":_emscripten_date_now,"emscripten_force_exit":_emscripten_force_exit,"emscripten_get_element_css_size":_emscripten_get_element_css_size,"emscripten_get_sbrk_ptr":_emscripten_get_sbrk_ptr,"emscripten_glActiveTexture":_emscripten_glActiveTexture,"emscripten_glAttachShader":_emscripten_glAttachShader,"emscripten_glBeginQuery":_emscripten_glBeginQuery,"emscripten_glBeginQueryEXT":_emscripten_glBeginQueryEXT,"emscripten_glBeginTransformFeedback":_emscripten_glBeginTransformFeedback,"emscripten_glBindAttribLocation":_emscripten_glBindAttribLocation,"emscripten_glBindBuffer":_emscripten_glBindBuffer,"emscripten_glBindBufferBase":_emscripten_glBindBufferBase,"emscripten_glBindBufferRange":_emscripten_glBindBufferRange,"emscripten_glBindFramebuffer":_emscripten_glBindFramebuffer,"emscripten_glBindRenderbuffer":_emscripten_glBindRenderbuffer,"emscripten_glBindSampler":_emscripten_glBindSampler,"emscripten_glBindTexture":_emscripten_glBindTexture,"emscripten_glBindTransformFeedback":_emscripten_glBindTransformFeedback,"emscripten_glBindVertexArray":_emscripten_glBindVertexArray,"emscripten_glBindVertexArrayOES":_emscripten_glBindVertexArrayOES,"emscripten_glBlendColor":_emscripten_glBlendColor,"emscripten_glBlendEquation":_emscripten_glBlendEquation,"emscripten_glBlendEquationSeparate":_emscripten_glBlendEquationSeparate,"emscripten_glBlendFunc":_emscripten_glBlendFunc,"emscripten_glBlendFuncSeparate":_emscripten_glBlendFuncSeparate,"emscripten_glBlitFramebuffer":_emscripten_glBlitFramebuffer,"emscripten_glBufferData":_emscripten_glBufferData,"emscripten_glBufferSubData":_emscripten_glBufferSubData,"emscripten_glCheckFramebufferStatus":_emscripten_glCheckFramebufferStatus,"emscripten_glClear":_emscripten_glClear,"emscripten_glClearBufferfi":_emscripten_glClearBufferfi,"emscripten_glClearBufferfv":_emscripten_glClearBufferfv,"emscripten_glClearBufferiv":_emscripten_glClearBufferiv,"emscripten_glClearBufferuiv":_emscripten_glClearBufferuiv,"emscripten_glClearColor":_emscripten_glClearColor,"emscripten_glClearDepthf":_emscripten_glClearDepthf,"emscripten_glClearStencil":_emscripten_glClearStencil,"emscripten_glClientWaitSync":_emscripten_glClientWaitSync,"emscripten_glColorMask":_emscripten_glColorMask,"emscripten_glCompileShader":_emscripten_glCompileShader,"emscripten_glCompressedTexImage2D":_emscripten_glCompressedTexImage2D,"emscripten_glCompressedTexImage3D":_emscripten_glCompressedTexImage3D,"emscripten_glCompressedTexSubImage2D":_emscripten_glCompressedTexSubImage2D,"emscripten_glCompressedTexSubImage3D":_emscripten_glCompressedTexSubImage3D,"emscripten_glCopyBufferSubData":_emscripten_glCopyBufferSubData,"emscripten_glCopyTexImage2D":_emscripten_glCopyTexImage2D,"emscripten_glCopyTexSubImage2D":_emscripten_glCopyTexSubImage2D,"emscripten_glCopyTexSubImage3D":_emscripten_glCopyTexSubImage3D,"emscripten_glCreateProgram":_emscripten_glCreateProgram,"emscripten_glCreateShader":_emscripten_glCreateShader,"emscripten_glCullFace":_emscripten_glCullFace,"emscripten_glDeleteBuffers":_emscripten_glDeleteBuffers,"emscripten_glDeleteFramebuffers":_emscripten_glDeleteFramebuffers,"emscripten_glDeleteProgram":_emscripten_glDeleteProgram,"emscripten_glDeleteQueries":_emscripten_glDeleteQueries,"emscripten_glDeleteQueriesEXT":_emscripten_glDeleteQueriesEXT,"emscripten_glDeleteRenderbuffers":_emscripten_glDeleteRenderbuffers,"emscripten_glDeleteSamplers":_emscripten_glDeleteSamplers,"emscripten_glDeleteShader":_emscripten_glDeleteShader,"emscripten_glDeleteSync":_emscripten_glDeleteSync,"emscripten_glDeleteTextures":_emscripten_glDeleteTextures,"emscripten_glDeleteTransformFeedbacks":_emscripten_glDeleteTransformFeedbacks,"emscripten_glDeleteVertexArrays":_emscripten_glDeleteVertexArrays,"emscripten_glDeleteVertexArraysOES":_emscripten_glDeleteVertexArraysOES,"emscripten_glDepthFunc":_emscripten_glDepthFunc,"emscripten_glDepthMask":_emscripten_glDepthMask,"emscripten_glDepthRangef":_emscripten_glDepthRangef,"emscripten_glDetachShader":_emscripten_glDetachShader,"emscripten_glDisable":_emscripten_glDisable,"emscripten_glDisableVertexAttribArray":_emscripten_glDisableVertexAttribArray,"emscripten_glDrawArrays":_emscripten_glDrawArrays,"emscripten_glDrawArraysInstanced":_emscripten_glDrawArraysInstanced,"emscripten_glDrawArraysInstancedANGLE":_emscripten_glDrawArraysInstancedANGLE,"emscripten_glDrawArraysInstancedARB":_emscripten_glDrawArraysInstancedARB,"emscripten_glDrawArraysInstancedEXT":_emscripten_glDrawArraysInstancedEXT,"emscripten_glDrawArraysInstancedNV":_emscripten_glDrawArraysInstancedNV,"emscripten_glDrawBuffers":_emscripten_glDrawBuffers,"emscripten_glDrawBuffersEXT":_emscripten_glDrawBuffersEXT,"emscripten_glDrawBuffersWEBGL":_emscripten_glDrawBuffersWEBGL,"emscripten_glDrawElements":_emscripten_glDrawElements,"emscripten_glDrawElementsInstanced":_emscripten_glDrawElementsInstanced,"emscripten_glDrawElementsInstancedANGLE":_emscripten_glDrawElementsInstancedANGLE,"emscripten_glDrawElementsInstancedARB":_emscripten_glDrawElementsInstancedARB,"emscripten_glDrawElementsInstancedEXT":_emscripten_glDrawElementsInstancedEXT,"emscripten_glDrawElementsInstancedNV":_emscripten_glDrawElementsInstancedNV,"emscripten_glDrawRangeElements":_emscripten_glDrawRangeElements,"emscripten_glEnable":_emscripten_glEnable,"emscripten_glEnableVertexAttribArray":_emscripten_glEnableVertexAttribArray,"emscripten_glEndQuery":_emscripten_glEndQuery,"emscripten_glEndQueryEXT":_emscripten_glEndQueryEXT,"emscripten_glEndTransformFeedback":_emscripten_glEndTransformFeedback,"emscripten_glFenceSync":_emscripten_glFenceSync,"emscripten_glFinish":_emscripten_glFinish,"emscripten_glFlush":_emscripten_glFlush,"emscripten_glFlushMappedBufferRange":_emscripten_glFlushMappedBufferRange,"emscripten_glFramebufferRenderbuffer":_emscripten_glFramebufferRenderbuffer,"emscripten_glFramebufferTexture2D":_emscripten_glFramebufferTexture2D,"emscripten_glFramebufferTextureLayer":_emscripten_glFramebufferTextureLayer,"emscripten_glFrontFace":_emscripten_glFrontFace,"emscripten_glGenBuffers":_emscripten_glGenBuffers,"emscripten_glGenFramebuffers":_emscripten_glGenFramebuffers,"emscripten_glGenQueries":_emscripten_glGenQueries,"emscripten_glGenQueriesEXT":_emscripten_glGenQueriesEXT,"emscripten_glGenRenderbuffers":_emscripten_glGenRenderbuffers,"emscripten_glGenSamplers":_emscripten_glGenSamplers,"emscripten_glGenTextures":_emscripten_glGenTextures,"emscripten_glGenTransformFeedbacks":_emscripten_glGenTransformFeedbacks,"emscripten_glGenVertexArrays":_emscripten_glGenVertexArrays,"emscripten_glGenVertexArraysOES":_emscripten_glGenVertexArraysOES,"emscripten_glGenerateMipmap":_emscripten_glGenerateMipmap,"emscripten_glGetActiveAttrib":_emscripten_glGetActiveAttrib,"emscripten_glGetActiveUniform":_emscripten_glGetActiveUniform,"emscripten_glGetActiveUniformBlockName":_emscripten_glGetActiveUniformBlockName,"emscripten_glGetActiveUniformBlockiv":_emscripten_glGetActiveUniformBlockiv,"emscripten_glGetActiveUniformsiv":_emscripten_glGetActiveUniformsiv,"emscripten_glGetAttachedShaders":_emscripten_glGetAttachedShaders,"emscripten_glGetAttribLocation":_emscripten_glGetAttribLocation,"emscripten_glGetBooleanv":_emscripten_glGetBooleanv,"emscripten_glGetBufferParameteri64v":_emscripten_glGetBufferParameteri64v,"emscripten_glGetBufferParameteriv":_emscripten_glGetBufferParameteriv,"emscripten_glGetBufferPointerv":_emscripten_glGetBufferPointerv,"emscripten_glGetError":_emscripten_glGetError,"emscripten_glGetFloatv":_emscripten_glGetFloatv,"emscripten_glGetFragDataLocation":_emscripten_glGetFragDataLocation,"emscripten_glGetFramebufferAttachmentParameteriv":_emscripten_glGetFramebufferAttachmentParameteriv,"emscripten_glGetInteger64i_v":_emscripten_glGetInteger64i_v,"emscripten_glGetInteger64v":_emscripten_glGetInteger64v,"emscripten_glGetIntegeri_v":_emscripten_glGetIntegeri_v,"emscripten_glGetIntegerv":_emscripten_glGetIntegerv,"emscripten_glGetInternalformativ":_emscripten_glGetInternalformativ,"emscripten_glGetProgramBinary":_emscripten_glGetProgramBinary,"emscripten_glGetProgramInfoLog":_emscripten_glGetProgramInfoLog,"emscripten_glGetProgramiv":_emscripten_glGetProgramiv,"emscripten_glGetQueryObjecti64vEXT":_emscripten_glGetQueryObjecti64vEXT,"emscripten_glGetQueryObjectivEXT":_emscripten_glGetQueryObjectivEXT,"emscripten_glGetQueryObjectui64vEXT":_emscripten_glGetQueryObjectui64vEXT,"emscripten_glGetQueryObjectuiv":_emscripten_glGetQueryObjectuiv,"emscripten_glGetQueryObjectuivEXT":_emscripten_glGetQueryObjectuivEXT,"emscripten_glGetQueryiv":_emscripten_glGetQueryiv,"emscripten_glGetQueryivEXT":_emscripten_glGetQueryivEXT,"emscripten_glGetRenderbufferParameteriv":_emscripten_glGetRenderbufferParameteriv,"emscripten_glGetSamplerParameterfv":_emscripten_glGetSamplerParameterfv,"emscripten_glGetSamplerParameteriv":_emscripten_glGetSamplerParameteriv,"emscripten_glGetShaderInfoLog":_emscripten_glGetShaderInfoLog,"emscripten_glGetShaderPrecisionFormat":_emscripten_glGetShaderPrecisionFormat,"emscripten_glGetShaderSource":_emscripten_glGetShaderSource,"emscripten_glGetShaderiv":_emscripten_glGetShaderiv,"emscripten_glGetString":_emscripten_glGetString,"emscripten_glGetStringi":_emscripten_glGetStringi,"emscripten_glGetSynciv":_emscripten_glGetSynciv,"emscripten_glGetTexParameterfv":_emscripten_glGetTexParameterfv,"emscripten_glGetTexParameteriv":_emscripten_glGetTexParameteriv,"emscripten_glGetTransformFeedbackVarying":_emscripten_glGetTransformFeedbackVarying,"emscripten_glGetUniformBlockIndex":_emscripten_glGetUniformBlockIndex,"emscripten_glGetUniformIndices":_emscripten_glGetUniformIndices,"emscripten_glGetUniformLocation":_emscripten_glGetUniformLocation,"emscripten_glGetUniformfv":_emscripten_glGetUniformfv,"emscripten_glGetUniformiv":_emscripten_glGetUniformiv,"emscripten_glGetUniformuiv":_emscripten_glGetUniformuiv,"emscripten_glGetVertexAttribIiv":_emscripten_glGetVertexAttribIiv,"emscripten_glGetVertexAttribIuiv":_emscripten_glGetVertexAttribIuiv,"emscripten_glGetVertexAttribPointerv":_emscripten_glGetVertexAttribPointerv,"emscripten_glGetVertexAttribfv":_emscripten_glGetVertexAttribfv,"emscripten_glGetVertexAttribiv":_emscripten_glGetVertexAttribiv,"emscripten_glHint":_emscripten_glHint,"emscripten_glInvalidateFramebuffer":_emscripten_glInvalidateFramebuffer,"emscripten_glInvalidateSubFramebuffer":_emscripten_glInvalidateSubFramebuffer,"emscripten_glIsBuffer":_emscripten_glIsBuffer,"emscripten_glIsEnabled":_emscripten_glIsEnabled,"emscripten_glIsFramebuffer":_emscripten_glIsFramebuffer,"emscripten_glIsProgram":_emscripten_glIsProgram,"emscripten_glIsQuery":_emscripten_glIsQuery,"emscripten_glIsQueryEXT":_emscripten_glIsQueryEXT,"emscripten_glIsRenderbuffer":_emscripten_glIsRenderbuffer,"emscripten_glIsSampler":_emscripten_glIsSampler,"emscripten_glIsShader":_emscripten_glIsShader,"emscripten_glIsSync":_emscripten_glIsSync,"emscripten_glIsTexture":_emscripten_glIsTexture,"emscripten_glIsTransformFeedback":_emscripten_glIsTransformFeedback,"emscripten_glIsVertexArray":_emscripten_glIsVertexArray,"emscripten_glIsVertexArrayOES":_emscripten_glIsVertexArrayOES,"emscripten_glLineWidth":_emscripten_glLineWidth,"emscripten_glLinkProgram":_emscripten_glLinkProgram,"emscripten_glMapBufferRange":_emscripten_glMapBufferRange,"emscripten_glPauseTransformFeedback":_emscripten_glPauseTransformFeedback,"emscripten_glPixelStorei":_emscripten_glPixelStorei,"emscripten_glPolygonOffset":_emscripten_glPolygonOffset,"emscripten_glProgramBinary":_emscripten_glProgramBinary,"emscripten_glProgramParameteri":_emscripten_glProgramParameteri,"emscripten_glQueryCounterEXT":_emscripten_glQueryCounterEXT,"emscripten_glReadBuffer":_emscripten_glReadBuffer,"emscripten_glReadPixels":_emscripten_glReadPixels,"emscripten_glReleaseShaderCompiler":_emscripten_glReleaseShaderCompiler,"emscripten_glRenderbufferStorage":_emscripten_glRenderbufferStorage,"emscripten_glRenderbufferStorageMultisample":_emscripten_glRenderbufferStorageMultisample,"emscripten_glResumeTransformFeedback":_emscripten_glResumeTransformFeedback,"emscripten_glSampleCoverage":_emscripten_glSampleCoverage,"emscripten_glSamplerParameterf":_emscripten_glSamplerParameterf,"emscripten_glSamplerParameterfv":_emscripten_glSamplerParameterfv,"emscripten_glSamplerParameteri":_emscripten_glSamplerParameteri,"emscripten_glSamplerParameteriv":_emscripten_glSamplerParameteriv,"emscripten_glScissor":_emscripten_glScissor,"emscripten_glShaderBinary":_emscripten_glShaderBinary,"emscripten_glShaderSource":_emscripten_glShaderSource,"emscripten_glStencilFunc":_emscripten_glStencilFunc,"emscripten_glStencilFuncSeparate":_emscripten_glStencilFuncSeparate,"emscripten_glStencilMask":_emscripten_glStencilMask,"emscripten_glStencilMaskSeparate":_emscripten_glStencilMaskSeparate,"emscripten_glStencilOp":_emscripten_glStencilOp,"emscripten_glStencilOpSeparate":_emscripten_glStencilOpSeparate,"emscripten_glTexImage2D":_emscripten_glTexImage2D,"emscripten_glTexImage3D":_emscripten_glTexImage3D,"emscripten_glTexParameterf":_emscripten_glTexParameterf,"emscripten_glTexParameterfv":_emscripten_glTexParameterfv,"emscripten_glTexParameteri":_emscripten_glTexParameteri,"emscripten_glTexParameteriv":_emscripten_glTexParameteriv,"emscripten_glTexStorage2D":_emscripten_glTexStorage2D,"emscripten_glTexStorage3D":_emscripten_glTexStorage3D,"emscripten_glTexSubImage2D":_emscripten_glTexSubImage2D,"emscripten_glTexSubImage3D":_emscripten_glTexSubImage3D,"emscripten_glTransformFeedbackVaryings":_emscripten_glTransformFeedbackVaryings,"emscripten_glUniform1f":_emscripten_glUniform1f,"emscripten_glUniform1fv":_emscripten_glUniform1fv,"emscripten_glUniform1i":_emscripten_glUniform1i,"emscripten_glUniform1iv":_emscripten_glUniform1iv,"emscripten_glUniform1ui":_emscripten_glUniform1ui,"emscripten_glUniform1uiv":_emscripten_glUniform1uiv,"emscripten_glUniform2f":_emscripten_glUniform2f,"emscripten_glUniform2fv":_emscripten_glUniform2fv,"emscripten_glUniform2i":_emscripten_glUniform2i,"emscripten_glUniform2iv":_emscripten_glUniform2iv,"emscripten_glUniform2ui":_emscripten_glUniform2ui,"emscripten_glUniform2uiv":_emscripten_glUniform2uiv,"emscripten_glUniform3f":_emscripten_glUniform3f,"emscripten_glUniform3fv":_emscripten_glUniform3fv,"emscripten_glUniform3i":_emscripten_glUniform3i,"emscripten_glUniform3iv":_emscripten_glUniform3iv,"emscripten_glUniform3ui":_emscripten_glUniform3ui,"emscripten_glUniform3uiv":_emscripten_glUniform3uiv,"emscripten_glUniform4f":_emscripten_glUniform4f,"emscripten_glUniform4fv":_emscripten_glUniform4fv,"emscripten_glUniform4i":_emscripten_glUniform4i,"emscripten_glUniform4iv":_emscripten_glUniform4iv,"emscripten_glUniform4ui":_emscripten_glUniform4ui,"emscripten_glUniform4uiv":_emscripten_glUniform4uiv,"emscripten_glUniformBlockBinding":_emscripten_glUniformBlockBinding,"emscripten_glUniformMatrix2fv":_emscripten_glUniformMatrix2fv,"emscripten_glUniformMatrix2x3fv":_emscripten_glUniformMatrix2x3fv,"emscripten_glUniformMatrix2x4fv":_emscripten_glUniformMatrix2x4fv,"emscripten_glUniformMatrix3fv":_emscripten_glUniformMatrix3fv,"emscripten_glUniformMatrix3x2fv":_emscripten_glUniformMatrix3x2fv,"emscripten_glUniformMatrix3x4fv":_emscripten_glUniformMatrix3x4fv,"emscripten_glUniformMatrix4fv":_emscripten_glUniformMatrix4fv,"emscripten_glUniformMatrix4x2fv":_emscripten_glUniformMatrix4x2fv,"emscripten_glUniformMatrix4x3fv":_emscripten_glUniformMatrix4x3fv,"emscripten_glUnmapBuffer":_emscripten_glUnmapBuffer,"emscripten_glUseProgram":_emscripten_glUseProgram,"emscripten_glValidateProgram":_emscripten_glValidateProgram,"emscripten_glVertexAttrib1f":_emscripten_glVertexAttrib1f,"emscripten_glVertexAttrib1fv":_emscripten_glVertexAttrib1fv,"emscripten_glVertexAttrib2f":_emscripten_glVertexAttrib2f,"emscripten_glVertexAttrib2fv":_emscripten_glVertexAttrib2fv,"emscripten_glVertexAttrib3f":_emscripten_glVertexAttrib3f,"emscripten_glVertexAttrib3fv":_emscripten_glVertexAttrib3fv,"emscripten_glVertexAttrib4f":_emscripten_glVertexAttrib4f,"emscripten_glVertexAttrib4fv":_emscripten_glVertexAttrib4fv,"emscripten_glVertexAttribDivisor":_emscripten_glVertexAttribDivisor,"emscripten_glVertexAttribDivisorANGLE":_emscripten_glVertexAttribDivisorANGLE,"emscripten_glVertexAttribDivisorARB":_emscripten_glVertexAttribDivisorARB,"emscripten_glVertexAttribDivisorEXT":_emscripten_glVertexAttribDivisorEXT,"emscripten_glVertexAttribDivisorNV":_emscripten_glVertexAttribDivisorNV,"emscripten_glVertexAttribI4i":_emscripten_glVertexAttribI4i,"emscripten_glVertexAttribI4iv":_emscripten_glVertexAttribI4iv,"emscripten_glVertexAttribI4ui":_emscripten_glVertexAttribI4ui,"emscripten_glVertexAttribI4uiv":_emscripten_glVertexAttribI4uiv,"emscripten_glVertexAttribIPointer":_emscripten_glVertexAttribIPointer,"emscripten_glVertexAttribPointer":_emscripten_glVertexAttribPointer,"emscripten_glViewport":_emscripten_glViewport,"emscripten_glWaitSync":_emscripten_glWaitSync,"emscripten_idb_async_delete":_emscripten_idb_async_delete,"emscripten_idb_async_exists":_emscripten_idb_async_exists,"emscripten_idb_async_load":_emscripten_idb_async_load,"emscripten_idb_async_store":_emscripten_idb_async_store,"emscripten_is_webgl_context_lost":_emscripten_is_webgl_context_lost,"emscripten_log":_emscripten_log,"emscripten_longjmp":_emscripten_longjmp,"emscripten_memcpy_big":_emscripten_memcpy_big,"emscripten_pause_main_loop":_emscripten_pause_main_loop,"emscripten_resize_heap":_emscripten_resize_heap,"emscripten_resume_main_loop":_emscripten_resume_main_loop,"emscripten_set_focus_callback_on_thread":_emscripten_set_focus_callback_on_thread,"emscripten_set_keydown_callback_on_thread":_emscripten_set_keydown_callback_on_thread,"emscripten_set_keyup_callback_on_thread":_emscripten_set_keyup_callback_on_thread,"emscripten_set_main_loop_arg":_emscripten_set_main_loop_arg,"emscripten_set_mousedown_callback_on_thread":_emscripten_set_mousedown_callback_on_thread,"emscripten_set_mousemove_callback_on_thread":_emscripten_set_mousemove_callback_on_thread,"emscripten_set_mouseup_callback_on_thread":_emscripten_set_mouseup_callback_on_thread,"emscripten_set_resize_callback_on_thread":_emscripten_set_resize_callback_on_thread,"emscripten_set_touchcancel_callback_on_thread":_emscripten_set_touchcancel_callback_on_thread,"emscripten_set_touchend_callback_on_thread":_emscripten_set_touchend_callback_on_thread,"emscripten_set_touchmove_callback_on_thread":_emscripten_set_touchmove_callback_on_thread,"emscripten_set_touchstart_callback_on_thread":_emscripten_set_touchstart_callback_on_thread,"emscripten_set_wheel_callback_on_thread":_emscripten_set_wheel_callback_on_thread,"emscripten_sleep":_emscripten_sleep,"emscripten_webgl_create_context":_emscripten_webgl_create_context,"emscripten_webgl_destroy_context":_emscripten_webgl_destroy_context,"emscripten_webgl_init_context_attributes":_emscripten_webgl_init_context_attributes,"emscripten_webgl_make_context_current":_emscripten_webgl_make_context_current,"environ_get":_environ_get,"environ_sizes_get":_environ_sizes_get,"exit":_exit,"fd_close":_fd_close,"fd_fdstat_get":_fd_fdstat_get,"fd_seek":_fd_seek,"fd_sync":_fd_sync,"fd_write":_fd_write,"flock":_flock,"getTempRet0":_getTempRet0,"getpagesize":_getpagesize,"getpwnam":_getpwnam,"gettimeofday":_gettimeofday,"glActiveTexture":_glActiveTexture,"glCompressedTexImage2D":_glCompressedTexImage2D,"glCompressedTexSubImage2D":_glCompressedTexSubImage2D,"glGenerateMipmap":_glGenerateMipmap,"glTexSubImage2D":_glTexSubImage2D,"glViewport":_glViewport,"invoke_fi":invoke_fi,"invoke_ii":invoke_ii,"invoke_iii":invoke_iii,"invoke_iiii":invoke_iiii,"invoke_iiiif":invoke_iiiif,"invoke_iiiii":invoke_iiiii,"invoke_iiiiii":invoke_iiiiii,"invoke_iiiiiii":invoke_iiiiiii,"invoke_iiiiiiif":invoke_iiiiiiif,"invoke_iiiiiiiiii":invoke_iiiiiiiiii,"invoke_iiiiiiiiiii":invoke_iiiiiiiiiii,"invoke_iij":invoke_iij,"invoke_ji":invoke_ji,"invoke_v":invoke_v,"invoke_vi":invoke_vi,"invoke_vidd":invoke_vidd,"invoke_vii":invoke_vii,"invoke_viid":invoke_viid,"invoke_viii":invoke_viii,"invoke_viiif":invoke_viiif,"invoke_viiii":invoke_viiii,"invoke_viiiii":invoke_viiiii,"invoke_viiiiii":invoke_viiiiii,"invoke_viiiiiii":invoke_viiiiiii,"invoke_viiiiiiiii":invoke_viiiiiiiii,"kill":_kill,"localtime":_localtime,"memory":wasmMemory,"mktime":_mktime,"nanosleep":_nanosleep,"pathconf":_pathconf,"round":_round,"saveSetjmp":_saveSetjmp,"setTempRet0":_setTempRet0,"strftime_l":_strftime_l,"system":_system,"table":wasmTable,"testSetjmp":_testSetjmp,"tzset":_tzset};var asm=createWasm();Module["asm"]=asm;var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["__wasm_call_ctors"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["main"]).apply(null,arguments)};var _strlen=Module["_strlen"]=function(){return(_strlen=Module["_strlen"]=Module["asm"]["strlen"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["free"]).apply(null,arguments)};var _strstr=Module["_strstr"]=function(){return(_strstr=Module["_strstr"]=Module["asm"]["strstr"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["malloc"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["__errno_location"]).apply(null,arguments)};var _realloc=Module["_realloc"]=function(){return(_realloc=Module["_realloc"]=Module["asm"]["realloc"]).apply(null,arguments)};var _fflush=Module["_fflush"]=function(){return(_fflush=Module["_fflush"]=Module["asm"]["fflush"]).apply(null,arguments)};var _htonl=Module["_htonl"]=function(){return(_htonl=Module["_htonl"]=Module["asm"]["htonl"]).apply(null,arguments)};var _htons=Module["_htons"]=function(){return(_htons=Module["_htons"]=Module["asm"]["htons"]).apply(null,arguments)};var _ntohs=Module["_ntohs"]=function(){return(_ntohs=Module["_ntohs"]=Module["asm"]["ntohs"]).apply(null,arguments)};var __get_tzname=Module["__get_tzname"]=function(){return(__get_tzname=Module["__get_tzname"]=Module["asm"]["_get_tzname"]).apply(null,arguments)};var __get_daylight=Module["__get_daylight"]=function(){return(__get_daylight=Module["__get_daylight"]=Module["asm"]["_get_daylight"]).apply(null,arguments)};var __get_timezone=Module["__get_timezone"]=function(){return(__get_timezone=Module["__get_timezone"]=Module["asm"]["_get_timezone"]).apply(null,arguments)};var _setThrew=Module["_setThrew"]=function(){return(_setThrew=Module["_setThrew"]=Module["asm"]["setThrew"]).apply(null,arguments)};var __ZSt18uncaught_exceptionv=Module["__ZSt18uncaught_exceptionv"]=function(){return(__ZSt18uncaught_exceptionv=Module["__ZSt18uncaught_exceptionv"]=Module["asm"]["_ZSt18uncaught_exceptionv"]).apply(null,arguments)};var ___getTypeName=Module["___getTypeName"]=function(){return(___getTypeName=Module["___getTypeName"]=Module["asm"]["__getTypeName"]).apply(null,arguments)};var ___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=function(){return(___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=Module["asm"]["__embind_register_native_and_builtin_types"]).apply(null,arguments)};var _emscripten_GetProcAddress=Module["_emscripten_GetProcAddress"]=function(){return(_emscripten_GetProcAddress=Module["_emscripten_GetProcAddress"]=Module["asm"]["emscripten_GetProcAddress"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["memalign"]).apply(null,arguments)};var _emscripten_builtin_free=Module["_emscripten_builtin_free"]=function(){return(_emscripten_builtin_free=Module["_emscripten_builtin_free"]=Module["asm"]["emscripten_builtin_free"]).apply(null,arguments)};var _emscripten_builtin_memalign=Module["_emscripten_builtin_memalign"]=function(){return(_emscripten_builtin_memalign=Module["_emscripten_builtin_memalign"]=Module["asm"]["emscripten_builtin_memalign"]).apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){return(dynCall_v=Module["dynCall_v"]=Module["asm"]["dynCall_v"]).apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){return(dynCall_vi=Module["dynCall_vi"]=Module["asm"]["dynCall_vi"]).apply(null,arguments)};var dynCall_vii=Module["dynCall_vii"]=function(){return(dynCall_vii=Module["dynCall_vii"]=Module["asm"]["dynCall_vii"]).apply(null,arguments)};var dynCall_viii=Module["dynCall_viii"]=function(){return(dynCall_viii=Module["dynCall_viii"]=Module["asm"]["dynCall_viii"]).apply(null,arguments)};var dynCall_viiii=Module["dynCall_viiii"]=function(){return(dynCall_viiii=Module["dynCall_viiii"]=Module["asm"]["dynCall_viiii"]).apply(null,arguments)};var dynCall_viiiii=Module["dynCall_viiiii"]=function(){return(dynCall_viiiii=Module["dynCall_viiiii"]=Module["asm"]["dynCall_viiiii"]).apply(null,arguments)};var dynCall_viiiiii=Module["dynCall_viiiiii"]=function(){return(dynCall_viiiiii=Module["dynCall_viiiiii"]=Module["asm"]["dynCall_viiiiii"]).apply(null,arguments)};var dynCall_viiiiiii=Module["dynCall_viiiiiii"]=function(){return(dynCall_viiiiiii=Module["dynCall_viiiiiii"]=Module["asm"]["dynCall_viiiiiii"]).apply(null,arguments)};var dynCall_viiiiiiiii=Module["dynCall_viiiiiiiii"]=function(){return(dynCall_viiiiiiiii=Module["dynCall_viiiiiiiii"]=Module["asm"]["dynCall_viiiiiiiii"]).apply(null,arguments)};var dynCall_viiif=Module["dynCall_viiif"]=function(){return(dynCall_viiif=Module["dynCall_viiif"]=Module["asm"]["dynCall_viiif"]).apply(null,arguments)};var dynCall_viid=Module["dynCall_viid"]=function(){return(dynCall_viid=Module["dynCall_viid"]=Module["asm"]["dynCall_viid"]).apply(null,arguments)};var dynCall_vidd=Module["dynCall_vidd"]=function(){return(dynCall_vidd=Module["dynCall_vidd"]=Module["asm"]["dynCall_vidd"]).apply(null,arguments)};var dynCall_ii=Module["dynCall_ii"]=function(){return(dynCall_ii=Module["dynCall_ii"]=Module["asm"]["dynCall_ii"]).apply(null,arguments)};var dynCall_iii=Module["dynCall_iii"]=function(){return(dynCall_iii=Module["dynCall_iii"]=Module["asm"]["dynCall_iii"]).apply(null,arguments)};var dynCall_iiii=Module["dynCall_iiii"]=function(){return(dynCall_iiii=Module["dynCall_iiii"]=Module["asm"]["dynCall_iiii"]).apply(null,arguments)};var dynCall_iiiii=Module["dynCall_iiiii"]=function(){return(dynCall_iiiii=Module["dynCall_iiiii"]=Module["asm"]["dynCall_iiiii"]).apply(null,arguments)};var dynCall_iiiiii=Module["dynCall_iiiiii"]=function(){return(dynCall_iiiiii=Module["dynCall_iiiiii"]=Module["asm"]["dynCall_iiiiii"]).apply(null,arguments)};var dynCall_iiiiiii=Module["dynCall_iiiiiii"]=function(){return(dynCall_iiiiiii=Module["dynCall_iiiiiii"]=Module["asm"]["dynCall_iiiiiii"]).apply(null,arguments)};var dynCall_iiiiiiiiii=Module["dynCall_iiiiiiiiii"]=function(){return(dynCall_iiiiiiiiii=Module["dynCall_iiiiiiiiii"]=Module["asm"]["dynCall_iiiiiiiiii"]).apply(null,arguments)};var dynCall_iiiiiiiiiii=Module["dynCall_iiiiiiiiiii"]=function(){return(dynCall_iiiiiiiiiii=Module["dynCall_iiiiiiiiiii"]=Module["asm"]["dynCall_iiiiiiiiiii"]).apply(null,arguments)};var dynCall_iiiiiiif=Module["dynCall_iiiiiiif"]=function(){return(dynCall_iiiiiiif=Module["dynCall_iiiiiiif"]=Module["asm"]["dynCall_iiiiiiif"]).apply(null,arguments)};var dynCall_iiiif=Module["dynCall_iiiif"]=function(){return(dynCall_iiiif=Module["dynCall_iiiif"]=Module["asm"]["dynCall_iiiif"]).apply(null,arguments)};var dynCall_iij=Module["dynCall_iij"]=function(){return(dynCall_iij=Module["dynCall_iij"]=Module["asm"]["dynCall_iij"]).apply(null,arguments)};var dynCall_ji=Module["dynCall_ji"]=function(){return(dynCall_ji=Module["dynCall_ji"]=Module["asm"]["dynCall_ji"]).apply(null,arguments)};var dynCall_fi=Module["dynCall_fi"]=function(){return(dynCall_fi=Module["dynCall_fi"]=Module["asm"]["dynCall_fi"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["stackSave"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["stackAlloc"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["stackRestore"]).apply(null,arguments)};var __growWasmMemory=Module["__growWasmMemory"]=function(){return(__growWasmMemory=Module["__growWasmMemory"]=Module["asm"]["__growWasmMemory"]).apply(null,arguments)};var dynCall_vid=Module["dynCall_vid"]=function(){return(dynCall_vid=Module["dynCall_vid"]=Module["asm"]["dynCall_vid"]).apply(null,arguments)};var dynCall_i=Module["dynCall_i"]=function(){return(dynCall_i=Module["dynCall_i"]=Module["asm"]["dynCall_i"]).apply(null,arguments)};var dynCall_di=Module["dynCall_di"]=function(){return(dynCall_di=Module["dynCall_di"]=Module["asm"]["dynCall_di"]).apply(null,arguments)};var dynCall_iiidi=Module["dynCall_iiidi"]=function(){return(dynCall_iiidi=Module["dynCall_iiidi"]=Module["asm"]["dynCall_iiidi"]).apply(null,arguments)};var dynCall_viddiii=Module["dynCall_viddiii"]=function(){return(dynCall_viddiii=Module["dynCall_viddiii"]=Module["asm"]["dynCall_viddiii"]).apply(null,arguments)};var dynCall_iid=Module["dynCall_iid"]=function(){return(dynCall_iid=Module["dynCall_iid"]=Module["asm"]["dynCall_iid"]).apply(null,arguments)};var dynCall_iiiiiiii=Module["dynCall_iiiiiiii"]=function(){return(dynCall_iiiiiiii=Module["dynCall_iiiiiiii"]=Module["asm"]["dynCall_iiiiiiii"]).apply(null,arguments)};var dynCall_viiiiiiii=Module["dynCall_viiiiiiii"]=function(){return(dynCall_viiiiiiii=Module["dynCall_viiiiiiii"]=Module["asm"]["dynCall_viiiiiiii"]).apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return(dynCall_jiji=Module["dynCall_jiji"]=Module["asm"]["dynCall_jiji"]).apply(null,arguments)};var dynCall_viij=Module["dynCall_viij"]=function(){return(dynCall_viij=Module["dynCall_viij"]=Module["asm"]["dynCall_viij"]).apply(null,arguments)};var dynCall_viiiiiiiiiiii=Module["dynCall_viiiiiiiiiiii"]=function(){return(dynCall_viiiiiiiiiiii=Module["dynCall_viiiiiiiiiiii"]=Module["asm"]["dynCall_viiiiiiiiiiii"]).apply(null,arguments)};var dynCall_jiiii=Module["dynCall_jiiii"]=function(){return(dynCall_jiiii=Module["dynCall_jiiii"]=Module["asm"]["dynCall_jiiii"]).apply(null,arguments)};var dynCall_diiii=Module["dynCall_diiii"]=function(){return(dynCall_diiii=Module["dynCall_diiii"]=Module["asm"]["dynCall_diiii"]).apply(null,arguments)};var dynCall_diiiiiiii=Module["dynCall_diiiiiiii"]=function(){return(dynCall_diiiiiiii=Module["dynCall_diiiiiiii"]=Module["asm"]["dynCall_diiiiiiii"]).apply(null,arguments)};var dynCall_dii=Module["dynCall_dii"]=function(){return(dynCall_dii=Module["dynCall_dii"]=Module["asm"]["dynCall_dii"]).apply(null,arguments)};var dynCall_diii=Module["dynCall_diii"]=function(){return(dynCall_diii=Module["dynCall_diii"]=Module["asm"]["dynCall_diii"]).apply(null,arguments)};var dynCall_fii=Module["dynCall_fii"]=function(){return(dynCall_fii=Module["dynCall_fii"]=Module["asm"]["dynCall_fii"]).apply(null,arguments)};var dynCall_viiiid=Module["dynCall_viiiid"]=function(){return(dynCall_viiiid=Module["dynCall_viiiid"]=Module["asm"]["dynCall_viiiid"]).apply(null,arguments)};var dynCall_vij=Module["dynCall_vij"]=function(){return(dynCall_vij=Module["dynCall_vij"]=Module["asm"]["dynCall_vij"]).apply(null,arguments)};var dynCall_viji=Module["dynCall_viji"]=function(){return(dynCall_viji=Module["dynCall_viji"]=Module["asm"]["dynCall_viji"]).apply(null,arguments)};var dynCall_viijii=Module["dynCall_viijii"]=function(){return(dynCall_viijii=Module["dynCall_viijii"]=Module["asm"]["dynCall_viijii"]).apply(null,arguments)};var dynCall_viiji=Module["dynCall_viiji"]=function(){return(dynCall_viiji=Module["dynCall_viiji"]=Module["asm"]["dynCall_viiji"]).apply(null,arguments)};var dynCall_viiiiiiiiii=Module["dynCall_viiiiiiiiii"]=function(){return(dynCall_viiiiiiiiii=Module["dynCall_viiiiiiiiii"]=Module["asm"]["dynCall_viiiiiiiiii"]).apply(null,arguments)};var dynCall_viiddi=Module["dynCall_viiddi"]=function(){return(dynCall_viiddi=Module["dynCall_viiddi"]=Module["asm"]["dynCall_viiddi"]).apply(null,arguments)};var dynCall_vddddddi=Module["dynCall_vddddddi"]=function(){return(dynCall_vddddddi=Module["dynCall_vddddddi"]=Module["asm"]["dynCall_vddddddi"]).apply(null,arguments)};var dynCall_vddi=Module["dynCall_vddi"]=function(){return(dynCall_vddi=Module["dynCall_vddi"]=Module["asm"]["dynCall_vddi"]).apply(null,arguments)};var dynCall_iiddddi=Module["dynCall_iiddddi"]=function(){return(dynCall_iiddddi=Module["dynCall_iiddddi"]=Module["asm"]["dynCall_iiddddi"]).apply(null,arguments)};var dynCall_viiiiiiiiiii=Module["dynCall_viiiiiiiiiii"]=function(){return(dynCall_viiiiiiiiiii=Module["dynCall_viiiiiiiiiii"]=Module["asm"]["dynCall_viiiiiiiiiii"]).apply(null,arguments)};var dynCall_viiiiiiiiiiiiii=Module["dynCall_viiiiiiiiiiiiii"]=function(){return(dynCall_viiiiiiiiiiiiii=Module["dynCall_viiiiiiiiiiiiii"]=Module["asm"]["dynCall_viiiiiiiiiiiiii"]).apply(null,arguments)};var dynCall_viiiiiiiiiiiii=Module["dynCall_viiiiiiiiiiiii"]=function(){return(dynCall_viiiiiiiiiiiii=Module["dynCall_viiiiiiiiiiiii"]=Module["asm"]["dynCall_viiiiiiiiiiiii"]).apply(null,arguments)};var dynCall_viiiiif=Module["dynCall_viiiiif"]=function(){return(dynCall_viiiiif=Module["dynCall_viiiiif"]=Module["asm"]["dynCall_viiiiif"]).apply(null,arguments)};var dynCall_viiid=Module["dynCall_viiid"]=function(){return(dynCall_viiid=Module["dynCall_viiid"]=Module["asm"]["dynCall_viiid"]).apply(null,arguments)};var dynCall_dd=Module["dynCall_dd"]=function(){return(dynCall_dd=Module["dynCall_dd"]=Module["asm"]["dynCall_dd"]).apply(null,arguments)};var dynCall_did=Module["dynCall_did"]=function(){return(dynCall_did=Module["dynCall_did"]=Module["asm"]["dynCall_did"]).apply(null,arguments)};var dynCall_jiij=Module["dynCall_jiij"]=function(){return(dynCall_jiij=Module["dynCall_jiij"]=Module["asm"]["dynCall_jiij"]).apply(null,arguments)};var dynCall_jij=Module["dynCall_jij"]=function(){return(dynCall_jij=Module["dynCall_jij"]=Module["asm"]["dynCall_jij"]).apply(null,arguments)};var dynCall_iidiiii=Module["dynCall_iidiiii"]=function(){return(dynCall_iidiiii=Module["dynCall_iidiiii"]=Module["asm"]["dynCall_iidiiii"]).apply(null,arguments)};var dynCall_iiiiiiiii=Module["dynCall_iiiiiiiii"]=function(){return(dynCall_iiiiiiiii=Module["dynCall_iiiiiiiii"]=Module["asm"]["dynCall_iiiiiiiii"]).apply(null,arguments)};var dynCall_iiiiij=Module["dynCall_iiiiij"]=function(){return(dynCall_iiiiij=Module["dynCall_iiiiij"]=Module["asm"]["dynCall_iiiiij"]).apply(null,arguments)};var dynCall_iiiiid=Module["dynCall_iiiiid"]=function(){return(dynCall_iiiiid=Module["dynCall_iiiiid"]=Module["asm"]["dynCall_iiiiid"]).apply(null,arguments)};var dynCall_iiiiijj=Module["dynCall_iiiiijj"]=function(){return(dynCall_iiiiijj=Module["dynCall_iiiiijj"]=Module["asm"]["dynCall_iiiiijj"]).apply(null,arguments)};var dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=function(){return(dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=Module["asm"]["dynCall_iiiiiijj"]).apply(null,arguments)};var dynCall_vffff=Module["dynCall_vffff"]=function(){return(dynCall_vffff=Module["dynCall_vffff"]=Module["asm"]["dynCall_vffff"]).apply(null,arguments)};var dynCall_vf=Module["dynCall_vf"]=function(){return(dynCall_vf=Module["dynCall_vf"]=Module["asm"]["dynCall_vf"]).apply(null,arguments)};var dynCall_vff=Module["dynCall_vff"]=function(){return(dynCall_vff=Module["dynCall_vff"]=Module["asm"]["dynCall_vff"]).apply(null,arguments)};var dynCall_vfi=Module["dynCall_vfi"]=function(){return(dynCall_vfi=Module["dynCall_vfi"]=Module["asm"]["dynCall_vfi"]).apply(null,arguments)};var dynCall_viif=Module["dynCall_viif"]=function(){return(dynCall_viif=Module["dynCall_viif"]=Module["asm"]["dynCall_viif"]).apply(null,arguments)};var dynCall_vif=Module["dynCall_vif"]=function(){return(dynCall_vif=Module["dynCall_vif"]=Module["asm"]["dynCall_vif"]).apply(null,arguments)};var dynCall_viff=Module["dynCall_viff"]=function(){return(dynCall_viff=Module["dynCall_viff"]=Module["asm"]["dynCall_viff"]).apply(null,arguments)};var dynCall_vifff=Module["dynCall_vifff"]=function(){return(dynCall_vifff=Module["dynCall_vifff"]=Module["asm"]["dynCall_vifff"]).apply(null,arguments)};var dynCall_viffff=Module["dynCall_viffff"]=function(){return(dynCall_viffff=Module["dynCall_viffff"]=Module["asm"]["dynCall_viffff"]).apply(null,arguments)};var dynCall_viifi=Module["dynCall_viifi"]=function(){return(dynCall_viifi=Module["dynCall_viifi"]=Module["asm"]["dynCall_viifi"]).apply(null,arguments)};function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{dynCall_viiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return dynCall_iii(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_iiiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{dynCall_viii(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_ii(index,a1){var sp=stackSave();try{return dynCall_ii(index,a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return dynCall_iiii(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{dynCall_vii(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{return dynCall_iiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{dynCall_vi(index,a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return dynCall_iiiiiii(index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{dynCall_v(index)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{dynCall_viiiii(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{return dynCall_iiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiif(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return dynCall_iiiiiiif(index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiif(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_iiiif(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vidd(index,a1,a2,a3){var sp=stackSave();try{dynCall_vidd(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiif(index,a1,a2,a3,a4){var sp=stackSave();try{dynCall_viiif(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return dynCall_iiiiii(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{dynCall_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viid(index,a1,a2,a3){var sp=stackSave();try{dynCall_viid(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fi(index,a1){var sp=stackSave();try{return dynCall_fi(index,a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{dynCall_viiiiii(index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{dynCall_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_ji(index,a1){var sp=stackSave();try{return dynCall_ji(index,a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iij(index,a1,a2,a3){var sp=stackSave();try{return dynCall_iij(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}Module["asm"]=asm;Module["UTF16ToString"]=UTF16ToString;Module["stringToUTF16"]=stringToUTF16;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_main"];args=args||[];var argc=args.length+1;var argv=stackAlloc((argc+1)*4);HEAP32[argv>>2]=allocateUTF8OnStack(thisProgram);for(var i=1;i>2)+i]=allocateUTF8OnStack(args[i-1])}HEAP32[(argv>>2)+argc]=0;try{var ret=entryFunction(argc,argv);exit(ret,true)}catch(e){if(e instanceof ExitStatus){return}else if(e=="unwind"){noExitRuntime=true;return}else{var toLog=e;if(e&&typeof e==="object"&&e.stack){toLog=[e,e.stack]}err("exception thrown: "+toLog);quit_(1,e)}}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){if(implicit&&noExitRuntime&&status===0){return}if(noExitRuntime){}else{ABORT=true;EXITSTATUS=status;exitRuntime();if(Module["onExit"])Module["onExit"](status)}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;run(); diff --git a/web/examples.wasm b/web/examples.wasm new file mode 100644 index 0000000..c13ca01 Binary files /dev/null and b/web/examples.wasm differ diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..bfe5f5d --- /dev/null +++ b/web/index.html @@ -0,0 +1,72 @@ + + + + + + + + + + Qt自定义控件大全V2021(QQ:517216493 WX: feiyangqingyun) + + + +
+
+ + Qt for WebAssembly: examples +
+ +
+
+ + + + + + diff --git a/web/qtloader.js b/web/qtloader.js new file mode 100644 index 0000000..ef4a6ec --- /dev/null +++ b/web/qtloader.js @@ -0,0 +1,577 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// QtLoader provides javascript API for managing Qt application modules. +// +// QtLoader provides API on top of Emscripten which supports common lifecycle +// tasks such as displaying placeholder content while the module downloads, +// handing application exits, and checking for browser wasm support. +// +// There are two usage modes: +// * Managed: QtLoader owns and manages the HTML display elements like +// the loader and canvas. +// * External: The embedding HTML page owns the display elements. QtLoader +// provides event callbacks which the page reacts to. +// +// Managed mode usage: +// +// var config = { +// containerElements : [$("container-id")]; +// } +// var qtLoader = QtLoader(config); +// qtLoader.loadEmscriptenModule("applicationName"); +// +// External mode.usage: +// +// var config = { +// canvasElements : [$("canvas-id")], +// showLoader: function() { +// loader.style.display = 'block' +// canvas.style.display = 'hidden' +// }, +// showCanvas: function() { +// loader.style.display = 'hidden' +// canvas.style.display = 'block' +// return canvas; +// } +// } +// var qtLoader = QtLoader(config); +// qtLoader.loadEmscriptenModule("applicationName"); +// +// Config keys +// +// containerElements : [container-element, ...] +// One or more HTML elements. QtLoader will display loader elements +// on these while loading the applicaton, and replace the loader with a +// canvas on load complete. +// canvasElements : [canvas-element, ...] +// One or more canvas elements. +// showLoader : function(status, containerElement) +// Optional loading element constructor function. Implement to create +// a custom loading screen. This function may be called multiple times, +// while preparing the application binary. "status" is a string +// containing the loading sub-status, and may be either "Downloading", +// or "Compiling". The browser may be using streaming compilation, in +// which case the wasm module is compiled during downloading and the +// there is no separate compile step. +// showCanvas : function(containerElement) +// Optional canvas constructor function. Implement to create custom +// canvas elements. +// showExit : function(crashed, exitCode, containerElement) +// Optional exited element constructor function. +// showError : function(crashed, exitCode, containerElement) +// Optional error element constructor function. +// +// path : +// Prefix path for wasm file, realative to the loading HMTL file. +// restartMode : "DoNotRestart", "RestartOnExit", "RestartOnCrash" +// Controls whether the application should be reloaded on exits. The default is "DoNotRestart" +// restartType : "RestartModule", "ReloadPage" +// restartLimit : +// Restart attempts limit. The default is 10. +// stdoutEnabled : +// stderrEnabled : +// environment : +// key-value environment variable pairs. +// +// QtLoader object API +// +// webAssemblySupported : bool +// webGLSupported : bool +// canLoadQt : bool +// Reports if WebAssembly and WebGL are supported. These are requirements for +// running Qt applications. +// loadEmscriptenModule(applicationName) +// Loads the application from the given emscripten javascript module file and wasm file +// status +// One of "Created", "Loading", "Running", "Exited". +// crashed +// Set to true if there was an unclean exit. +// exitCode +// main()/emscripten_force_exit() return code. Valid on status change to +// "Exited", iff crashed is false. +// exitText +// Abort/exit message. +// addCanvasElement +// Add canvas at run-time. Adds a corresponding QScreen, +// removeCanvasElement +// Remove canvas at run-time. Removes the corresponding QScreen. +// resizeCanvasElement +// Signals to the application that a canvas has been resized. +// setFontDpi +// Sets the logical font dpi for the application. + + +var Module = {} + +function QtLoader(config) +{ + function webAssemblySupported() { + return typeof WebAssembly !== "undefined" + } + + function webGLSupported() { + // We expect that WebGL is supported if WebAssembly is; however + // the GPU may be blacklisted. + try { + var canvas = document.createElement("canvas"); + return !!(window.WebGLRenderingContext && (canvas.getContext("webgl") || canvas.getContext("experimental-webgl"))); + } catch (e) { + return false; + } + } + + function canLoadQt() { + // The current Qt implementation requires WebAssembly (asm.js is not in use), + // and also WebGL (there is no raster fallback). + return webAssemblySupported() && webGLSupported(); + } + + function removeChildren(element) { + while (element.firstChild) element.removeChild(element.firstChild); + } + + function createCanvas() { + var canvas = document.createElement("canvas"); + canvas.className = "QtCanvas"; + canvas.style.height = "100%"; + canvas.style.width = "100%"; + + // Set contentEditable in order to enable clipboard events; hide the resulting focus frame. + canvas.contentEditable = true; + canvas.style.outline = "0px solid transparent"; + canvas.style.caretColor = "transparent"; + canvas.style.cursor = "default"; + + return canvas; + } + + // Set default state handler functions and create canvases if needed + if (config.containerElements !== undefined) { + + config.canvasElements = config.containerElements.map(createCanvas); + + config.showError = config.showError || function(errorText, container) { + removeChildren(container); + var errorTextElement = document.createElement("text"); + errorTextElement.className = "QtError" + errorTextElement.innerHTML = errorText; + return errorTextElement; + } + + config.showLoader = config.showLoader || function(loadingState, container) { + removeChildren(container); + var loadingText = document.createElement("text"); + loadingText.className = "QtLoading" + loadingText.innerHTML = '

${loadingState}...

'; + return loadingText; + }; + + config.showCanvas = config.showCanvas || function(canvas, container) { + removeChildren(container); + } + + config.showExit = config.showExit || function(crashed, exitCode, container) { + if (!crashed) + return undefined; + + removeChildren(container); + var fontSize = 54; + var crashSymbols = ["\u{1F615}", "\u{1F614}", "\u{1F644}", "\u{1F928}", "\u{1F62C}", + "\u{1F915}", "\u{2639}", "\u{1F62E}", "\u{1F61E}", "\u{1F633}"]; + var symbolIndex = Math.floor(Math.random() * crashSymbols.length); + var errorHtml = ` ${crashSymbols[symbolIndex]} ` + var errorElement = document.createElement("text"); + errorElement.className = "QtExit" + errorElement.innerHTML = errorHtml; + return errorElement; + } + } + + config.restartMode = config.restartMode || "DoNotRestart"; + config.restartLimit = config.restartLimit || 10; + + if (config.stdoutEnabled === undefined) config.stdoutEnabled = true; + if (config.stderrEnabled === undefined) config.stderrEnabled = true; + + // Make sure config.path is defined and ends with "/" if needed + if (config.path === undefined) + config.path = ""; + if (config.path.length > 0 && !config.path.endsWith("/")) + config.path = config.path.concat("/"); + + if (config.environment === undefined) + config.environment = {}; + + var publicAPI = {}; + publicAPI.webAssemblySupported = webAssemblySupported(); + publicAPI.webGLSupported = webGLSupported(); + publicAPI.canLoadQt = canLoadQt(); + publicAPI.canLoadApplication = canLoadQt(); + publicAPI.status = undefined; + publicAPI.loadEmscriptenModule = loadEmscriptenModule; + publicAPI.addCanvasElement = addCanvasElement; + publicAPI.removeCanvasElement = removeCanvasElement; + publicAPI.resizeCanvasElement = resizeCanvasElement; + publicAPI.setFontDpi = setFontDpi; + publicAPI.fontDpi = fontDpi; + + restartCount = 0; + + function fetchResource(filePath) { + var fullPath = config.path + filePath; + return fetch(fullPath).then(function(response) { + if (!response.ok) { + self.error = response.status + " " + response.statusText + " " + response.url; + setStatus("Error"); + return Promise.reject(self.error) + } else { + return response; + } + }); + } + + function fetchText(filePath) { + return fetchResource(filePath).then(function(response) { + return response.text(); + }); + } + + function fetchThenCompileWasm(response) { + return response.arrayBuffer().then(function(data) { + self.loaderSubState = "Compiling"; + setStatus("Loading") // trigger loaderSubState udpate + return WebAssembly.compile(data); + }); + } + + function fetchCompileWasm(filePath) { + return fetchResource(filePath).then(function(response) { + if (typeof WebAssembly.compileStreaming !== "undefined") { + self.loaderSubState = "Downloading/Compiling"; + setStatus("Loading"); + return WebAssembly.compileStreaming(response).catch(function(error) { + // compileStreaming may/will fail if the server does not set the correct + // mime type (application/wasm) for the wasm file. Fall back to fetch, + // then compile in this case. + return fetchThenCompileWasm(response); + }); + } else { + // Fall back to fetch, then compile if compileStreaming is not supported + return fetchThenCompileWasm(response); + } + }); + } + + function loadEmscriptenModule(applicationName) { + + // Loading in qtloader.js goes through four steps: + // 1) Check prerequisites + // 2) Download resources + // 3) Configure the emscripten Module object + // 4) Start the emcripten runtime, after which emscripten takes over + + // Check for Wasm & WebGL support; set error and return before downloading resources if missing + if (!webAssemblySupported()) { + self.error = "Error: WebAssembly is not supported" + setStatus("Error"); + return; + } + if (!webGLSupported()) { + self.error = "Error: WebGL is not supported" + setStatus("Error"); + return; + } + + // Continue waiting if loadEmscriptenModule() is called again + if (publicAPI.status == "Loading") + return; + self.loaderSubState = "Downloading"; + setStatus("Loading"); + + // Fetch emscripten generated javascript runtime + var emscriptenModuleSource = undefined + var emscriptenModuleSourcePromise = fetchText(applicationName + ".js").then(function(source) { + emscriptenModuleSource = source + }); + + // Fetch and compile wasm module + var wasmModule = undefined; + var wasmModulePromise = fetchCompileWasm(applicationName + ".wasm").then(function (module) { + wasmModule = module; + }); + + // Wait for all resources ready + Promise.all([emscriptenModuleSourcePromise, wasmModulePromise]).then(function(){ + completeLoadEmscriptenModule(applicationName, emscriptenModuleSource, wasmModule); + }).catch(function(error) { + self.error = error; + setStatus("Error"); + }); + } + + function completeLoadEmscriptenModule(applicationName, emscriptenModuleSource, wasmModule) { + + // The wasm binary has been compiled into a module during resource download, + // and is ready to be instantiated. Define the instantiateWasm callback which + // emscripten will call to create the instance. + Module.instantiateWasm = function(imports, successCallback) { + WebAssembly.instantiate(wasmModule, imports).then(function(instance) { + successCallback(instance, wasmModule); + }, function(error) { + self.error = error; + setStatus("Error"); + }); + return {}; + }; + + Module.locateFile = Module.locateFile || function(filename) { + return config.path + filename; + }; + + // Attach status callbacks + Module.setStatus = Module.setStatus || function(text) { + // Currently the only usable status update from this function + // is "Running..." + if (text.startsWith("Running")) + setStatus("Running"); + }; + Module.monitorRunDependencies = Module.monitorRunDependencies || function(left) { + // console.log("monitorRunDependencies " + left) + }; + + // Attach standard out/err callbacks. + Module.print = Module.print || function(text) { + if (config.stdoutEnabled) + console.log(text) + }; + Module.printErr = Module.printErr || function(text) { + // Filter out OpenGL getProcAddress warnings. Qt tries to resolve + // all possible function/extension names at startup which causes + // emscripten to spam the console log with warnings. + if (text.startsWith !== undefined && text.startsWith("bad name in getProcAddress:")) + return; + + if (config.stderrEnabled) + console.log(text) + }; + + // Error handling: set status to "Exited", update crashed and + // exitCode according to exit type. + // Emscripten will typically call printErr with the error text + // as well. Note that emscripten may also throw exceptions from + // async callbacks. These should be handled in window.onerror by user code. + Module.onAbort = Module.onAbort || function(text) { + publicAPI.crashed = true; + publicAPI.exitText = text; + setStatus("Exited"); + }; + Module.quit = Module.quit || function(code, exception) { + if (exception.name == "ExitStatus") { + // Clean exit with code + publicAPI.exitText = undefined + publicAPI.exitCode = code; + } else { + publicAPI.exitText = exception.toString(); + publicAPI.crashed = true; + } + setStatus("Exited"); + }; + + // Set environment variables + Module.preRun = Module.preRun || [] + Module.preRun.push(function() { + for (var [key, value] of Object.entries(config.environment)) { + ENV[key.toUpperCase()] = value; + } + }); + + Module.mainScriptUrlOrBlob = new Blob([emscriptenModuleSource], {type: 'text/javascript'}); + + Module.qtCanvasElements = config.canvasElements; + + config.restart = function() { + + // Restart by reloading the page. This will wipe all state which means + // reload loops can't be prevented. + if (config.restartType == "ReloadPage") { + location.reload(); + } + + // Restart by readling the emscripten app module. + ++self.restartCount; + if (self.restartCount > config.restartLimit) { + self.error = "Error: This application has crashed too many times and has been disabled. Reload the page to try again." + setStatus("Error"); + return; + } + loadEmscriptenModule(applicationName); + }; + + publicAPI.exitCode = undefined; + publicAPI.exitText = undefined; + publicAPI.crashed = false; + + // Finally evaluate the emscripten application script, which will + // reference the global Module object created above. + self.eval(emscriptenModuleSource); // ES5 indirect global scope eval + } + + function setErrorContent() { + if (config.containerElements === undefined) { + if (config.showError !== undefined) + config.showError(self.error); + return; + } + + for (container of config.containerElements) { + var errorElement = config.showError(self.error, container); + container.appendChild(errorElement); + } + } + + function setLoaderContent() { + if (config.containerElements === undefined) { + if (config.showLoader !== undefined) + config.showLoader(self.loaderSubState); + return; + } + + for (container of config.containerElements) { + var loaderElement = config.showLoader(self.loaderSubState, container); + container.appendChild(loaderElement); + } + } + + function setCanvasContent() { + if (config.containerElements === undefined) { + if (config.showCanvas !== undefined) + config.showCanvas(); + return; + } + + for (var i = 0; i < config.containerElements.length; ++i) { + var container = config.containerElements[i]; + var canvas = config.canvasElements[i]; + config.showCanvas(canvas, container); + container.appendChild(canvas); + } + } + + function setExitContent() { + + // publicAPI.crashed = true; + + if (publicAPI.status != "Exited") + return; + + if (config.containerElements === undefined) { + if (config.showExit !== undefined) + config.showExit(publicAPI.crashed, publicAPI.exitCode); + return; + } + + if (!publicAPI.crashed) + return; + + for (container of config.containerElements) { + var loaderElement = config.showExit(publicAPI.crashed, publicAPI.exitCode, container); + if (loaderElement !== undefined) + container.appendChild(loaderElement); + } + } + + var committedStatus = undefined; + function handleStatusChange() { + if (publicAPI.status != "Loading" && committedStatus == publicAPI.status) + return; + committedStatus = publicAPI.status; + + if (publicAPI.status == "Error") { + setErrorContent(); + } else if (publicAPI.status == "Loading") { + setLoaderContent(); + } else if (publicAPI.status == "Running") { + setCanvasContent(); + } else if (publicAPI.status == "Exited") { + if (config.restartMode == "RestartOnExit" || + config.restartMode == "RestartOnCrash" && publicAPI.crashed) { + committedStatus = undefined; + config.restart(); + } else { + setExitContent(); + } + } + + // Send status change notification + if (config.statusChanged) + config.statusChanged(publicAPI.status); + } + + function setStatus(status) { + if (status != "Loading" && publicAPI.status == status) + return; + publicAPI.status = status; + + window.setTimeout(function() { handleStatusChange(); }, 0); + } + + function addCanvasElement(element) { + if (publicAPI.status == "Running") + Module.qtAddCanvasElement(element); + else + console.log("Error: addCanvasElement can only be called in the Running state"); + } + + function removeCanvasElement(element) { + if (publicAPI.status == "Running") + Module.qtRemoveCanvasElement(element); + else + console.log("Error: removeCanvasElement can only be called in the Running state"); + } + + function resizeCanvasElement(element) { + if (publicAPI.status == "Running") + Module.qtResizeCanvasElement(element); + } + + function setFontDpi(dpi) { + Module.qtFontDpi = dpi; + if (publicAPI.status == "Running") + Module.qtSetFontDpi(dpi); + } + + function fontDpi() { + return Module.qtFontDpi; + } + + setStatus("Created"); + + return publicAPI; +} diff --git a/web/qtlogo.svg b/web/qtlogo.svg new file mode 100644 index 0000000..ad7c777 --- /dev/null +++ b/web/qtlogo.svg @@ -0,0 +1,40 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/websnap/snap_android.jpg b/websnap/snap_android.jpg new file mode 100644 index 0000000..7c6f202 Binary files /dev/null and b/websnap/snap_android.jpg differ diff --git a/websnap/snap_chrom1.jpg b/websnap/snap_chrom1.jpg new file mode 100644 index 0000000..666d236 Binary files /dev/null and b/websnap/snap_chrom1.jpg differ diff --git a/websnap/snap_chrom2.jpg b/websnap/snap_chrom2.jpg new file mode 100644 index 0000000..19f0a26 Binary files /dev/null and b/websnap/snap_chrom2.jpg differ diff --git a/websnap/snap_edge1.jpg b/websnap/snap_edge1.jpg new file mode 100644 index 0000000..524cb2d Binary files /dev/null and b/websnap/snap_edge1.jpg differ diff --git a/websnap/snap_edge2.jpg b/websnap/snap_edge2.jpg new file mode 100644 index 0000000..22d405f Binary files /dev/null and b/websnap/snap_edge2.jpg differ diff --git a/websnap/snap_firefox1.jpg b/websnap/snap_firefox1.jpg new file mode 100644 index 0000000..bccd892 Binary files /dev/null and b/websnap/snap_firefox1.jpg differ diff --git a/websnap/snap_uidemo24.jpg b/websnap/snap_uidemo24.jpg new file mode 100644 index 0000000..971d424 Binary files /dev/null and b/websnap/snap_uidemo24.jpg differ diff --git a/websnap/snap_uidemo25.jpg b/websnap/snap_uidemo25.jpg new file mode 100644 index 0000000..ab0e527 Binary files /dev/null and b/websnap/snap_uidemo25.jpg differ diff --git a/websnap/snap_uidemo26.jpg b/websnap/snap_uidemo26.jpg new file mode 100644 index 0000000..17f7090 Binary files /dev/null and b/websnap/snap_uidemo26.jpg differ diff --git a/zhtopy/zhtopy.h b/zhtopy/zhtopy.h index 0625a79..45a138a 100644 --- a/zhtopy/zhtopy.h +++ b/zhtopy/zhtopy.h @@ -3,22 +3,16 @@ /** * 汉字转拼音类 作者:feiyangqingyun(QQ:517216493) 2019-2-16 - * 1:汉字转拼音 - * 2:汉字转拼音简拼 - * 3:汉字转拼音首字母 + * 1. 汉字转拼音 + * 2. 汉字转拼音简拼 + * 3. 汉字转拼音首字母 */ #include #include #ifdef quc -#if (QT_VERSION < QT_VERSION_CHECK(5,7,0)) -#include -#else -#include -#endif - -class QDESIGNER_WIDGET_EXPORT ZhToPY : public QObject +class Q_DECL_EXPORT ZhToPY : public QObject #else class ZhToPY : public QObject #endif