Add QActionGroup

This commit is contained in:
Simon De Backer
2020-10-03 15:54:38 +02:00
parent 937a6d740b
commit a7920ea5fc

View File

@@ -75,6 +75,7 @@
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QPushButton> #include <QPushButton>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QActionGroup>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@@ -86,14 +87,14 @@ QT_BEGIN_NAMESPACE
namespace qdesigner_internal { namespace qdesigner_internal {
// Richtext simplification filter helpers: Elements to be discarded // Richtext simplification filter helpers: Elements to be discarded
static inline bool filterElement(const QStringRef &name) static inline bool filterElement(const QStringView &name)
{ {
return name != QLatin1String("meta") && name != QLatin1String("style"); return name != QLatin1String("meta") && name != QLatin1String("style");
} }
// Richtext simplification filter helpers: Filter attributes of elements // Richtext simplification filter helpers: Filter attributes of elements
static inline void filterAttributes( static inline void filterAttributes(
const QStringRef &name, const QStringView &name,
QXmlStreamAttributes *atts, QXmlStreamAttributes *atts,
bool *paragraphAlignmentFound) bool *paragraphAlignmentFound)
{ {
@@ -122,8 +123,8 @@ namespace qdesigner_internal {
} }
} }
// Richtext simplification filter helpers: Check for blank QStringRef. // Richtext simplification filter helpers: Check for blank QStringView.
static inline bool isWhiteSpace(const QStringRef &in) static inline bool isWhiteSpace(const QStringView &in)
{ {
const int count = in.size(); const int count = in.size();
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
@@ -150,7 +151,7 @@ namespace qdesigner_internal {
case QXmlStreamReader::StartElement: case QXmlStreamReader::StartElement:
elementCount++; elementCount++;
if (filterElement(reader.name())) { if (filterElement(reader.name())) {
const QStringRef name = reader.name(); const QStringView name = reader.name();
QXmlStreamAttributes attributes = reader.attributes(); QXmlStreamAttributes attributes = reader.attributes();
filterAttributes(name, &attributes, &paragraphAlignmentFound); filterAttributes(name, &attributes, &paragraphAlignmentFound);
writer.writeStartElement(name.toString()); writer.writeStartElement(name.toString());