summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/designer/src/components/propertyeditor/previewwidget.ui30
-rw-r--r--src/qdoc/clangcodeparser.cpp30
-rw-r--r--src/qdoc/clangcodeparser.h1
-rw-r--r--src/qdoc/codeparser.cpp12
-rw-r--r--src/qdoc/codeparser.h1
-rw-r--r--src/qdoc/cppcodeparser.cpp2
-rw-r--r--src/qdoc/docbookgenerator.h2
-rw-r--r--src/qdoc/node.cpp14
-rw-r--r--src/qdoc/node.h4
-rw-r--r--src/qdoc/qmlvisitor.cpp2
-rw-r--r--src/qtdiag/qtdiag.cpp54
11 files changed, 100 insertions, 52 deletions
diff --git a/src/designer/src/components/propertyeditor/previewwidget.ui b/src/designer/src/components/propertyeditor/previewwidget.ui
index 64c29229f..077ff24b4 100644
--- a/src/designer/src/components/propertyeditor/previewwidget.ui
+++ b/src/designer/src/components/propertyeditor/previewwidget.ui
@@ -129,7 +129,7 @@
<item>
<widget class="QPushButton" name="toggleButton">
<property name="text">
- <string>ToggleButton</string>
+ <string extracomment="Palette Editor Preview Widget">ToggleButton</string>
</property>
<property name="checkable">
<bool>true</bool>
@@ -147,14 +147,14 @@
<item>
<widget class="QToolButton" name="toolButton">
<property name="text">
- <string>ToolButton</string>
+ <string extracomment="Palette Editor Preview Widget">ToolButton</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="menuToolButton">
<property name="text">
- <string>Menu</string>
+ <string extracomment="Palette Editor Preview Widget">Menu</string>
</property>
</widget>
</item>
@@ -181,7 +181,7 @@
<item row="0" column="1">
<widget class="QGroupBox" name="itemGroupBox">
<property name="title">
- <string>Item Views</string>
+ <string extracomment="Palette Editor Preview Widget">Item Views</string>
</property>
<property name="checkable">
<bool>true</bool>
@@ -194,26 +194,26 @@
</property>
<column>
<property name="text">
- <string>Column 1</string>
+ <string extracomment="Palette Editor Preview Widget">Column 1</string>
</property>
</column>
<item>
<property name="text">
- <string>Top Level 1</string>
+ <string extracomment="Palette Editor Preview Widget">Top Level 1</string>
</property>
<item>
<property name="text">
- <string>Nested Item 1</string>
+ <string extracomment="Palette Editor Preview Widget">Nested Item 1</string>
</property>
</item>
<item>
<property name="text">
- <string>Nested Item 2</string>
+ <string extracomment="Palette Editor Preview Widget">Nested Item 2</string>
</property>
</item>
<item>
<property name="text">
- <string>Nested Item 3</string>
+ <string extracomment="Palette Editor Preview Widget">Nested Item 3</string>
</property>
</item>
</item>
@@ -225,7 +225,7 @@
<item row="1" column="0">
<widget class="QGroupBox" name="simpleGroupBox">
<property name="title">
- <string>Simple Input Widgets</string>
+ <string extracomment="Palette Editor Preview Widget">Simple Input Widgets</string>
</property>
<property name="checkable">
<bool>true</bool>
@@ -252,12 +252,12 @@
</item>
<item>
<property name="text">
- <string>Item1</string>
+ <string extracomment="Palette Editor Preview Widget">Item1</string>
</property>
</item>
<item>
<property name="text">
- <string>Item2</string>
+ <string extracomment="Palette Editor Preview Widget">Item2</string>
</property>
</item>
</widget>
@@ -291,7 +291,7 @@
<item row="1" column="1">
<widget class="QGroupBox" name="displayGroupBox">
<property name="title">
- <string>Display Widgets</string>
+ <string extracomment="Palette Editor Preview Widget">Display Widgets</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
@@ -307,7 +307,7 @@
<item>
<widget class="QLabel" name="label">
<property name="text">
- <string>QLabel</string>
+ <string extracomment="Palette Editor Preview Widget">QLabel</string>
</property>
</widget>
</item>
@@ -317,7 +317,7 @@
<enum>QFrame::StyledPanel</enum>
</property>
<property name="text">
- <string>QLabel with frame</string>
+ <string extracomment="Palette Editor Preview Widget">QLabel with frame</string>
</property>
</widget>
</item>
diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp
index 366e2671e..6a4a77d7c 100644
--- a/src/qdoc/clangcodeparser.cpp
+++ b/src/qdoc/clangcodeparser.cpp
@@ -593,6 +593,8 @@ CXChildVisitResult ClangVisitor::visitFnSignature(CXCursor cursor, CXSourceLocat
bool &ignoreSignature)
{
switch (clang_getCursorKind(cursor)) {
+ case CXCursor_Namespace:
+ return CXChildVisit_Recurse;
case CXCursor_FunctionDecl:
case CXCursor_FunctionTemplate:
case CXCursor_CXXMethod:
@@ -1503,14 +1505,14 @@ void ClangCodeParser::parseSourceFile(const Location & /*location*/, const QStri
return;
}
- CXCursor cur = clang_getTranslationUnitCursor(tu);
+ CXCursor tuCur = clang_getTranslationUnitCursor(tu);
ClangVisitor visitor(qdb_, allHeaders_);
- visitor.visitChildren(cur);
+ visitor.visitChildren(tuCur);
CXToken *tokens;
unsigned int numTokens = 0;
const QSet<QString> &commands = topicCommands() + metaCommands();
- clang_tokenize(tu, clang_getCursorExtent(cur), &tokens, &numTokens);
+ clang_tokenize(tu, clang_getCursorExtent(tuCur), &tokens, &numTokens);
for (unsigned int i = 0; i < numTokens; ++i) {
if (clang_getTokenKind(tokens[i]) != CXToken_Comment)
@@ -1519,7 +1521,8 @@ void ClangCodeParser::parseSourceFile(const Location & /*location*/, const QStri
if (!comment.startsWith("/*!"))
continue;
- auto loc = fromCXSourceLocation(clang_getTokenLocation(tu, tokens[i]));
+ auto commentLoc = clang_getTokenLocation(tu, tokens[i]);
+ auto loc = fromCXSourceLocation(commentLoc);
auto end_loc = fromCXSourceLocation(clang_getRangeEnd(clang_getTokenExtent(tu, tokens[i])));
Doc::trimCStyleComment(loc, comment);
@@ -1536,7 +1539,6 @@ void ClangCodeParser::parseSourceFile(const Location & /*location*/, const QStri
topic = topics[0].topic;
if (topic.isEmpty()) {
- CXSourceLocation commentLoc = clang_getTokenLocation(tu, tokens[i]);
Node *n = nullptr;
if (i + 1 < numTokens) {
// Try to find the next declaration.
@@ -1568,6 +1570,17 @@ void ClangCodeParser::parseSourceFile(const Location & /*location*/, const QStri
}
}
} else {
+ // Store the namespace scope from lexical parents of the comment
+ namespaceScope_.clear();
+ CXCursor cur = clang_getCursor(tu, commentLoc);
+ while (true) {
+ CXCursorKind kind = clang_getCursorKind(cur);
+ if (clang_isTranslationUnit(kind) || clang_isInvalid(kind))
+ break;
+ if (kind == CXCursor_Namespace)
+ namespaceScope_ << fromCXString(clang_getCursorSpelling(cur));
+ cur = clang_getCursorLexicalParent(cur);
+ }
processTopicArgs(doc, topic, nodes, docs);
}
processMetaCommands(nodes, docs);
@@ -1654,9 +1667,14 @@ Node *ClangCodeParser::parseFnArg(const Location &location, const QString &fnArg
args.push_back(pchName_.constData());
}
CXTranslationUnit tu;
- QByteArray fn = fnArg.toUtf8();
+ QByteArray fn;
+ for (const auto &ns : qAsConst(namespaceScope_))
+ fn.prepend("namespace " + ns.toUtf8() + " {");
+ fn += fnArg.toUtf8();
if (!fn.endsWith(";"))
fn += "{ }";
+ fn.append(namespaceScope_.size(), '}');
+
const char *dummyFileName = "/fn_dummyfile.cpp";
CXUnsavedFile unsavedFile { dummyFileName, fn.constData(),
static_cast<unsigned long>(fn.size()) };
diff --git a/src/qdoc/clangcodeparser.h b/src/qdoc/clangcodeparser.h
index 078d307c2..9af292e67 100644
--- a/src/qdoc/clangcodeparser.h
+++ b/src/qdoc/clangcodeparser.h
@@ -78,6 +78,7 @@ private:
QVector<QByteArray> defines_;
std::vector<const char *> args_;
QVector<QByteArray> moreArgs_;
+ QStringList namespaceScope_;
};
QT_END_NAMESPACE
diff --git a/src/qdoc/codeparser.cpp b/src/qdoc/codeparser.cpp
index e9dc3a352..db2d0df97 100644
--- a/src/qdoc/codeparser.cpp
+++ b/src/qdoc/codeparser.cpp
@@ -161,11 +161,11 @@ const QSet<QString> &CodeParser::commonMetaCommands()
<< COMMAND_INJSMODULE << COMMAND_INMODULE << COMMAND_INPUBLICGROUP
<< COMMAND_INQMLMODULE << COMMAND_INTERNAL << COMMAND_MAINCLASS
<< COMMAND_NOAUTOLIST << COMMAND_NONREENTRANT << COMMAND_OBSOLETE
- << COMMAND_PAGEKEYWORDS << COMMAND_PRELIMINARY << COMMAND_QMLABSTRACT
- << COMMAND_QMLDEFAULT << COMMAND_QMLINHERITS << COMMAND_QMLREADONLY
- << COMMAND_QTVARIABLE << COMMAND_REENTRANT << COMMAND_SINCE
- << COMMAND_STARTPAGE << COMMAND_SUBTITLE << COMMAND_THREADSAFE
- << COMMAND_TITLE << COMMAND_WRAPPER;
+ << COMMAND_PRELIMINARY << COMMAND_QMLABSTRACT << COMMAND_QMLDEFAULT
+ << COMMAND_QMLINHERITS << COMMAND_QMLREADONLY << COMMAND_QTVARIABLE
+ << COMMAND_REENTRANT << COMMAND_SINCE << COMMAND_STARTPAGE
+ << COMMAND_SUBTITLE << COMMAND_THREADSAFE << COMMAND_TITLE
+ << COMMAND_WRAPPER;
}
return commonMetaCommands_;
}
@@ -269,7 +269,7 @@ bool CodeParser::isParsingQdoc() const
void CodeParser::checkModuleInclusion(Node *n)
{
if (n->physicalModuleName().isEmpty()) {
- n->setPhysicalModuleName(Generator::defaultModuleName());
+ qdb_->addToModule(Generator::defaultModuleName(), n);
QString word;
switch (n->nodeType()) {
case Node::Class:
diff --git a/src/qdoc/codeparser.h b/src/qdoc/codeparser.h
index 6ab214eb1..7ae34df1d 100644
--- a/src/qdoc/codeparser.h
+++ b/src/qdoc/codeparser.h
@@ -137,7 +137,6 @@ private:
#define COMMAND_OBSOLETE Doc::alias(QLatin1String("obsolete"))
#define COMMAND_OVERLOAD Doc::alias(QLatin1String("overload"))
#define COMMAND_PAGE Doc::alias(QLatin1String("page"))
-#define COMMAND_PAGEKEYWORDS Doc::alias(QLatin1String("pagekeywords"))
#define COMMAND_PERMISSIONS Doc::alias(QLatin1String("permissions"))
#define COMMAND_PRELIMINARY Doc::alias(QLatin1String("preliminary"))
#define COMMAND_PREVIOUSPAGE Doc::alias(QLatin1String("previouspage"))
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp
index 877b08279..dec081c22 100644
--- a/src/qdoc/cppcodeparser.cpp
+++ b/src/qdoc/cppcodeparser.cpp
@@ -620,8 +620,6 @@ void CppCodeParser::processMetaCommand(const Doc &doc, const QString &command,
node->setSince(arg);
} else if (command == COMMAND_WRAPPER) {
node->setWrapper();
- } else if (command == COMMAND_PAGEKEYWORDS) {
- node->addPageKeywords(arg);
} else if (command == COMMAND_THREADSAFE) {
node->setThreadSafeness(Node::ThreadSafe);
} else if (command == COMMAND_TITLE) {
diff --git a/src/qdoc/docbookgenerator.h b/src/qdoc/docbookgenerator.h
index ad5b36220..9a223f4af 100644
--- a/src/qdoc/docbookgenerator.h
+++ b/src/qdoc/docbookgenerator.h
@@ -172,7 +172,7 @@ private:
QString buildversion;
QXmlStreamWriter *writer = nullptr;
- Config *config;
+ Config *config = nullptr;
};
QT_END_NAMESPACE
diff --git a/src/qdoc/node.cpp b/src/qdoc/node.cpp
index cffaf79dd..634cce3ec 100644
--- a/src/qdoc/node.cpp
+++ b/src/qdoc/node.cpp
@@ -1822,12 +1822,6 @@ QString Node::physicalModuleName() const
Returns the node's reconstituted brief data member.
*/
-/*! \fn void Node::addPageKeywords(const QString &t)
- If this is a PageNode, the function appends the string \a t
- to the page keywords data member. Otherwise the function does
- nothing.
- */
-
/*! \fn bool Node::isSharingComment() const
This function returns \c true if the node is sharing a comment
with other nodes. For example, multiple functions can be documented
@@ -3661,14 +3655,6 @@ bool PageNode::setTitle(const QString &title)
Appends \a t to the list of group names.
*/
-/*! \fn const QStringList &PageNode::pageKeywords() const
- Returns a const reference to the list of keywords for this page.
- */
-
-/*! \fn void PageNode::addPageKeywords(const QString &t)
- Appends \a t to the keywords list.
- */
-
/*! \fn void PageNode::setOutputFileName(const QString &f)
Sets this PageNode's output file name to \a f.
*/
diff --git a/src/qdoc/node.h b/src/qdoc/node.h
index f1b356fa4..9f78cc824 100644
--- a/src/qdoc/node.h
+++ b/src/qdoc/node.h
@@ -322,7 +322,6 @@ public:
const QString &templateDecl() const { return templateDecl_; }
const QString &reconstitutedBrief() const { return reconstitutedBrief_; }
QString nodeSubtypeString() const;
- virtual void addPageKeywords(const QString &) {}
bool isSharingComment() const { return (sharedCommentNode_ != nullptr); }
bool hasSharedDoc() const;
@@ -434,8 +433,6 @@ public:
const QStringList &groupNames() const { return groupNames_; }
void appendGroupName(const QString &t) override { groupNames_.append(t); }
- const QStringList &pageKeywords() const { return pageKeywds_; }
- void addPageKeywords(const QString &t) override { pageKeywds_ << t; }
void setOutputFileName(const QString &f) override { outputFileName_ = f; }
QString outputFileName() const override { return outputFileName_; }
@@ -448,7 +445,6 @@ protected:
QString subtitle_;
QString outputFileName_;
QStringList groupNames_;
- QStringList pageKeywds_;
};
class ExternalPageNode : public PageNode
diff --git a/src/qdoc/qmlvisitor.cpp b/src/qdoc/qmlvisitor.cpp
index 168c5e38d..2ee362d77 100644
--- a/src/qdoc/qmlvisitor.cpp
+++ b/src/qdoc/qmlvisitor.cpp
@@ -453,8 +453,6 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation, Node *node, D
node->setStatus(Node::Internal);
} else if (command == COMMAND_OBSOLETE) {
node->setStatus(Node::Obsolete);
- } else if (command == COMMAND_PAGEKEYWORDS) {
- // Not done yet. Do we need this?
} else if (command == COMMAND_PRELIMINARY) {
node->setStatus(Node::Preliminary);
} else if (command == COMMAND_SINCE) {
diff --git a/src/qtdiag/qtdiag.cpp b/src/qtdiag/qtdiag.cpp
index 94b166cad..4fc288cd7 100644
--- a/src/qtdiag/qtdiag.cpp
+++ b/src/qtdiag/qtdiag.cpp
@@ -302,6 +302,48 @@ void dumpRhiBackendInfo(QTextStream &str, const char *name, QRhi::Implementation
{ "ReadBackNonBaseMipLevel", QRhi::ReadBackNonBaseMipLevel },
{ nullptr, QRhi::Feature(0) }
};
+ struct RhiTextureFormat {
+ const char *name;
+ QRhiTexture::Format val;
+ };
+ const RhiTextureFormat textureFormats[] = {
+ { "RGBA8", QRhiTexture::RGBA8 },
+ { "BGRA8", QRhiTexture::BGRA8 },
+ { "R8", QRhiTexture::R8 },
+ { "R16", QRhiTexture::R16 },
+ { "RED_OR_ALPHA8", QRhiTexture::RED_OR_ALPHA8 },
+ { "RGBA16F", QRhiTexture::RGBA16F },
+ { "RGBA32F", QRhiTexture::RGBA32F },
+ { "R16F", QRhiTexture::R16F },
+ { "R32F", QRhiTexture::R32F },
+ { "D16", QRhiTexture::D16 },
+ { "D32F", QRhiTexture::D32F },
+ { "BC1", QRhiTexture::BC1 },
+ { "BC2", QRhiTexture::BC2 },
+ { "BC3", QRhiTexture::BC3 },
+ { "BC4", QRhiTexture::BC4 },
+ { "BC5", QRhiTexture::BC5 },
+ { "BC6H", QRhiTexture::BC6H },
+ { "BC7", QRhiTexture::BC7 },
+ { "ETC2_RGB8", QRhiTexture::ETC2_RGB8 },
+ { "ETC2_RGB8A1", QRhiTexture::ETC2_RGB8A1 },
+ { "ETC2_RGBA8", QRhiTexture::ETC2_RGBA8 },
+ { "ASTC_4x4", QRhiTexture::ASTC_4x4 },
+ { "ASTC_5x4", QRhiTexture::ASTC_5x4 },
+ { "ASTC_5x5", QRhiTexture::ASTC_5x5 },
+ { "ASTC_6x5", QRhiTexture::ASTC_6x5 },
+ { "ASTC_6x6", QRhiTexture::ASTC_6x6 },
+ { "ASTC_8x5", QRhiTexture::ASTC_8x5 },
+ { "ASTC_8x6", QRhiTexture::ASTC_8x6 },
+ { "ASTC_8x8", QRhiTexture::ASTC_8x8 },
+ { "ASTC_10x5", QRhiTexture::ASTC_10x5 },
+ { "ASTC_10x6", QRhiTexture::ASTC_10x6 },
+ { "ASTC_10x8", QRhiTexture::ASTC_10x8 },
+ { "ASTC_10x10", QRhiTexture::ASTC_10x10 },
+ { "ASTC_12x10", QRhiTexture::ASTC_12x10 },
+ { "ASTC_12x12", QRhiTexture::ASTC_12x12 },
+ { nullptr, QRhiTexture::UnknownFormat }
+ };
QScopedPointer<QRhi> rhi(QRhi::create(impl, initParams, QRhi::Flags(), nullptr));
if (rhi) {
@@ -311,10 +353,20 @@ void dumpRhiBackendInfo(QTextStream &str, const char *name, QRhi::Implementation
str << " Max Color Attachments: " << rhi->resourceLimit(QRhi::MaxColorAttachments) << "\n";
str << " Frames in Flight: " << rhi->resourceLimit(QRhi::FramesInFlight) << "\n";
str << " Uniform Buffer Alignment: " << rhi->ubufAlignment() << "\n";
+ QByteArrayList supportedSampleCounts;
+ for (int s : rhi->supportedSampleCounts())
+ supportedSampleCounts << QByteArray::number(s);
+ str << " Supported MSAA sample counts: " << supportedSampleCounts.join(',') << "\n";
str << " Features:\n";
for (int i = 0; features[i].name; i++) {
str << " " << (rhi->isFeatureSupported(features[i].val) ? "v" : "-") << " " << features[i].name << "\n";
}
+ str << " Texture formats:";
+ for (int i = 0; textureFormats[i].name; i++) {
+ if (rhi->isTextureFormatSupported(textureFormats[i].val))
+ str << " " << textureFormats[i].name;
+ }
+ str << "\n";
}
}
@@ -326,7 +378,7 @@ void dumpRhiInfo(QTextStream &str)
{
QRhiGles2InitParams params;
params.fallbackSurface = QRhiGles2InitParams::newFallbackSurface();
- dumpRhiBackendInfo(str, "OpenGL ES2", QRhi::OpenGLES2, &params);
+ dumpRhiBackendInfo(str, "OpenGL (with default QSurfaceFormat)", QRhi::OpenGLES2, &params);
delete params.fallbackSurface;
}
#endif