20 : m_stdout(stdout,
QFile::WriteOnly |
QFile::Text)
32template <
class DomClass>
33Driver::DomObjectHashConstIt<DomClass>
34 Driver::findByAttributeNameIt(
const DomObjectHash<DomClass> &domHash,
37 const auto end = domHash.cend();
39 if (
it.key()->attributeName() ==
name)
45template <
class DomClass>
46const DomClass *Driver::findByAttributeName(
const DomObjectHash<DomClass> &domHash,
49 auto it = findByAttributeNameIt(domHash,
name);
50 return it != domHash.
cend() ?
it.key() :
nullptr;
53template <
class DomClass>
54QString Driver::findOrInsert(DomObjectHash<DomClass> *domHash,
const DomClass *
dom,
58 if (
it == domHash->
end()) {
68 const bool isMember = !m_widgets.isEmpty();
69 return findOrInsert(&m_widgets, ui_widget, ui_widget->
attributeClass(), isMember);
79 return findOrInsert(&m_layouts, ui_layout, ui_layout->
attributeClass());
84 switch (ui_layoutItem->
kind()) {
107 return findOrInsert(&m_actions, ui_action,
actionClass());
118 return findByAttributeName(m_buttonGroups, attributeName);
131 [] (
QChar c) { return !c.isLetterOrNumber(); },
139 bool alreadyUsed =
false;
155 if (alreadyUsed && !
className.isEmpty()) {
156 fprintf(stderr,
"%s: Warning: The name '%s' (%s) is already in use, defaulting to '%s'.\n",
170 if (qname.
at(0) == u
'Q' || qname.
at(0) == u
'K')
181 return (
c.toUpper() >= u
'A' &&
c.toUpper() <= u
'Z') ||
c.isDigit() ||
c == u
'_';
188 if (
name.isEmpty()) {
206 for (
int i = 0;
i < baseName.
size(); ++
i) {
215 return baseName.
toUpper() +
"_H"_L1;
235 m_output =
out !=
nullptr ?
out : &m_stdout;
240 m_output = oldOutput;
259 bool deleteOutput =
false;
277 bool rtn = tool.
write(&
f);
283 m_output = oldOutput;
290 return findByAttributeName(m_widgets, attributeName);
295 auto it = findByAttributeNameIt(m_widgets, attributeName);
296 return it != m_widgets.cend() ?
it.value() :
QString();
301 return findByAttributeName(m_actionGroups, attributeName);
306 return findByAttributeName(m_actions, attributeName);
DomLayout * elementLayout() const
DomWidget * elementWidget() const
DomSpacer * elementSpacer() const
QString attributeClass() const
bool attributeIdbasedtr() const
bool uic(const QString &fileName, QTextStream *output=nullptr)
void setUseIdBasedTranslations(bool u)
const DomAction * actionByName(const QString &attributeName) const
QString widgetVariableName(const QString &attributeName) const
static QString qtify(const QString &name)
const DomActionGroup * actionGroupByName(const QString &attributeName) const
QString unique(const QString &instanceName=QString(), const QString &className=QString())
QString findOrInsertButtonGroup(const DomButtonGroup *ui_group)
static QString normalizedName(const QString &name)
QString findOrInsertWidget(const DomWidget *ui_widget)
const DomWidget * widgetByName(const QString &attributeName) const
QString findOrInsertActionGroup(const DomActionGroup *ui_group)
QString findOrInsertLayoutItem(const DomLayoutItem *ui_layoutItem)
const DomButtonGroup * findButtonGroup(const QString &attributeName) const
QString headerFileName() const
QString findOrInsertAction(const DomAction *ui_action)
QString findOrInsertLayout(const DomLayout *ui_layout)
QString findOrInsertSpacer(const DomSpacer *ui_spacer)
QString findOrInsertName(const QString &name)
bool printDependencies(const QString &fileName)
constexpr bool isDigit() const noexcept
Returns true if the character is a decimal digit (Number_DecimalDigit); otherwise returns false.
QChar toLower() const noexcept
Returns the lowercase equivalent if the character is uppercase or titlecase; otherwise returns the ch...
constexpr bool isUpper() const noexcept
Returns true if the character is an uppercase letter, for example category() is Letter_Uppercase.
\inmodule QtCore \reentrant
QString baseName() const
Returns the base name of the file without the path.
bool contains(const Key &key) const noexcept
Returns true if the hash contains an item with the key; otherwise returns false.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
const_iterator cend() const noexcept
iterator find(const T &value)
const_iterator cbegin() const noexcept
iterator insert(const T &value)
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString & replace(qsizetype i, qsizetype len, QChar after)
qsizetype size() const
Returns the number of characters in this string.
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString & append(QChar c)
QString & remove(qsizetype i, qsizetype len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
QString & prepend(QChar c)
QString toUpper() const &
bool write(QIODevice *in)
QSet< QString >::iterator it
static QString buttonGroupClass()
static bool isAnsiCCharacter(QChar c)
static QString spacerItemClass()
static QString actionGroupClass()
static QString actionClass()
Combined button and popup list for selecting options.
GLenum GLuint GLintptr GLsizeiptr size
[1]
#define qPrintable(string)
#define QStringLiteral(str)
const char className[16]
[1]
QFileInfo info(fileName)
[8]
QTextStream out(stdout)
[7]
QString messagePrefix() const
unsigned int dependencies