Convert ShaderView to QWidget.
This commit is contained in:
parent
6218928e15
commit
48598de9c8
@ -37,10 +37,8 @@ ToolBox::ToolBox(QWidget * parent) :
|
||||
|
||||
// Shader views.
|
||||
ui->page_shaders->setLayout(shaderForm_);
|
||||
shaderForm_->addRow(vertex_.path.label, vertex_.path.value);
|
||||
shaderForm_->addRow(vertex_.editor);
|
||||
shaderForm_->addRow(fragment_.path.label, fragment_.path.value);
|
||||
shaderForm_->addRow(fragment_.editor);
|
||||
shaderForm_->addRow(reinterpret_cast<QWidget *>(&vertex_));
|
||||
shaderForm_->addRow(reinterpret_cast<QWidget *>(&fragment_));
|
||||
}
|
||||
|
||||
void ToolBox::updateFocus(const QString & name)
|
||||
|
@ -122,16 +122,23 @@ namespace Qtk
|
||||
};
|
||||
SpinBoxHorizontal3D transformPanel_, scalePanel_;
|
||||
|
||||
class ShaderView
|
||||
class ShaderView final : QWidget
|
||||
{
|
||||
public:
|
||||
explicit ShaderView(QWidget * parent = nullptr,
|
||||
const char * l = "ShaderView:") :
|
||||
path(parent, l), editor(new QTextEdit(parent))
|
||||
layout(new QVBoxLayout(this)), path(parent, l),
|
||||
editor(new QTextEdit(parent))
|
||||
{
|
||||
auto * pathLayout = new QHBoxLayout;
|
||||
pathLayout->addWidget(path.label);
|
||||
pathLayout->addWidget(path.value);
|
||||
layout->addLayout(pathLayout);
|
||||
layout->addWidget(editor);
|
||||
editor->setReadOnly(true);
|
||||
}
|
||||
|
||||
QVBoxLayout * layout;
|
||||
/// Shader name and path on disk.
|
||||
ObjectDetails::Item path;
|
||||
/// Read-only (for now) display of the shader source code.
|
||||
|
Loading…
x
Reference in New Issue
Block a user