本文整理汇总了C++中QDate::currentDate方法的典型用法代码示例。如果您正苦于以下问题:C++ QDate::currentDate方法的具体用法?C++ QDate::currentDate怎么用?C++ QDate::currentDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDate
的用法示例。
在下文中一共展示了QDate::currentDate方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveToFile
void TMSIImpedanceWidget::saveToFile()
{
// Open file dialog
QDate date;
QString fileName = QFileDialog::getSaveFileName(this,
"Save impedance values",
QString("%1/%2_%3_%4_Impedances").arg(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)).arg(date.currentDate().year()).arg(date.currentDate().month()).arg(date.currentDate().day()),
tr("Text file (*.txt)"));
ofstream outputFileStream;
outputFileStream.open(fileName.toStdString(), ios::trunc); //ios::trunc deletes old file data
QList<QGraphicsItem *> itemList = m_qGScene->items();
// Convert to QList with TMSIElectrodeItem's
QList<TMSIElectrodeItem *> itemListNew;
for(int i = 0; i<itemList.size(); i++)
itemListNew.append((TMSIElectrodeItem *)itemList.at(i));
// Sort list corresponding to the channelIndex
sort(itemListNew.begin(), itemListNew.end(), compareChannelIndex);
// Update position
for(int i = 0; i<itemListNew.size(); i++)
{
TMSIElectrodeItem *item = itemListNew.at(i);
outputFileStream << i << " " << item->getElectrodeName().toStdString() << " " << item->getImpedanceValue() << endl;
}
outputFileStream.close();
}
示例2: VaciarCampos
void frmClientes::VaciarCampos() {
QDate dFecha;
ui->txtcCodigoCliente->setText("");
ui->txtPrimerApellido->setText("");
ui->txtSegundoApellido->setText("");
ui->txtcNombre->setText("");
ui->txtcNombreFiscal->setText("");
ui->txtcNombreComercial->setText("");
ui->txtcPersonaContacto->setText("");
ui->txtcCifNif->setText("");
ui->txtcDireccion1->setText("");
ui->txtcDireccion2->setText("");
ui->txtcPoblacion->setText("");
ui->txtcProvincia->setText("");
ui->txtcPais->setText("");
ui->txtcTelefono1->setText("");
ui->txtcTelefono2->setText("");
ui->txtcFax->setText("");
ui->txtcMovil->setText("");
ui->txtcEMail->setText("");
ui->txtcWeb->setText("");
ui->txtcDireccionFactura1->setText("");
ui->txtcDireccionFactura2->setText("");
ui->txtcCPFactura->setText("");
ui->txtcPoblacionFactura->setText("");
ui->txtcProvinciaFactura->setText("");
ui->txtcPaisFactura->setText("");
ui->txtcDireccionAlmacen1->setText("");
ui->txtcDireccionAlmacen2->setText("");
ui->txtcCpPoblacionAlmacen->setText("");
ui->txtcPoblacionAlmacen->setText("");
ui->txtcProvinciaAlmacen->setText("");
ui->txtcPaisAlmacen->setText("");
ui->txtdFechaAlta->setDate(dFecha.currentDate());
ui->txtdFechaUltimaCompra->setDate(dFecha.currentDate());
ui->txtrImporteAcumulado->setText("");
ui->txtrVentasEjercicio->setText("");
ui->txtrRiesgoPermitido->setText("");
ui->txtrDeudaActual->setText("");
ui->txttComentarios->setText("");
ui->chklBloqueoCliente->setChecked(false);
ui->txttComentarioBloqueo->setText( "");
ui->txtnPorcDtoCliente->setText("0");
ui->chklRecargoEquivalencia->setChecked(false);
ui->txtcCuentaContable->setText("");
ui->txtcCuentaIvaRepercutido->setText("");
ui->txtcCuentaDeudas->setText("");
ui->txtcCuentaCobros->setText("");
//ui->cbocFormaPago->setItemText();
ui->txtnDiaPago1->setValue(0);
ui->txtnDiaPago2->setValue(0);
// ui->cbonTarifaCliente->lineEdit()->setText(oCliente->getnTarifaCliente());
ui->txtrImporteACuenta->setText("");
ui->txtrVales->setText("");
ui->txtcEntidadBancaria->setText("");
ui->txtcOficinaBancaria->setText("");
ui->txtcDc->setText("");
ui->txtcCuentaCorriente->setText("");
ui->txtdFechaNacimiento->setDate(dFecha.currentDate());
ui->txtcAccesoWeb->setText("");
ui->txtcPasswordWeb->setText("");
ui->txtPrimerApellido->setFocus();
ui->chkClienteEmpresa->setChecked(false);
}
示例3: takeScreenshot
void TMSIImpedanceWidget::takeScreenshot()
{
// Open file dialog
QDate date;
QString fileName = QFileDialog::getSaveFileName(this,
"Save Screenshot",
QString("%1/%2_%3_%4_Impedances").arg(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)).arg(date.currentDate().year()).arg(date.currentDate().month()).arg(date.currentDate().day()),
tr("Vector graphic(*.svg);;Images (*.png)"));
if(!fileName.isEmpty())
{
// Generate screenshot
if(fileName.contains(".svg"))
{
QSvgGenerator svgGen;
svgGen.setFileName(fileName);
QRectF rect = m_qGScene->itemsBoundingRect();
svgGen.setSize(QSize(rect.width(), rect.height()));
//svgGen.setViewBox(QRect(0, 0, rect.width(), rect.height()));
QPainter painter(&svgGen);
m_qGScene->render(&painter);
}
if(fileName.contains(".png"))
{
m_qGScene->setSceneRect(m_qGScene->itemsBoundingRect()); // Re-shrink the scene to it's bounding contents
QImage image(m_qGScene->sceneRect().size().toSize(), QImage::Format_ARGB32); // Create the image with the exact size of the shrunk scene
image.fill(Qt::transparent); // Start all pixels transparent
QPainter painter(&image);
m_qGScene->render(&painter);
image.save(fileName);
}
}
}
示例4: savefunc
//.........这里部分代码省略.........
refArray.append(ref);
}
if(ui->entRef->isChecked()) {
ref["Referral"] = "ENT";
ui->entRef->setChecked(false);
refArray.append(ref);
}
if(ui->localRef->isChecked()) {
ref["Referral"] = "Other local chest physician";
ui->localRef->setChecked(false);
refArray.append(ref);
}
if(ui->asthmaRef->isChecked()) {
ref["Referral"] = "Tertiary airways clinic";
ui->asthmaRef->setChecked(false);
refArray.append(ref);
}
if(ui->ildRef->isChecked()) {
ref["Referral"] = "Tertiary ILD clinic";
ui->ildRef->setChecked(false);
refArray.append(ref);
}
if(ui->ventRef->isChecked()) {
ref["Referral"] = "Long term ventilation service";
ui->ventRef->setChecked(false);
refArray.append(ref);
}
if(ui->otherRef->isChecked()) {
ref["Referral"] = "Other";
ui->otherRef->setChecked(false);
refArray.append(ref);
}
if(refArray.isEmpty()) savedata["Referrals"] = "None";
else savedata["Referrals"] = refArray;
if(ui->refEdit->toPlainText().length()) {
savedata["Referral notes"] = ui->refEdit->toPlainText();
ui->refEdit->clear();
}
// Disposal
if(ui->dischDisp->isChecked()) {
savedata["Disposal"] = "Discharge";
uncheckall(GROUP_DISPOSAL);
}
else if(ui->fuDisp->isChecked()) {
savedata["Disposal"] = "Follow up";
savedata["Follow up"] = ui->fuEdit->text();
uncheckall(GROUP_DISPOSAL);
ui->fuEdit->clear();
}
else if(ui->dnadischDisp->isChecked()) {
savedata["Disposal"] = "DNA - discharge";
uncheckall(GROUP_DISPOSAL);
}
else if(ui->dnafuDisp->isChecked()) {
savedata["Disposal"] = "DNA - follow up";
savedata["Follow up"] = ui->fuEdit->text();
uncheckall(GROUP_DISPOSAL);
}
else if(ui->otherDisp->isChecked()) {
savedata["Disposal"] = "Other / pending";
uncheckall(GROUP_DISPOSAL);
}
else if(ui->letterDisp->isChecked()) {
savedata["Disposal"] = "Write with results";
uncheckall(GROUP_DISPOSAL);
}
if(ui->admitDisp->isChecked()) {
savedata["Admit"] = "True";
ui->admitDisp->setChecked(false);
}
// Misc data
if(ui->notesEdit->toPlainText().length()) {
savedata["Notes"] = ui->notesEdit->toPlainText();
ui->notesEdit->clear();
}
if(ui->radmeetCheck->isChecked()) {
savedata["For radiology meeting"] = "True";
ui->radmeetCheck->setChecked(false);
}
if(ui->juniorCheck->isChecked()) {
savedata["Seen by junior"] = "True";
ui->juniorCheck->setChecked(false);
}
QDate date;
QTime time;
savedata["Date"] = date.currentDate().toString("dd:MM:yyyy");
savedata["Time"] = time.currentTime().toString("hh:mm");
QStringList l;
l = calculated_values->keys();
foreach(QString s, l) {
savedata[s] = calculated_values->value(s);
calculated_values->remove(s);
}
示例5: on_pushButton_done_clicked
void PunchOut::on_pushButton_done_clicked()
{
QDate date;
qmodel->setData(ui->tableView->currentIndex(), date.currentDate());
}
示例6: init
void TMSI::init()
{
m_pRMTSA_TMSI = PluginOutputData<NewRealTimeMultiSampleArray>::create(this, "TMSI", "EEG output data");
m_outputConnectors.append(m_pRMTSA_TMSI);
//default values used by the setupGUI class must be set here
m_iSamplingFreq = 1024;
m_iNumberOfChannels = 138;
m_iSamplesPerBlock = 16;
m_iTriggerInterval = 5000;
m_iSplitFileSizeMs = 10;
m_iSplitCount = 0;
m_bUseChExponent = true;
m_bUseUnitGain = true;
m_bUseUnitOffset = true;
m_bWriteToFile = false;
m_bWriteDriverDebugToFile = false;
m_bUseFiltering = false;
m_bUseFFT = false;
m_bIsRunning = false;
m_bBeepTrigger = false;
m_bUseCommonAverage = true;
m_bUseKeyboardTrigger = false;
m_bCheckImpedances = false;
m_bSplitFile = false;
m_iTriggerType = 0;
QDate date;
m_sOutputFilePath = QString ("%1Sequence_01/Subject_01/%2_%3_%4_EEG_001_raw.fif").arg(m_qStringResourcePath).arg(date.currentDate().year()).arg(date.currentDate().month()).arg(date.currentDate().day());
m_sElcFilePath = QString("./mne_x_plugins/resources/tmsi/loc_files/Lorenz-Duke128-28-11-2013.elc");
m_pFiffInfo = QSharedPointer<FiffInfo>(new FiffInfo());
//Initialise matrix used to perform a very simple high pass filter operation
m_matOldMatrix = MatrixXf::Zero(m_iNumberOfChannels, m_iSamplesPerBlock);
}
示例7: init
void GUSBAmp::init()
{
m_iSplitFileSizeMs = 10;
m_iSplitCount = 0;
m_bSplitFile = false;
QDate date;
m_sOutputFilePath = QString ("%1Sequence_01/Subject_01/%2_%3_%4_EEG_001_raw.fif").arg(m_qStringResourcePath).arg(date.currentDate().year()).arg(date.currentDate().month()).arg(date.currentDate().day());
m_pRTMSA_GUSBAmp = PluginOutputData<NewRealTimeMultiSampleArray>::create(this, "GUSBAmp", "EEG output data");
m_outputConnectors.append(m_pRTMSA_GUSBAmp);
m_pFiffInfo = QSharedPointer<FiffInfo>(new FiffInfo());
m_bIsRunning = false;
}