本文整理汇总了C++中TilesetManager::setReloadTilesetsOnChange方法的典型用法代码示例。如果您正苦于以下问题:C++ TilesetManager::setReloadTilesetsOnChange方法的具体用法?C++ TilesetManager::setReloadTilesetsOnChange怎么用?C++ TilesetManager::setReloadTilesetsOnChange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TilesetManager
的用法示例。
在下文中一共展示了TilesetManager::setReloadTilesetsOnChange方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mSettings
Preferences::Preferences()
: mSettings(new QSettings)
{
// Retrieve storage settings
mSettings->beginGroup(QLatin1String("Storage"));
mLayerDataFormat = (MapWriter::LayerDataFormat)
mSettings->value(QLatin1String("LayerDataFormat"),
MapWriter::Base64Zlib).toInt();
mDtdEnabled = mSettings->value(QLatin1String("DtdEnabled")).toBool();
mReloadTilesetsOnChange =
mSettings->value(QLatin1String("ReloadTilesets"), true).toBool();
mSettings->endGroup();
// Retrieve interface settings
mSettings->beginGroup(QLatin1String("Interface"));
mShowGrid = mSettings->value(QLatin1String("ShowGrid"), false).toBool();
mSnapToGrid = mSettings->value(QLatin1String("SnapToGrid"),
false).toBool();
mGridColor = QColor(mSettings->value(QLatin1String("GridColor"),
QColor(Qt::black).name()).toString());
mHighlightCurrentLayer = mSettings->value(QLatin1String("HighlightCurrentLayer"),
false).toBool();
mShowTilesetGrid = mSettings->value(QLatin1String("ShowTilesetGrid"),
true).toBool();
mLanguage = mSettings->value(QLatin1String("Language"),
QString()).toString();
mUseOpenGL = mSettings->value(QLatin1String("OpenGL"), false).toBool();
mSettings->endGroup();
// Retrieve defined object types
mSettings->beginGroup(QLatin1String("ObjectTypes"));
const QStringList names =
mSettings->value(QLatin1String("Names")).toStringList();
const QStringList colors =
mSettings->value(QLatin1String("Colors")).toStringList();
mSettings->endGroup();
const int count = qMin(names.size(), colors.size());
for (int i = 0; i < count; ++i)
mObjectTypes.append(ObjectType(names.at(i), QColor(colors.at(i))));
mSettings->beginGroup(QLatin1String("Automapping"));
mAutoMapDrawing = mSettings->value(QLatin1String("WhileDrawing"),
false).toBool();
mSettings->endGroup();
mSettings->beginGroup(QLatin1String("MapsDirectory"));
mMapsDirectory = mSettings->value(QLatin1String("Current"), QString()).toString();
mSettings->endGroup();
TilesetManager *tilesetManager = TilesetManager::instance();
tilesetManager->setReloadTilesetsOnChange(mReloadTilesetsOnChange);
}
示例2: setReloadTilesetsOnChanged
void Preferences::setReloadTilesetsOnChanged(bool value)
{
if (mReloadTilesetsOnChange == value)
return;
mReloadTilesetsOnChange = value;
mSettings->setValue(QLatin1String("Storage/ReloadTilesets"),
mReloadTilesetsOnChange);
TilesetManager *tilesetManager = TilesetManager::instance();
tilesetManager->setReloadTilesetsOnChange(mReloadTilesetsOnChange);
}
示例3: mSettings
Preferences::Preferences()
: mSettings(new QSettings(this))
{
// Retrieve storage settings
mSettings->beginGroup(QLatin1String("Storage"));
mLayerDataFormat = (Map::LayerDataFormat)
mSettings->value(QLatin1String("LayerDataFormat"),
Map::Base64Zlib).toInt();
mDtdEnabled = boolValue("DtdEnabled");
mReloadTilesetsOnChange = boolValue("ReloadTilesets", true);
mSettings->endGroup();
// Retrieve interface settings
mSettings->beginGroup(QLatin1String("Interface"));
mShowGrid = boolValue("ShowGrid");
mShowTileObjectOutlines = boolValue("ShowTileObjectOutlines");
mShowTileAnimations = boolValue("ShowTileAnimations", true);
mSnapToGrid = boolValue("SnapToGrid");
mSnapToFineGrid = boolValue("SnapToFineGrid");
mGridColor = colorValue("GridColor", Qt::black);
mGridFine = intValue("GridFine", 4);
mObjectLineWidth = realValue("ObjectLineWidth", 2);
mHighlightCurrentLayer = boolValue("HighlightCurrentLayer");
mShowTilesetGrid = boolValue("ShowTilesetGrid", true);
mLanguage = stringValue("Language");
mUseOpenGL = boolValue("OpenGL");
mSettings->endGroup();
// Retrieve defined object types
mSettings->beginGroup(QLatin1String("ObjectTypes"));
const QStringList names =
mSettings->value(QLatin1String("Names")).toStringList();
const QStringList colors =
mSettings->value(QLatin1String("Colors")).toStringList();
mSettings->endGroup();
const int count = qMin(names.size(), colors.size());
for (int i = 0; i < count; ++i)
mObjectTypes.append(ObjectType(names.at(i), QColor(colors.at(i))));
mSettings->beginGroup(QLatin1String("Automapping"));
mAutoMapDrawing = boolValue("WhileDrawing");
mSettings->endGroup();
mSettings->beginGroup(QLatin1String("MapsDirectory"));
mMapsDirectory = stringValue("Current");
mSettings->endGroup();
TilesetManager *tilesetManager = TilesetManager::instance();
tilesetManager->setReloadTilesetsOnChange(mReloadTilesetsOnChange);
tilesetManager->setAnimateTiles(mShowTileAnimations);
}
示例4: mSettings
Preferences::Preferences()
: mSettings(new QSettings(this))
{
// Retrieve storage settings
mSettings->beginGroup(QLatin1String("Storage"));
mLayerDataFormat = (Map::LayerDataFormat)
mSettings->value(QLatin1String("LayerDataFormat"),
Map::Base64Zlib).toInt();
mMapRenderOrder = (Map::RenderOrder)
mSettings->value(QLatin1String("MapRenderOrder"),
Map::RightDown).toInt();
mDtdEnabled = boolValue("DtdEnabled");
mReloadTilesetsOnChange = boolValue("ReloadTilesets", true);
mStampsDirectory = stringValue("StampsDirectory");
mSettings->endGroup();
// Retrieve interface settings
mSettings->beginGroup(QLatin1String("Interface"));
mShowGrid = boolValue("ShowGrid");
mShowTileObjectOutlines = boolValue("ShowTileObjectOutlines");
mShowTileAnimations = boolValue("ShowTileAnimations", true);
mSnapToGrid = boolValue("SnapToGrid");
mSnapToFineGrid = boolValue("SnapToFineGrid");
mGridColor = colorValue("GridColor", Qt::black);
mGridFine = intValue("GridFine", 4);
mObjectLineWidth = realValue("ObjectLineWidth", 2);
mHighlightCurrentLayer = boolValue("HighlightCurrentLayer");
mShowTilesetGrid = boolValue("ShowTilesetGrid", true);
mLanguage = stringValue("Language");
mUseOpenGL = boolValue("OpenGL");
mSettings->endGroup();
// Retrieve defined object types
mSettings->beginGroup(QLatin1String("ObjectTypes"));
const QStringList names =
mSettings->value(QLatin1String("Names")).toStringList();
const QStringList colors =
mSettings->value(QLatin1String("Colors")).toStringList();
mSettings->endGroup();
const int count = qMin(names.size(), colors.size());
for (int i = 0; i < count; ++i)
mObjectTypes.append(ObjectType(names.at(i), QColor(colors.at(i))));
mSettings->beginGroup(QLatin1String("Automapping"));
mAutoMapDrawing = boolValue("WhileDrawing");
mSettings->endGroup();
mSettings->beginGroup(QLatin1String("MapsDirectory"));
mMapsDirectory = stringValue("Current");
mSettings->endGroup();
TilesetManager *tilesetManager = TilesetManager::instance();
tilesetManager->setReloadTilesetsOnChange(mReloadTilesetsOnChange);
tilesetManager->setAnimateTiles(mShowTileAnimations);
// Keeping track of some usage information
mSettings->beginGroup(QLatin1String("Install"));
mFirstRun = mSettings->value(QLatin1String("FirstRun")).toDate();
mRunCount = intValue("RunCount", 0) + 1;
mIsPatron = boolValue("IsPatron");
if (!mFirstRun.isValid()) {
mFirstRun = QDate::currentDate();
mSettings->setValue(QLatin1String("FirstRun"), mFirstRun.toString(Qt::ISODate));
}
mSettings->setValue(QLatin1String("RunCount"), mRunCount);
mSettings->endGroup();
// Retrieve startup settings
mSettings->beginGroup(QLatin1String("Startup"));
mOpenLastFilesOnStartup = boolValue("OpenLastFiles", true);
mSettings->endGroup();
}
示例5: mSettings
Preferences::Preferences()
: mSettings(new QSettings(this))
{
// Retrieve storage settings
mSettings->beginGroup(QLatin1String("Storage"));
mLayerDataFormat = static_cast<Map::LayerDataFormat>
(intValue("LayerDataFormat", Map::CSV));
mMapRenderOrder = static_cast<Map::RenderOrder>
(intValue("MapRenderOrder", Map::RightDown));
mDtdEnabled = boolValue("DtdEnabled");
mReloadTilesetsOnChange = boolValue("ReloadTilesets", true);
mStampsDirectory = stringValue("StampsDirectory");
mObjectTypesFile = stringValue("ObjectTypesFile");
mSettings->endGroup();
// Retrieve interface settings
mSettings->beginGroup(QLatin1String("Interface"));
mShowGrid = boolValue("ShowGrid", true);
mShowTileObjectOutlines = boolValue("ShowTileObjectOutlines");
mShowTileAnimations = boolValue("ShowTileAnimations", true);
mSnapToGrid = boolValue("SnapToGrid");
mSnapToFineGrid = boolValue("SnapToFineGrid");
mGridColor = colorValue("GridColor", Qt::black);
mGridFine = intValue("GridFine", 4);
mObjectLineWidth = realValue("ObjectLineWidth", 2);
mHighlightCurrentLayer = boolValue("HighlightCurrentLayer");
mShowTilesetGrid = boolValue("ShowTilesetGrid", true);
mLanguage = stringValue("Language");
mUseOpenGL = boolValue("OpenGL");
mObjectLabelVisibility = static_cast<ObjectLabelVisiblity>
(intValue("ObjectLabelVisibility", AllObjectLabels));
mSettings->endGroup();
// Retrieve defined object types
ObjectTypesReader objectTypesReader;
mObjectTypes = objectTypesReader.readObjectTypes(objectTypesFile());
// For backwards compatibilty, read in object types from settings
if (!objectTypesReader.errorString().isEmpty()) {
mSettings->beginGroup(QLatin1String("ObjectTypes"));
const QStringList names = mSettings->value(QLatin1String("Names")).toStringList();
const QStringList colors = mSettings->value(QLatin1String("Colors")).toStringList();
mSettings->endGroup();
if (!names.isEmpty()) {
const int count = qMin(names.size(), colors.size());
for (int i = 0; i < count; ++i)
mObjectTypes.append(ObjectType(names.at(i), QColor(colors.at(i))));
}
} else {
mSettings->remove(QLatin1String("ObjectTypes"));
}
mSettings->beginGroup(QLatin1String("Automapping"));
mAutoMapDrawing = boolValue("WhileDrawing");
mSettings->endGroup();
mSettings->beginGroup(QLatin1String("MapsDirectory"));
mMapsDirectory = stringValue("Current");
mSettings->endGroup();
TilesetManager *tilesetManager = TilesetManager::instance();
tilesetManager->setReloadTilesetsOnChange(mReloadTilesetsOnChange);
tilesetManager->setAnimateTiles(mShowTileAnimations);
// Read the lists of enabled and disabled plugins
const QStringList disabledPlugins = mSettings->value(QLatin1String("Plugins/Disabled")).toStringList();
const QStringList enabledPlugins = mSettings->value(QLatin1String("Plugins/Enabled")).toStringList();
PluginManager *pluginManager = PluginManager::instance();
for (const QString &fileName : disabledPlugins)
pluginManager->setPluginState(fileName, PluginDisabled);
for (const QString &fileName : enabledPlugins)
pluginManager->setPluginState(fileName, PluginEnabled);
// Keeping track of some usage information
mSettings->beginGroup(QLatin1String("Install"));
mFirstRun = mSettings->value(QLatin1String("FirstRun")).toDate();
mRunCount = intValue("RunCount", 0) + 1;
mIsPatron = boolValue("IsPatron");
mCheckForUpdates = boolValue("CheckForUpdates");
if (!mFirstRun.isValid()) {
mFirstRun = QDate::currentDate();
mSettings->setValue(QLatin1String("FirstRun"), mFirstRun.toString(Qt::ISODate));
}
mSettings->setValue(QLatin1String("RunCount"), mRunCount);
mSettings->endGroup();
// Retrieve startup settings
mSettings->beginGroup(QLatin1String("Startup"));
mOpenLastFilesOnStartup = boolValue("OpenLastFiles", true);
mSettings->endGroup();
}