本文整理汇总了C++中QTC_CHECK函数的典型用法代码示例。如果您正苦于以下问题:C++ QTC_CHECK函数的具体用法?C++ QTC_CHECK怎么用?C++ QTC_CHECK使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了QTC_CHECK函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateCacheAndEmitEnvironmentChanged
bool BuildConfiguration::fromMap(const QVariantMap &map)
{
m_clearSystemEnvironment = map.value(QLatin1String(CLEAR_SYSTEM_ENVIRONMENT_KEY)).toBool();
m_userEnvironmentChanges = Utils::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList());
m_buildDirectory = Utils::FileName::fromString(map.value(QLatin1String(BUILDDIRECTORY_KEY)).toString());
updateCacheAndEmitEnvironmentChanged();
qDeleteAll(m_stepLists);
m_stepLists.clear();
int maxI = map.value(QLatin1String(BUILD_STEP_LIST_COUNT), 0).toInt();
for (int i = 0; i < maxI; ++i) {
QVariantMap data = map.value(QLatin1String(BUILD_STEP_LIST_PREFIX) + QString::number(i)).toMap();
if (data.isEmpty()) {
qWarning() << "No data for build step list" << i << "found!";
continue;
}
auto list = new BuildStepList(this, idFromMap(data));
if (!list->fromMap(data)) {
qWarning() << "Failed to restore build step list" << i;
delete list;
return false;
}
m_stepLists.append(list);
}
// We currently assume there to be at least a clean and build list!
QTC_CHECK(knownStepLists().contains(Core::Id(Constants::BUILDSTEPS_BUILD)));
QTC_CHECK(knownStepLists().contains(Core::Id(Constants::BUILDSTEPS_CLEAN)));
return ProjectConfiguration::fromMap(map);
}
示例2: QTC_CHECK
void IosDeployStep::run(QFutureInterface<bool> &fi)
{
m_futureInterface = fi;
QTC_CHECK(m_transferStatus == NoTransfer);
if (iosdevice().isNull()) {
if (iossimulator().isNull())
TaskHub::addTask(Task::Error, tr("Deployment failed. No iOS device found."),
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT);
m_futureInterface.reportResult(!iossimulator().isNull());
cleanup();
emit finished();
return;
}
m_transferStatus = TransferInProgress;
QTC_CHECK(m_toolHandler == 0);
m_toolHandler = new IosToolHandler(IosDeviceType::IosDevice, this);
m_futureInterface.setProgressRange(0, 200);
m_futureInterface.setProgressValueAndText(0, QLatin1String("Transferring application"));
m_futureInterface.reportStarted();
connect(m_toolHandler, SIGNAL(isTransferringApp(Ios::IosToolHandler*,QString,QString,int,int,QString)),
SLOT(handleIsTransferringApp(Ios::IosToolHandler*,QString,QString,int,int,QString)));
connect(m_toolHandler, SIGNAL(didTransferApp(Ios::IosToolHandler*,QString,QString,Ios::IosToolHandler::OpStatus)),
SLOT(handleDidTransferApp(Ios::IosToolHandler*,QString,QString,Ios::IosToolHandler::OpStatus)));
connect(m_toolHandler, SIGNAL(finished(Ios::IosToolHandler*)),
SLOT(handleFinished(Ios::IosToolHandler*)));
connect(m_toolHandler, SIGNAL(errorMsg(Ios::IosToolHandler*,QString)),
SLOT(handleErrorMsg(Ios::IosToolHandler*,QString)));
m_toolHandler->requestTransferApp(appBundle(), deviceId());
}
示例3: selectedIndex
void BranchDialog::rename()
{
QModelIndex selected = selectedIndex();
QTC_CHECK(selected != m_model->currentBranch()); // otherwise the button would not be enabled!
const bool isTag = m_model->isTag(selected);
QTC_CHECK(m_model->isLocal(selected) || isTag);
QString oldName = m_model->fullName(selected);
QStringList localNames;
if (!isTag)
localNames = m_model->localBranchNames();
BranchAddDialog branchAddDialog(localNames, false, this);
if (isTag)
branchAddDialog.setWindowTitle(tr("Rename Tag"));
branchAddDialog.setBranchName(oldName);
branchAddDialog.setTrackedBranchName(QString(), false);
branchAddDialog.exec();
if (branchAddDialog.result() == QDialog::Accepted) {
if (branchAddDialog.branchName() == oldName)
return;
if (isTag)
m_model->renameTag(oldName, branchAddDialog.branchName());
else
m_model->renameBranch(oldName, branchAddDialog.branchName());
refresh();
}
enableButtons();
}
示例4: selectedIndex
bool BranchUtils::rename()
{
const QModelIndex selected = selectedIndex();
QTC_CHECK(selected != m_model->currentBranch());
const bool isTag = m_model->isTag(selected);
QTC_CHECK(m_model->isLocal(selected) || isTag);
QString oldName = m_model->fullName(selected);
QStringList localNames;
if (!isTag)
localNames = m_model->localBranchNames();
BranchAddDialog branchAddDialog(localNames, false, m_widget);
if (isTag)
branchAddDialog.setWindowTitle(tr("Rename Tag"));
branchAddDialog.setBranchName(oldName);
branchAddDialog.setTrackedBranchName(QString(), false);
branchAddDialog.exec();
if (branchAddDialog.result() == QDialog::Accepted) {
if (branchAddDialog.branchName() == oldName)
return false;
if (isTag)
m_model->renameTag(oldName, branchAddDialog.branchName());
else
m_model->renameBranch(oldName, branchAddDialog.branchName());
return true;
}
if (QTC_GUARD(m_branchView))
m_branchView->selectionModel()->clear();
return false;
}
示例5: QTC_CHECK
void TreeModel::checkIndex(const QModelIndex &index) const
{
if (index.isValid()) {
QTC_CHECK(index.model() == this);
} else {
QTC_CHECK(index.model() == 0);
}
}
示例6: removeAnnotationDate
static QString removeAnnotationDate(const QString &b)
{
if (b.isEmpty())
return b;
const QChar space(QLatin1Char(' '));
const int parenPos = b.indexOf(QLatin1Char(')'));
if (parenPos == -1)
return b;
int datePos = parenPos;
int i = parenPos;
while (i >= 0 && b.at(i) != space)
--i;
while (i >= 0 && b.at(i) == space)
--i;
int spaceCount = 0;
// i is now on timezone. Go back 3 spaces: That is where the date starts.
while (i >= 0) {
if (b.at(i) == space)
++spaceCount;
if (spaceCount == 3) {
datePos = i;
break;
}
--i;
}
if (datePos == 0)
return b;
// Copy over the parts that have not changed into a new byte array
QString result;
QTC_ASSERT(b.size() >= parenPos, return result);
int prevPos = 0;
int pos = b.indexOf(QLatin1Char('\n'), 0) + 1;
forever {
QTC_CHECK(prevPos < pos);
int afterParen = prevPos + parenPos;
result.append(b.mid(prevPos, datePos));
result.append(b.mid(afterParen, pos - afterParen));
prevPos = pos;
QTC_CHECK(prevPos != 0);
if (pos == b.size())
break;
pos = b.indexOf(QLatin1Char('\n'), pos) + 1;
if (pos == 0) // indexOf returned -1
pos = b.size();
}
return result;
}
示例7: QObject
QmlProfilerEventRelativesModelProxy::QmlProfilerEventRelativesModelProxy(QmlProfilerModelManager *modelManager,
QmlProfilerEventsModelProxy *eventsModel,
QObject *parent)
: QObject(parent)
{
QTC_CHECK(modelManager);
m_modelManager = modelManager;
connect(modelManager->simpleModel(), SIGNAL(changed()), this, SLOT(dataChanged()));
QTC_CHECK(eventsModel);
m_eventsModel = eventsModel;
m_acceptedTypes << QmlDebug::Compiling << QmlDebug::Creating << QmlDebug::Binding << QmlDebug::HandlingSignal;
}
示例8: m_fatalErrorCount
XcodebuildParser::XcodebuildParser() :
m_fatalErrorCount(0),
m_xcodeBuildParserState(OutsideXcodebuild)
{
setObjectName(QLatin1String("XcodeParser"));
m_failureRe.setPattern(QLatin1String(failureRe));
QTC_CHECK(m_failureRe.isValid());
m_successRe.setPattern(QLatin1String(successRe));
QTC_CHECK(m_successRe.isValid());
m_buildRe.setPattern(QLatin1String(buildRe));
QTC_CHECK(m_buildRe.isValid());
m_replacingSignatureRe.setPattern(QLatin1String(signatureChangeRe));
QTC_CHECK(m_replacingSignatureRe.isValid());
}
示例9: QObject
QmlProfilerStatisticsRelativesModel::QmlProfilerStatisticsRelativesModel(
QmlProfilerModelManager *modelManager, QmlProfilerStatisticsModel *statisticsModel,
QObject *parent) : QObject(parent)
{
QTC_CHECK(modelManager);
m_modelManager = modelManager;
QTC_CHECK(statisticsModel);
m_statisticsModel = statisticsModel;
// Load the child models whenever the parent model is done to get the filtering for JS/QML
// right.
connect(m_statisticsModel, &QmlProfilerStatisticsModel::dataAvailable,
this, &QmlProfilerStatisticsRelativesModel::dataChanged);
}
示例10: QObject
QmlProfilerEventRelativesModelProxy::QmlProfilerEventRelativesModelProxy(QmlProfilerModelManager *modelManager,
QmlProfilerEventsModelProxy *eventsModel,
QObject *parent)
: QObject(parent)
{
QTC_CHECK(modelManager);
m_modelManager = modelManager;
QTC_CHECK(eventsModel);
m_eventsModel = eventsModel;
// Load the child models whenever the parent model is done to get the filtering for JS/QML
// right.
connect(m_eventsModel, SIGNAL(dataAvailable()), this, SLOT(dataChanged()));
}
示例11: d
IDevice::IDevice(const QString &type, Origin origin, Core::Id id) : d(new Internal::IDevicePrivate)
{
d->type = type;
d->origin = origin;
QTC_CHECK(origin == ManuallyAdded || id.isValid());
d->id = id.isValid() ? id : newId();
}
示例12: QTC_CHECK
void GdbMi::parseTuple(const char *&from, const char *to)
{
//qDebug() << "parseTuple: " << QByteArray(from, to - from);
QTC_CHECK(*from == '{');
++from;
parseTuple_helper(from, to);
}
示例13: submitEditorWidget
void PerforceSubmitEditor::updateFields()
{
PerforceSubmitEditorWidget *widget = submitEditorWidget();
widget->setData(m_entries.value(QLatin1String("Change")).trimmed(),
m_entries.value(QLatin1String("Client")).trimmed(),
m_entries.value(QLatin1String("User")).trimmed());
const QChar newLine = QLatin1Char('\n');
QStringList lines = m_entries.value(QLatin1String("Description")).split(newLine);
lines.removeFirst(); // that is the line break after 'Description:'
lines.removeLast(); // that is the empty line at the end
const QRegExp leadingTabPattern = QRegExp(QLatin1String("^\\t"));
QTC_CHECK(leadingTabPattern.isValid());
lines.replaceInStrings(leadingTabPattern, QString());
widget->setDescriptionText(lines.join(newLine));
lines = m_entries.value(QLatin1String("Files")).split(newLine);
// split up "file#add" and store complete spec line as user data
foreach (const QString &specLine, lines) {
const QStringList list = specLine.split(QLatin1Char('#'));
if (list.size() == 2) {
const QString file = list.at(0).trimmed();
const QString state = list.at(1).trimmed();
m_fileModel->addFile(file, state).at(0)->setData(specLine, FileSpecRole);
}
}
}
示例14: spaceMatcher
QString ClassNameValidatingLineEdit::createClassName(const QString &name)
{
// Remove spaces and convert the adjacent characters to uppercase
QString className = name;
QRegExp spaceMatcher(QLatin1String(" +(\\w)"), Qt::CaseSensitive, QRegExp::RegExp2);
QTC_CHECK(spaceMatcher.isValid());
int pos;
while ((pos = spaceMatcher.indexIn(className)) != -1) {
className.replace(pos, spaceMatcher.matchedLength(),
spaceMatcher.cap(1).toUpper());
}
// Filter out any remaining invalid characters
className.remove(QRegExp(QLatin1String("[^a-zA-Z0-9_]")));
// If the first character is numeric, prefix the name with a "_"
if (className.at(0).isNumber()) {
className.prepend(QLatin1Char('_'));
} else {
// Convert the first character to uppercase
className.replace(0, 1, className.left(1).toUpper());
}
return className;
}
示例15: QTC_CHECK
void IosDeployStep::run(QFutureInterface<bool> &fi)
{
m_futureInterface = fi;
QTC_CHECK(m_transferStatus == NoTransfer);
if (iosdevice().isNull()) {
m_futureInterface.reportResult(!iossimulator().isNull());
cleanup();
m_futureInterface.reportFinished();
return;
}
m_transferStatus = TransferInProgress;
IosToolHandler *toolHandler = new IosToolHandler(IosToolHandler::IosDeviceType, this);
m_futureInterface.setProgressRange(0, 200);
m_futureInterface.setProgressValueAndText(0, QLatin1String("Transferring application"));
m_futureInterface.reportStarted();
connect(toolHandler, SIGNAL(isTransferringApp(Ios::IosToolHandler*,QString,QString,int,int,QString)),
SLOT(handleIsTransferringApp(Ios::IosToolHandler*,QString,QString,int,int,QString)));
connect(toolHandler, SIGNAL(didTransferApp(Ios::IosToolHandler*,QString,QString,Ios::IosToolHandler::OpStatus)),
SLOT(handleDidTransferApp(Ios::IosToolHandler*,QString,QString,Ios::IosToolHandler::OpStatus)));
connect(toolHandler, SIGNAL(finished(Ios::IosToolHandler*)),
SLOT(handleFinished(Ios::IosToolHandler*)));
connect(toolHandler, SIGNAL(errorMsg(Ios::IosToolHandler*,QString)),
SLOT(handleErrorMsg(Ios::IosToolHandler*,QString)));
toolHandler->requestTransferApp(appBundle(), deviceId());
}