7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtGui/qpainter.h>
9#include <QtWidgets/qstyle.h>
10#include <QtWidgets/qwidget.h>
21 inline bool begin(QWidget *w) {
return begin(w, w); }
22 inline bool begin(QPaintDevice *pd, QWidget *w) {
23 Q_ASSERT_X(w,
"QStylePainter::QStylePainter",
"Widget must be non-zero");
26 const bool res = QPainter::begin(pd);
27 setRenderHint(QPainter::SmoothPixmapTransform);
30 inline void drawPrimitive(QStyle::PrimitiveElement pe,
const QStyleOption &opt);
31 inline void drawControl(QStyle::ControlElement ce,
const QStyleOption &opt);
32 inline void drawComplexControl(QStyle::ComplexControl cc,
const QStyleOptionComplex &opt);
33 inline void drawItemText(
const QRect &r,
int flags,
const QPalette &pal,
bool enabled,
34 const QString &text, QPalette::ColorRole textRole =
QPalette::
NoRole);
35 inline void drawItemPixmap(
const QRect &r,
int flags,
const QPixmap &pixmap);
36 inline QStyle *
style()
const {
return wstyle; }
46 wstyle->drawPrimitive(pe, &opt,
this, widget);
51 wstyle->drawControl(ce, &opt,
this, widget);
56 wstyle->drawComplexControl(cc, &opt,
this, widget);
60 const QString &text, QPalette::ColorRole textRole)
62 wstyle->drawItemText(
this, r, flags, pal, enabled, text, textRole);
67 wstyle->drawItemPixmap(
this, r, flags, pixmap);
The QComboBox widget combines a button with a dropdown list.
QFileDialogComboBox(QWidget *parent=nullptr)
QStringList history() const
void setHistory(const QStringList &paths)
void setFileDialogPrivate(QFileDialogPrivate *d_pointer)
void showPopup() override
Displays the list of items in the combobox.
void paintEvent(QPaintEvent *) override
\reimp
void keyPressEvent(QKeyEvent *e) override
FIXME: this is a hack to avoid propagating key press events to the dialog and from there to the "Ok" ...
void setFileDialogPrivate(QFileDialogPrivate *d_pointer)
QFileDialogLineEdit(QWidget *parent=nullptr)
void setFileDialogPrivate(QFileDialogPrivate *d_pointer)
QSize sizeHint() const override
QFileDialogListView(QWidget *parent=nullptr)
void keyPressEvent(QKeyEvent *e) override
void keyPressEvent(QKeyEvent *e) override
QSize sizeHint() const override
QFileDialogTreeView(QWidget *parent)
void setFileDialogPrivate(QFileDialogPrivate *d_pointer)
The QFileDialog class provides a dialog that allows users to select files or directories.
The QGridLayout class lays out widgets in a grid.
The QListView class provides a list or icon view onto a model.
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget.
QStylePainter(QPaintDevice *pd, QWidget *w)
Construct a QStylePainter using pd for its paint device, and attributes from widget.
bool begin(QPaintDevice *pd, QWidget *w)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool begin(QWidget *w)
Begin painting operations on the specified widget.
void drawControl(QStyle::ControlElement ce, const QStyleOption &opt)
Use the widget's style to draw a control element ce specified by QStyleOption option.
void drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOption &opt)
Use the widget's style to draw a primitive element pe specified by QStyleOption option.
QStylePainter()
Constructs a QStylePainter.
void drawComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex &opt)
Use the widget's style to draw a complex control cc specified by the QStyleOptionComplex option.
void drawItemText(const QRect &r, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole=QPalette::NoRole)
Draws the text in rectangle rect and palette pal.
QStyle * style() const
Return the current style used by the QStylePainter.
void drawItemPixmap(const QRect &r, int flags, const QPixmap &pixmap)
Draws the pixmap in rectangle rect.
QStylePainter(QWidget *w)
Construct a QStylePainter using widget widget for its paint device.
The QStyledItemDelegate class provides display and editing facilities for data items from a model.
The QTreeView class provides a default model/view implementation of a tree view.
Combined button and popup list for selecting options.
QT_REQUIRE_CONFIG(animation)
static QUrl _qt_get_directory(const QUrl &url, const QFileInfo &local)
QStringList qt_strip_filters(const QStringList &filters)
QStringList qt_make_filter_list(const QString &filter)
static QString fileFromPath(const QString &rootPath, QString path)
static bool isCaseSensitiveFileSystem(const QString &path)
QT_REQUIRE_CONFIG(filedialog)
QT_REQUIRE_CONFIG(itemmodel)
QT_REQUIRE_CONFIG(treeview)
QFileDialogArgs(const QUrl &url={})