mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-23 15:06:32 +00:00
Show parse errors on the line they occur
This commit is contained in:
+428
-174
File diff suppressed because it is too large
Load Diff
@@ -179,8 +179,11 @@ struct ParsedFormat
|
||||
{
|
||||
ShaderConstant fixed, repeating;
|
||||
Packing::Rules packing;
|
||||
QMap<int, QString> errors;
|
||||
};
|
||||
|
||||
struct StructFormatData;
|
||||
|
||||
struct BufferFormatter
|
||||
{
|
||||
private:
|
||||
@@ -188,8 +191,11 @@ private:
|
||||
|
||||
static GraphicsAPI m_API;
|
||||
|
||||
static bool CheckInvalidUnbounded(const ShaderConstant &structDef, QString &errors);
|
||||
static bool ContainsUnbounded(const rdcarray<ShaderConstant> &members);
|
||||
static bool CheckInvalidUnbounded(const StructFormatData &structDef,
|
||||
const QMap<QString, StructFormatData> &structelems,
|
||||
QMap<int, QString> &errors);
|
||||
static bool ContainsUnbounded(const ShaderConstant &structType,
|
||||
rdcpair<rdcstr, rdcstr> *found = NULL);
|
||||
|
||||
static QString DeclareStruct(Packing::Rules pack, QList<QString> &declaredStructs,
|
||||
const QString &name, const rdcarray<ShaderConstant> &members,
|
||||
@@ -208,8 +214,7 @@ public:
|
||||
BufferFormatter() = default;
|
||||
|
||||
static void Init(GraphicsAPI api) { m_API = api; }
|
||||
static ParsedFormat ParseFormatString(const QString &formatString, uint64_t maxLen, bool cbuffer,
|
||||
QString &errors);
|
||||
static ParsedFormat ParseFormatString(const QString &formatString, uint64_t maxLen, bool cbuffer);
|
||||
static uint32_t GetVarAdvance(Packing::Rules pack, const ShaderConstant &var);
|
||||
|
||||
static Packing::Rules EstimatePackingRules(const rdcarray<ShaderConstant> &members);
|
||||
|
||||
@@ -229,24 +229,120 @@ iimageCubeArray uimageCubeArray image2DMS iimage2DMS uimage2DMS image2DMSArray i
|
||||
uimage2DMSArray
|
||||
)EOKEYWORDS"};
|
||||
|
||||
static const char *buffer_keywords[2] = {"struct enum",
|
||||
|
||||
// keyword set 1:
|
||||
// Secondary keywords and identifiers
|
||||
R"EOKEYWORDS(
|
||||
bool
|
||||
bool bool1 bool2 bool3 bool4 bool1x1 bool1x2 bool1x3 bool1x4 bool2x1 bool2x2 bool2x3 bool2x4 bool3x1
|
||||
bool3x2 bool3x3 bool3x4 bool4x1 bool4x2 bool4x3 bool4x4
|
||||
|
||||
char
|
||||
char char1 char2 char3 char4 char1x1 char1x2 char1x3 char1x4 char2x1 char2x2 char2x3 char2x4 char3x1
|
||||
char3x2 char3x3 char3x4 char4x1 char4x2 char4x3 char4x4
|
||||
|
||||
byte
|
||||
byte byte1 byte2 byte3 byte4 byte1x1 byte1x2 byte1x3 byte1x4 byte2x1 byte2x2 byte2x3 byte2x4 byte3x1
|
||||
byte3x2 byte3x3 byte3x4 byte4x1 byte4x2 byte4x3 byte4x4
|
||||
|
||||
ubyte
|
||||
ubyte ubyte1 ubyte2 ubyte3 ubyte4 ubyte1x1 ubyte1x2 ubyte1x3 ubyte1x4 ubyte2x1 ubyte2x2 ubyte2x3 ubyte2x4 ubyte3x1
|
||||
ubyte3x2 ubyte3x3 ubyte3x4 ubyte4x1 ubyte4x2 ubyte4x3 ubyte4x4
|
||||
|
||||
xbyte
|
||||
xbyte xbyte1 xbyte2 xbyte3 xbyte4 xbyte1x1 xbyte1x2 xbyte1x3 xbyte1x4 xbyte2x1 xbyte2x2 xbyte2x3 xbyte2x4 xbyte3x1
|
||||
xbyte3x2 xbyte3x3 xbyte3x4 xbyte4x1 xbyte4x2 xbyte4x3 xbyte4x4
|
||||
|
||||
short
|
||||
short short1 short2 short3 short4 short1x1 short1x2 short1x3 short1x4 short2x1 short2x2 short2x3 short2x4 short3x1
|
||||
short3x2 short3x3 short3x4 short4x1 short4x2 short4x3 short4x4
|
||||
|
||||
ushort
|
||||
ushort ushort1 ushort2 ushort3 ushort4 ushort1x1 ushort1x2 ushort1x3 ushort1x4 ushort2x1 ushort2x2 ushort2x3 ushort2x4 ushort3x1
|
||||
ushort3x2 ushort3x3 ushort3x4 ushort4x1 ushort4x2 ushort4x3 ushort4x4
|
||||
|
||||
xshort
|
||||
xshort xshort1 xshort2 xshort3 xshort4 xshort1x1 xshort1x2 xshort1x3 xshort1x4 xshort2x1 xshort2x2 xshort2x3 xshort2x4 xshort3x1
|
||||
xshort3x2 xshort3x3 xshort3x4 xshort4x1 xshort4x2 xshort4x3 xshort4x4
|
||||
|
||||
long
|
||||
long long1 long2 long3 long4 long1x1 long1x2 long1x3 long1x4 long2x1 long2x2 long2x3 long2x4 long3x1
|
||||
long3x2 long3x3 long3x4 long4x1 long4x2 long4x3 long4x4
|
||||
|
||||
ulong
|
||||
ulong ulong1 ulong2 ulong3 ulong4 ulong1x1 ulong1x2 ulong1x3 ulong1x4 ulong2x1 ulong2x2 ulong2x3 ulong2x4 ulong3x1
|
||||
ulong3x2 ulong3x3 ulong3x4 ulong4x1 ulong4x2 ulong4x3 ulong4x4
|
||||
|
||||
xlong
|
||||
xlong xlong1 xlong2 xlong3 xlong4 xlong1x1 xlong1x2 xlong1x3 xlong1x4 xlong2x1 xlong2x2 xlong2x3 xlong2x4 xlong3x1
|
||||
xlong3x2 xlong3x3 xlong3x4 xlong4x1 xlong4x2 xlong4x3 xlong4x4
|
||||
|
||||
int
|
||||
int int1 int2 int3 int4 int1x1 int1x2 int1x3 int1x4 int2x1 int2x2 int2x3 int2x4 int3x1
|
||||
int3x2 int3x3 int3x4 int4x1 int4x2 int4x3 int4x4
|
||||
|
||||
uint
|
||||
uint uint1 uint2 uint3 uint4 uint1x1 uint1x2 uint1x3 uint1x4 uint2x1 uint2x2 uint2x3 uint2x4 uint3x1
|
||||
uint3x2 uint3x3 uint3x4 uint4x1 uint4x2 uint4x3 uint4x4
|
||||
|
||||
xint
|
||||
xint xint1 xint2 xint3 xint4 xint1x1 xint1x2 xint1x3 xint1x4 xint2x1 xint2x2 xint2x3 xint2x4 xint3x1
|
||||
xint3x2 xint3x3 xint3x4 xint4x1 xint4x2 xint4x3 xint4x4
|
||||
|
||||
float
|
||||
float float1 float2 float3 float4 float1x1 float1x2 float1x3 float1x4 float2x1 float2x2 float2x3 float2x4 float3x1
|
||||
float3x2 float3x3 float3x4 float4x1 float4x2 float4x3 float4x4
|
||||
|
||||
half
|
||||
half half1 half2 half3 half4 half1x1 half1x2 half1x3 half1x4 half2x1 half2x2 half2x3 half2x4 half3x1
|
||||
half3x2 half3x3 half3x4 half4x1 half4x2 half4x3 half4x4
|
||||
|
||||
double double1 double2 double3 double4 double1x1 double1x2 double1x3 double1x4 double2x1 double2x2
|
||||
double2x3 double2x4 double3x1 double3x2 double3x3 double3x4 double4x1 double4x2 double4x3 double4x4
|
||||
|
||||
mat2 mat3 mat4
|
||||
mat2x2 mat2x3 mat2x4
|
||||
mat3x2 mat3x3 mat3x4
|
||||
mat4x2 mat4x3 mat4x4
|
||||
dmat2 dmat3 dmat4
|
||||
dmat2x2 dmat2x3 dmat2x4
|
||||
dmat3x2 dmat3x3 dmat3x4
|
||||
dmat4x2 dmat4x3 dmat4x4
|
||||
imat2 imat3 imat4
|
||||
imat2x2 imat2x3 imat2x4
|
||||
imat3x2 imat3x3 imat3x4
|
||||
imat4x2 imat4x3 imat4x4
|
||||
umat2 umat3 umat4
|
||||
umat2x2 umat2x3 umat2x4
|
||||
umat3x2 umat3x3 umat3x4
|
||||
umat4x2 umat4x3 umat4x4
|
||||
vec2 vec3 vec4
|
||||
dvec2 dvec3 dvec4
|
||||
ivec2 ivec3 ivec4
|
||||
uvec2 uvec3 uvec4
|
||||
|
||||
unormh unormh1 unormh2 unormh3 unormh4
|
||||
unormb unormb1 unormb2 unormb3 unormb4
|
||||
snormh snormh1 snormh2 snormh3 snormh4
|
||||
snormb snormb1 snormb2 snormb3 snormb4
|
||||
uintten uintten1 uintten2 uintten3 uintten4
|
||||
unormten unormten1 unormten2 unormten3 unormten4
|
||||
floateleven floateleven1 floateleven2 floateleven3 floateleven4
|
||||
|
||||
row_major column_major unsigned signed rgb
|
||||
)EOKEYWORDS"};
|
||||
|
||||
void ConfigureSyntax(ScintillaEdit *scintilla, int language)
|
||||
{
|
||||
bool hlsl = false;
|
||||
bool glsl = false;
|
||||
int lexLang = language;
|
||||
|
||||
if(language == SCLEX_HLSL)
|
||||
{
|
||||
hlsl = true;
|
||||
language = SCLEX_CPP;
|
||||
}
|
||||
if(lexLang == SCLEX_HLSL || lexLang == SCLEX_GLSL || lexLang == SCLEX_BUFFER)
|
||||
lexLang = SCLEX_CPP;
|
||||
|
||||
if(language == SCLEX_GLSL)
|
||||
{
|
||||
glsl = true;
|
||||
language = SCLEX_CPP;
|
||||
}
|
||||
|
||||
scintilla->setLexer(language);
|
||||
scintilla->setLexer(lexLang);
|
||||
|
||||
#define SC_COL(qcol) SCINTILLA_COLOUR(qcol.red(), qcol.green(), qcol.blue())
|
||||
|
||||
@@ -288,7 +384,7 @@ void ConfigureSyntax(ScintillaEdit *scintilla, int language)
|
||||
sptr_t teal = SCINTILLA_COLOUR(0, 150, 150);
|
||||
sptr_t olive = SCINTILLA_COLOUR(150, 150, 0);
|
||||
|
||||
if(language == SCLEX_CPP)
|
||||
if(lexLang == SCLEX_CPP)
|
||||
{
|
||||
scintilla->setProperty("lexer.cpp.track.preprocessor", "0");
|
||||
scintilla->setProperty("styling.within.preprocessor", "1");
|
||||
@@ -301,16 +397,21 @@ void ConfigureSyntax(ScintillaEdit *scintilla, int language)
|
||||
scintilla->styleSetFore(SCE_C_PREPROCESSOR, blue);
|
||||
scintilla->styleSetBold(SCE_C_PREPROCESSOR, true);
|
||||
|
||||
if(hlsl)
|
||||
if(language == SCLEX_HLSL)
|
||||
{
|
||||
scintilla->setKeyWords(0, hlsl_keywords[0]);
|
||||
scintilla->setKeyWords(1, hlsl_keywords[1]);
|
||||
}
|
||||
else if(glsl)
|
||||
else if(language == SCLEX_GLSL)
|
||||
{
|
||||
scintilla->setKeyWords(0, glsl_keywords[0]);
|
||||
scintilla->setKeyWords(1, glsl_keywords[1]);
|
||||
}
|
||||
else if(language == SCLEX_BUFFER)
|
||||
{
|
||||
scintilla->setKeyWords(0, buffer_keywords[0]);
|
||||
scintilla->setKeyWords(1, buffer_keywords[1]);
|
||||
}
|
||||
}
|
||||
else if(language == SCLEX_PYTHON)
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
#define SCLEX_GLSL 1000
|
||||
#define SCLEX_HLSL 1001
|
||||
#define SCLEX_BUFFER 1002
|
||||
|
||||
#define SCINTILLA_COLOUR(r, g, b) (long(r) | (long(g) << 8) | (long(b) << 16))
|
||||
|
||||
|
||||
@@ -30,8 +30,13 @@
|
||||
#include <QTextCursor>
|
||||
#include <QTextDocument>
|
||||
#include "Code/QRDUtils.h"
|
||||
#include "Code/ScintillaSyntax.h"
|
||||
#include "scintilla/include/SciLexer.h"
|
||||
#include "scintilla/include/qt/ScintillaEdit.h"
|
||||
#include "ui_BufferFormatSpecifier.h"
|
||||
|
||||
static const int ERROR_STYLE = STYLE_LASTPREDEFINED + 1;
|
||||
|
||||
BufferFormatList *globalFormatList = NULL;
|
||||
|
||||
BufferFormatList::BufferFormatList(ICaptureContext &ctx, QObject *parent)
|
||||
@@ -70,16 +75,65 @@ BufferFormatSpecifier::BufferFormatSpecifier(QWidget *parent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
setErrors(QString());
|
||||
formatText = new ScintillaEdit(this);
|
||||
|
||||
on_showHelp_toggled(false);
|
||||
formatText->styleSetFont(STYLE_DEFAULT, Formatter::FixedFont().family().toUtf8().data());
|
||||
formatText->styleSetSize(STYLE_DEFAULT, Formatter::FixedFont().pointSize());
|
||||
|
||||
formatText->styleSetFont(ERROR_STYLE, Formatter::FixedFont().family().toUtf8().data());
|
||||
formatText->styleSetSize(ERROR_STYLE, Formatter::FixedFont().pointSize());
|
||||
|
||||
QColor base = formatText->palette().color(QPalette::Base);
|
||||
|
||||
QColor col = QColor::fromHslF(0.0f, 1.0f, qBound(0.1, base.lightnessF(), 0.9));
|
||||
|
||||
formatText->styleSetBack(ERROR_STYLE, SCINTILLA_COLOUR(col.red(), col.green(), col.blue()));
|
||||
|
||||
ConfigureSyntax(formatText, SCLEX_BUFFER);
|
||||
|
||||
formatText->setTabWidth(4);
|
||||
|
||||
formatText->setScrollWidth(1);
|
||||
formatText->setScrollWidthTracking(true);
|
||||
|
||||
formatText->annotationSetVisible(ANNOTATION_BOXED);
|
||||
|
||||
formatText->colourise(0, -1);
|
||||
|
||||
formatText->setMarginWidthN(0, 0);
|
||||
formatText->setMarginWidthN(1, 0);
|
||||
formatText->setMarginWidthN(2, 0);
|
||||
|
||||
QFrame *formatContainer = new QFrame(this);
|
||||
QVBoxLayout *layout = new QVBoxLayout;
|
||||
layout->setContentsMargins(2, 2, 2, 2);
|
||||
layout->addWidget(formatText);
|
||||
formatContainer->setLayout(layout);
|
||||
|
||||
QPalette pal = formatContainer->palette();
|
||||
pal.setColor(QPalette::Window, pal.color(QPalette::Base));
|
||||
formatContainer->setPalette(pal);
|
||||
formatContainer->setAutoFillBackground(true);
|
||||
|
||||
formatContainer->setFrameShape(QFrame::Panel);
|
||||
formatContainer->setFrameShadow(QFrame::Plain);
|
||||
|
||||
QObject::connect(formatText, &ScintillaEdit::modified,
|
||||
[this](int type, int, int, int, const QByteArray &, int, int, int) {
|
||||
ui->savedList->clearSelection();
|
||||
if(!(type & SC_MOD_CHANGEANNOTATION))
|
||||
formatText->annotationClearAll();
|
||||
});
|
||||
|
||||
ui->mainLayout->insertWidget(0, formatContainer);
|
||||
|
||||
ui->savedList->setItemDelegate(new FullEditorDelegate(ui->savedList));
|
||||
|
||||
ui->formatText->setFont(Formatter::FixedFont());
|
||||
ui->savedList->setFont(Formatter::PreferredFont());
|
||||
|
||||
ui->savedList->setColumns({tr("Saved formats")});
|
||||
|
||||
setErrors({});
|
||||
|
||||
on_showHelp_toggled(false);
|
||||
}
|
||||
|
||||
BufferFormatSpecifier::~BufferFormatSpecifier()
|
||||
@@ -94,6 +148,8 @@ void BufferFormatSpecifier::setAutoFormat(QString autoFormat)
|
||||
updateFormatList();
|
||||
|
||||
setFormat(autoFormat);
|
||||
|
||||
formatText->emptyUndoBuffer();
|
||||
}
|
||||
|
||||
void BufferFormatSpecifier::setContext(ICaptureContext *ctx)
|
||||
@@ -116,16 +172,33 @@ void BufferFormatSpecifier::setTitle(QString title)
|
||||
|
||||
void BufferFormatSpecifier::setFormat(const QString &format)
|
||||
{
|
||||
ui->formatText->setText(format);
|
||||
formatText->setText(format.toUtf8().data());
|
||||
}
|
||||
|
||||
void BufferFormatSpecifier::setErrors(const QString &errors)
|
||||
void BufferFormatSpecifier::setErrors(const QMap<int, QString> &errors)
|
||||
{
|
||||
ui->errors->setText(errors);
|
||||
if(errors.isEmpty())
|
||||
ui->errors->setVisible(false);
|
||||
else
|
||||
ui->errors->setVisible(true);
|
||||
formatText->annotationClearAll();
|
||||
|
||||
bool first = true;
|
||||
|
||||
for(auto err = errors.begin(); err != errors.end(); ++err)
|
||||
{
|
||||
int line = err.key();
|
||||
|
||||
formatText->annotationSetStyle(line, ERROR_STYLE);
|
||||
formatText->annotationSetText(line, (tr("Error: %1").arg(err.value())).toUtf8().data());
|
||||
|
||||
if(first)
|
||||
{
|
||||
int firstLine = formatText->firstVisibleLine();
|
||||
int linesVisible = formatText->linesOnScreen();
|
||||
|
||||
if(line < firstLine || line > (firstLine + linesVisible - 1))
|
||||
formatText->setFirstVisibleLine(qMax(0, line - linesVisible / 2));
|
||||
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BufferFormatSpecifier::updateFormatList()
|
||||
@@ -219,7 +292,8 @@ void BufferFormatSpecifier::on_savedList_itemChanged(RDTreeWidgetItem *item, int
|
||||
}
|
||||
}
|
||||
|
||||
globalFormatList->setFormat(name, ui->formatText->toPlainText());
|
||||
globalFormatList->setFormat(name,
|
||||
QString::fromUtf8(formatText->getText(formatText->textLength() + 1)));
|
||||
}
|
||||
|
||||
void BufferFormatSpecifier::on_savedList_itemDoubleClicked(RDTreeWidgetItem *item, int column)
|
||||
@@ -262,7 +336,7 @@ void BufferFormatSpecifier::on_savedList_itemSelectionChanged()
|
||||
void BufferFormatSpecifier::on_showHelp_toggled(bool help)
|
||||
{
|
||||
ui->helpText->setVisible(help);
|
||||
ui->formatText->setVisible(!help);
|
||||
formatText->parentWidget()->setVisible(!help);
|
||||
}
|
||||
|
||||
void BufferFormatSpecifier::on_loadDef_clicked()
|
||||
@@ -281,12 +355,8 @@ void BufferFormatSpecifier::on_loadDef_clicked()
|
||||
format = globalFormatList->getFormat(name);
|
||||
|
||||
{
|
||||
QSignalBlocker block(ui->formatText);
|
||||
|
||||
QTextDocument *doc = ui->formatText->document();
|
||||
QTextCursor cur(doc);
|
||||
cur.select(QTextCursor::Document);
|
||||
cur.insertText(format);
|
||||
QSignalBlocker block(formatText);
|
||||
formatText->setText(format.toUtf8().data());
|
||||
}
|
||||
|
||||
emit processFormat(format);
|
||||
@@ -317,7 +387,8 @@ void BufferFormatSpecifier::on_saveDef_clicked()
|
||||
if(res != QMessageBox::Yes)
|
||||
return;
|
||||
|
||||
globalFormatList->setFormat(name, ui->formatText->toPlainText());
|
||||
globalFormatList->setFormat(name,
|
||||
QString::fromUtf8(formatText->getText(formatText->textLength() + 1)));
|
||||
}
|
||||
|
||||
void BufferFormatSpecifier::on_delDef_clicked()
|
||||
@@ -341,13 +412,8 @@ void BufferFormatSpecifier::on_delDef_clicked()
|
||||
globalFormatList->setFormat(name, QString());
|
||||
}
|
||||
|
||||
void BufferFormatSpecifier::on_formatText_textChanged()
|
||||
{
|
||||
ui->savedList->clearSelection();
|
||||
}
|
||||
|
||||
void BufferFormatSpecifier::on_apply_clicked()
|
||||
{
|
||||
setErrors(QString());
|
||||
emit processFormat(ui->formatText->toPlainText());
|
||||
setErrors({});
|
||||
emit processFormat(QString::fromUtf8(formatText->getText(formatText->textLength() + 1)));
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <QWidget>
|
||||
|
||||
struct ICaptureContext;
|
||||
class ScintillaEdit;
|
||||
|
||||
class RDTreeWidgetItem;
|
||||
|
||||
@@ -68,6 +69,7 @@ public:
|
||||
|
||||
void setContext(ICaptureContext *ctx);
|
||||
void setTitle(QString title);
|
||||
void setErrors(const QMap<int, QString> &errors);
|
||||
|
||||
signals:
|
||||
void processFormat(const QString &format);
|
||||
@@ -78,7 +80,6 @@ public slots:
|
||||
void on_loadDef_clicked();
|
||||
void on_saveDef_clicked();
|
||||
void on_delDef_clicked();
|
||||
void on_formatText_textChanged();
|
||||
void on_savedList_keyPress(QKeyEvent *event);
|
||||
void on_savedList_itemChanged(RDTreeWidgetItem *item, int column);
|
||||
void on_savedList_itemDoubleClicked(RDTreeWidgetItem *item, int column);
|
||||
@@ -86,7 +87,6 @@ public slots:
|
||||
|
||||
// manual slots
|
||||
void setFormat(const QString &format);
|
||||
void setErrors(const QString &errors);
|
||||
void updateFormatList();
|
||||
|
||||
private slots:
|
||||
@@ -96,5 +96,7 @@ private:
|
||||
Ui::BufferFormatSpecifier *ui;
|
||||
ICaptureContext *m_Ctx;
|
||||
|
||||
ScintillaEdit *formatText;
|
||||
|
||||
QString m_AutoFormat;
|
||||
};
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<property name="title">
|
||||
<string>Format</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<layout class="QHBoxLayout" name="mainLayout">
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
@@ -56,9 +56,6 @@
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="formatText"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="helpText">
|
||||
<property name="html">
|
||||
@@ -240,61 +237,6 @@ p, li { white-space: pre-wrap; }
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QLabel" name="errors">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="palette">
|
||||
<palette>
|
||||
<active>
|
||||
<colorrole role="WindowText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>170</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</active>
|
||||
<inactive>
|
||||
<colorrole role="WindowText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>170</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</inactive>
|
||||
<disabled>
|
||||
<colorrole role="WindowText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>106</red>
|
||||
<green>104</green>
|
||||
<blue>100</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</disabled>
|
||||
</palette>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>14</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
|
||||
@@ -2894,9 +2894,7 @@ void BufferViewer::OnEventChanged(uint32_t eventId)
|
||||
}
|
||||
}
|
||||
|
||||
QString errors;
|
||||
ParsedFormat parsed =
|
||||
BufferFormatter::ParseFormatString(m_Format, m_ByteSize, IsCBufferView(), errors);
|
||||
ParsedFormat parsed = BufferFormatter::ParseFormatString(m_Format, m_ByteSize, IsCBufferView());
|
||||
|
||||
bufdata->vsinConfig.fixedVars = parsed.fixed;
|
||||
bufdata->vsinConfig.packing = parsed.packing;
|
||||
@@ -4944,8 +4942,6 @@ void BufferViewer::on_setFormat_toggled(bool checked)
|
||||
|
||||
void BufferViewer::processFormat(const QString &format)
|
||||
{
|
||||
QString errors;
|
||||
|
||||
// save scroll values now before we reset all the models
|
||||
m_Scrolls = new PopulateBufferData;
|
||||
FillScrolls(m_Scrolls);
|
||||
@@ -4964,7 +4960,7 @@ void BufferViewer::processFormat(const QString &format)
|
||||
}
|
||||
else
|
||||
{
|
||||
parsed = BufferFormatter::ParseFormatString(format, m_ByteSize, IsCBufferView(), errors);
|
||||
parsed = BufferFormatter::ParseFormatString(format, m_ByteSize, IsCBufferView());
|
||||
}
|
||||
|
||||
const bool repeatedVars = parsed.repeating.type.descriptor.type != VarType::Unknown;
|
||||
@@ -5091,7 +5087,7 @@ void BufferViewer::processFormat(const QString &format)
|
||||
byteRangeLength->setValue(m_ByteSize);
|
||||
}
|
||||
|
||||
ui->formatSpecifier->setErrors(errors);
|
||||
ui->formatSpecifier->setErrors(parsed.errors);
|
||||
|
||||
OnEventChanged(m_Ctx.CurEvent());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user