Use new RDTreeWidget everywhere in favour of QTreeWidget

* Since we're promoting everything, we reset the behaviour of
  RDTreeWidget so that it's not doing anything different by default.
* RDTreeWidget's interface is a bit different, exposing some useful
  things like a single selected item and so on.
* We also can't set columns in the Qt Creator UI anymore, so we set them
  from code.
This commit is contained in:
baldurk
2017-04-20 17:04:46 +01:00
parent d699e89fd2
commit f65f5ea9da
32 changed files with 882 additions and 5513 deletions
@@ -48,7 +48,7 @@ ConstantBufferPreviewer::ConstantBufferPreviewer(ICaptureContext &ctx, const Sha
ui->splitter->handle(1)->setEnabled(false);
{
// Name | Value | Type
ui->variables->setColumns({tr("Name"), tr("Value"), tr("Type")});
ui->variables->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
ui->variables->header()->setSectionResizeMode(1, QHeaderView::Stretch);
ui->variables->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
@@ -166,19 +166,19 @@ void ConstantBufferPreviewer::processFormat(const QString &format)
OnEventChanged(m_Ctx.CurEvent());
}
void ConstantBufferPreviewer::addVariables(QTreeWidgetItem *root,
void ConstantBufferPreviewer::addVariables(RDTreeWidgetItem *root,
const rdctype::array<ShaderVariable> &vars)
{
for(const ShaderVariable &v : vars)
{
QTreeWidgetItem *n = makeTreeNode({ToQStr(v.name), VarString(v), TypeString(v)});
RDTreeWidgetItem *n = new RDTreeWidgetItem({ToQStr(v.name), VarString(v), TypeString(v)});
root->addChild(n);
if(v.rows > 1)
{
for(uint32_t i = 0; i < v.rows; i++)
n->addChild(makeTreeNode(
n->addChild(new RDTreeWidgetItem(
{QString("%1.row%2").arg(ToQStr(v.name)).arg(i), RowString(v, i), RowTypeString(v)}));
}