Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickfontdialogimpl.cpp
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
6
7#include <QtQuickTemplates2/private/qquickdialogbuttonbox_p_p.h>
8#include <private/qfontdatabase_p.h>
9
10#include <QRegularExpression>
11
13
14Q_LOGGING_CATEGORY(lcAttachedProperty, "qt.quick.dialogs.quickfontdialogimpl.attachedOrWarn")
15
19
21{
24 qmlAttachedPropertiesObject<QQuickFontDialogImpl>(q));
25 if (!attached) {
26 qCWarning(lcAttachedProperty)
27 << "Expected FontDialogImpl attached object to be present on" << this;
28 }
29 return attached;
30}
31
33
42
47
52
53QSharedPointer<QFontDialogOptions> QQuickFontDialogImpl::options() const
54{
55 Q_D(const QQuickFontDialogImpl);
56
57 return d->options;
58}
59
60void QQuickFontDialogImpl::setOptions(const QSharedPointer<QFontDialogOptions> &options)
61{
63
64 if (options == d->options)
65 return;
66
67 d->options = options;
68
70}
71
73{
74 Q_D(const QQuickFontDialogImpl);
75 return d->currentFont;
76}
77
78void QQuickFontDialogImpl::setCurrentFont(const QFont &font, bool selectInListViews)
79{
81
82 if (font == d->currentFont)
83 return;
84
85 d->currentFont = font;
86
88
89 if (!selectInListViews)
90 return;
91
92 QQuickFontDialogImplAttached *attached = d->attachedOrWarn();
93 if (!attached)
94 return;
95
96 if (!attached->familyListView()->model().isValid()) {
97 const QSignalBlocker blocker(attached->sampleEdit());
98 attached->updateFamilies();
99 }
100
101 attached->selectFontInListViews(font);
102}
103
105{
107 QQuickFontDialogImplAttached *attached = d->attachedOrWarn();
108 if (!attached)
109 return;
110
111 if (!attached->familyListView()->model().isValid())
112 attached->updateFamilies();
113
115}
116
118{
120
122
123 QQuickFontDialogImplAttached *attached = d->attachedOrWarn();
124 if (!attached)
125 return;
126
127 // The family and style text edits are read-only so that they
128 // can show the current selection but also allow key input to "search".
129 // This is why we handle just the release event, and don't accept it.
130 if (window()->activeFocusItem() == attached->familyEdit())
131 attached->searchFamily(event->text());
132 else if (window()->activeFocusItem() == attached->styleEdit())
133 attached->searchStyle(event->text());
134}
135
137{
139
141
142 QQuickFontDialogImplAttached *attached = d->attachedOrWarn();
143 if (!attached)
144 return;
145
146 attached->clearSearch();
147}
148
151 m_writingSystem(QFontDatabase::Any),
152 m_selectedSize(-1),
153 m_smoothlyScalable(false),
154 m_ignoreFamilyUpdate(false),
155 m_ignoreStyleUpdate(false)
156{
157 if (!qobject_cast<QQuickFontDialogImpl *>(parent)) {
158 qmlWarning(this) << "FontDialogImpl attached properties should only be "
159 << "accessed through the root FileDialogImpl instance";
160 }
161}
162
164{
166 return d->familyListView;
167}
168
170{
172 if (d->familyListView == familyListView)
173 return;
174
175 if (d->familyListView) {
177 this, &QQuickFontDialogImplAttached::_q_familyChanged);
178 }
179
180 d->familyListView = familyListView;
181
182 if (familyListView) {
184 this, &QQuickFontDialogImplAttached::_q_familyChanged);
185 }
186
188}
189
191{
193 return d->styleListView;
194}
195
197{
199 if (d->styleListView == styleListView)
200 return;
201
202 if (d->styleListView) {
204 this, &QQuickFontDialogImplAttached::_q_styleChanged);
205 }
206
207 d->styleListView = styleListView;
208
209 if (styleListView) {
211 this, &QQuickFontDialogImplAttached::_q_styleChanged);
212 }
213
215}
216
218{
220 return d->sizeListView;
221}
222
224{
226 if (d->sizeListView == sizeListView)
227 return;
228
229 if (d->sizeListView) {
231 this, &QQuickFontDialogImplAttached::_q_sizeChanged);
232 }
233
234 d->sizeListView = sizeListView;
235
236 if (d->sizeListView) {
238 this, &QQuickFontDialogImplAttached::_q_sizeChanged);
239 }
240
242}
243
245{
247 return d->sampleEdit;
248}
249
251{
253
254 if (d->sampleEdit == sampleEdit)
255 return;
256
257 if (d->sampleEdit) {
259 d, &QQuickFontDialogImplAttachedPrivate::currentFontChanged);
260 }
261
262 d->sampleEdit = sampleEdit;
263
264 if (d->sampleEdit) {
266 d, &QQuickFontDialogImplAttachedPrivate::currentFontChanged);
267
268 d->sampleEdit->setText(QFontDatabase::writingSystemSample(m_writingSystem));
269 }
270
272}
273
275{
277 return d->buttonBox;
278}
279
281{
283 if (buttonBox == d->buttonBox)
284 return;
285
286 if (d->buttonBox) {
287 QQuickFontDialogImpl *fontDialogImpl = qobject_cast<QQuickFontDialogImpl *>(parent());
288 if (fontDialogImpl) {
289 auto dialogPrivate = QQuickDialogPrivate::get(fontDialogImpl);
291 dialogPrivate, &QQuickDialogPrivate::handleAccept);
293 dialogPrivate, &QQuickDialogPrivate::handleReject);
296 }
297 }
298
299 d->buttonBox = buttonBox;
300
301 if (buttonBox) {
302 QQuickFontDialogImpl *fontDialogImpl = qobject_cast<QQuickFontDialogImpl *>(parent());
303 if (fontDialogImpl) {
304 auto dialogPrivate = QQuickDialogPrivate::get(fontDialogImpl);
309 QObjectPrivate::connect(d->buttonBox, &QQuickDialogButtonBox::clicked, dialogPrivate,
311 }
312 }
313
315}
316
318{
320 return d->writingSystemComboBox;
321}
322
324{
326
327 if (d->writingSystemComboBox == writingSystemComboBox)
328 return;
329
330 if (d->writingSystemComboBox) {
331 disconnect(d->writingSystemComboBox, &QQuickComboBox::activated,
332 this, &QQuickFontDialogImplAttached::_q_writingSystemChanged);
333 }
334
335 d->writingSystemComboBox = writingSystemComboBox;
336
337 if (d->writingSystemComboBox) {
338 QStringList writingSystemModel;
339 for (int i = 0; i < QFontDatabase::WritingSystemsCount; ++i) {
342 if (wsName.isEmpty())
343 break;
344 writingSystemModel.append(wsName);
345 }
346
347 d->writingSystemComboBox->setModel(writingSystemModel);
348
349 connect(d->writingSystemComboBox, &QQuickComboBox::activated,
350 this, &QQuickFontDialogImplAttached::_q_writingSystemChanged);
351 }
352
354}
355
357{
359 return d->underlineCheckBox;
360}
361
363{
365
366 if (d->underlineCheckBox == underlineCheckBox)
367 return;
368
369 if (d->underlineCheckBox) {
371 this, &QQuickFontDialogImplAttached::_q_updateSample);
372 }
373
374 d->underlineCheckBox = underlineCheckBox;
375
376 if (d->underlineCheckBox) {
377 connect(d->underlineCheckBox, &QQuickCheckBox::checkStateChanged,
378 this, &QQuickFontDialogImplAttached::_q_updateSample);
379 }
380
382}
383
385{
387 return d->strikeoutCheckBox;
388}
389
391{
393
394 if (d->strikeoutCheckBox == strikeoutCheckBox)
395 return;
396
397 if (d->strikeoutCheckBox) {
399 this, &QQuickFontDialogImplAttached::_q_updateSample);
400 }
401
402 d->strikeoutCheckBox = strikeoutCheckBox;
403
404 if (d->strikeoutCheckBox) {
405 connect(d->strikeoutCheckBox, &QQuickCheckBox::checkStateChanged,
406 this, &QQuickFontDialogImplAttached::_q_updateSample);
407 }
408
410}
411
413{
415 return d->familyEdit;
416}
417
419{
421
422 if (d->familyEdit == familyEdit)
423 return;
424
425 d->familyEdit = familyEdit;
426
428}
429
431{
433 return d->styleEdit;
434}
435
437{
439
440 if (d->styleEdit == styleEdit)
441 return;
442
443 d->styleEdit = styleEdit;
444
446}
447
449{
451 return d->sizeEdit;
452}
453
455{
457
458 if (d->sizeEdit == sizeEdit)
459 return;
460
461 if (d->sizeEdit) {
463 this, &QQuickFontDialogImplAttached::_q_sizeEdited);
464 }
465
466 d->sizeEdit = sizeEdit;
467
468 if (d->sizeEdit) {
470 this, &QQuickFontDialogImplAttached::_q_sizeEdited);
471 }
472
474}
475
476static int findFamilyInModel(const QString &selectedFamily, const QStringList &model)
477{
478 enum match_t { MATCH_NONE = 0, MATCH_LAST_RESORT = 1, MATCH_APP = 2, MATCH_FAMILY = 3 };
479 QString foundryName1, familyName1, foundryName2, familyName2;
480 int bestFamilyMatch = -1;
481 match_t bestFamilyType = MATCH_NONE;
482 const QFont f;
483
484 QFontDatabasePrivate::parseFontName(selectedFamily, foundryName1, familyName1);
485
486 int i = 0;
487 for (auto it = model.constBegin(); it != model.constEnd(); ++it, ++i) {
488 QFontDatabasePrivate::parseFontName(*it, foundryName2, familyName2);
489
490 if (familyName1 == familyName2) {
491 bestFamilyType = MATCH_FAMILY;
492 if (foundryName1 == foundryName2)
493 return i;
494 else
495 bestFamilyMatch = i;
496 }
497
498 // fallbacks
499 match_t type = MATCH_NONE;
500 if (bestFamilyType <= MATCH_NONE && familyName2 == QStringLiteral("helvetica"))
501 type = MATCH_LAST_RESORT;
502 if (bestFamilyType <= MATCH_LAST_RESORT && familyName2 == f.families().constFirst())
503 type = MATCH_APP;
504 if (type != MATCH_NONE) {
505 bestFamilyType = type;
506 bestFamilyMatch = i;
507 }
508 }
509
510 return bestFamilyMatch;
511}
512
513static int findStyleInModel(const QString &selectedStyle, const QStringList &model)
514{
515 if (model.isEmpty())
516 return -1;
517
518 if (!selectedStyle.isEmpty()) {
520 if (idx >= 0)
521 return idx;
522
523 enum class StyleClass {Unknown, Normal, Italic};
524 auto classifyStyleFallback = [](const QString & style) {
525 if (style.toLower() == QLatin1String("italic") || style.toLower() == QLatin1String("oblique"))
526 return StyleClass::Italic;
527 if (style.toLower() == QLatin1String("normal") || style.toLower() == QLatin1String("regular"))
528 return StyleClass::Normal;
529 return StyleClass::Unknown;
530 };
531
532 auto styleClass = classifyStyleFallback(selectedStyle);
533
534 if (styleClass != StyleClass::Unknown)
535 for (int i = 0; i < model.size(); ++i)
536 if (classifyStyleFallback(model.at(i)) == styleClass)
537 return i;
538 }
539 return 0;
540}
541
549{
550 const QFontDialogOptions::FontDialogOptions scalableMask(
552
553 const QFontDialogOptions::FontDialogOptions spacingMask(QFontDialogOptions::ProportionalFonts
555
556 const auto p = qobject_cast<QQuickFontDialogImpl *>(parent());
557
558 const auto options = p->options()->options();
559
560 QStringList familyNames;
561 const auto families = QFontDatabase::families(m_writingSystem);
562 for (const auto &family : families) {
564 continue;
565
566 if ((options & scalableMask) && (options & scalableMask) != scalableMask) {
567 if (bool(options & QFontDialogOptions::ScalableFonts)
569 continue;
570 }
571
572 if ((options & spacingMask) && (options & scalableMask) != spacingMask) {
573 if (bool(options & QFontDialogOptions::MonospacedFonts)
575 continue;
576 }
577
578 familyNames << family;
579 }
580
581 auto listView = familyListView();
582
583 // Index will be set to -1 on empty model, and 0 for non empty models.
584 m_ignoreFamilyUpdate = !m_selectedFamily.isEmpty();
585 listView->setModel(familyNames);
586 m_ignoreFamilyUpdate = false;
587
588 // Will overwrite selectedFamily and selectedStyle
589 listView->setCurrentIndex(findFamilyInModel(m_selectedFamily, familyNames));
590
591 if (familyNames.isEmpty())
592 _q_familyChanged();
593}
594
603void QQuickFontDialogImplAttached::updateStyles()
604{
605 const QString family = familyListView()->currentIndex() >= 0 ? m_selectedFamily : QString();
606 const QStringList styles = QFontDatabase::styles(family);
607
608 auto listView = styleListView();
609
610 m_ignoreStyleUpdate = !m_selectedStyle.isEmpty();
611 listView->setModel(styles);
612
613 if (styles.isEmpty()) {
614 styleEdit()->clear();
615 m_smoothlyScalable = false;
616 } else {
617 int newIndex = findStyleInModel(m_selectedStyle, styles);
618
619 listView->setCurrentIndex(newIndex);
620
621 m_selectedStyle = styles.at(newIndex);
622 styleEdit()->setText(m_selectedStyle);
623
624 m_smoothlyScalable = QFontDatabase::isSmoothlyScalable(m_selectedFamily, m_selectedStyle);
625 }
626
627 m_ignoreStyleUpdate = false;
628
629 updateSizes();
630}
631
638void QQuickFontDialogImplAttached::updateSizes()
639{
640 if (!m_selectedFamily.isEmpty()) {
641 const QList<int> sizes = QFontDatabase::pointSizes(m_selectedFamily, m_selectedStyle);
642
643 QStringList str_sizes;
644
645 str_sizes.reserve(sizes.size());
646
647 int idx = 0, current = -1;
649 str_sizes.append(QString::number(*it));
650 if (current == -1 && m_selectedSize == *it) {
651 current = idx;
652 }
653 ++idx;
654 }
655
656 auto listView = sizeListView();
657
658 // only select the first element in the model when this function is first called and the new model isn't empty
659 listView->setModel(str_sizes);
660
661 if (current != -1)
662 listView->setCurrentIndex(current);
663
664 sizeEdit()->setText(!m_smoothlyScalable && listView->currentIndex() > 0
665 ? str_sizes.at(listView->currentIndex())
666 : QString::number(m_selectedSize));
667 } else {
668 qCWarning(lcAttachedProperty) << "Warning! selectedFamily is empty";
669 sizeEdit()->clear();
670 }
671
672 _q_updateSample();
673}
674
675void QQuickFontDialogImplAttached::_q_updateSample()
676{
677 if (m_selectedFamily.isEmpty())
678 return;
679
680 const int pSize = sizeEdit()->text().toInt();
681
682 QFont newFont = QFontDatabase::font(m_selectedFamily, m_selectedStyle, pSize);
683
684 newFont.setUnderline(underlineCheckBox()->isChecked());
685 newFont.setStrikeOut(strikeoutCheckBox()->isChecked());
686
687 sampleEdit()->setFont(newFont);
688}
689
690void QQuickFontDialogImplAttached::_q_writingSystemChanged(int index)
691{
692 m_writingSystem = QFontDatabase::WritingSystem(index);
694
696}
697
698void QQuickFontDialogImplAttached::searchListView(const QString &s, QQuickListView *listView)
699{
700 if (s.isEmpty())
701 return;
702
703 const QStringList model = listView->model().toStringList();
704
705 bool redo = false;
706
707 do {
708 m_search.append(s);
709
710 for (int i = 0; i < model.size(); ++i) {
711 if (model.at(i).startsWith(m_search, Qt::CaseInsensitive)) {
713 return;
714 }
715 }
716
717 clearSearch();
718
719 redo = !redo;
720 } while (redo);
721}
722
724{
725 m_search.clear();
726}
727
728void QQuickFontDialogImplAttached::_q_familyChanged()
729{
730 if (m_ignoreFamilyUpdate)
731 return;
732
733 const int index = familyListView()->currentIndex();
734
735 if (index < 0) {
736 familyEdit()->clear();
737 } else {
738 m_selectedFamily = familyListView()->model().toStringList().at(index);
739 familyEdit()->setText(m_selectedFamily);
740 }
741
742 updateStyles();
743}
744
745void QQuickFontDialogImplAttached::_q_styleChanged()
746{
747 if (m_ignoreStyleUpdate)
748 return;
749
750 const int index = styleListView()->currentIndex();
751
752 if (index < 0) {
753 qCWarning(lcAttachedProperty) << "currentIndex changed to -1";
754 return;
755 }
756
757 m_selectedStyle = styleListView()->model().toStringList().at(index);
758 styleEdit()->setText(m_selectedStyle);
759 m_smoothlyScalable = QFontDatabase::isSmoothlyScalable(m_selectedFamily, m_selectedStyle);
760
761 updateSizes();
762}
763
764void QQuickFontDialogImplAttached::_q_sizeEdited()
765{
766 const int size = qAbs(sizeEdit()->text().toInt());
767
768 if (size == m_selectedSize)
769 return;
770
771 m_selectedSize = size;
772
773 if (sizeListView()->count()) {
774 auto model = sizeListView()->model().toStringList();
775
776 int i;
777 for (i = 0; i < model.size() - 1; ++i) {
778 if (model.at(i).toInt() >= size)
779 break;
780 }
781
782 QSignalBlocker blocker(sizeListView());
783 if (model.at(i).toInt() == size)
785 else
787 }
788
789 _q_updateSample();
790}
791
792void QQuickFontDialogImplAttached::_q_sizeChanged()
793{
794 const int index = sizeListView()->currentIndex();
795
796 if (index < 0) {
797 qCWarning(lcAttachedProperty) << "currentIndex changed to -1";
798 return;
799 }
800
801 const QString s = sizeListView()->model().toStringList().at(index);
802 m_selectedSize = s.toInt();
803
804 sizeEdit()->setText(s);
805
806 _q_updateSample();
807}
808
809void QQuickFontDialogImplAttachedPrivate::currentFontChanged(const QFont &font)
810{
811 auto fontDialogImpl = qobject_cast<QQuickFontDialogImpl *>(parent);
812
813 if (!fontDialogImpl) {
814 return;
815 }
816
817 fontDialogImpl->setCurrentFont(font);
818}
819
834
836
837#include "moc_qquickfontdialogimpl_p.cpp"
QAbstractItemModel * model() const
Returns the model that this view is presenting.
void setCurrentIndex(const QModelIndex &index)
Sets the current item to be the item at index.
QModelIndex currentIndex() const
Returns the model index of the current item.
virtual void setModel(QAbstractItemModel *model)
Sets the model for the view to present.
The QFocusEvent class contains event parameters for widget focus events.
Definition qevent.h:470
static void parseFontName(const QString &name, QString &foundry, QString &family)
\threadsafe \inmodule QtGui
static QString writingSystemName(WritingSystem writingSystem)
Returns the names the writingSystem (e.g.
WritingSystem
\value Any \value Latin \value Greek \value Cyrillic \value Armenian \value Hebrew \value Arabic \val...
static bool isSmoothlyScalable(const QString &family, const QString &style=QString())
Returns true if the font that has family family and style style is smoothly scalable; otherwise retur...
static bool isPrivateFamily(const QString &family)
static QString styleString(const QFont &font)
Returns a string that describes the style of the font.
static QFont font(const QString &family, const QString &style, int pointSize)
Returns a QFont object that has family family, style style and point size pointSize.
static QString writingSystemSample(WritingSystem writingSystem)
Returns a string with sample characters from writingSystem.
static QStringList families(WritingSystem writingSystem=Any)
Returns a sorted list of the available font families which support the writingSystem.
static QList< int > pointSizes(const QString &family, const QString &style=QString())
Returns a list of the point sizes available for the font that has family family and style styleName.
static QStringList styles(const QString &family)
Returns a list of the styles available for the font family family.
static bool isFixedPitch(const QString &family, const QString &style=QString())
Returns true if the font that has family family and style style is fixed pitch; otherwise returns fal...
\reentrant
Definition qfont.h:22
bool strikeOut() const
Returns true if strikeout has been set; otherwise returns false.
Definition qfont.cpp:1304
bool underline() const
Returns true if underline has been set; otherwise returns false.
Definition qfont.cpp:1251
QStringList families() const
Definition qfont.cpp:2699
int pointSize() const
Returns the point size of the font.
Definition qfont.cpp:884
The QKeyEvent class describes a key event.
Definition qevent.h:424
QObject * parent
Definition qobject.h:73
static QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
Definition qobject_p.h:299
static bool disconnect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
Definition qobject_p.h:328
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2960
void setChecked(bool checked)
void checkStateChanged()
void activated(int index)
void clicked(QQuickAbstractButton *button)
virtual void handleClick(QQuickAbstractButton *button)
static QQuickDialogPrivate * get(QQuickDialog *dialog)
virtual void handleAccept()
static QPlatformDialogHelper::ButtonRole buttonRole(QQuickAbstractButton *button)
Popup dialog with standard buttons and a title, used for short-term interaction with the user.
virtual void handleReject()
void selectFontInListViews(const QFont &font)
void setButtonBox(QQuickDialogButtonBox *buttonBox)
void setSizeEdit(QQuickTextField *sizeEdit)
void setFamilyEdit(QQuickTextField *familyEdit)
void setSampleEdit(QQuickTextEdit *sampleEdit)
void setStyleEdit(QQuickTextField *styleEdit)
void setSizeListView(QQuickListView *sizeListView)
void setUnderlineCheckBox(QQuickCheckBox *underlineCheckBox)
void setFamilyListView(QQuickListView *familyListView)
QQuickFontDialogImplAttached(QObject *parent=nullptr)
void setWritingSystemComboBox(QQuickComboBox *writingSystemComboBox)
void setStrikeoutCheckBox(QQuickCheckBox *strikethroughCheckBox)
void setStyleListView(QQuickListView *styleListView)
QQuickDialogButtonBox * buttonBox
void handleClick(QQuickAbstractButton *button) override
QQuickFontDialogImplAttached * attachedOrWarn()
static QQuickFontDialogImplAttached * qmlAttachedProperties(QObject *object)
QSharedPointer< QFontDialogOptions > options() const
void currentFontChanged(const QFont &font)
void setCurrentFont(const QFont &font, bool selectInListViews=false)
QQuickFontDialogImpl(QObject *parent=nullptr)
void setOptions(const QSharedPointer< QFontDialogOptions > &options)
void keyReleaseEvent(QKeyEvent *event) override
void focusOutEvent(QFocusEvent *event) override
void currentIndexChanged()
void setCurrentIndex(int idx)
void setVisible(bool)
virtual void focusOutEvent(QFocusEvent *event)
virtual void keyReleaseEvent(QKeyEvent *event)
void setFont(const QFont &font)
void fontChanged(const QFont &font)
void setText(const QString &)
\qmlproperty string QtQuick::TextEdit::font.family
void setText(const QString &)
\inmodule QtCore \reentrant
static QString escape(const QString &str)
This is an overloaded member function, provided for convenience. It differs from the above function o...
const_iterator constBegin() const noexcept
Definition qset.h:139
const_iterator constEnd() const noexcept
Definition qset.h:143
Exception-safe wrapper around QObject::blockSignals().
Definition qobject.h:483
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
int toInt(bool *ok=nullptr, int base=10) const
Returns the string converted to an int using base base, which is 10 by default and must be between 2 ...
Definition qstring.h:731
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
Definition qstring.h:192
void clear()
Clears the contents of the string and makes it null.
Definition qstring.h:1252
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:8084
QString & append(QChar c)
Definition qstring.cpp:3252
bool isValid() const
Returns true if the storage type of this variant is not QMetaType::UnknownType; otherwise returns fal...
Definition qvariant.h:714
QStringList toStringList() const
Returns the variant as a QStringList if the variant has userType() \l QMetaType::QStringList,...
QString text
QPushButton * button
[2]
QSet< QString >::iterator it
Combined button and popup list for selecting options.
@ CaseInsensitive
#define Q_LOGGING_CATEGORY(name,...)
#define qCWarning(category,...)
constexpr T qAbs(const T &t)
Definition qnumeric.h:328
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint index
[2]
GLenum GLenum GLsizei count
GLfloat GLfloat f
GLenum type
struct _cl_event * event
GLdouble s
[6]
Definition qopenglext.h:235
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLfloat GLfloat p
[1]
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
static int findFamilyInModel(const QString &selectedFamily, const QStringList &model)
static int findStyleInModel(const QString &selectedStyle, const QStringList &model)
QLatin1StringView QLatin1String
Definition qstringfwd.h:31
#define QStringLiteral(str)
#define emit
static QStringList toStringList(const QJsonArray &jsonArray)
static int toInt(const QChar &qc, int R)
QSqlQueryModel * model
[16]
QListView * listView
myObject disconnect()
[26]