summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/CMakeLists.txt10
-rw-r--r--src/widgets/accessible/itemviews.cpp31
-rw-r--r--src/widgets/accessible/qaccessiblecolorwell.cpp5
-rw-r--r--src/widgets/accessible/qaccessiblemenu.cpp5
-rw-r--r--src/widgets/accessible/qaccessiblewidget.cpp5
-rw-r--r--src/widgets/accessible/rangecontrols.cpp12
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp15
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp6
-rw-r--r--src/widgets/dialogs/qsidebar.cpp5
-rw-r--r--src/widgets/doc/images/modelview-models.svg208
-rw-r--r--src/widgets/doc/images/modelview-overview.svg103
-rw-r--r--src/widgets/doc/images/modelview-tablemodel.svg96
-rw-r--r--src/widgets/doc/images/modelview-treemodel.svg107
-rw-r--r--src/widgets/doc/src/external-resources.qdoc6
-rw-r--r--src/widgets/doc/src/model-view-programming.qdoc8
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.cpp6
-rw-r--r--src/widgets/graphicsview/qgraphicsscenebsptreeindex.cpp4
-rw-r--r--src/widgets/graphicsview/qgraphicssceneindex.cpp4
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp6
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp41
-rw-r--r--src/widgets/itemviews/qabstractitemview_p.h12
-rw-r--r--src/widgets/itemviews/qcolumnviewgrip.cpp15
-rw-r--r--src/widgets/itemviews/qlistview.cpp22
-rw-r--r--src/widgets/itemviews/qlistview_p.h4
-rw-r--r--src/widgets/itemviews/qlistwidget.cpp6
-rw-r--r--src/widgets/itemviews/qtableview.cpp6
-rw-r--r--src/widgets/itemviews/qtableview_p.h5
-rw-r--r--src/widgets/itemviews/qtreeview.cpp16
-rw-r--r--src/widgets/itemviews/qtreeview_p.h4
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp6
-rw-r--r--src/widgets/kernel/qapplication.cpp6
-rw-r--r--src/widgets/kernel/qlayout.cpp6
-rw-r--r--src/widgets/kernel/qtooltip.cpp92
-rw-r--r--src/widgets/kernel/qtooltip_p.h74
-rw-r--r--src/widgets/kernel/qwidgetrepaintmanager.cpp12
-rw-r--r--src/widgets/styles/images/fusion_normalizedockup-10.png (renamed from src/widgets/styles/images/fusion_normalizedockup_10.png)bin234 -> 234 bytes
-rw-r--r--src/widgets/styles/images/fusion_normalizedockup-20.png (renamed from src/widgets/styles/images/fusion_normalizedockup_20.png)bin342 -> 342 bytes
-rw-r--r--src/widgets/styles/images/fusion_normalizedockup-48.png (renamed from src/widgets/styles/images/fusion_normalizedockup_48.png)bin487 -> 487 bytes
-rw-r--r--src/widgets/styles/images/fusion_normalizedockup-64.png (renamed from src/widgets/styles/images/fusion_normalizedockup_64.png)bin579 -> 579 bytes
-rw-r--r--src/widgets/styles/qcommonstyle.cpp9
-rw-r--r--src/widgets/util/qflickgesture.cpp6
-rw-r--r--src/widgets/widgets/qcombobox.cpp6
-rw-r--r--src/widgets/widgets/qlabel.cpp6
-rw-r--r--src/widgets/widgets/qlineedit_p.cpp6
-rw-r--r--src/widgets/widgets/qmainwindowlayout.cpp6
-rw-r--r--src/widgets/widgets/qmenu.cpp6
46 files changed, 894 insertions, 120 deletions
diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt
index f4fc96b867d..c47e3bee13c 100644
--- a/src/widgets/CMakeLists.txt
+++ b/src/widgets/CMakeLists.txt
@@ -339,12 +339,12 @@ set(qstyle_resource_fusion_files
"styles/images/fusion_closedock-32.png"
"styles/images/fusion_closedock-48.png"
"styles/images/fusion_closedock-64.png"
- "styles/images/fusion_normalizedockup_10.png"
+ "styles/images/fusion_normalizedockup-10.png"
"styles/images/fusion_normalizedockup-16.png"
- "styles/images/fusion_normalizedockup_20.png"
+ "styles/images/fusion_normalizedockup-20.png"
"styles/images/fusion_normalizedockup-32.png"
- "styles/images/fusion_normalizedockup_48.png"
- "styles/images/fusion_normalizedockup_64.png"
+ "styles/images/fusion_normalizedockup-48.png"
+ "styles/images/fusion_normalizedockup-64.png"
"styles/images/fusion_titlebar-min-10.png"
"styles/images/fusion_titlebar-min-16.png"
"styles/images/fusion_titlebar-min-20.png"
@@ -412,7 +412,7 @@ qt_internal_extend_target(Widgets CONDITION QT_FEATURE_shortcut
qt_internal_extend_target(Widgets CONDITION QT_FEATURE_tooltip
SOURCES
- kernel/qtooltip.cpp kernel/qtooltip.h
+ kernel/qtooltip.cpp kernel/qtooltip.h kernel/qtooltip_p.h
)
qt_internal_extend_target(Widgets CONDITION QT_FEATURE_whatsthis
diff --git a/src/widgets/accessible/itemviews.cpp b/src/widgets/accessible/itemviews.cpp
index cc3a230f9b4..ba941012dd7 100644
--- a/src/widgets/accessible/itemviews.cpp
+++ b/src/widgets/accessible/itemviews.cpp
@@ -99,6 +99,21 @@ QHeaderView *QAccessibleTable::verticalHeader() const
return header;
}
+// Normally cellAt takes row/column in the range
+// [0 .. rowCount())
+// [0 .. columnCount())
+//
+// As an extension we allow clients to ask for headers
+//
+// * Has both vertical and horizontal headers:
+// (-1,-1) -> corner button
+// * Has column headers:
+// (-1, column) -> column header for column \a column
+// * has row headers
+// (row, -1) -> row header for row \a row
+//
+// If asking for a header that does not exist, The invalid
+// index warning is logged, and nullptr is returned.
QAccessibleInterface *QAccessibleTable::cellAt(int row, int column) const
{
const QAbstractItemView *theView = view();
@@ -107,6 +122,22 @@ QAccessibleInterface *QAccessibleTable::cellAt(int row, int column) const
return nullptr;
Q_ASSERT(role() != QAccessible::List);
Q_ASSERT(role() != QAccessible::Tree);
+
+ const int vHeader = verticalHeader() ? 1 : 0;
+ const int hHeader = horizontalHeader() ? 1 : 0;
+
+ const int doHHeader = ((row == -1) && hHeader);
+ const int doVHeader = ((column == -1) && vHeader);
+
+ if (doVHeader && doHHeader)
+ return child(0);
+
+ if (doVHeader)
+ return child((row + hHeader) * (columnCount() + vHeader) + (column + vHeader));
+
+ if (doHHeader)
+ return child((row + hHeader) * (columnCount() + vHeader) + (column + vHeader));
+
QModelIndex index = theModel->index(row, column, theView->rootIndex());
if (Q_UNLIKELY(!index.isValid())) {
qWarning() << "QAccessibleTable::cellAt: invalid index: " << index << " for " << theView;
diff --git a/src/widgets/accessible/qaccessiblecolorwell.cpp b/src/widgets/accessible/qaccessiblecolorwell.cpp
index ca08e511e9a..64fcd2a7fd1 100644
--- a/src/widgets/accessible/qaccessiblecolorwell.cpp
+++ b/src/widgets/accessible/qaccessiblecolorwell.cpp
@@ -3,6 +3,8 @@
#include "private/qaccessiblecolorwell_p.h"
+#include <QtCore/qcoreapplication.h>
+
QT_REQUIRE_CONFIG(accessibility);
#if QT_CONFIG(colordialog)
@@ -14,6 +16,7 @@ class QAccessibleColorWellItem : public QAccessibleInterface
{
QAccessibleColorWell *m_parent;
+ Q_DECLARE_TR_FUNCTIONS(QAccessibleColorWellItem)
public:
QAccessibleColorWellItem(QAccessibleColorWell *parent);
@@ -79,7 +82,7 @@ QString QAccessibleColorWellItem::text(QAccessible::Text t) const
if (t == QAccessible::Name) {
QRgb color = m_parent->colorWell()->rgbValues()[m_parent->indexOfChild(this)];
//: Color specified via its 3 RGB components (red, green, blue)
- return QObject::tr("RGB %1, %2, %3")
+ return tr("RGB %1, %2, %3")
.arg(QString::number(qRed(color)), QString::number(qGreen(color)),
QString::number(qBlue(color)));
}
diff --git a/src/widgets/accessible/qaccessiblemenu.cpp b/src/widgets/accessible/qaccessiblemenu.cpp
index fd5f1efc7a0..2416110042a 100644
--- a/src/widgets/accessible/qaccessiblemenu.cpp
+++ b/src/widgets/accessible/qaccessiblemenu.cpp
@@ -146,6 +146,11 @@ int QAccessibleMenuBar::indexOfChild(const QAccessibleInterface *child) const
#endif // QT_CONFIG(menubar)
+/*!
+ \class QAccessibleMenuItem
+ \inmodule QtWidgets
+ \internal
+*/
QAccessibleMenuItem::QAccessibleMenuItem(QWidget *owner, QAction *action)
: m_action(action), m_owner(owner)
{
diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp
index b4adae2e6e6..6fd86004fff 100644
--- a/src/widgets/accessible/qaccessiblewidget.cpp
+++ b/src/widgets/accessible/qaccessiblewidget.cpp
@@ -455,6 +455,11 @@ QAccessibleWidgetV2::QAccessibleWidgetV2(QWidget *object, QAccessible::Role role
{
}
+/*!
+ \class QAccessibleWidgetV2
+ \inmodule QtWidgets
+ \internal
+*/
QAccessibleWidgetV2::QAccessibleWidgetV2(QWidget *object, QAccessible::Role role)
: QAccessibleWidget(object, role)
{
diff --git a/src/widgets/accessible/rangecontrols.cpp b/src/widgets/accessible/rangecontrols.cpp
index 1f7b20833dd..969fb74c2c1 100644
--- a/src/widgets/accessible/rangecontrols.cpp
+++ b/src/widgets/accessible/rangecontrols.cpp
@@ -34,6 +34,12 @@ using namespace Qt::StringLiterals;
#if QT_CONFIG(accessibility)
#if QT_CONFIG(spinbox)
+
+/*!
+ \class QAccessibleAbstractSpinBox
+ \inmodule QtWidgets
+ \internal
+*/
QAccessibleAbstractSpinBox::QAccessibleAbstractSpinBox(QWidget *w)
: QAccessibleWidgetV2(w, QAccessible::SpinBox), lineEdit(nullptr)
{
@@ -242,6 +248,12 @@ QSpinBox *QAccessibleSpinBox::spinBox() const
// ================================== QAccessibleDoubleSpinBox ==================================
+
+/*!
+ \class QAccessibleDoubleSpinBox
+ \inmodule QtWidgets
+ \internal
+*/
QAccessibleDoubleSpinBox::QAccessibleDoubleSpinBox(QWidget *widget)
: QAccessibleAbstractSpinBox(widget)
{
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index d51c408ab5c..ce46170bba5 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -662,7 +662,7 @@ private:
int val2y(int val);
void setVal(int v);
- QPixmap *pix;
+ QPixmap pix;
};
@@ -682,14 +682,12 @@ QColorLuminancePicker::QColorLuminancePicker(QWidget* parent)
:QWidget(parent)
{
hue = 100; val = 100; sat = 100;
- pix = nullptr;
// setAttribute(WA_NoErase, true);
setFocusPolicy(Qt::StrongFocus);
}
QColorLuminancePicker::~QColorLuminancePicker()
{
- delete pix;
}
void QColorLuminancePicker::keyPressEvent(QKeyEvent *event)
@@ -725,7 +723,7 @@ void QColorLuminancePicker::setVal(int v)
if (val == v)
return;
val = qMax(0, qMin(v,255));
- delete pix; pix=nullptr;
+ pix = QPixmap();
repaint();
emit newHsv(hue, sat, val);
}
@@ -744,8 +742,7 @@ void QColorLuminancePicker::paintEvent(QPaintEvent *)
QRect r(0, foff, w, height() - 2*foff);
int wi = r.width() - 2;
int hi = r.height() - 2;
- if (!pix || pix->height() != hi || pix->width() != wi) {
- delete pix;
+ if (pix.isNull() || pix.height() != hi || pix.width() != wi) {
QImage img(wi, hi, QImage::Format_RGB32);
int y;
uint *pixel = (uint *) img.scanLine(0);
@@ -754,10 +751,10 @@ void QColorLuminancePicker::paintEvent(QPaintEvent *)
std::fill(pixel, end, QColor::fromHsv(hue, sat, y2val(y + coff)).rgb());
pixel = end;
}
- pix = new QPixmap(QPixmap::fromImage(img));
+ pix = QPixmap::fromImage(img);
}
QPainter p(this);
- p.drawPixmap(1, coff, *pix);
+ p.drawPixmap(1, coff, pix);
const QPalette &g = palette();
qDrawShadePanel(&p, r, g, true);
p.setPen(g.windowText().color());
@@ -773,7 +770,7 @@ void QColorLuminancePicker::setCol(int h, int s , int v)
val = v;
hue = h;
sat = s;
- delete pix; pix=nullptr;
+ pix = QPixmap();
repaint();
}
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 03a42e321d2..1f39dbfb516 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -4172,6 +4172,12 @@ QSize QFileDialogTreeView::sizeHint() const
}
/*!
+ \class QFileDialogLineEdit
+ \inmodule QtWidgets
+ \internal
+*/
+
+/*!
// FIXME: this is a hack to avoid propagating key press events
// to the dialog and from there to the "Ok" button
*/
diff --git a/src/widgets/dialogs/qsidebar.cpp b/src/widgets/dialogs/qsidebar.cpp
index a357d34f327..1ac2271fa8b 100644
--- a/src/widgets/dialogs/qsidebar.cpp
+++ b/src/widgets/dialogs/qsidebar.cpp
@@ -360,6 +360,11 @@ void QUrlModel::changed(const QString &path)
}
}
+/*!
+ \class QSidebar
+ \inmodule QtWidgets
+ \internal
+*/
QSidebar::QSidebar(QWidget *parent) : QListView(parent)
{
}
diff --git a/src/widgets/doc/images/modelview-models.svg b/src/widgets/doc/images/modelview-models.svg
new file mode 100644
index 00000000000..a7efed081ef
--- /dev/null
+++ b/src/widgets/doc/images/modelview-models.svg
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ width="600"
+ height="285"
+ version="1.1"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+
+<style>
+ svg .line-style { stroke: black; fill: none }
+ svg .text-style { font: 12px arial; fill: black }
+ svg .italic-style { font: 12px arial; fill: black; font-style: italic }
+ svg .bold-style { font: 14px arial; fill: black; font-weight: bold }
+ svg .item-style { font: 16px arial; fill: black }
+
+ svg.dark .line-style { stroke: #f2f2f2; fill: none }
+ svg.dark .text-style { font: 12px arial; fill: #f2f2f2 }
+ svg.dark .italic-style { font: 12px arial; fill: #f2f2f2; font-style: italic }
+ svg.dark .bold-style { font: 14px arial; fill: #f2f2f2; font-weight: bold }
+ svg.dark .item-style { font: 14px arial; fill: #f2f2f2 }
+
+ [data-theme="dark"] svg .line-style { stroke: #f2f2f2; fill: none }
+ [data-theme="dark"] svg .text-style { font: 12px arial; fill: #f2f2f2 }
+ [data-theme="dark"] svg .italic-style { font: 12px arial; fill: #f2f2f2; font-style: italic }
+ [data-theme="dark"] svg .bold-style { font: 14px arial; fill: #f2f2f2; font-weight: bold }
+ [data-theme="dark"] svg .item-style { font: 14px arial; fill: #f2f2f2 }
+
+ [data-theme="light"] svg .line-style { stroke: black; fill: none }
+ [data-theme="light"] svg .text-style { font: 12px arial; fill: black }
+ [data-theme="light"] svg .italic-style { font: 12px arial; fill: black; font-style: italic }
+ [data-theme="light"] svg .bold-style { font: 14px arial; fill: black; font-weight: bold }
+ [data-theme="light"] svg .item-style { font: 14px arial; fill: black }
+</style>
+
+<text x="35" y="16" font-family="arial" font-size="12px" font-weight="bold"
+ class="bold-style">List Model</text>
+<text x="215" y="16" font-family="arial" font-size="12px" font-weight="bold"
+ class="bold-style">Table Model</text>
+<text x="435" y="16" font-family="arial" font-size="12px" font-weight="bold"
+ class="bold-style">Tree Model</text>
+
+<path d="m 400.5,255.5 v 25" stroke="black" stroke-dasharray="3, 3"
+ class="line-style" />
+<path d="m 385.5,30.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ stroke-dasharray="5, 5"
+ class="line-style" />
+
+<text x="425" y="49" font-family="arial" font-size="12px" font-style="italic"
+ class="italic-style">Root item</text>
+<path d="m 400.5,60.5 v 195" stroke="black"
+ class="line-style" />
+<path d="m 420.5,70.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 400.5,85.5 h 20" stroke="black"
+ class="line-style" />
+<path d="m 435.5,100.5 v 65" stroke="black"
+ class="line-style" />
+<path d="m 455.5,110.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 435.5,125.5 h 20" stroke="black"
+ class="line-style" />
+<path d="m 455.5,150.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 435.5,165.5 h 20" stroke="black"
+ class="line-style" />
+<path d="m 435.5,165.5 v 25" stroke="black" stroke-dasharray="3, 3"
+ class="line-style" />
+<path d="m 420.5,200.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 400.5,215.5 h 20" stroke="black"
+ class="line-style" />
+<path d="m 420.5,240.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 400.5,255.5 h 20" stroke="black"
+ class="line-style" />
+
+<path d="m 450.5,70.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 485.5,110.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 485.5,150.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 450.5,200.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 450.5,240.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 480.5,70.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ stroke-dasharray="3, 3"
+ class="line-style" />
+<path d="m 515.5,110.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ stroke-dasharray="3, 3"
+ class="line-style" />
+<path d="m 515.5,150.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ stroke-dasharray="3, 3"
+ class="line-style" />
+<path d="m 480.5,200.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ stroke-dasharray="3, 3"
+ class="line-style" />
+<path d="m 480.5,240.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ stroke-dasharray="3, 3"
+ class="line-style" />
+
+<text x="515" y="89" font-family="arial" font-size="12px"
+ class="text-style">row = 0</text>
+<text x="550" y="129" font-family="arial" font-size="12px"
+ class="text-style">row = 0</text>
+<text x="550" y="169" font-family="arial" font-size="12px"
+ class="text-style">row = 1</text>
+<text x="515" y="219" font-family="arial" font-size="12px"
+ class="text-style">row = 1</text>
+<text x="515" y="259" font-family="arial" font-size="12px"
+ class="text-style">row = 2</text>
+
+<path d="m 155.5,30.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ stroke-dasharray="5, 5"
+ class="line-style" />
+<path d="m 10.5,30.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ stroke-dasharray="5, 5"
+ class="line-style" />
+<text x="50" y="49" font-family="arial" font-size="12px" font-style="italic"
+ class="italic-style">Root item</text>
+<path d="m 25.5,60.5 v 105" stroke="black"
+ class="line-style" />
+<path d="M 25.5,85.5 h 20" stroke="black"
+ class="line-style" />
+<path d="m 45.5,70.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<text x="80" y="89" font-family="arial" font-size="12px"
+ class="text-style">row = 0</text>
+<path d="m 25.5,165.5 v 25" stroke="black" stroke-dasharray="3, 3"
+ class="line-style" />
+<path d="m 25.5,125.5 h 20" stroke="black"
+ class="line-style" />
+<path d="m 45.5,110.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<text x="80" y="129" font-family="arial" font-size="12px"
+ class="text-style">row = 1</text>
+<path d="m 25.5,165.5 h 20" stroke="black"
+ class="line-style" />
+<path d="m 45.5,150.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<text x="80" y="169" font-family="arial" font-size="12px"
+ class="text-style">row = 2</text>
+
+<text x="195" y="49" font-family="arial" font-size="12px" font-style="italic"
+ class="italic-style">Root item</text>
+<text x="315" y="89" font-family="arial" font-size="12px"
+ class="text-style">row = 0</text>
+<text x="315" y="119" font-family="arial" font-size="12px"
+ class="text-style">row = 1</text>
+<text x="315" y="149" font-family="arial" font-size="12px"
+ class="text-style">row = 2</text>
+<text x="315" y="179" font-family="arial" font-size="12px"
+ class="text-style">row = 3</text>
+
+<path d="m 170.5,60.5 v 25" stroke="black"
+ class="line-style" />
+<path d="m 170.5,85.5 h 20" stroke="black"
+ class="line-style" />
+<path d="m 190.5,70.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 220.5,70.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 250.5,70.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 280.5,70.5 h 30 v 30" stroke="black" fill="none"
+ stroke-dasharray="3, 3"
+ class="line-style" />
+<path d="m 190.5,100.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 220.5,100.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 250.5,100.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 280.5,100.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ stroke-dasharray="3, 3"
+ class="line-style" />
+<path d="m 190.5,130.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 220.5,130.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 250.5,130.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 220.5,160.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ stroke-dasharray="3, 3"
+ class="line-style" />
+<path d="m 190.5,160.5 v 30 h 30" stroke="black" fill="none"
+ stroke-dasharray="3, 3"
+ class="line-style" />
+<path d="m 250.5,190.5 h 30" stroke="black" stroke-dasharray="3, 3"
+ class="line-style" />
+<path d="m 280.5,160.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ stroke-dasharray="3, 3"
+ class="line-style" />
+<path d="m 310.5,130.5 v 30" stroke="black" stroke-dasharray="3, 3"
+ class="line-style" />
+
+<g transform="translate(200, 200)">
+<text x="0" y="0" font-family="arial" font-size="12px"
+ class="text-style" transform="rotate(90)">column = 0</text>
+<text x="0" y="-30" font-family="arial" font-size="12px"
+ class="text-style" transform="rotate(90)">column = 1</text>
+<text x="0" y="-60" font-family="arial" font-size="12px"
+ class="text-style" transform="rotate(90)">column = 2</text>
+<text x="0" y="-90" font-family="arial" font-size="12px"
+ class="text-style" transform="rotate(90)">column = 3</text>
+</g>
+</svg>
diff --git a/src/widgets/doc/images/modelview-overview.svg b/src/widgets/doc/images/modelview-overview.svg
new file mode 100644
index 00000000000..62212027d9e
--- /dev/null
+++ b/src/widgets/doc/images/modelview-overview.svg
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ width="250"
+ height="240"
+ version="1.1"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+
+<style>
+ svg .line-style { stroke: black; fill: none }
+ svg .fill-style { stroke: none; fill: black }
+ svg .text-style { font: 14px arial; fill: black }
+ svg .italic-style { font: 12px arial; fill: black; font-style: italic }
+ svg .mv-style { font: 14px arial; fill: black }
+ svg .view-style { stroke: black; fill: #ff9f7e }
+ svg .delegate-style { stroke: black; fill: #9fff7e }
+ svg .model-style { stroke: black; fill: #9fbdff }
+
+ svg.dark .line-style { stroke: #f2f2f2; fill: none }
+ svg.dark .fill-style { stroke: none; fill: #f2f2f2 }
+ svg.dark .text-style { font: 14px arial; fill: #f2f2f2 }
+ svg.dark .italic-style { font: 12px arial; fill: #f2f2f2; font-style: italic }
+ svg.dark .mv-style { font: 14px arial; fill: black }
+ svg.dark .view-style { stroke: black; fill: #ff9f7e }
+ svg.dark .delegate-style { stroke: black; fill: #9fff7e }
+ svg.dark .model-style { stroke: black; fill: #9fbdff }
+
+ [data-theme="dark"] svg .line-style { stroke: #f2f2f2; fill: none }
+ [data-theme="dark"] svg .fill-style { stroke: none; fill: #f2f2f2 }
+ [data-theme="dark"] svg .text-style { font: 14px arial; fill: #f2f2f2 }
+ [data-theme="dark"] svg .italic-style { font: 12px arial; fill: #f2f2f2; font-style: italic }
+ [data-theme="dark"] svg .mv-style { font: 14px arial; fill: black }
+ [data-theme="dark"] svg .view-style { stroke: black; fill: #ff9f7e }
+ [data-theme="dark"] svg .delegate-style { stroke: black; fill: #9fff7e }
+ [data-theme="dark"] svg .model-style { stroke: black; fill: #9fbdff }
+
+ [data-theme="light"] svg .line-style { stroke: black; fill: none }
+ [data-theme="light"] svg .fill-style { stroke: none; fill: black }
+ [data-theme="light"] svg .text-style { font: 14px arial; fill: black }
+ [data-theme="light"] svg .italic-style { font: 12px arial; fill: black; font-style: italic }
+ [data-theme="light"] svg .mv-style { font: 14px arial; fill: black }
+ [data-theme="light"] svg .view-style { stroke: black; fill: #ff9f7e }
+ [data-theme="light"] svg .delegate-style { stroke: black; fill: #9fff7e }
+ [data-theme="light"] svg .model-style { stroke: black; fill: #9fbdff }
+</style>
+
+<path d="m 53.5,6.5 h 55 v 40 h -55 z" stroke="black" fill="none"
+ stroke-dasharray="4, 4"
+ class="line-style" />
+<text x="67" y="31" font-family="arial" font-size="14px"
+ class="text-style">Data</text>
+
+<path d="m 81.5,49.5 v 32" stroke="black"
+ class="line-style" />
+<path d="M 81.5,47.5 l 5,10 l -10,0 z" stroke="black" fill="black"
+ class="fill-style" />
+<path d="M 81.5,88.5 l 5,-10 l -10,0 z" stroke="black" fill="black"
+ class="fill-style" />
+
+<path d="m 44.5,88.5 h 75 v 45 h -75 z" stroke="black" fill="#9fbdff"
+ class="model-style" />
+<text x="62" y="116" font-family="arial" font-size="14px"
+ class="mv-style">Model</text>
+
+<path d="M 81.5,133.5 v 45" stroke="black" fill="none"
+ class="line-style" />
+<path d="M 81.5,133.5 l -5,10 l 10,0 z" stroke="black" fill="black"
+ class="fill-style" />
+<path d="M 81.5,180.5 l -5,-10 l 10,0 z" stroke="black" fill="black"
+ class="fill-style" />
+<text x="15" y="161" font-family="arial" font-size="12px" font-style="italic"
+ class="italic-style">Rendering</text>
+
+<circle cx="162.5" cy="178.5" r="10" stroke="black" fill="#9fff7e"
+ class="delegate-style" />
+<text x="177" y="182" font-family="arial" font-size="14px"
+ class="text-style">Delegate</text>
+
+<path d="m 44.5,181.5 h 75 v 45 h -75 z" stroke="black" fill="#ff9f7e"
+ class="view-style" />
+<text x="66" y="209" font-family="arial" font-size="14px"
+ class="mv-style">View</text>
+
+<path d="m 120.5,201.5 c 14.93034,0.75465 25.55119,0.35392 34.2,-12.4"
+ stroke="black" fill="none"
+ class="line-style" />
+<path d="M 119.5,201.5 l 10,-5 l 0,10 z" stroke="black" fill="black"
+ class="fill-style" />
+<path d="M 155.5,188.5 l -2,11 l -8,-8 z" stroke="black" fill="black"
+ class="fill-style" />
+<text x="135" y="217" font-family="arial" font-size="12px" font-style="italic"
+ class="italic-style">Rendering</text>
+
+<path d="m 165.5,165.5 c 13.03176,-44.88642 -12.5498,-61.94517 -45.15643,-62.41431"
+ stroke="black" fill="none"
+ class="line-style" />
+<path d="M 165.5,167.5 l 8,-9 l -11,-3 z" stroke="black" fill="black"
+ class="fill-style" />
+<path d="M 119.5,103.5 l 10,-5 l -0.75,11 z" stroke="black" fill="black"
+ class="fill-style" />
+<text x="168" y="120" font-family="arial" font-size="12px" font-style="italic"
+ class="italic-style">Editing</text>
+</svg>
diff --git a/src/widgets/doc/images/modelview-tablemodel.svg b/src/widgets/doc/images/modelview-tablemodel.svg
new file mode 100644
index 00000000000..ee670b53fa7
--- /dev/null
+++ b/src/widgets/doc/images/modelview-tablemodel.svg
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ width="240"
+ height="270"
+ version="1.1"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+
+<style>
+ svg .line-style { stroke: black; fill: none }
+ svg .text-style { font: 12px arial; fill: black }
+ svg .italic-style { font: 12px arial; fill: black; font-style: italic }
+ svg .bold-style { font: 14px arial; fill: black; font-weight: bold }
+
+ svg.dark .line-style { stroke: #f2f2f2; fill: none }
+ svg.dark .text-style { font: 12px arial; fill: #f2f2f2 }
+ svg.dark .italic-style { font: 12px arial; fill: #f2f2f2; font-style: italic }
+ svg.dark .bold-style { font: 14px arial; fill: #f2f2f2; font-weight: bold }
+
+ [data-theme="dark"] svg .line-style { stroke: #f2f2f2; fill: none }
+ [data-theme="dark"] svg .text-style { font: 12px arial; fill: #f2f2f2 }
+ [data-theme="dark"] svg .italic-style { font: 12px arial; fill: #f2f2f2; font-style: italic }
+ [data-theme="dark"] svg .bold-style { font: 14px arial; fill: #f2f2f2; font-weight: bold }
+
+ [data-theme="light"] svg .line-style { stroke: black; fill: none }
+ [data-theme="light"] svg .text-style { font: 12px arial; fill: black }
+ [data-theme="light"] svg .italic-style { font: 12px arial; fill: black; font-style: italic }
+ [data-theme="light"] svg .bold-style { font: 14px arial; fill: black; font-weight: bold }
+</style>
+
+<text x="75" y="16" font-family="arial" font-size="14px" font-weight="bold"
+ class="bold-style">Table Model</text>
+
+<path d="m 15.5,30.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ stroke-dasharray="5, 5"
+ class="line-style"/>
+
+<text x="55" y="49" font-family="arial" font-size="12px" font-style="italic"
+ class="italic-style">Root item</text>
+<text x="175" y="89" font-family="arial" font-size="12px"
+ class="text-style">row = 0</text>
+<text x="175" y="119" font-family="arial" font-size="12px"
+ class="text-style">row = 1</text>
+<text x="175" y="149" font-family="arial" font-size="12px"
+ class="text-style">row = 2</text>
+<text x="175" y="179" font-family="arial" font-size="12px"
+ class="text-style">row = 3</text>
+
+<path d="m 30.5,60.5 v 25" stroke="black"
+ class="line-style" />
+<path d="m 30.5,85.5 h 20" stroke="black"
+ class="line-style" />
+<path d="m 50.5,70.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 80.5,70.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 110.5,70.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 140.5,70.5 h 30 v 30" stroke="black" fill="none"
+ class="line-style" stroke-dasharray="3, 3" />
+<path d="m 50.5,100.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 80.5,100.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 110.5,100.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 140.5,100.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" stroke-dasharray="3, 3" />
+<path d="m 50.5,130.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 80.5,130.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 110.5,130.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 80.5,160.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" stroke-dasharray="3, 3" />
+<path d="m 50.5,160.5 v 30 h 30" stroke="black" fill="none"
+ class="line-style" stroke-dasharray="3, 3" />
+<path d="m 110.5,190.5 h 30" stroke="black"
+ class="line-style" stroke-dasharray="3, 3" />
+<path d="m 140.5,160.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" stroke-dasharray="3, 3" />
+<path d="m 170.5,130.5 v 30" stroke="black"
+ class="line-style" stroke-dasharray="3, 3" />
+
+<g transform="translate(65, 200)">
+<text x="0" y="0" font-family="arial" font-size="12px"
+ class="text-style" transform="rotate(90)">column = 0</text>
+<text x="0" y="-30" font-family="arial" font-size="12px"
+ class="text-style" transform="rotate(90)">column = 1</text>
+<text x="0" y="-60" font-family="arial" font-size="12px"
+ class="text-style" transform="rotate(90)">column = 2</text>
+<text x="0" y="-90" font-family="arial" font-size="12px"
+ class="text-style" transform="rotate(90)">column = 3</text>
+</g>
+</svg>
diff --git a/src/widgets/doc/images/modelview-treemodel.svg b/src/widgets/doc/images/modelview-treemodel.svg
new file mode 100644
index 00000000000..69babda81af
--- /dev/null
+++ b/src/widgets/doc/images/modelview-treemodel.svg
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ width="240"
+ height="290"
+ version="1.1"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+
+<style>
+ svg .line-style { stroke: black; fill: none }
+ svg .text-style { font: 12px arial; fill: black }
+ svg .italic-style { font: 12px arial; fill: black; font-style: italic }
+ svg .bold-style { font: 14px arial; fill: black; font-weight: bold }
+
+ svg.dark .line-style { stroke: #f2f2f2; fill: none }
+ svg.dark .text-style { font: 12px arial; fill: #f2f2f2 }
+ svg.dark .italic-style { font: 12px arial; fill: #f2f2f2; font-style: italic }
+ svg.dark .bold-style { font: 14px arial; fill: #f2f2f2; font-weight: bold }
+
+ [data-theme="dark"] svg .line-style { stroke: #f2f2f2; fill: none }
+ [data-theme="dark"] svg .text-style { font: 12px arial; fill: #f2f2f2 }
+ [data-theme="dark"] svg .italic-style { font: 12px arial; fill: #f2f2f2; font-style: italic }
+ [data-theme="dark"] svg .bold-style { font: 14px arial; fill: #f2f2f2; font-weight: bold }
+
+ [data-theme="light"] svg .line-style { stroke: black; fill: none }
+ [data-theme="light"] svg .text-style { font: 12px arial; fill: black }
+ [data-theme="light"] svg .italic-style { font: 12px arial; fill: black; font-style: italic }
+ [data-theme="light"] svg .bold-style { font: 14px arial; fill: black; font-weight: bold }
+</style>
+
+<g transform="translate(10,0)">
+<text x="75" y="16" font-family="arial" font-size="14px" font-weight="bold"
+ class="bold-style">Tree Model</text>
+
+<path d="m 25.5,255.5 v 25" stroke="black" stroke-dasharray="3, 3"
+ class="line-style" />
+<path d="m 10.5,30.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ stroke-dasharray="5, 5"
+ class="line-style"/>
+
+<text x="50" y="49" font-family="arial" font-size="12px" font-style="italic"
+ class="italic-style">Root item</text>
+<path d="m 25.5,60.5 v 195" stroke="black"
+ class="line-style" />
+<path d="m 45.5,70.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 25.5,85.5 h 20" stroke="black"
+ class="line-style" />
+<path d="m 60.5,100.5 v 65" stroke="black"
+ class="line-style" />
+<path d="m 80.5,110.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 60,125.5 h 20" stroke="black"
+ class="line-style" />
+<path d="m 80.5,150.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 60,165.5 h 20"
+ class="line-style" />
+<path d="m 60,165.5 v 25" stroke="black" stroke-dasharray="3, 3"
+ class="line-style" />
+<path d="m 45.5,200.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 25.5,215.5 h 20" stroke="black"
+ class="line-style" />
+<path d="m 45.5,240.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 25.5,255.5 h 20" stroke="black"
+ class="line-style" />
+
+<path d="m 75.5,70.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 110.5,110.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 110.5,150.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 75.5,200.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 75.5,240.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ class="line-style" />
+<path d="m 105.5,70.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ stroke-dasharray="3, 3"
+ class="line-style" />
+<path d="m 140.5,110.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ stroke-dasharray="3, 3"
+ class="line-style" />
+<path d="m 140.5,150.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ stroke-dasharray="3, 3"
+ class="line-style" />
+<path d="m 105.5,200.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ stroke-dasharray="3, 3"
+ class="line-style" />
+<path d="m 105.5,240.5 h 30 v 30 h -30 z" stroke="black" fill="none"
+ stroke-dasharray="3, 3"
+ class="line-style"/>
+
+<text x="140" y="89" font-family="arial" font-size="12px"
+ class="text-style">row = 0</text>
+<text x="175" y="129" font-family="arial" font-size="12px"
+ class="text-style">row = 0</text>
+<text x="175" y="169" font-family="arial" font-size="12px"
+ class="text-style">row = 1</text>
+<text x="140" y="219" font-family="arial" font-size="12px"
+ class="text-style">row = 1</text>
+<text x="140" y="259" font-family="arial" font-size="12px"
+ class="text-style">row = 2</text>
+</g>
+</svg>
diff --git a/src/widgets/doc/src/external-resources.qdoc b/src/widgets/doc/src/external-resources.qdoc
index 96117546a29..0eccc3b19d4 100644
--- a/src/widgets/doc/src/external-resources.qdoc
+++ b/src/widgets/doc/src/external-resources.qdoc
@@ -1,12 +1,6 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
-
-/*!
- \externalpage http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/index.html
- \title Apple Human Interface Guidelines
-*/
-
/*!
\externalpage https://rk.nvg.ntnu.no/sinclair/computers/zxspectrum/zxspectrum.htm
\title Sinclair Spectrum
diff --git a/src/widgets/doc/src/model-view-programming.qdoc b/src/widgets/doc/src/model-view-programming.qdoc
index 288564b19c3..351c7d06147 100644
--- a/src/widgets/doc/src/model-view-programming.qdoc
+++ b/src/widgets/doc/src/model-view-programming.qdoc
@@ -47,7 +47,7 @@
customized.
\table
- \row \li \inlineimage modelview-overview.png
+ \row \li \inlineimage modelview-overview.svg
{Model, view, and delegate interaction diagram}
\li \b{The model/view architecture}
@@ -276,7 +276,7 @@
of data in the model, but they are not restricted in the way that they
present this information to the user.
- \image modelview-models.png {List model, table model, and tree model}
+ \image modelview-models.svg {List model, table model, and tree model}
Models also notify any attached views about changes to data through the
signals and slots mechanism.
@@ -333,7 +333,7 @@
a model index.
\table 70%
- \row \li \inlineimage modelview-tablemodel.png
+ \row \li \inlineimage modelview-tablemodel.svg
{Structure of the table model using rows and columns}
\li \b{Rows and columns}
@@ -366,7 +366,7 @@
\snippet code/doc_src_model-view-programming.cpp 3
\table 70%
- \row \li \inlineimage modelview-treemodel.png
+ \row \li \inlineimage modelview-treemodel.svg
{Structure of the tree model with parent, row, and column items}
\li \b{Parents, rows, and columns}
diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp
index 0b7877b96a6..0fe8f5b97fd 100644
--- a/src/widgets/graphicsview/qgraphicsscene.cpp
+++ b/src/widgets/graphicsview/qgraphicsscene.cpp
@@ -1087,6 +1087,12 @@ void QGraphicsScenePrivate::enableMouseTrackingOnViews()
}
/*!
+ \class QGraphicsScenePrivate
+ \inmodule QtWidgets
+ \internal
+*/
+
+/*!
Returns all items for the screen position in \a event.
*/
QList<QGraphicsItem *> QGraphicsScenePrivate::itemsAtPosition(const QPoint &screenPos,
diff --git a/src/widgets/graphicsview/qgraphicsscenebsptreeindex.cpp b/src/widgets/graphicsview/qgraphicsscenebsptreeindex.cpp
index 5a8f76fe440..ddf91a99b4f 100644
--- a/src/widgets/graphicsview/qgraphicsscenebsptreeindex.cpp
+++ b/src/widgets/graphicsview/qgraphicsscenebsptreeindex.cpp
@@ -58,6 +58,10 @@ static inline int intmaxlog(int n)
}
/*!
+ \class QGraphicsSceneBspTreeIndexPrivate
+ \inmodule QtWidgets
+ \internal
+
Constructs a private scene bsp index.
*/
QGraphicsSceneBspTreeIndexPrivate::QGraphicsSceneBspTreeIndexPrivate(QGraphicsScene *scene)
diff --git a/src/widgets/graphicsview/qgraphicssceneindex.cpp b/src/widgets/graphicsview/qgraphicssceneindex.cpp
index c37f4dfa977..2f9dba99941 100644
--- a/src/widgets/graphicsview/qgraphicssceneindex.cpp
+++ b/src/widgets/graphicsview/qgraphicssceneindex.cpp
@@ -170,6 +170,10 @@ namespace QtPrivate { // just to keep indentation of the following functions at
} // namespace QtPrivate
/*!
+ \class QGraphicsSceneIndexPrivate
+ \inmodule QtWidgets
+ \internal
+
Constructs a private scene index.
*/
QGraphicsSceneIndexPrivate::QGraphicsSceneIndexPrivate(QGraphicsScene *scene) : scene(scene)
diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp
index 657fc828074..2246ad6d39e 100644
--- a/src/widgets/graphicsview/qgraphicsview.cpp
+++ b/src/widgets/graphicsview/qgraphicsview.cpp
@@ -1119,6 +1119,12 @@ void QGraphicsViewPrivate::freeStyleOptionsArray(QStyleOptionGraphicsItem *array
Q_GUI_EXPORT extern QPainterPath qt_regionToPath(const QRegion &region);
/*!
+ \class QGraphicsViewPrivate
+ \inmodule QtWidgets
+ \internal
+*/
+
+/*!
### Adjustments in findItems: mapToScene(QRect) forces us to adjust the
input rectangle by (0, 0, 1, 1), because it uses QRect::bottomRight()
(etc) when mapping the rectangle to a polygon (which is _wrong_). In
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index 6288aae096a..05233ba5801 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -172,6 +172,43 @@ void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index
}
}
+#if QT_CONFIG(accessibility)
+void QAbstractItemViewPrivate::updateItemAccessibility(const QModelIndex &index,
+ const QList<int> &roles)
+{
+ Q_Q(QAbstractItemView);
+
+ if (!QAccessible::isActive())
+ return;
+
+ const int childIndex = accessibleChildIndex(index);
+ if (childIndex < 0)
+ return;
+
+ // see QAccessibleTableCell for how role data are mapped to the a11y layer
+
+ for (int role : roles) {
+ if (role == Qt::AccessibleTextRole
+ || (role == Qt::DisplayRole
+ && index.data(Qt::AccessibleTextRole).toString().isEmpty())) {
+ QAccessibleEvent event(q, QAccessible::NameChanged);
+ event.setChild(childIndex);
+ QAccessible::updateAccessibility(&event);
+ } else if (role == Qt::AccessibleDescriptionRole) {
+ QAccessibleEvent event(q, QAccessible::DescriptionChanged);
+ event.setChild(childIndex);
+ QAccessible::updateAccessibility(&event);
+ } else if (role == Qt::CheckStateRole) {
+ QAccessible::State state;
+ state.checked = true;
+ QAccessibleStateChangeEvent event(q, state);
+ event.setChild(childIndex);
+ QAccessible::updateAccessibility(&event);
+ }
+ }
+}
+#endif
+
#if QT_CONFIG(gestures) && QT_CONFIG(scroller)
// stores and restores the selection and current item when flicking
@@ -3495,6 +3532,10 @@ void QAbstractItemView::dataChanged(const QModelIndex &topLeft, const QModelInde
accessibleEvent.setLastRow(bottomRight.row());
accessibleEvent.setLastColumn(bottomRight.column());
QAccessible::updateAccessibility(&accessibleEvent);
+
+ // send accessibility events as needed when current item is modified
+ if (topLeft == bottomRight && topLeft == currentIndex())
+ d->updateItemAccessibility(topLeft, roles);
}
#endif
d->updateGeometry();
diff --git a/src/widgets/itemviews/qabstractitemview_p.h b/src/widgets/itemviews/qabstractitemview_p.h
index 60799fb8a50..f9e899d7fc8 100644
--- a/src/widgets/itemviews/qabstractitemview_p.h
+++ b/src/widgets/itemviews/qabstractitemview_p.h
@@ -272,6 +272,18 @@ public:
return isIndexValid(index) && isIndexSelectable(index);
}
+#if QT_CONFIG(accessibility)
+ virtual int accessibleChildIndex(const QModelIndex &index) const
+ {
+ Q_UNUSED(index);
+ return -1;
+ }
+#endif
+
+#if QT_CONFIG(accessibility)
+ void updateItemAccessibility(const QModelIndex &index, const QList<int> &roles);
+#endif
+
// reimplemented from QAbstractScrollAreaPrivate
QPoint contentsOffset() const override {
Q_Q(const QAbstractItemView);
diff --git a/src/widgets/itemviews/qcolumnviewgrip.cpp b/src/widgets/itemviews/qcolumnviewgrip.cpp
index fe82c450c2d..269955a8d63 100644
--- a/src/widgets/itemviews/qcolumnviewgrip.cpp
+++ b/src/widgets/itemviews/qcolumnviewgrip.cpp
@@ -13,19 +13,18 @@ QT_BEGIN_NAMESPACE
/*
\internal
- class QColumnViewGrip
-
- QColumnViewGrip is created to go inside QAbstractScrollArea's corner.
- When the mouse it moved it will resize the scroll area and emit's a signal.
- */
-
-/*
- \internal
\fn void QColumnViewGrip::gripMoved()
Signal that is emitted when the grip moves the parent widget.
*/
/*!
+ \class QColumnViewGrip
+ \inmodule QtWidgets
+ \internal
+
+ QColumnViewGrip is created to go inside QAbstractScrollArea's corner.
+ When the mouse is moved it will resize the scroll area and emit a signal.
+
Creates a new QColumnViewGrip with the given \a parent to view a model.
Use setModel() to set the model.
*/
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index ff1bec803d7..50b6034500d 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -608,6 +608,12 @@ void QListViewPrivate::selectAll(QItemSelectionModel::SelectionFlags command)
}
/*!
+ \class QListViewPrivate
+ \inmodule QtWidgets
+ \internal
+*/
+
+/*!
\reimp
We have a QListView way of knowing what elements are on the viewport
@@ -1953,6 +1959,14 @@ bool QListViewPrivate::dropOn(QDropEvent *event, int *dropRow, int *dropCol, QMo
}
#endif
+#if QT_CONFIG(accessibility)
+int QListViewPrivate::accessibleChildIndex(const QModelIndex &index) const
+{
+ Q_Q(const QListView);
+ return q->visualIndex(index);
+}
+#endif
+
void QListViewPrivate::removeCurrentAndDisabled(QList<QModelIndex> *indexes,
const QModelIndex &current) const
{
@@ -3391,11 +3405,12 @@ void QIconModeViewBase::updateContentsSize()
*/
void QListView::currentChanged(const QModelIndex &current, const QModelIndex &previous)
{
+ Q_D(const QListView);
QAbstractItemView::currentChanged(current, previous);
#if QT_CONFIG(accessibility)
if (QAccessible::isActive()) {
if (current.isValid() && hasFocus()) {
- int entry = visualIndex(current);
+ int entry = d->accessibleChildIndex(current);
QAccessibleEvent event(this, QAccessible::Focus);
event.setChild(entry);
QAccessible::updateAccessibility(&event);
@@ -3411,18 +3426,19 @@ void QListView::selectionChanged(const QItemSelection &selected,
const QItemSelection &deselected)
{
#if QT_CONFIG(accessibility)
+ Q_D(const QListView);
if (QAccessible::isActive()) {
// ### does not work properly for selection ranges.
QModelIndex sel = selected.indexes().value(0);
if (sel.isValid()) {
- int entry = visualIndex(sel);
+ int entry = d->accessibleChildIndex(sel);
QAccessibleEvent event(this, QAccessible::SelectionAdd);
event.setChild(entry);
QAccessible::updateAccessibility(&event);
}
QModelIndex desel = deselected.indexes().value(0);
if (desel.isValid()) {
- int entry = visualIndex(desel);
+ int entry = d->accessibleChildIndex(desel);
QAccessibleEvent event(this, QAccessible::SelectionRemove);
event.setChild(entry);
QAccessible::updateAccessibility(&event);
diff --git a/src/widgets/itemviews/qlistview_p.h b/src/widgets/itemviews/qlistview_p.h
index 4475fa5461f..7e36887a65c 100644
--- a/src/widgets/itemviews/qlistview_p.h
+++ b/src/widgets/itemviews/qlistview_p.h
@@ -346,6 +346,10 @@ public:
bool dropOn(QDropEvent *event, int *row, int *col, QModelIndex *index) override;
#endif
+#if QT_CONFIG(accessibility)
+ int accessibleChildIndex(const QModelIndex &index) const override;
+#endif
+
inline void setGridSize(const QSize &size) { grid = size; }
inline QSize gridSize() const { return grid; }
inline void setWrapping(bool b) { wrap = b; }
diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp
index d175bf9c5a1..54279efe2f0 100644
--- a/src/widgets/itemviews/qlistwidget.cpp
+++ b/src/widgets/itemviews/qlistwidget.cpp
@@ -256,6 +256,12 @@ bool QListModel::removeRows(int row, int count, const QModelIndex &parent)
}
/*!
+ \class QListModel
+ \inmodule QtWidgets
+ \internal
+*/
+
+/*!
\since 5.13
\reimp
*/
diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp
index 40e3fcaf91b..2d28b3d4a81 100644
--- a/src/widgets/itemviews/qtableview.cpp
+++ b/src/widgets/itemviews/qtableview.cpp
@@ -3593,7 +3593,7 @@ void QTableView::currentChanged(const QModelIndex &current, const QModelIndex &p
if (QAccessible::isActive()) {
if (current.isValid() && hasFocus()) {
Q_D(QTableView);
- int entry = d->accessibleTable2Index(current);
+ int entry = d->accessibleChildIndex(current);
QAccessibleEvent event(this, QAccessible::Focus);
event.setChild(entry);
QAccessible::updateAccessibility(&event);
@@ -3616,14 +3616,14 @@ void QTableView::selectionChanged(const QItemSelection &selected,
// ### does not work properly for selection ranges.
QModelIndex sel = selected.indexes().value(0);
if (sel.isValid()) {
- int entry = d->accessibleTable2Index(sel);
+ int entry = d->accessibleChildIndex(sel);
QAccessibleEvent event(this, QAccessible::SelectionAdd);
event.setChild(entry);
QAccessible::updateAccessibility(&event);
}
QModelIndex desel = deselected.indexes().value(0);
if (desel.isValid()) {
- int entry = d->accessibleTable2Index(desel);
+ int entry = d->accessibleChildIndex(desel);
QAccessibleEvent event(this, QAccessible::SelectionRemove);
event.setChild(entry);
QAccessible::updateAccessibility(&event);
diff --git a/src/widgets/itemviews/qtableview_p.h b/src/widgets/itemviews/qtableview_p.h
index 8ddb8e797a9..9a7ce229880 100644
--- a/src/widgets/itemviews/qtableview_p.h
+++ b/src/widgets/itemviews/qtableview_p.h
@@ -141,11 +141,14 @@ public:
QStyleOptionViewItem::ViewItemPosition viewItemPosition(const QModelIndex &index) const;
- inline int accessibleTable2Index(const QModelIndex &index) const {
+#if QT_CONFIG(accessibility)
+ inline int accessibleChildIndex(const QModelIndex &index) const override
+ {
const int vHeader = verticalHeader ? 1 : 0;
return (index.row() + (horizontalHeader ? 1 : 0)) * (index.model()->columnCount() + vHeader)
+ index.column() + vHeader;
}
+#endif
int sectionSpanEndLogical(const QHeaderView *header, int logical, int span) const;
int sectionSpanSize(const QHeaderView *header, int logical, int span) const;
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index 84ff04c9f34..570566793dc 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -1453,6 +1453,12 @@ QRect QTreeViewPrivate::intersectedRect(const QRect rect, const QModelIndex &top
}
/*!
+ \class QTreeViewPrivate
+ \inmodule QtWidgets
+ \internal
+*/
+
+/*!
\reimp
We have a QTreeView way of knowing what elements are on the viewport
@@ -4077,13 +4083,15 @@ void QTreeViewPrivate::sortIndicatorChanged(int column, Qt::SortOrder order)
model->sort(column, order);
}
-int QTreeViewPrivate::accessibleTree2Index(const QModelIndex &index) const
+#if QT_CONFIG(accessibility)
+int QTreeViewPrivate::accessibleChildIndex(const QModelIndex &index) const
{
Q_Q(const QTreeView);
// Note that this will include the header, even if its hidden.
return (q->visualIndex(index) + (q->header() ? 1 : 0)) * index.model()->columnCount() + index.column();
}
+#endif
void QTreeViewPrivate::updateIndentationFromStyle()
{
@@ -4110,7 +4118,7 @@ void QTreeView::currentChanged(const QModelIndex &current, const QModelIndex &pr
Q_D(QTreeView);
QAccessibleEvent event(this, QAccessible::Focus);
- event.setChild(d->accessibleTree2Index(current));
+ event.setChild(d->accessibleChildIndex(current));
QAccessible::updateAccessibility(&event);
}
#endif
@@ -4130,7 +4138,7 @@ void QTreeView::selectionChanged(const QItemSelection &selected,
// ### does not work properly for selection ranges.
QModelIndex sel = selected.indexes().value(0);
if (sel.isValid()) {
- int entry = d->accessibleTree2Index(sel);
+ int entry = d->accessibleChildIndex(sel);
Q_ASSERT(entry >= 0);
QAccessibleEvent event(this, QAccessible::SelectionAdd);
event.setChild(entry);
@@ -4138,7 +4146,7 @@ void QTreeView::selectionChanged(const QItemSelection &selected,
}
QModelIndex desel = deselected.indexes().value(0);
if (desel.isValid()) {
- int entry = d->accessibleTree2Index(desel);
+ int entry = d->accessibleChildIndex(desel);
Q_ASSERT(entry >= 0);
QAccessibleEvent event(this, QAccessible::SelectionRemove);
event.setChild(entry);
diff --git a/src/widgets/itemviews/qtreeview_p.h b/src/widgets/itemviews/qtreeview_p.h
index 5a4e057901c..34db2fcdacb 100644
--- a/src/widgets/itemviews/qtreeview_p.h
+++ b/src/widgets/itemviews/qtreeview_p.h
@@ -234,7 +234,9 @@ public:
return (viewIndex(index) + (header ? 1 : 0)) * model->columnCount()+index.column();
}
- int accessibleTree2Index(const QModelIndex &index) const;
+#if QT_CONFIG(accessibility)
+ int accessibleChildIndex(const QModelIndex &index) const override;
+#endif
void updateIndentationFromStyle();
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index 6b03b6f9f1a..f8ffaba3ec2 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -523,6 +523,12 @@ bool QTreeModel::setHeaderData(int section, Qt::Orientation orientation,
}
/*!
+ \class QTreeModel
+ \inmodule QtWidgets
+ \internal
+*/
+
+/*!
\reimp
Returns the flags for the item referred to the given \a index.
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index fa95a1d2538..d2b0fb724ac 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -503,6 +503,12 @@ void qt_init_tooltip_palette()
extern void qRegisterWidgetsVariant();
/*!
+ \class QApplicationPrivate
+ \inmodule QtWidgets
+ \internal
+*/
+
+/*!
Initializes the QApplication object, called from the constructors.
*/
void QApplicationPrivate::initialize()
diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp
index 5ba92714f6c..45b0c8d2aea 100644
--- a/src/widgets/kernel/qlayout.cpp
+++ b/src/widgets/kernel/qlayout.cpp
@@ -771,6 +771,12 @@ void QLayoutPrivate::reparentChildWidgets(QWidget *mw)
}
/*!
+ \class QLayoutPrivate
+ \inmodule QtWidgets
+ \internal
+*/
+
+/*!
Returns \c true if the \a widget can be added to the \a layout;
otherwise returns \c false.
*/
diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp
index d989feb7f91..97332cd7d5d 100644
--- a/src/widgets/kernel/qtooltip.cpp
+++ b/src/widgets/kernel/qtooltip.cpp
@@ -6,15 +6,12 @@
#include <qapplication.h>
#include <qevent.h>
-#include <qpointer.h>
#include <qstyle.h>
#include <qstyleoption.h>
#include <qstylepainter.h>
#if QT_CONFIG(effects)
#include <private/qeffects_p.h>
#endif
-#include <qtextdocument.h>
-#include <qdebug.h>
#include <qpa/qplatformscreen.h>
#include <qpa/qplatformcursor.h>
#if QT_CONFIG(style_stylesheet)
@@ -23,12 +20,10 @@
#include <qpa/qplatformwindow.h>
#include <qpa/qplatformwindow_p.h>
-#include <qlabel.h>
#include <QtWidgets/private/qlabel_p.h>
#include <QtGui/private/qhighdpiscaling_p.h>
#include <qtooltip.h>
-
-#include <QtCore/qbasictimer.h>
+#include <QtWidgets/private/qtooltip_p.h>
QT_BEGIN_NAMESPACE
@@ -93,57 +88,6 @@ using namespace Qt::StringLiterals;
\sa QWidget::toolTip, QAction::toolTip
*/
-class QTipLabel : public QLabel
-{
- Q_OBJECT
-public:
- QTipLabel(const QString &text, const QPoint &pos, QWidget *w, int msecDisplayTime);
- ~QTipLabel();
- static QTipLabel *instance;
-
- void adjustTooltipScreen(const QPoint &pos);
- void updateSize(const QPoint &pos);
-
- bool eventFilter(QObject *, QEvent *) override;
-
- QBasicTimer hideTimer, expireTimer;
-
- bool fadingOut;
-
- void reuseTip(const QString &text, int msecDisplayTime, const QPoint &pos);
- void hideTip();
- void hideTipImmediately();
- void setTipRect(QWidget *w, const QRect &r);
- void restartExpireTimer(int msecDisplayTime);
- bool tipChanged(const QPoint &pos, const QString &text, QObject *o);
- void placeTip(const QPoint &pos, QWidget *w);
-
- static QScreen *getTipScreen(const QPoint &pos, QWidget *w);
-protected:
- void timerEvent(QTimerEvent *e) override;
- void paintEvent(QPaintEvent *e) override;
- void mouseMoveEvent(QMouseEvent *e) override;
- void resizeEvent(QResizeEvent *e) override;
-
-#if QT_CONFIG(style_stylesheet)
-public slots:
- /** \internal
- Cleanup the _q_stylesheet_parent property.
- */
- void styleSheetParentDestroyed() {
- setProperty("_q_stylesheet_parent", QVariant());
- styleSheetParent = nullptr;
- }
-
-private:
- QWidget *styleSheetParent;
-#endif
-
-private:
- QWidget *widget;
- QRect rect;
-};
-
QTipLabel *QTipLabel::instance = nullptr;
QTipLabel::QTipLabel(const QString &text, const QPoint &pos, QWidget *w, int msecDisplayTime)
@@ -152,6 +96,7 @@ QTipLabel::QTipLabel(const QString &text, const QPoint &pos, QWidget *w, int mse
, styleSheetParent(nullptr)
#endif
, widget(nullptr)
+ , fadingOut(false)
{
delete instance;
instance = this;
@@ -166,7 +111,6 @@ QTipLabel::QTipLabel(const QString &text, const QPoint &pos, QWidget *w, int mse
qApp->installEventFilter(this);
setWindowOpacity(style()->styleHint(QStyle::SH_ToolTipLabel_Opacity, nullptr, this) / 255.0);
setMouseTracking(true);
- fadingOut = false;
reuseTip(text, msecDisplayTime, pos);
}
@@ -240,10 +184,10 @@ void QTipLabel::resizeEvent(QResizeEvent *e)
void QTipLabel::mouseMoveEvent(QMouseEvent *e)
{
if (!rect.isNull()) {
- QPoint pos = e->globalPosition().toPoint();
+ QPointF pos = e->globalPosition();
if (widget)
pos = widget->mapFromGlobal(pos);
- if (!rect.contains(pos))
+ if (!rect.contains(pos.toPoint()))
hideTip();
}
QLabel::mouseMoveEvent(e);
@@ -389,13 +333,16 @@ void QTipLabel::placeTip(const QPoint &pos, QWidget *w)
p += offset;
#if QT_CONFIG(wayland)
- create();
- if (auto waylandWindow = dynamic_cast<QNativeInterface::Private::QWaylandWindow*>(windowHandle()->handle())) {
- // based on the existing code below, by default position at 'p' stored at the bottom right of our rect
- // then flip to the other arbitrary 4x24 space if constrained
- const QRect controlGeometry(QRect(p.x() - 4, p.y() - 24, 4, 24));
- waylandWindow->setParentControlGeometry(controlGeometry);
- waylandWindow->setExtendedWindowType(QNativeInterface::Private::QWaylandWindow::ToolTip);
+ if (w) {
+ create();
+ if (auto waylandWindow = dynamic_cast<QNativeInterface::Private::QWaylandWindow*>(windowHandle()->handle())) {
+ // based on the existing code below, by default position at 'p' stored at the bottom right of our rect
+ // then flip to the other arbitrary 4x24 space if constrained
+ const QRect controlGeometry = QRect(p.x() - 4, p.y() - 24, 4, 24)
+ .translated(-w->window()->mapToGlobal(QPoint(0, 0)));
+ waylandWindow->setParentControlGeometry(controlGeometry);
+ waylandWindow->setExtendedWindowType(QNativeInterface::Private::QWaylandWindow::ToolTip);
+ }
}
#endif
@@ -430,6 +377,15 @@ bool QTipLabel::tipChanged(const QPoint &pos, const QString &text, QObject *o)
return false;
}
+/** \internal
+ Cleanup the _q_stylesheet_parent property.
+ */
+void QTipLabel::styleSheetParentDestroyed()
+{
+ setProperty("_q_stylesheet_parent", QVariant());
+ styleSheetParent = nullptr;
+}
+
/*!
Shows \a text as a tool tip, with the global position \a pos as
the point of interest. The tool tip will be shown with a platform
@@ -591,4 +547,4 @@ void QToolTip::setFont(const QFont &font)
QT_END_NAMESPACE
-#include "qtooltip.moc"
+#include "moc_qtooltip_p.cpp"
diff --git a/src/widgets/kernel/qtooltip_p.h b/src/widgets/kernel/qtooltip_p.h
new file mode 100644
index 00000000000..51faaf58c34
--- /dev/null
+++ b/src/widgets/kernel/qtooltip_p.h
@@ -0,0 +1,74 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// Qt-Security score:significant reason:default
+
+#ifndef QTOOLTIP_P_H
+#define QTOOLTIP_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of qlayout*.cpp, and qabstractlayout.cpp. This header
+// file may change from version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QLabel>
+#include <QString>
+#include <QRect>
+#include <QToolTip>
+
+QT_REQUIRE_CONFIG(tooltip);
+QT_BEGIN_NAMESPACE
+
+class Q_WIDGETS_EXPORT QTipLabel final : public QLabel
+{
+ Q_OBJECT
+public:
+ explicit QTipLabel(const QString &text, const QPoint &pos, QWidget *w, int msecDisplayTime);
+ ~QTipLabel() override;
+
+ void adjustTooltipScreen(const QPoint &pos);
+ void updateSize(const QPoint &pos);
+
+ bool eventFilter(QObject *, QEvent *) override;
+
+ void reuseTip(const QString &text, int msecDisplayTime, const QPoint &pos);
+ void hideTip();
+ void hideTipImmediately();
+ void setTipRect(QWidget *w, const QRect &r);
+ void restartExpireTimer(int msecDisplayTime);
+ bool tipChanged(const QPoint &pos, const QString &text, QObject *o);
+ void placeTip(const QPoint &pos, QWidget *w);
+
+ static QScreen *getTipScreen(const QPoint &pos, QWidget *w);
+protected:
+ void timerEvent(QTimerEvent *e) override;
+ void paintEvent(QPaintEvent *e) override;
+ void mouseMoveEvent(QMouseEvent *e) override;
+ void resizeEvent(QResizeEvent *e) override;
+
+#if QT_CONFIG(style_stylesheet)
+public Q_SLOTS:
+ void styleSheetParentDestroyed();
+
+private:
+ QWidget *styleSheetParent;
+#endif
+
+private:
+ friend class QToolTip;
+
+ static QTipLabel *instance;
+ QBasicTimer hideTimer, expireTimer;
+ QWidget *widget;
+ QRect rect;
+ bool fadingOut;
+};
+
+QT_END_NAMESPACE
+
+#endif // QTOOLTIP_P_H
diff --git a/src/widgets/kernel/qwidgetrepaintmanager.cpp b/src/widgets/kernel/qwidgetrepaintmanager.cpp
index 93464264506..30526e38b3e 100644
--- a/src/widgets/kernel/qwidgetrepaintmanager.cpp
+++ b/src/widgets/kernel/qwidgetrepaintmanager.cpp
@@ -597,6 +597,12 @@ static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget)
// ---------------------------------------------------------------------------
/*!
+ \class QWidgetRepaintManager
+ \inmodule QtWidgets
+ \internal
+*/
+
+/*!
Synchronizes the \a exposedRegion of the \a exposedWidget with the backing store.
If there are dirty widgets, including but not limited to the \a exposedWidget,
@@ -1202,6 +1208,12 @@ bool QWidgetRepaintManager::isDirty() const
}
/*!
+ \class QWidgetPrivate
+ \inmodule QtWidgets
+ \internal
+*/
+
+/*!
Invalidates the backing store when the widget is resized.
Static areas are never invalidated unless absolutely needed.
*/
diff --git a/src/widgets/styles/images/fusion_normalizedockup_10.png b/src/widgets/styles/images/fusion_normalizedockup-10.png
index 7516e4ee4f8..7516e4ee4f8 100644
--- a/src/widgets/styles/images/fusion_normalizedockup_10.png
+++ b/src/widgets/styles/images/fusion_normalizedockup-10.png
Binary files differ
diff --git a/src/widgets/styles/images/fusion_normalizedockup_20.png b/src/widgets/styles/images/fusion_normalizedockup-20.png
index 2bc9421d5ac..2bc9421d5ac 100644
--- a/src/widgets/styles/images/fusion_normalizedockup_20.png
+++ b/src/widgets/styles/images/fusion_normalizedockup-20.png
Binary files differ
diff --git a/src/widgets/styles/images/fusion_normalizedockup_48.png b/src/widgets/styles/images/fusion_normalizedockup-48.png
index 6c497abdded..6c497abdded 100644
--- a/src/widgets/styles/images/fusion_normalizedockup_48.png
+++ b/src/widgets/styles/images/fusion_normalizedockup-48.png
Binary files differ
diff --git a/src/widgets/styles/images/fusion_normalizedockup_64.png b/src/widgets/styles/images/fusion_normalizedockup-64.png
index 5ec620e5a04..5ec620e5a04 100644
--- a/src/widgets/styles/images/fusion_normalizedockup_64.png
+++ b/src/widgets/styles/images/fusion_normalizedockup-64.png
Binary files differ
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 90c1cfb4b86..592b70ef8ba 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -1994,12 +1994,9 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
tr = proxy()->subElementRect(SE_TabBarTabText, opt, widget);
if (!tab->icon.isNull()) {
- QPixmap tabIcon = tab->icon.pixmap(tab->iconSize, QStyleHelper::getDpr(p),
- (tab->state & State_Enabled) ? QIcon::Normal
- : QIcon::Disabled,
- (tab->state & State_Selected) ? QIcon::On
- : QIcon::Off);
- p->drawPixmap(iconRect.x(), iconRect.y(), tabIcon);
+ const auto mode = (tab->state & State_Enabled) ? QIcon::Normal : QIcon::Disabled;
+ const auto state = (tab->state & State_Selected) ? QIcon::On : QIcon::Off;
+ tab->icon.paint(p, iconRect, Qt::AlignCenter, mode, state);
}
proxy()->drawItemText(p, tr, alignment, tab->palette, tab->state & State_Enabled, tab->text,
diff --git a/src/widgets/util/qflickgesture.cpp b/src/widgets/util/qflickgesture.cpp
index a05781cd439..41d02779039 100644
--- a/src/widgets/util/qflickgesture.cpp
+++ b/src/widgets/util/qflickgesture.cpp
@@ -293,6 +293,12 @@ QFlickGestureRecognizer::QFlickGestureRecognizer(Qt::MouseButton button)
this->button = button;
}
+/*!
+ \class QFlickGestureRecognizer
+ \inmodule QtWidgets
+ \internal
+*/
+
/*! \reimp
*/
QGesture *QFlickGestureRecognizer::create(QObject *target)
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index 1dcbec27487..0182ab8531f 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -829,6 +829,12 @@ QAbstractItemView *QComboBoxPrivateContainer::itemView() const
}
/*!
+ \class QComboBoxPrivateContainer
+ \inmodule QtWidgets
+ \internal
+*/
+
+/*!
Sets the item view to be used for the combobox popup.
*/
void QComboBoxPrivateContainer::setItemView(QAbstractItemView *itemView)
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp
index 784ce2c8d19..a2171eb3473 100644
--- a/src/widgets/widgets/qlabel.cpp
+++ b/src/widgets/widgets/qlabel.cpp
@@ -518,6 +518,12 @@ void QLabel::setMargin(int margin)
}
/*!
+ \class QLabelPrivate
+ \inmodule QtWidgets
+ \internal
+*/
+
+/*!
Returns the size that will be used if the width of the label is \a
w. If \a w is -1, the sizeHint() is returned. If \a w is 0 minimumSizeHint() is returned
*/
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp
index ee80cca649c..0a083beeb25 100644
--- a/src/widgets/widgets/qlineedit_p.cpp
+++ b/src/widgets/widgets/qlineedit_p.cpp
@@ -293,6 +293,12 @@ void QLineEditPrivate::resetInputMethod()
}
/*!
+ \class QLineEditPrivate
+ \inmodule QtWidgets
+ \internal
+*/
+
+/*!
This function is not intended as polymorphic usage. Just a shared code
fragment that calls QInputMethod::invokeAction for this
class.
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp
index 1708a53f163..cec25faef3e 100644
--- a/src/widgets/widgets/qmainwindowlayout.cpp
+++ b/src/widgets/widgets/qmainwindowlayout.cpp
@@ -1541,6 +1541,12 @@ void QMainWindowLayout::removeToolBar(QToolBar *toolbar)
}
/*!
+ \class QMainWindowLayout
+ \inmodule QtWidgets
+ \internal
+*/
+
+/*!
Adds \a toolbar to \a area, continuing the current line.
*/
void QMainWindowLayout::addToolBar(Qt::ToolBarArea area,
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 3575eb78ac4..9b6b96d911b 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -1537,8 +1537,12 @@ void QMenuPrivate::_q_actionTriggered()
}
activateCausedStack(list, action, QAction::Trigger, false);
// if a widget action fires, we need to hide the menu explicitly
- if (qobject_cast<QWidgetAction*>(action))
+ if (qobject_cast<QWidgetAction*>(action)) {
+ // make sure QMenu::exec returns the triggered widget action
+ currentAction = action;
+ setSyncAction();
hideUpToMenuBar();
+ }
}
}
}