CTweakEditor: Make use of STL equivalents over << where applicable
More recognizable with regards to behavior being performed. While we're at it, we can preallocate the backing asset QVector ahead of time.
This commit is contained in:
parent
d235fd4b17
commit
fdcb0b770c
|
@ -116,9 +116,12 @@ void CTweakEditor::OnProjectChanged(CGameProject* pNewProject)
|
||||||
// Create tweak list
|
// Create tweak list
|
||||||
if (pNewProject != nullptr)
|
if (pNewProject != nullptr)
|
||||||
{
|
{
|
||||||
for (CTweakData* pTweakData : pNewProject->TweakManager()->TweakObjects())
|
const auto& tweakObjects = pNewProject->TweakManager()->TweakObjects();
|
||||||
|
mTweakAssets.reserve(static_cast<int>(tweakObjects.size()));
|
||||||
|
|
||||||
|
for (CTweakData* tweakData : tweakObjects)
|
||||||
{
|
{
|
||||||
mTweakAssets << pTweakData;
|
mTweakAssets.push_back(tweakData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,8 +59,11 @@ CWorldEditor::CWorldEditor(QWidget *parent)
|
||||||
ui->ResourceBrowserContainer->setLayout(pLayout);
|
ui->ResourceBrowserContainer->setLayout(pLayout);
|
||||||
|
|
||||||
// Initialize splitter
|
// Initialize splitter
|
||||||
QList<int> SplitterSizes;
|
const QList<int> SplitterSizes{
|
||||||
SplitterSizes << width() * 0.25 << width() * 0.53 << width() * 0.22;
|
static_cast<int>(width() * 0.25),
|
||||||
|
static_cast<int>(width() * 0.53),
|
||||||
|
static_cast<int>(width() * 0.22),
|
||||||
|
};
|
||||||
ui->splitter->setSizes(SplitterSizes);
|
ui->splitter->setSizes(SplitterSizes);
|
||||||
|
|
||||||
// Initialize UI stuff
|
// Initialize UI stuff
|
||||||
|
|
Loading…
Reference in New Issue