Esempio n. 1
0
PraxisDlg::PraxisDlg(QString sCourseId, int iScore, QWidget *parent, QObject *pCourseObj) :
    QDialog(parent),ready(false),
    ui(new Ui::PraxisDlg),_menuBtn(178, 6),_b(true),
    _total(0),
    _score(iScore)
{
    ui->setupUi(this);
    this->setWindowFlags(Qt::FramelessWindowHint);
    this->move(0, 0);
    this->setStyleSheet("QDialog{border-image:url(:/images/PraxisDlg/back.png);}");
    this->setObjectName("课程习题");
    _sCourseId = sCourseId;
    _pCourseObj = pCourseObj;

    int nX[7] = {21,21,21,628,628,628,628};
    int nY[7] = {180,313,446,38,180,313,446};
    for(int i=0; i<7; ++i)
    {
        Praxis *p = new Praxis(this);
        p->move(nX[i], nY[i]);
        _vecPraxis.push_back(p);
    }

    //关闭按钮
    ui->_pCloseBtn->setStyleSheet("QPushButton{border-image:url(:/images/SyllabusBasicDlg/close.png);}");
    //提交按钮
    // 修改为使用objectname 来控制按钮样式: 20151103
//    ui->_pSbumitBtn->setStyleSheet("QPushButton{border-image: url(:/images/PraxisDlg/submit.png);}");
    //按钮栏
    _menuBtn.setParent(ui->_pMenuBtnParentWidget);
    connect(this, SIGNAL(SetLookToPage(int)), &_menuBtn, SLOT(GetLookToPage(int)));
    _menuBtn.SetUrl("http://120.55.119.93/course/index.php?m=Api&c=Question&a=questionList&page=%1&rows=7&course_id=%2");
    //下边按钮栏的背景样式
    ui->_pMenuBtnParentWidget->setStyleSheet("QWidget{border-image: url(:/images/MenuBtnBack.png);}");

    //下方样式
    ui->_pBottomLab->setStyleSheet("QLabel{color:white;font-size:14px;font-weight:500;border-image:url(:/images/bottom.png);}");
    ui->_pBottomLab->move(0, this->height()-35);
    //修改
    mark=false;
    isLeftPressDown = false;
    this->dir = NONE;
    this->setMouseTracking(true);

    _timer = new QTimer;
    connect(_timer, SIGNAL(timeout()), this, SLOT(sTimeout()));
    _lblGif = new QLabel(this);
    _lblGif->setWindowFlags(Qt::FramelessWindowHint);

    // 如果超过90分,则无法点击提交:设置提交按钮状态
    if (_score >= 90)
    {
        ui->_pSbumitBtn->setEnabled(false);
        ui->_pSbumitBtn->setObjectName("submit_disable");
        // 加载用户分数

    }
    else
        ui->_pSbumitBtn->setObjectName("submit");
}
Esempio n. 2
0
OrderDownload::OrderDownload(QObject *parent) : QObject(parent),
    _optType(OTNone)
{
    _timer = new QTimer;
    connect(_timer, SIGNAL(timeout()), this, SLOT(sTimeout()));

    _manager = new QNetworkAccessManager;
    connect(_manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(sReplyFinished(QNetworkReply*)));
}
Esempio n. 3
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    _synchronizeType(STNone),
    _currentLocalId(-1)
{
    ui->setupUi(this);

    qsrand(time(NULL));

    _manager = new QNetworkAccessManager;
    connect(_manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(sReplyFinished(QNetworkReply*)));

    _timer = new QTimer;
    connect(_timer, SIGNAL(timeout()), this, SLOT(sTimeout()));

    g_paramsMap["appid"] = g_config.kjtAppid();
    g_paramsMap["version"] = g_config.kjtVersion();               // 由接口提供方指定的接口版本
    g_paramsMap["format"] = g_config.kjtFormat();               // 接口返回结果类型:json

//    _orderCreateKJTToERP = new OrderCreateKJTToERP();
//    connect(_orderCreateKJTToERP, SIGNAL(finished(bool,QString)), this, SLOT(sOrderCreateKJTToERPFinished(bool, QString)));

    _orderUpload = new OrderUpload;
    connect(_orderUpload, SIGNAL(finished(bool,QString)), this, SLOT(sOrderUploadFinished(bool, QString)));

    _orderDownload = new OrderDownload;
    connect(_orderDownload, SIGNAL(finished(bool,QString)), this, SLOT(sOrderDownloadFinished(bool, QString)));

    _productUpload = new ProductUpload;
    connect(_productUpload, SIGNAL(finished(bool,QString)), this, SLOT(sProductUploadFinished(bool, QString)));

    _productDownload = new ProductDownload;
    connect(_productDownload, SIGNAL(finished(bool,QString)), this, SLOT(sProductDownloadFinished(bool, QString)));

    connect(ui->pbnStart, SIGNAL(clicked(bool)), this, SLOT(sStart()));
    connect(ui->btnDownloadProduct, SIGNAL(clicked(bool)), this, SLOT(sDownloadProduct()));
    connect(ui->btnDownloadProductPrice, SIGNAL(clicked(bool)), this, SLOT(sDownloadProductPrice()));

    ui->pushButton->hide();
    ui->pushButton_2->hide();
    ui->pushButton_3->hide();
    ui->dateTimeEdit->hide();
    ui->dateTimeEdit_2->hide();

    ui->pushButton_6->hide();
    ui->pushButton_4->hide();
    ui->pushButton_7->hide();
    ui->btnDownloadProduct->hide();
    ui->btnDownloadProductPrice->hide();
#ifndef QT_NO_DEBUG
#else
    ui->pushButton_5->hide();
    ui->pushButton_8->hide();
#endif
}
Esempio n. 4
0
  /**
  Read, extract data from a trigger command and save the trigger
  @param[in] cmd cfBase object
  @param[in] CmdID Not used here
  @param[in,out] data The trigger to add or modify
  */
bool cTriggerConsole::ReadDataFromCmd(cfBase *cmd, int CmdID, cTrigger &data)
{
	cTrigger tmp = data;

	enum {
		eADD_ALL, eADD_CMD, eADD_CHOICE,
		eADD_DEFp, eADD_QUOTE, eADD_DEF,
		eADD_DESCp, eADD_QUOTE2, eADD_DESC,
		eADD_FLAGSp, eADD_FLAGS,
		eADD_NICKp, eADD_NICK,
		eADD_CLASSp, eADD_CLASS,
		eADD_CLASSXp, eADD_CLASSX,
		eADD_TIMEOUTp, eADD_TIMEOUT
	};

	cmd->GetParStr(eADD_CMD, tmp.mCommand);
	cmd->GetParUnEscapeStr(eADD_DEF, tmp.mDefinition);
	cmd->GetParStr(eADD_DESC, tmp.mDescription);
	cmd->GetParStr(eADD_NICK, tmp.mSendAs); // empty = hub security
	cmd->GetParInt(eADD_FLAGS, tmp.mFlags);
	cmd->GetParInt(eADD_CLASS, tmp.mMinClass);
	cmd->GetParInt(eADD_CLASSX, tmp.mMaxClass);
	string sTimeout("0");
	cmd->GetParStr(eADD_TIMEOUT, sTimeout);
	tmp.mSeconds = mOwner->mServer->Str2Period(sTimeout, *cmd->mOS);

	bool checkDefinition = !(tmp.mFlags & eTF_DB);

	if (CmdID == eLC_ADD && checkDefinition && !CheckData(cmd, tmp)) {
		return false;
	} else if (CmdID == eLC_MOD && !data.mCommand.empty() && checkDefinition && !CheckData(cmd, tmp)) {
		return false;
	}

	data = tmp;
	return true;
}