12#include <private/qcombobox_p.h>
93 if (!uiLanguages.isEmpty())
115 if (writingSystems.
contains(system))
172 const QStyleOptionViewItem &
option,
186 truetype(
QStringLiteral(
":/qt-project.org/styles/commonstyle/images/fonttruetype-16.png")),
194 const QStyleOptionViewItem &
option,
229 r.setRight(
r.right() - actualSize.
width() - 4);
231 r.setLeft(
r.left() + actualSize.
width() + 4);
260 r.setRight(
r.right() -
w);
262 r.setLeft(
r.left() +
w);
310 if ((
filters & scalableMask) && (
filters & scalableMask) != scalableMask) {
314 if ((
filters & spacingMask) && (
filters & spacingMask) != spacingMask) {
330 m->setStringList(
list);
348 if (families.isEmpty() || families.first() !=
text) {
394 d->currentFont =
font();
409 this,
SLOT(_q_updateModel()));
490 return d->currentFont;
496 if (
font !=
d->currentFont) {
497 d->currentFont =
font;
499 if (
d->currentFont ==
font) {
522 lview->window()->setFixedWidth(
qMin(
width() * 5 / 3,
575 d->sampleTextForFontFamily[fontFamily] = sampleText;
586 return d->sampleTextForFontFamily.value(fontFamily);
597 d->displayFontForFontFamily[fontFamily] =
font;
608 return d->displayFontForFontFamily.value(fontFamily, {});
613#include "qfontcombobox.moc"
614#include "moc_qfontcombobox.cpp"
The QAbstractItemDelegate class is used to display and edit data items from a model.
The QComboBox widget is a combined button and popup list.
QAbstractItemView * view() const
Returns the list view used for the combobox popup.
void setItemDelegate(QAbstractItemDelegate *delegate)
Sets the item delegate for the popup list view.
bool event(QEvent *event) override
\reimp
void currentTextChanged(const QString &)
QAbstractItemDelegate * itemDelegate() const
Returns the item delegate used by the popup list view.
virtual void setModel(QAbstractItemModel *model)
Sets the model to be model.
QSize sizeHint() const override
\reimp
void setEditable(bool editable)
static bool closingDown()
Returns true if the application objects are being destroyed; otherwise returns false.
QHash< QString, QFont > displayFontForFontFamily
QFontComboBox::FontFilters filters
void _q_currentChanged(const QString &)
QHash< QString, QString > sampleTextForFontFamily
QHash< QFontDatabase::WritingSystem, QString > sampleTextForWritingSystem
The QFontComboBox widget is a combobox that lets the user select a font family.
void setDisplayFont(const QString &fontFamily, const QFont &font)
Sets the font to be used to display a given fontFamily (when the combo is open).
QFontComboBox(QWidget *parent=nullptr)
Constructs a font combobox with the given parent.
QFont currentFont
the currently selected font
bool event(QEvent *e) override
\reimp
QSize sizeHint() const override
\reimp
~QFontComboBox()
Destroys the combobox.
QString sampleTextForSystem(QFontDatabase::WritingSystem writingSystem) const
Returns the sample text to show after the font name (when the combo is open) for a given writingSyste...
QString sampleTextForFont(const QString &fontFamily) const
Returns the sample text to show after the font name (when the combo is open) for a given fontFamily.
std::optional< QFont > displayFont(const QString &fontFamily) const
Returns the font (if set) to be used to display a given fontFamily (when the combo is open).
void setFontFilters(FontFilters filters)
void currentFontChanged(const QFont &f)
This signal is emitted whenever the current font changes, with the new font.
void setSampleTextForSystem(QFontDatabase::WritingSystem writingSystem, const QString &sampleText)
Sets the sampleText to show after the font name (when the combo is open) for a given writingSystem.
void setWritingSystem(QFontDatabase::WritingSystem)
QFontDatabase::WritingSystem writingSystem
the writing system that serves as a filter for the combobox
FontFilters fontFilters
the filter for the combobox
void setCurrentFont(const QFont &f)
void setSampleTextForFont(const QString &fontFamily, const QString &sampleText)
Sets the sampleText to show after the font name (when the combo is open) for a given fontFamily.
\threadsafe \inmodule QtGui
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 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< WritingSystem > writingSystems()
Returns a sorted list of the available writing systems.
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...
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
This pure abstract function must be reimplemented if you want to provide custom rendering.
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
This pure abstract function must be reimplemented if you want to provide custom rendering.
QFontComboBoxPrivate * comboPrivate
QFontFamilyDelegate(QObject *parent, QFontComboBoxPrivate *comboP)
QFontDatabase::WritingSystem writingSystem
\reentrant \inmodule QtGui
\reentrant \inmodule QtGui
int horizontalAdvance(const QString &, int len=-1) const
Returns the horizontal advance in pixels of the first len characters of text.
void setPointSize(int)
Sets the point size to pointSize.
void setFamilies(const QStringList &)
QStringList families() const
T value(const Key &key) const noexcept
The QIcon class provides scalable icons in different modes and states.
void paint(QPainter *painter, const QRect &rect, Qt::Alignment alignment=Qt::AlignCenter, Mode mode=Normal, State state=Off) const
Uses the painter to paint the icon with specified alignment, required mode, and state into the rectan...
QSize actualSize(const QSize &size, Mode mode=Normal, State state=Off) const
Returns the actual size of the icon for the requested size, mode, and state.
The QListView class provides a list or icon view onto a model.
void setUniformItemSizes(bool enable)
qsizetype size() const noexcept
bool isEmpty() const noexcept
const T & constLast() const noexcept
bool removeOne(const AT &t)
const_reference at(qsizetype i) const noexcept
QStringList uiLanguages() const
List of locale names for use in selecting translations.
static QLocale system()
Returns a QLocale object initialized to the system locale.
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
The QPainter class performs low-level painting on widgets and other paint devices.
void drawRect(const QRectF &rect)
Draws the current rectangle with the current pen and brush.
void setPen(const QColor &color)
This is an overloaded member function, provided for convenience. It differs from the above function o...
const QFont & font() const
Returns the currently set font used for drawing text.
void restore()
Restores the current painter state (pops a saved state off the stack).
QFontMetrics fontMetrics() const
Returns the font metrics for the painter if the painter is active.
void save()
Saves the current painter state (pushes the state onto a stack).
void setFont(const QFont &f)
Sets the painter's font to the given font.
void drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position.
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
\inmodule QtCore\reentrant
constexpr qreal height() const noexcept
Returns the height of the rectangle.
\inmodule QtCore\reentrant
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr void setHeight(int h) noexcept
Sets the height of the rectangle to the given height.
Exception-safe wrapper around QObject::blockSignals().
constexpr int width() const noexcept
Returns the width.
constexpr void setWidth(int w) noexcept
Sets the width to the given width.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QChar * data()
Returns a pointer to the data stored in the QString.
static Qt::Alignment visualAlignment(Qt::LayoutDirection direction, Qt::Alignment alignment)
Transforms an alignment of Qt::AlignLeft or Qt::AlignRight without Qt::AlignAbsolute into Qt::AlignLe...
static QRect alignedRect(Qt::LayoutDirection direction, Qt::Alignment alignment, const QSize &size, const QRect &rectangle)
Returns a new rectangle of the specified size that is aligned to the given rectangle according to the...
Combined button and popup list for selecting options.
static QFontDatabase::WritingSystem writingSystemFromLocale()
static QFontDatabase::WritingSystem writingSystemFromScript(QLocale::Script script)
static QFontDatabase::WritingSystem writingSystemForFont(const QFont &font, bool *hasLatin)
constexpr const T & qMin(const T &a, const T &b)
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr offset
GLsizei GLfixed GLfixed GLfixed GLfixed const GLubyte * bitmap
GLdouble GLdouble GLdouble GLdouble q
#define QStringLiteral(str)
QFileInfo fi("c:/temp/foo")
[newstuff]
const QStringList filters({"Image files (*.png *.xpm *.jpg)", "Text files (*.txt)", "Any files (*)" })
[6]
bool contains(const AT &t) const noexcept
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent