MPhysics2DPanningPrivate::MPhysics2DPanningPrivate(MPhysics2DPanning *publicObject) : enabled(true), range(QRectF(0.0, 0.0, 0.0, 0.0)), posX(0.0), posY(0.0), velX(0.0), velY(0.0), pointerSpringX(0.0), pointerSpringY(0.0), sceneLastPos(QPointF()), maxVel(0.0), panningAnimation(new PanningAnimation), pointerPressed(false), pointerSpringK(0.0), frictionC(0.0), slideFrictionC(0.0), borderSpringK(0.0), borderFrictionC(0.0), panDirection(0), integrationStepTimer(QElapsedTimer()), integrationStepDeltaTime(0.0f), boundsBehavior(MPhysics2DPanning::DragAndOvershootBounds), q_ptr(publicObject) { integrationStepTimer.invalidate(); }
void QHostInfoCache::put(const QString &name, const QHostInfo &info) { // if the lookup failed, don't cache if (info.error() != QHostInfo::NoError) return; QHostInfoCacheElement* element = new QHostInfoCacheElement(); element->info = info; element->age = QElapsedTimer(); element->age.start(); QMutexLocker locker(&this->mutex); cache.insert(name, element); // cache will take ownership }
Download::Download(QObject *parent) : QObject(parent), m_redirectedUrl(QUrl()), m_destinationFolder(QString()), m_fileName(QString()), m_fileSize(-1), m_bytesDownloaded(-1), m_package("package", this), m_enabled(true), m_extracting(false), m_speed(0), m_weightedSpeed(0), m_speedTimer(QElapsedTimer()), m_bytesProcessedAtLastSpeedMeasurement(-1) { }
#include "global.h" int Global::playerNum=0,Global::problemNum=0,Global::sumScore=0; vector<Player> Global::players=vector<Player>(); vector<Problem> Global::problems=vector<Problem>(); QList<int> Global::problemOrder=QList<int>(); QString Global::testPath="",Global::srcPath="",Global::dataPath="",Global::resultPath="",Global::testName=""; bool Global::alreadyJudging=false,Global::isListUsed=false; Qt::SortOrder Global::preSortOrder=Qt::AscendingOrder; QFont Global::font=QFont("微软雅黑",9),Global::boldFont=QFont("微软雅黑",9,75); QElapsedTimer Global::clickTimer=QElapsedTimer(); QList<pair<int,int>> Global::judgeList=QList<pair<int,int>>(); QString Global::labelStyle1[]= { "QLabel" "{" " color:rgba(0,0,0,128);" " background:rgba(235,29,0,192);" "}", //0 1~9 "QLabel" "{" " color:rgba(0,0,0,128);" " background:rgba(226,58,0,192);" "}", //1 10~19 "QLabel" "{" " color:rgba(0,0,0,128);" " background:rgba(217,87,0,192);" "}", //2 20~29 "QLabel"
{ Q_UNUSED(event); if (isExposed()) renderNow(); } void MainWindow::resizeEvent(QResizeEvent *event) { Q_UNUSED(event); if (isExposed()) renderNow(); } static QElapsedTimer timer = QElapsedTimer(); void MainWindow::renderNow() { if (!isExposed()) return; updatePending = false; bool needsInitialize = false; if (!context) { context = new QOpenGLContext(this); context->setFormat(requestedFormat()); context->create();