summaryrefslogtreecommitdiffstats
path: root/src/gui/doc/snippets
diff options
context:
space:
mode:
authorLaszlo Agocs <[email protected]>2023-07-11 12:08:18 +0200
committerLaszlo Agocs <[email protected]>2023-07-12 11:42:00 +0200
commitbcf14392df0d83e79e10022112aea7dd91c5a1f9 (patch)
tree523ae640e91f5e90ce50f344e7c1ff5f7977cdc2 /src/gui/doc/snippets
parentec2faefbc248b733b4382aadf0cbbfe5c0cc3e19 (diff)
rhi doc: Make getShader in the snippets more compact
One line is better than three. Pick-to: 6.6 Change-Id: Ib738ec18b51accead3897b450b26207b3fba87d8 Reviewed-by: Laszlo Agocs <[email protected]>
Diffstat (limited to 'src/gui/doc/snippets')
-rw-r--r--src/gui/doc/snippets/rhioffscreen/main.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/gui/doc/snippets/rhioffscreen/main.cpp b/src/gui/doc/snippets/rhioffscreen/main.cpp
index b3fac4b5201..217b07dcdad 100644
--- a/src/gui/doc/snippets/rhioffscreen/main.cpp
+++ b/src/gui/doc/snippets/rhioffscreen/main.cpp
@@ -82,9 +82,7 @@ int main(int argc, char **argv)
ps->setTargetBlends({ premulAlphaBlend });
static auto getShader = [](const QString &name) {
QFile f(name);
- if (f.open(QIODevice::ReadOnly))
- return QShader::fromSerialized(f.readAll());
- return QShader();
+ return f.open(QIODevice::ReadOnly) ? QShader::fromSerialized(f.readAll()) : QShader();
};
ps->setShaderStages({
{ QRhiShaderStage::Vertex, getShader(QLatin1String("color.vert.qsb")) },