Use QList instead of QVector in widgets
Task-number: QTBUG-84469 Change-Id: I3007734f8e4f164ece9dd8850ef007cbef9e12ef Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>bb10
parent
d4c04acc65
commit
2a6cdec718
|
|
@ -117,8 +117,8 @@ QAccessibleInterface *QAccessibleMenu::child(int index) const
|
|||
QAccessibleInterface *QAccessibleMenu::parent() const
|
||||
{
|
||||
if (QAction *menuAction = menu()->menuAction()) {
|
||||
QVector<QObject*> parentCandidates;
|
||||
const QVector<QObject*> associatedObjects = menuAction->associatedObjects();
|
||||
QList<QObject *> parentCandidates;
|
||||
const QList<QObject *> associatedObjects = menuAction->associatedObjects();
|
||||
parentCandidates.reserve(associatedObjects.size() + 1);
|
||||
parentCandidates << menu()->parentWidget() << associatedObjects;
|
||||
for (QObject *object : qAsConst(parentCandidates)) {
|
||||
|
|
|
|||
|
|
@ -299,10 +299,10 @@ static inline bool isAncestor(const QObject *obj, const QObject *child)
|
|||
}
|
||||
|
||||
/*! \reimp */
|
||||
QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >
|
||||
QList<QPair<QAccessibleInterface *, QAccessible::Relation>>
|
||||
QAccessibleWidget::relations(QAccessible::Relation match /*= QAccessible::AllRelations*/) const
|
||||
{
|
||||
QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > rels;
|
||||
QList<QPair<QAccessibleInterface *, QAccessible::Relation>> rels;
|
||||
if (match & QAccessible::Label) {
|
||||
const QAccessible::Relation rel = QAccessible::Label;
|
||||
if (QWidget *parent = widget()->parentWidget()) {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,8 @@ public:
|
|||
QWindow *window() const override;
|
||||
int childCount() const override;
|
||||
int indexOfChild(const QAccessibleInterface *child) const override;
|
||||
QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > relations(QAccessible::Relation match = QAccessible::AllRelations) const override;
|
||||
QList<QPair<QAccessibleInterface *, QAccessible::Relation>>
|
||||
relations(QAccessible::Relation match = QAccessible::AllRelations) const override;
|
||||
QAccessibleInterface *focusChild() const override;
|
||||
|
||||
QRect rect() const override;
|
||||
|
|
|
|||
|
|
@ -519,11 +519,12 @@ QString QAccessibleDisplay::text(QAccessible::Text t) const
|
|||
}
|
||||
|
||||
/*! \reimp */
|
||||
QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >
|
||||
QList<QPair<QAccessibleInterface *, QAccessible::Relation>>
|
||||
QAccessibleDisplay::relations(QAccessible::Relation match /* = QAccessible::AllRelations */) const
|
||||
{
|
||||
QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > rels = QAccessibleWidget::relations(match);
|
||||
#if QT_CONFIG(shortcut) && QT_CONFIG(label)
|
||||
QList<QPair<QAccessibleInterface *, QAccessible::Relation>> rels =
|
||||
QAccessibleWidget::relations(match);
|
||||
# if QT_CONFIG(shortcut) && QT_CONFIG(label)
|
||||
if (match & QAccessible::Labelled) {
|
||||
if (QLabel *label = qobject_cast<QLabel*>(object())) {
|
||||
const QAccessible::Relation rel = QAccessible::Labelled;
|
||||
|
|
@ -630,10 +631,11 @@ QAccessible::Role QAccessibleGroupBox::role() const
|
|||
return groupBox()->isCheckable() ? QAccessible::CheckBox : QAccessible::Grouping;
|
||||
}
|
||||
|
||||
QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >
|
||||
QList<QPair<QAccessibleInterface *, QAccessible::Relation>>
|
||||
QAccessibleGroupBox::relations(QAccessible::Relation match /* = QAccessible::AllRelations */) const
|
||||
{
|
||||
QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > rels = QAccessibleWidget::relations(match);
|
||||
QList<QPair<QAccessibleInterface *, QAccessible::Relation>> rels =
|
||||
QAccessibleWidget::relations(match);
|
||||
|
||||
if ((match & QAccessible::Labelled) && (!groupBox()->title().isEmpty())) {
|
||||
const QList<QWidget*> kids = childWidgets(widget());
|
||||
|
|
|
|||
|
|
@ -118,7 +118,8 @@ public:
|
|||
QAccessible::Role role() const override;
|
||||
QAccessible::State state() const override;
|
||||
|
||||
QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >relations(QAccessible::Relation match = QAccessible::AllRelations) const override;
|
||||
QList<QPair<QAccessibleInterface *, QAccessible::Relation>>
|
||||
relations(QAccessible::Relation match = QAccessible::AllRelations) const override;
|
||||
void *interface_cast(QAccessible::InterfaceType t) override;
|
||||
|
||||
// QAccessibleImageInterface
|
||||
|
|
@ -137,7 +138,8 @@ public:
|
|||
QAccessible::Role role() const override;
|
||||
QString text(QAccessible::Text t) const override;
|
||||
|
||||
QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >relations(QAccessible::Relation match = QAccessible::AllRelations) const override;
|
||||
QList<QPair<QAccessibleInterface *, QAccessible::Relation>>
|
||||
relations(QAccessible::Relation match = QAccessible::AllRelations) const override;
|
||||
|
||||
//QAccessibleActionInterface
|
||||
QStringList actionNames() const override;
|
||||
|
|
|
|||
|
|
@ -3634,7 +3634,7 @@ void QFileDialogPrivate::_q_autoCompleteFileName(const QString &text)
|
|||
const QStringList multipleFiles = typedFiles();
|
||||
if (multipleFiles.count() > 0) {
|
||||
QModelIndexList oldFiles = qFileDialogUi->listView->selectionModel()->selectedRows();
|
||||
QVector<QModelIndex> newFiles;
|
||||
QList<QModelIndex> newFiles;
|
||||
for (const auto &file : multipleFiles) {
|
||||
QModelIndex idx = model->index(file);
|
||||
if (oldFiles.removeAll(idx) == 0)
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ class Q_WIDGETS_EXPORT QFileDialogPrivate : public QDialogPrivate
|
|||
Q_DECLARE_PUBLIC(QFileDialog)
|
||||
|
||||
public:
|
||||
using PersistentModelIndexList = QVector<QPersistentModelIndex>;
|
||||
using PersistentModelIndexList = QList<QPersistentModelIndex>;
|
||||
|
||||
struct HistoryItem
|
||||
{
|
||||
|
|
|
|||
|
|
@ -380,7 +380,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil
|
|||
}
|
||||
for (int i = infoList.count() - 1; i >= 0; --i) {
|
||||
QString driveName = translateDriveName(infoList.at(i));
|
||||
QVector<QPair<QString,QFileInfo> > updatedFiles;
|
||||
QList<QPair<QString, QFileInfo>> updatedFiles;
|
||||
updatedFiles.append(QPair<QString,QFileInfo>(driveName, infoList.at(i)));
|
||||
emit updates(path, updatedFiles);
|
||||
}
|
||||
|
|
@ -391,7 +391,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil
|
|||
base.start();
|
||||
QFileInfo fileInfo;
|
||||
bool firstTime = true;
|
||||
QVector<QPair<QString, QFileInfo> > updatedFiles;
|
||||
QList<QPair<QString, QFileInfo>> updatedFiles;
|
||||
QStringList filesToCheck = files;
|
||||
|
||||
QStringList allFiles;
|
||||
|
|
@ -418,7 +418,9 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil
|
|||
emit directoryLoaded(path);
|
||||
}
|
||||
|
||||
void QFileInfoGatherer::fetch(const QFileInfo &fileInfo, QElapsedTimer &base, bool &firstTime, QVector<QPair<QString, QFileInfo> > &updatedFiles, const QString &path) {
|
||||
void QFileInfoGatherer::fetch(const QFileInfo &fileInfo, QElapsedTimer &base, bool &firstTime,
|
||||
QList<QPair<QString, QFileInfo>> &updatedFiles, const QString &path)
|
||||
{
|
||||
updatedFiles.append(QPair<QString, QFileInfo>(fileInfo.fileName(), fileInfo));
|
||||
QElapsedTimer current;
|
||||
current.start();
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ class Q_AUTOTEST_EXPORT QFileInfoGatherer : public QThread
|
|||
Q_OBJECT
|
||||
|
||||
Q_SIGNALS:
|
||||
void updates(const QString &directory, const QVector<QPair<QString, QFileInfo> > &updates);
|
||||
void updates(const QString &directory, const QList<QPair<QString, QFileInfo>> &updates);
|
||||
void newListOfFiles(const QString &directory, const QStringList &listOfFiles) const;
|
||||
void nameResolved(const QString &fileName, const QString &resolvedName) const;
|
||||
void directoryLoaded(const QString &path);
|
||||
|
|
@ -199,7 +199,8 @@ private:
|
|||
void run() override;
|
||||
// called by run():
|
||||
void getFileInfos(const QString &path, const QStringList &files);
|
||||
void fetch(const QFileInfo &info, QElapsedTimer &base, bool &firstTime, QVector<QPair<QString, QFileInfo> > &updatedFiles, const QString &path);
|
||||
void fetch(const QFileInfo &info, QElapsedTimer &base, bool &firstTime,
|
||||
QList<QPair<QString, QFileInfo>> &updatedFiles, const QString &path);
|
||||
|
||||
private:
|
||||
void createWatcher();
|
||||
|
|
|
|||
|
|
@ -1106,7 +1106,7 @@ void QFileSystemModelPrivate::sortChildren(int column, const QModelIndex &parent
|
|||
if (indexNode->children.count() == 0)
|
||||
return;
|
||||
|
||||
QVector<QFileSystemModelPrivate::QFileSystemNode*> values;
|
||||
QList<QFileSystemModelPrivate::QFileSystemNode *> values;
|
||||
|
||||
for (auto iterator = indexNode->children.constBegin(), cend = indexNode->children.constEnd(); iterator != cend; ++iterator) {
|
||||
if (filtersAcceptsNode(iterator.value())) {
|
||||
|
|
@ -1150,7 +1150,7 @@ void QFileSystemModel::sort(int column, Qt::SortOrder order)
|
|||
|
||||
emit layoutAboutToBeChanged();
|
||||
QModelIndexList oldList = persistentIndexList();
|
||||
QVector<QPair<QFileSystemModelPrivate::QFileSystemNode*, int> > oldNodes;
|
||||
QList<QPair<QFileSystemModelPrivate::QFileSystemNode *, int>> oldNodes;
|
||||
const int nodeCount = oldList.count();
|
||||
oldNodes.reserve(nodeCount);
|
||||
for (int i = 0; i < nodeCount; ++i) {
|
||||
|
|
@ -1920,11 +1920,12 @@ void QFileSystemModelPrivate::removeVisibleFile(QFileSystemNode *parentNode, int
|
|||
The thread has received new information about files,
|
||||
update and emit dataChanged if it has actually changed.
|
||||
*/
|
||||
void QFileSystemModelPrivate::_q_fileSystemChanged(const QString &path, const QVector<QPair<QString, QFileInfo> > &updates)
|
||||
void QFileSystemModelPrivate::_q_fileSystemChanged(const QString &path,
|
||||
const QList<QPair<QString, QFileInfo>> &updates)
|
||||
{
|
||||
#if QT_CONFIG(filesystemwatcher)
|
||||
Q_Q(QFileSystemModel);
|
||||
QVector<QString> rowsToUpdate;
|
||||
QList<QString> rowsToUpdate;
|
||||
QStringList newFiles;
|
||||
QFileSystemModelPrivate::QFileSystemNode *parentNode = node(path, false);
|
||||
QModelIndex parentIndex = index(parentNode);
|
||||
|
|
@ -2077,12 +2078,12 @@ void QFileSystemModelPrivate::init()
|
|||
|
||||
delayedSortTimer.setSingleShot(true);
|
||||
|
||||
qRegisterMetaType<QVector<QPair<QString,QFileInfo> > >();
|
||||
qRegisterMetaType<QList<QPair<QString, QFileInfo>>>();
|
||||
#if QT_CONFIG(filesystemwatcher)
|
||||
q->connect(&fileInfoGatherer, SIGNAL(newListOfFiles(QString,QStringList)),
|
||||
q, SLOT(_q_directoryChanged(QString,QStringList)));
|
||||
q->connect(&fileInfoGatherer, SIGNAL(updates(QString,QVector<QPair<QString,QFileInfo> >)),
|
||||
q, SLOT(_q_fileSystemChanged(QString,QVector<QPair<QString,QFileInfo> >)));
|
||||
q->connect(&fileInfoGatherer, SIGNAL(updates(QString, QList<QPair<QString, QFileInfo>>)), q,
|
||||
SLOT(_q_fileSystemChanged(QString, QList<QPair<QString, QFileInfo>>)));
|
||||
q->connect(&fileInfoGatherer, SIGNAL(nameResolved(QString,QString)),
|
||||
q, SLOT(_q_resolvedName(QString,QString)));
|
||||
q->connect(&fileInfoGatherer, SIGNAL(directoryLoaded(QString)),
|
||||
|
|
|
|||
|
|
@ -170,7 +170,9 @@ private:
|
|||
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_directoryChanged(const QString &directory, const QStringList &list))
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_performDelayedSort())
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_fileSystemChanged(const QString &path, const QVector<QPair<QString, QFileInfo> > &))
|
||||
Q_PRIVATE_SLOT(d_func(),
|
||||
void _q_fileSystemChanged(const QString &path,
|
||||
const QList<QPair<QString, QFileInfo>> &))
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_resolvedName(const QString &fileName, const QString &resolvedName))
|
||||
|
||||
friend class QFileDialogPrivate;
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ public:
|
|||
|
||||
void _q_directoryChanged(const QString &directory, const QStringList &list);
|
||||
void _q_performDelayedSort();
|
||||
void _q_fileSystemChanged(const QString &path, const QVector<QPair<QString, QFileInfo> > &);
|
||||
void _q_fileSystemChanged(const QString &path, const QList<QPair<QString, QFileInfo>> &);
|
||||
void _q_resolvedName(const QString &fileName, const QString &resolvedName);
|
||||
|
||||
QDir rootDir;
|
||||
|
|
@ -301,7 +301,7 @@ public:
|
|||
QString file;
|
||||
const QFileSystemNode *node;
|
||||
};
|
||||
QVector<Fetching> toFetch;
|
||||
QList<Fetching> toFetch;
|
||||
|
||||
QBasicTimer fetchingTimer;
|
||||
|
||||
|
|
|
|||
|
|
@ -52,11 +52,11 @@
|
|||
//
|
||||
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include <qlist.h>
|
||||
#include <qlistview.h>
|
||||
#include <qstandarditemmodel.h>
|
||||
#include <qstyleditemdelegate.h>
|
||||
#include <qurl.h>
|
||||
#include <qvector.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(filedialog);
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ private:
|
|||
};
|
||||
friend class QTypeInfo<WatchItem>;
|
||||
|
||||
QVector<WatchItem> watching;
|
||||
QList<WatchItem> watching;
|
||||
QList<QUrl> invalidUrls;
|
||||
};
|
||||
Q_DECLARE_TYPEINFO(QUrlModel::WatchItem, Q_MOVABLE_TYPE);
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ public:
|
|||
QWizardField(QWizardPage *page, const QString &spec, QObject *object, const char *property,
|
||||
const char *changedSignal);
|
||||
|
||||
void resolve(const QVector<QWizardDefaultProperty> &defaultPropertyTable);
|
||||
void resolve(const QList<QWizardDefaultProperty> &defaultPropertyTable);
|
||||
void findProperty(const QWizardDefaultProperty *properties, int propertyCount);
|
||||
|
||||
QWizardPage *page;
|
||||
|
|
@ -213,7 +213,7 @@ QWizardField::QWizardField(QWizardPage *page, const QString &spec, QObject *obje
|
|||
}
|
||||
}
|
||||
|
||||
void QWizardField::resolve(const QVector<QWizardDefaultProperty> &defaultPropertyTable)
|
||||
void QWizardField::resolve(const QList<QWizardDefaultProperty> &defaultPropertyTable)
|
||||
{
|
||||
if (property.isEmpty())
|
||||
findProperty(defaultPropertyTable.constData(), defaultPropertyTable.count());
|
||||
|
|
@ -491,7 +491,7 @@ public:
|
|||
QString title;
|
||||
QString subTitle;
|
||||
QPixmap pixmaps[QWizard::NPixmaps];
|
||||
QVector<QWizardField> pendingFields;
|
||||
QList<QWizardField> pendingFields;
|
||||
mutable TriState completeState = Tri_Unknown;
|
||||
bool explicitlyFinal = false;
|
||||
bool commit = false;
|
||||
|
|
@ -585,9 +585,9 @@ public:
|
|||
#endif
|
||||
|
||||
PageMap pageMap;
|
||||
QVector<QWizardField> fields;
|
||||
QList<QWizardField> fields;
|
||||
QMap<QString, int> fieldIndexMap;
|
||||
QVector<QWizardDefaultProperty> defaultPropertyTable;
|
||||
QList<QWizardDefaultProperty> defaultPropertyTable;
|
||||
QList<int> history;
|
||||
int start = -1;
|
||||
bool startSetByUser = false;
|
||||
|
|
@ -1707,7 +1707,7 @@ void QWizardPrivate::_q_updateButtonStates()
|
|||
void QWizardPrivate::_q_handleFieldObjectDestroyed(QObject *object)
|
||||
{
|
||||
int destroyed_index = -1;
|
||||
QVector<QWizardField>::iterator it = fields.begin();
|
||||
QList<QWizardField>::iterator it = fields.begin();
|
||||
while (it != fields.end()) {
|
||||
const QWizardField &field = *it;
|
||||
if (field.object == object) {
|
||||
|
|
@ -2244,7 +2244,7 @@ void QWizard::setPage(int theid, QWizardPage *page)
|
|||
|
||||
page->setParent(d->pageFrame);
|
||||
|
||||
QVector<QWizardField> &pendingFields = page->d_func()->pendingFields;
|
||||
QList<QWizardField> &pendingFields = page->d_func()->pendingFields;
|
||||
for (int i = 0; i < pendingFields.count(); ++i)
|
||||
d->addField(pendingFields.at(i));
|
||||
pendingFields.clear();
|
||||
|
|
@ -3597,7 +3597,7 @@ void QWizardPage::cleanupPage()
|
|||
{
|
||||
Q_D(QWizardPage);
|
||||
if (d->wizard) {
|
||||
const QVector<QWizardField> &fields = d->wizard->d_func()->fields;
|
||||
const QList<QWizardField> &fields = d->wizard->d_func()->fields;
|
||||
for (const auto &field : fields) {
|
||||
if (field.page == this)
|
||||
field.object->setProperty(field.property, field.initialValue);
|
||||
|
|
@ -3648,7 +3648,7 @@ bool QWizardPage::isComplete() const
|
|||
if (!d->wizard)
|
||||
return true;
|
||||
|
||||
const QVector<QWizardField> &wizardFields = d->wizard->d_func()->fields;
|
||||
const QList<QWizardField> &wizardFields = d->wizard->d_func()->fields;
|
||||
for (int i = wizardFields.count() - 1; i >= 0; --i) {
|
||||
const QWizardField &field = wizardFields.at(i);
|
||||
if (field.page == this && field.mandatory) {
|
||||
|
|
|
|||
|
|
@ -214,8 +214,9 @@ public:
|
|||
return setOfVertices;
|
||||
}
|
||||
|
||||
QVector<QPair<Vertex*, Vertex*> > connections() const {
|
||||
QVector<QPair<Vertex*, Vertex*> > conns;
|
||||
QList<QPair<Vertex *, Vertex *>> connections() const
|
||||
{
|
||||
QList<QPair<Vertex *, Vertex *>> conns;
|
||||
for (const_iterator it = constBegin(); it != constEnd(); ++it) {
|
||||
Vertex *from = it.from();
|
||||
Vertex *to = it.to();
|
||||
|
|
|
|||
|
|
@ -728,10 +728,8 @@ AnchorData *QGraphicsAnchorLayoutPrivate::addAnchorMaybeParallel(AnchorData *new
|
|||
Note that this function doesn't add the created anchor to the graph. This should be done by
|
||||
the caller.
|
||||
*/
|
||||
static AnchorData *createSequence(Graph<AnchorVertex, AnchorData> *graph,
|
||||
AnchorVertex *before,
|
||||
const QVector<AnchorVertex*> &vertices,
|
||||
AnchorVertex *after)
|
||||
static AnchorData *createSequence(Graph<AnchorVertex, AnchorData> *graph, AnchorVertex *before,
|
||||
const QList<AnchorVertex *> &vertices, AnchorVertex *after)
|
||||
{
|
||||
#if defined(QT_DEBUG) && 0
|
||||
QString strVertices;
|
||||
|
|
@ -743,7 +741,7 @@ static AnchorData *createSequence(Graph<AnchorVertex, AnchorData> *graph,
|
|||
#endif
|
||||
|
||||
AnchorVertex *prev = before;
|
||||
QVector<AnchorData *> edges;
|
||||
QList<AnchorData *> edges;
|
||||
edges.reserve(vertices.count() + 1);
|
||||
|
||||
const int numVertices = vertices.count();
|
||||
|
|
@ -1022,7 +1020,7 @@ bool QGraphicsAnchorLayoutPrivate::simplifyGraphIteration(Qt::Orientation orient
|
|||
QSet<AnchorVertex *> visited;
|
||||
QStack<QPair<AnchorVertex *, AnchorVertex *> > stack;
|
||||
stack.push(qMakePair(static_cast<AnchorVertex *>(nullptr), layoutFirstVertex[orientation]));
|
||||
QVector<AnchorVertex*> candidates;
|
||||
QList<AnchorVertex *> candidates;
|
||||
|
||||
// Walk depth-first, in the stack we store start of the candidate sequence (beforeSequence)
|
||||
// and the vertex to be visited.
|
||||
|
|
@ -1252,7 +1250,7 @@ void QGraphicsAnchorLayoutPrivate::restoreSimplifiedGraph(Qt::Orientation orient
|
|||
|
||||
// Restore anchor simplification
|
||||
Graph<AnchorVertex, AnchorData> &g = graph[orientation];
|
||||
QVector<QPair<AnchorVertex*, AnchorVertex*> > connections = g.connections();
|
||||
QList<QPair<AnchorVertex *, AnchorVertex *>> connections = g.connections();
|
||||
for (int i = 0; i < connections.count(); ++i) {
|
||||
AnchorVertex *v1 = connections.at(i).first;
|
||||
AnchorVertex *v2 = connections.at(i).second;
|
||||
|
|
@ -2274,7 +2272,7 @@ bool QGraphicsAnchorLayoutPrivate::calculateNonTrunk(const QList<QSimplexConstra
|
|||
void QGraphicsAnchorLayoutPrivate::refreshAllSizeHints(Qt::Orientation orientation)
|
||||
{
|
||||
Graph<AnchorVertex, AnchorData> &g = graph[orientation];
|
||||
QVector<QPair<AnchorVertex *, AnchorVertex *> > vertices = g.connections();
|
||||
QList<QPair<AnchorVertex *, AnchorVertex *>> vertices = g.connections();
|
||||
|
||||
QLayoutStyleInfo styleInf = styleInfo();
|
||||
for (int i = 0; i < vertices.count(); ++i) {
|
||||
|
|
@ -2367,7 +2365,7 @@ void QGraphicsAnchorLayoutPrivate::constraintsFromPaths(Qt::Orientation orientat
|
|||
void QGraphicsAnchorLayoutPrivate::updateAnchorSizes(Qt::Orientation orientation)
|
||||
{
|
||||
Graph<AnchorVertex, AnchorData> &g = graph[orientation];
|
||||
const QVector<QPair<AnchorVertex *, AnchorVertex *> > &vertices = g.connections();
|
||||
const QList<QPair<AnchorVertex *, AnchorVertex *>> &vertices = g.connections();
|
||||
|
||||
for (int i = 0; i < vertices.count(); ++i) {
|
||||
AnchorData *ad = g.edgeData(vertices.at(i).first, vertices.at(i).second);
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ inline QString AnchorData::toString() const
|
|||
|
||||
struct SequentialAnchorData : public AnchorData
|
||||
{
|
||||
SequentialAnchorData(const QVector<AnchorVertex *> &vertices, const QVector<AnchorData *> &edges)
|
||||
SequentialAnchorData(const QList<AnchorVertex *> &vertices, const QList<AnchorData *> &edges)
|
||||
: AnchorData(), m_children(vertices), m_edges(edges)
|
||||
{
|
||||
type = AnchorData::Sequential;
|
||||
|
|
@ -203,8 +203,8 @@ struct SequentialAnchorData : public AnchorData
|
|||
virtual void updateChildrenSizes() override;
|
||||
void calculateSizeHints();
|
||||
|
||||
QVector<AnchorVertex*> m_children; // list of vertices in the sequence
|
||||
QVector<AnchorData*> m_edges; // keep the list of edges too.
|
||||
QList<AnchorVertex *> m_children; // list of vertices in the sequence
|
||||
QList<AnchorData *> m_edges; // keep the list of edges too.
|
||||
};
|
||||
|
||||
struct ParallelAnchorData : public AnchorData
|
||||
|
|
@ -556,7 +556,7 @@ public:
|
|||
QHVContainer<std::array<qreal, 3>> sizeHints = {{-1, -1, -1}, {-1, -1, -1}};
|
||||
|
||||
// Items
|
||||
QVector<QGraphicsLayoutItem *> items;
|
||||
QList<QGraphicsLayoutItem *> items;
|
||||
|
||||
// Mapping between high level anchorage points (Item, Edge) to low level
|
||||
// ones (Graph Vertices)
|
||||
|
|
|
|||
|
|
@ -10786,7 +10786,7 @@ void QGraphicsSimpleTextItem::paint(QPainter *painter, const QStyleOptionGraphic
|
|||
range.start = 0;
|
||||
range.length = layout.text().length();
|
||||
range.format.setTextOutline(d->pen);
|
||||
layout.setFormats(QVector<QTextLayout::FormatRange>(1, range));
|
||||
layout.setFormats(QList<QTextLayout::FormatRange>(1, range));
|
||||
}
|
||||
|
||||
setupTextLayout(&layout);
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ public:
|
|||
QHash<QPaintDevice *, DeviceData> deviceData;
|
||||
|
||||
// List of logical exposed rects
|
||||
QVector<QRectF> exposed;
|
||||
QList<QRectF> exposed;
|
||||
bool allExposed;
|
||||
|
||||
// Empty cache
|
||||
|
|
@ -289,7 +289,7 @@ public:
|
|||
}
|
||||
|
||||
struct ExtraStruct {
|
||||
ExtraStruct() {} // for QVector, don't use
|
||||
ExtraStruct() { } // for QList, don't use
|
||||
ExtraStruct(Extra type, const QVariant &value)
|
||||
: type(type), value(value)
|
||||
{ }
|
||||
|
|
@ -301,7 +301,7 @@ public:
|
|||
{ return type < extra; }
|
||||
};
|
||||
|
||||
QVector<ExtraStruct> extras;
|
||||
QList<ExtraStruct> extras;
|
||||
|
||||
QGraphicsItemCache *maybeExtraItemCache() const;
|
||||
QGraphicsItemCache *extraItemCache() const;
|
||||
|
|
|
|||
|
|
@ -126,22 +126,23 @@ public:
|
|||
qreal step;
|
||||
qreal value;
|
||||
};
|
||||
QVector<Pair> xPosition;
|
||||
QVector<Pair> yPosition;
|
||||
QVector<Pair> rotation;
|
||||
QVector<Pair> verticalScale;
|
||||
QVector<Pair> horizontalScale;
|
||||
QVector<Pair> verticalShear;
|
||||
QVector<Pair> horizontalShear;
|
||||
QVector<Pair> xTranslation;
|
||||
QVector<Pair> yTranslation;
|
||||
QList<Pair> xPosition;
|
||||
QList<Pair> yPosition;
|
||||
QList<Pair> rotation;
|
||||
QList<Pair> verticalScale;
|
||||
QList<Pair> horizontalScale;
|
||||
QList<Pair> verticalShear;
|
||||
QList<Pair> horizontalShear;
|
||||
QList<Pair> xTranslation;
|
||||
QList<Pair> yTranslation;
|
||||
|
||||
qreal linearValueForStep(qreal step, const QVector<Pair> &source, qreal defaultValue = 0);
|
||||
void insertUniquePair(qreal step, qreal value, QVector<Pair> *binList, const char* method);
|
||||
qreal linearValueForStep(qreal step, const QList<Pair> &source, qreal defaultValue = 0);
|
||||
void insertUniquePair(qreal step, qreal value, QList<Pair> *binList, const char *method);
|
||||
};
|
||||
Q_DECLARE_TYPEINFO(QGraphicsItemAnimationPrivate::Pair, Q_PRIMITIVE_TYPE);
|
||||
|
||||
qreal QGraphicsItemAnimationPrivate::linearValueForStep(qreal step, const QVector<Pair> &source, qreal defaultValue)
|
||||
qreal QGraphicsItemAnimationPrivate::linearValueForStep(qreal step, const QList<Pair> &source,
|
||||
qreal defaultValue)
|
||||
{
|
||||
if (source.isEmpty())
|
||||
return defaultValue;
|
||||
|
|
@ -171,14 +172,15 @@ qreal QGraphicsItemAnimationPrivate::linearValueForStep(qreal step, const QVecto
|
|||
return valueBefore + (valueAfter - valueBefore) * ((step - stepBefore) / (stepAfter - stepBefore));
|
||||
}
|
||||
|
||||
void QGraphicsItemAnimationPrivate::insertUniquePair(qreal step, qreal value, QVector<Pair> *binList, const char* method)
|
||||
void QGraphicsItemAnimationPrivate::insertUniquePair(qreal step, qreal value, QList<Pair> *binList,
|
||||
const char *method)
|
||||
{
|
||||
if (!check_step_valid(step, method))
|
||||
return;
|
||||
|
||||
const Pair pair = { step, value };
|
||||
|
||||
const QVector<Pair>::iterator result = std::lower_bound(binList->begin(), binList->end(), pair);
|
||||
const QList<Pair>::iterator result = std::lower_bound(binList->begin(), binList->end(), pair);
|
||||
if (result == binList->end() || pair < *result)
|
||||
binList->insert(result, pair);
|
||||
else
|
||||
|
|
|
|||
|
|
@ -53,10 +53,8 @@
|
|||
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include <QtCore/qlist.h>
|
||||
|
||||
#include <QtCore/qrect.h>
|
||||
#include <QtCore/qset.h>
|
||||
#include <QtCore/qvector.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(graphicsview);
|
||||
|
||||
|
|
@ -107,8 +105,8 @@ private:
|
|||
void climbTree(QGraphicsSceneBspTreeVisitor *visitor, const QRectF &rect, int index = 0) const;
|
||||
QRectF rectForIndex(int index) const;
|
||||
|
||||
QVector<Node> nodes;
|
||||
QVector<QList<QGraphicsItem *> > leaves;
|
||||
QList<Node> nodes;
|
||||
QList<QList<QGraphicsItem *>> leaves;
|
||||
int leafCnt;
|
||||
QRectF rect;
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ public:
|
|||
QPainterPath selectionArea;
|
||||
int selectionChanging;
|
||||
QSet<QGraphicsItem *> selectedItems;
|
||||
QVector<QGraphicsItem *> unpolishedItems;
|
||||
QList<QGraphicsItem *> unpolishedItems;
|
||||
QList<QGraphicsItem *> topLevelItems;
|
||||
|
||||
QHash<QGraphicsItem *, QPointF> movingItemsInitialPositions;
|
||||
|
|
|
|||
|
|
@ -2664,7 +2664,7 @@ void QGraphicsView::updateScene(const QList<QRectF> &rects)
|
|||
return;
|
||||
|
||||
// Extract and reset dirty scene rect info.
|
||||
QVector<QRect> dirtyViewportRects;
|
||||
QList<QRect> dirtyViewportRects;
|
||||
dirtyViewportRects.reserve(d->dirtyRegion.rectCount() + rects.count());
|
||||
for (const QRect &dirtyRect : d->dirtyRegion)
|
||||
dirtyViewportRects += dirtyRect;
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ public:
|
|||
|
||||
QGraphicsView::CacheMode cacheMode;
|
||||
|
||||
QVector<QStyleOptionGraphicsItem> styleOptions;
|
||||
QList<QStyleOptionGraphicsItem> styleOptions;
|
||||
QStyleOptionGraphicsItem *allocStyleOptionsArray(int numItems);
|
||||
void freeStyleOptionsArray(QStyleOptionGraphicsItem *array);
|
||||
|
||||
|
|
|
|||
|
|
@ -414,9 +414,9 @@ bool QAbstractItemDelegate::helpEvent(QHelpEvent *event,
|
|||
|
||||
This virtual method is reserved and will be used in Qt 5.1.
|
||||
*/
|
||||
QVector<int> QAbstractItemDelegate::paintingRoles() const
|
||||
QList<int> QAbstractItemDelegate::paintingRoles() const
|
||||
{
|
||||
return QVector<int>();
|
||||
return QList<int>();
|
||||
}
|
||||
|
||||
QAbstractItemDelegatePrivate::QAbstractItemDelegatePrivate()
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ public:
|
|||
const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index);
|
||||
|
||||
virtual QVector<int> paintingRoles() const;
|
||||
virtual QList<int> paintingRoles() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void commitData(QWidget *editor);
|
||||
|
|
|
|||
|
|
@ -679,8 +679,8 @@ void QAbstractItemView::setModel(QAbstractItemModel *model)
|
|||
if (d->model && d->model != QAbstractItemModelPrivate::staticEmptyModel()) {
|
||||
disconnect(d->model, SIGNAL(destroyed()),
|
||||
this, SLOT(_q_modelDestroyed()));
|
||||
disconnect(d->model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)),
|
||||
this, SLOT(dataChanged(QModelIndex,QModelIndex,QVector<int>)));
|
||||
disconnect(d->model, SIGNAL(dataChanged(QModelIndex, QModelIndex, QList<int>)), this,
|
||||
SLOT(dataChanged(QModelIndex, QModelIndex, QList<int>)));
|
||||
disconnect(d->model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
|
||||
this, SLOT(_q_headerDataChanged()));
|
||||
disconnect(d->model, SIGNAL(rowsInserted(QModelIndex,int,int)),
|
||||
|
|
@ -710,8 +710,8 @@ void QAbstractItemView::setModel(QAbstractItemModel *model)
|
|||
if (d->model != QAbstractItemModelPrivate::staticEmptyModel()) {
|
||||
connect(d->model, SIGNAL(destroyed()),
|
||||
this, SLOT(_q_modelDestroyed()));
|
||||
connect(d->model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)),
|
||||
this, SLOT(dataChanged(QModelIndex,QModelIndex,QVector<int>)));
|
||||
connect(d->model, SIGNAL(dataChanged(QModelIndex, QModelIndex, QList<int>)), this,
|
||||
SLOT(dataChanged(QModelIndex, QModelIndex, QList<int>)));
|
||||
connect(d->model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
|
||||
this, SLOT(_q_headerDataChanged()));
|
||||
connect(d->model, SIGNAL(rowsInserted(QModelIndex,int,int)),
|
||||
|
|
@ -3265,7 +3265,8 @@ void QAbstractItemView::update(const QModelIndex &index)
|
|||
|
||||
\note: Qt::ToolTipRole is not honored by dataChanged() in the views provided by Qt.
|
||||
*/
|
||||
void QAbstractItemView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
|
||||
void QAbstractItemView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight,
|
||||
const QList<int> &roles)
|
||||
{
|
||||
Q_UNUSED(roles);
|
||||
// Single item changed
|
||||
|
|
|
|||
|
|
@ -242,7 +242,8 @@ public Q_SLOTS:
|
|||
void update(const QModelIndex &index);
|
||||
|
||||
protected Q_SLOTS:
|
||||
virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>());
|
||||
virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight,
|
||||
const QList<int> &roles = QList<int>());
|
||||
virtual void rowsInserted(const QModelIndex &parent, int start, int end);
|
||||
virtual void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
|
||||
virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ struct QItemViewPaintPair {
|
|||
template <>
|
||||
class QTypeInfo<QItemViewPaintPair> : public QTypeInfoMerger<QItemViewPaintPair, QRect, QModelIndex> {};
|
||||
|
||||
typedef QVector<QItemViewPaintPair> QItemViewPaintPairs;
|
||||
typedef QList<QItemViewPaintPair> QItemViewPaintPairs;
|
||||
|
||||
class Q_AUTOTEST_EXPORT QAbstractItemViewPrivate : public QAbstractScrollAreaPrivate
|
||||
{
|
||||
|
|
@ -459,11 +459,11 @@ private:
|
|||
};
|
||||
|
||||
QT_BEGIN_INCLUDE_NAMESPACE
|
||||
#include <qvector.h>
|
||||
#include <qlist.h>
|
||||
QT_END_INCLUDE_NAMESPACE
|
||||
|
||||
template <typename T>
|
||||
inline int qBinarySearch(const QVector<T> &vec, const T &item, int start, int end)
|
||||
template<typename T>
|
||||
inline int qBinarySearch(const QList<T> &vec, const T &item, int start, int end)
|
||||
{
|
||||
int i = (start + end + 1) >> 1;
|
||||
while (end - start > 0) {
|
||||
|
|
|
|||
|
|
@ -128,12 +128,12 @@ void QBspTree::init(const QRect &area, int depth, NodeType type, int index)
|
|||
}
|
||||
}
|
||||
|
||||
void QBspTree::insert(QVector<int> &leaf, const QRect &, uint, QBspTreeData data)
|
||||
void QBspTree::insert(QList<int> &leaf, const QRect &, uint, QBspTreeData data)
|
||||
{
|
||||
leaf.append(data.i);
|
||||
}
|
||||
|
||||
void QBspTree::remove(QVector<int> &leaf, const QRect &, uint, QBspTreeData data)
|
||||
void QBspTree::remove(QList<int> &leaf, const QRect &, uint, QBspTreeData data)
|
||||
{
|
||||
int i = leaf.indexOf(data.i);
|
||||
if (i != -1)
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
//
|
||||
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include <qvector.h>
|
||||
#include <qlist.h>
|
||||
#include <qrect.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
|
@ -80,7 +80,7 @@ public:
|
|||
};
|
||||
};
|
||||
typedef QBspTree::Data QBspTreeData;
|
||||
typedef void callback(QVector<int> &leaf, const QRect &area, uint visited, QBspTreeData data);
|
||||
typedef void callback(QList<int> &leaf, const QRect &area, uint visited, QBspTreeData data);
|
||||
|
||||
QBspTree();
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ public:
|
|||
void climbTree(const QRect &rect, callback *function, QBspTreeData data);
|
||||
|
||||
inline int leafCount() const { return leaves.count(); }
|
||||
inline QVector<int> &leaf(int i) { return leaves[i]; }
|
||||
inline QList<int> &leaf(int i) { return leaves[i]; }
|
||||
inline void insertLeaf(const QRect &r, int i) { climbTree(r, &insert, i, 0); }
|
||||
inline void removeLeaf(const QRect &r, int i) { climbTree(r, &remove, i, 0); }
|
||||
|
||||
|
|
@ -103,14 +103,14 @@ protected:
|
|||
inline int parentIndex(int i) const { return (i & 1) ? ((i - 1) / 2) : ((i - 2) / 2); }
|
||||
inline int firstChildIndex(int i) const { return ((i * 2) + 1); }
|
||||
|
||||
static void insert(QVector<int> &leaf, const QRect &area, uint visited, QBspTreeData data);
|
||||
static void remove(QVector<int> &leaf, const QRect &area, uint visited, QBspTreeData data);
|
||||
static void insert(QList<int> &leaf, const QRect &area, uint visited, QBspTreeData data);
|
||||
static void remove(QList<int> &leaf, const QRect &area, uint visited, QBspTreeData data);
|
||||
|
||||
private:
|
||||
uint depth;
|
||||
mutable uint visited;
|
||||
QVector<Node> nodes;
|
||||
mutable QVector< QVector<int> > leaves; // the leaves are just indices into the items
|
||||
QList<Node> nodes;
|
||||
mutable QList<QList<int>> leaves; // the leaves are just indices into the items
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -566,7 +566,7 @@ void QColumnViewPrivate::closeColumns(const QModelIndex &parent, bool build)
|
|||
bool clearAll = !parent.isValid();
|
||||
bool passThroughRoot = false;
|
||||
|
||||
QVector<QModelIndex> dirsToAppend;
|
||||
QList<QModelIndex> dirsToAppend;
|
||||
|
||||
// Find the last column that matches the parent's tree
|
||||
int currentColumn = -1;
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ public:
|
|||
void _q_columnsInserted(const QModelIndex &parent, int start, int end) override;
|
||||
|
||||
QList<QAbstractItemView*> columns;
|
||||
QVector<int> columnSizes; // used during init and corner moving
|
||||
QList<int> columnSizes; // used during init and corner moving
|
||||
bool showResizeGrips;
|
||||
int offset;
|
||||
#if QT_CONFIG(animation)
|
||||
|
|
|
|||
|
|
@ -102,7 +102,8 @@ public:
|
|||
void populate();
|
||||
|
||||
// private slots
|
||||
void _q_dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &);
|
||||
void _q_dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight,
|
||||
const QList<int> &);
|
||||
void _q_commitData(QWidget *);
|
||||
void _q_closeEditor(QWidget *, QAbstractItemDelegate::EndEditHint);
|
||||
void _q_modelDestroyed();
|
||||
|
|
@ -176,7 +177,8 @@ static bool qContainsIndex(const QModelIndex &idx, const QModelIndex &topLeft,
|
|||
&& idx.column() >= topLeft.column() && idx.column() <= bottomRight.column();
|
||||
}
|
||||
|
||||
void QDataWidgetMapperPrivate::_q_dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &)
|
||||
void QDataWidgetMapperPrivate::_q_dataChanged(const QModelIndex &topLeft,
|
||||
const QModelIndex &bottomRight, const QList<int> &)
|
||||
{
|
||||
if (topLeft.parent() != rootIndex)
|
||||
return; // not in our hierarchy
|
||||
|
|
@ -349,8 +351,8 @@ void QDataWidgetMapper::setModel(QAbstractItemModel *model)
|
|||
return;
|
||||
|
||||
if (d->model) {
|
||||
disconnect(d->model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)), this,
|
||||
SLOT(_q_dataChanged(QModelIndex,QModelIndex,QVector<int>)));
|
||||
disconnect(d->model, SIGNAL(dataChanged(QModelIndex, QModelIndex, QList<int>)), this,
|
||||
SLOT(_q_dataChanged(QModelIndex, QModelIndex, QList<int>)));
|
||||
disconnect(d->model, SIGNAL(destroyed()), this,
|
||||
SLOT(_q_modelDestroyed()));
|
||||
}
|
||||
|
|
@ -360,8 +362,8 @@ void QDataWidgetMapper::setModel(QAbstractItemModel *model)
|
|||
|
||||
d->model = model;
|
||||
|
||||
connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)),
|
||||
SLOT(_q_dataChanged(QModelIndex,QModelIndex,QVector<int>)));
|
||||
connect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex, QList<int>)),
|
||||
SLOT(_q_dataChanged(QModelIndex, QModelIndex, QList<int>)));
|
||||
connect(model, SIGNAL(destroyed()), SLOT(_q_modelDestroyed()));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,9 @@ Q_SIGNALS:
|
|||
private:
|
||||
Q_DECLARE_PRIVATE(QDataWidgetMapper)
|
||||
Q_DISABLE_COPY(QDataWidgetMapper)
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_dataChanged(const QModelIndex &, const QModelIndex &, const QVector<int> &))
|
||||
Q_PRIVATE_SLOT(d_func(),
|
||||
void _q_dataChanged(const QModelIndex &, const QModelIndex &,
|
||||
const QList<int> &))
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_commitData(QWidget *))
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_closeEditor(QWidget *, QAbstractItemDelegate::EndEditHint))
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_modelDestroyed())
|
||||
|
|
|
|||
|
|
@ -39,25 +39,25 @@
|
|||
|
||||
#include "qheaderview.h"
|
||||
|
||||
#include <qabstractitemdelegate.h>
|
||||
#include <qapplication.h>
|
||||
#include <qbitarray.h>
|
||||
#include <qbrush.h>
|
||||
#include <qdebug.h>
|
||||
#include <qevent.h>
|
||||
#include <qlist.h>
|
||||
#include <qpainter.h>
|
||||
#include <qscrollbar.h>
|
||||
#include <qstyle.h>
|
||||
#include <qstyleoption.h>
|
||||
#if QT_CONFIG(tooltip)
|
||||
#include <qtooltip.h>
|
||||
#endif
|
||||
#include <qvarlengtharray.h>
|
||||
#include <qvariant.h>
|
||||
#if QT_CONFIG(whatsthis)
|
||||
#include <qwhatsthis.h>
|
||||
#endif
|
||||
#include <qstyle.h>
|
||||
#include <qstyleoption.h>
|
||||
#include <qvector.h>
|
||||
#include <qapplication.h>
|
||||
#include <qvarlengtharray.h>
|
||||
#include <qabstractitemdelegate.h>
|
||||
#include <qvariant.h>
|
||||
#include <private/qheaderview_p.h>
|
||||
#include <private/qabstractitemmodel_p.h>
|
||||
|
||||
|
|
@ -3050,7 +3050,8 @@ void QHeaderView::scrollContentsBy(int dx, int dy)
|
|||
\reimp
|
||||
\internal
|
||||
*/
|
||||
void QHeaderView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
|
||||
void QHeaderView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight,
|
||||
const QList<int> &roles)
|
||||
{
|
||||
Q_D(QHeaderView);
|
||||
if (!roles.isEmpty()) {
|
||||
|
|
@ -3979,8 +3980,8 @@ bool QHeaderViewPrivate::read(QDataStream &in)
|
|||
int sortIndicatorSectionIn;
|
||||
bool sortIndicatorShownIn;
|
||||
int lengthIn;
|
||||
QVector<int> visualIndicesIn;
|
||||
QVector<int> logicalIndicesIn;
|
||||
QList<int> visualIndicesIn;
|
||||
QList<int> logicalIndicesIn;
|
||||
QHash<int, int> hiddenSectionSizeIn;
|
||||
bool movableSectionsIn;
|
||||
bool clickableSectionsIn;
|
||||
|
|
@ -3991,7 +3992,7 @@ bool QHeaderViewPrivate::read(QDataStream &in)
|
|||
int contentsSectionsIn;
|
||||
int defaultSectionSizeIn;
|
||||
int minimumSectionSizeIn;
|
||||
QVector<SectionItem> sectionItemsIn;
|
||||
QList<SectionItem> sectionItemsIn;
|
||||
|
||||
in >> orient;
|
||||
in >> order;
|
||||
|
|
@ -4031,7 +4032,7 @@ bool QHeaderViewPrivate::read(QDataStream &in)
|
|||
// In Qt4 we had a vector of spans where one span could hold information on more sections.
|
||||
// Now we have an itemvector where one items contains information about one section
|
||||
// For backward compatibility with Qt4 we do the following
|
||||
QVector<SectionItem> newSectionItems;
|
||||
QList<SectionItem> newSectionItems;
|
||||
for (int u = 0; u < sectionItemsIn.count(); ++u) {
|
||||
int count = sectionItemsIn.at(u).tmpDataStreamSectionCount;
|
||||
if (count > 1)
|
||||
|
|
|
|||
|
|
@ -217,7 +217,8 @@ protected:
|
|||
void updateGeometries() override;
|
||||
void scrollContentsBy(int dx, int dy) override;
|
||||
|
||||
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>()) override;
|
||||
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight,
|
||||
const QList<int> &roles = QList<int>()) override;
|
||||
void rowsInserted(const QModelIndex &parent, int start, int end) override;
|
||||
|
||||
QRect visualRect(const QModelIndex &index) const override;
|
||||
|
|
|
|||
|
|
@ -258,8 +258,8 @@ public:
|
|||
int sortIndicatorSection;
|
||||
bool sortIndicatorShown;
|
||||
|
||||
mutable QVector<int> visualIndices; // visualIndex = visualIndices.at(logicalIndex)
|
||||
mutable QVector<int> logicalIndices; // logicalIndex = row or column in the model
|
||||
mutable QList<int> visualIndices; // visualIndex = visualIndices.at(logicalIndex)
|
||||
mutable QList<int> logicalIndices; // logicalIndex = row or column in the model
|
||||
mutable QBitArray sectionSelected; // from logical index to bit
|
||||
mutable QHash<int, int> hiddenSectionSize; // from logical index to section size
|
||||
mutable QHash<int, int> cascadingSectionSize; // from visual index to section size
|
||||
|
|
@ -329,12 +329,12 @@ public:
|
|||
#endif
|
||||
};
|
||||
|
||||
QVector<SectionItem> sectionItems;
|
||||
QList<SectionItem> sectionItems;
|
||||
struct LayoutChangeItem {
|
||||
QPersistentModelIndex index;
|
||||
SectionItem section;
|
||||
};
|
||||
QVector<LayoutChangeItem> layoutChangePersistentSections;
|
||||
QList<LayoutChangeItem> layoutChangePersistentSections;
|
||||
|
||||
void createSectionItems(int start, int end, int size, QHeaderView::ResizeMode mode);
|
||||
void removeSectionsFromSectionItems(int start, int end);
|
||||
|
|
|
|||
|
|
@ -695,10 +695,12 @@ void QItemDelegate::drawDisplay(QPainter *painter, const QStyleOptionViewItem &o
|
|||
|| textRect.height() < textLayoutSize.height())) {
|
||||
painter->save();
|
||||
painter->setClipRect(layoutRect);
|
||||
d->textLayout.draw(painter, layoutRect.topLeft(), QVector<QTextLayout::FormatRange>(), layoutRect);
|
||||
d->textLayout.draw(painter, layoutRect.topLeft(), QList<QTextLayout::FormatRange>(),
|
||||
layoutRect);
|
||||
painter->restore();
|
||||
} else {
|
||||
d->textLayout.draw(painter, layoutRect.topLeft(), QVector<QTextLayout::FormatRange>(), layoutRect);
|
||||
d->textLayout.draw(painter, layoutRect.topLeft(), QList<QTextLayout::FormatRange>(),
|
||||
layoutRect);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,26 +41,26 @@
|
|||
#include "qlistview.h"
|
||||
|
||||
#include <qabstractitemdelegate.h>
|
||||
#include <qapplication.h>
|
||||
#include <qpainter.h>
|
||||
#include <qbitmap.h>
|
||||
#if QT_CONFIG(draganddrop)
|
||||
#include <qdrag.h>
|
||||
#endif
|
||||
#include <qvector.h>
|
||||
#include <qstyle.h>
|
||||
#include <qevent.h>
|
||||
#include <qscrollbar.h>
|
||||
#if QT_CONFIG(rubberband)
|
||||
#include <qrubberband.h>
|
||||
#endif
|
||||
#include <private/qapplication_p.h>
|
||||
#include <private/qlistview_p.h>
|
||||
#include <private/qscrollbar_p.h>
|
||||
#include <qdebug.h>
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
#include <qaccessible.h>
|
||||
#endif
|
||||
#include <qapplication.h>
|
||||
#include <qpainter.h>
|
||||
#include <qbitmap.h>
|
||||
#include <qdebug.h>
|
||||
#if QT_CONFIG(draganddrop)
|
||||
#include <qdrag.h>
|
||||
#endif
|
||||
#include <qevent.h>
|
||||
#include <qlist.h>
|
||||
#if QT_CONFIG(rubberband)
|
||||
#include <qrubberband.h>
|
||||
#endif
|
||||
#include <qscrollbar.h>
|
||||
#include <qstyle.h>
|
||||
#include <private/qapplication_p.h>
|
||||
#include <private/qlistview_p.h>
|
||||
#include <private/qscrollbar_p.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
|
@ -655,7 +655,8 @@ QItemViewPaintPairs QListViewPrivate::draggablePaintPairs(const QModelIndexList
|
|||
QRect &rect = *r;
|
||||
const QRect viewportRect = viewport->rect();
|
||||
QItemViewPaintPairs ret;
|
||||
QVector<QModelIndex> visibleIndexes = intersectingSet(viewportRect.translated(q->horizontalOffset(), q->verticalOffset()));
|
||||
QList<QModelIndex> visibleIndexes =
|
||||
intersectingSet(viewportRect.translated(q->horizontalOffset(), q->verticalOffset()));
|
||||
std::sort(visibleIndexes.begin(), visibleIndexes.end());
|
||||
for (const auto &index : indexes) {
|
||||
if (std::binary_search(visibleIndexes.cbegin(), visibleIndexes.cend(), index)) {
|
||||
|
|
@ -731,7 +732,8 @@ QSize QListView::contentsSize() const
|
|||
/*!
|
||||
\reimp
|
||||
*/
|
||||
void QListView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
|
||||
void QListView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight,
|
||||
const QList<int> &roles)
|
||||
{
|
||||
d_func()->commonListView->dataChanged(topLeft, bottomRight);
|
||||
QAbstractItemView::dataChanged(topLeft, bottomRight, roles);
|
||||
|
|
@ -920,8 +922,8 @@ void QListView::dropEvent(QDropEvent *event)
|
|||
int col = -1;
|
||||
int row = -1;
|
||||
if (d->dropOn(event, &row, &col, &topIndex)) {
|
||||
const QVector<QModelIndex> selIndexes = selectedIndexes();
|
||||
QVector<QPersistentModelIndex> persIndexes;
|
||||
const QList<QModelIndex> selIndexes = selectedIndexes();
|
||||
QList<QPersistentModelIndex> persIndexes;
|
||||
persIndexes.reserve(selIndexes.count());
|
||||
|
||||
for (const auto &index : selIndexes) {
|
||||
|
|
@ -1006,7 +1008,8 @@ void QListView::paintEvent(QPaintEvent *e)
|
|||
QStyleOptionViewItem option = d->viewOptionsV1();
|
||||
QPainter painter(d->viewport);
|
||||
|
||||
const QVector<QModelIndex> toBeRendered = d->intersectingSet(e->rect().translated(horizontalOffset(), verticalOffset()), false);
|
||||
const QList<QModelIndex> toBeRendered =
|
||||
d->intersectingSet(e->rect().translated(horizontalOffset(), verticalOffset()), false);
|
||||
|
||||
const QModelIndex current = currentIndex();
|
||||
const QModelIndex hover = d->hover;
|
||||
|
|
@ -1025,8 +1028,8 @@ void QListView::paintEvent(QPaintEvent *e)
|
|||
? qMax(viewport()->size().width(), d->contentsSize().width()) - 2 * d->spacing()
|
||||
: qMax(viewport()->size().height(), d->contentsSize().height()) - 2 * d->spacing();
|
||||
|
||||
QVector<QModelIndex>::const_iterator end = toBeRendered.constEnd();
|
||||
for (QVector<QModelIndex>::const_iterator it = toBeRendered.constBegin(); it != end; ++it) {
|
||||
QList<QModelIndex>::const_iterator end = toBeRendered.constEnd();
|
||||
for (QList<QModelIndex>::const_iterator it = toBeRendered.constBegin(); it != end; ++it) {
|
||||
Q_ASSERT((*it).isValid());
|
||||
option.rect = visualRect(*it);
|
||||
|
||||
|
|
@ -1111,7 +1114,7 @@ QModelIndex QListView::indexAt(const QPoint &p) const
|
|||
{
|
||||
Q_D(const QListView);
|
||||
QRect rect(p.x() + horizontalOffset(), p.y() + verticalOffset(), 1, 1);
|
||||
const QVector<QModelIndex> intersectVector = d->intersectingSet(rect);
|
||||
const QList<QModelIndex> intersectVector = d->intersectingSet(rect);
|
||||
QModelIndex index = intersectVector.count() > 0
|
||||
? intersectVector.last() : QModelIndex();
|
||||
if (index.isValid() && visualRect(index).contains(p))
|
||||
|
|
@ -1190,7 +1193,7 @@ QModelIndex QListView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie
|
|||
if (d->gridSize().isValid()) rect.setSize(d->gridSize());
|
||||
|
||||
QSize contents = d->contentsSize();
|
||||
QVector<QModelIndex> intersectVector;
|
||||
QList<QModelIndex> intersectVector;
|
||||
|
||||
switch (cursorAction) {
|
||||
case MoveLeft:
|
||||
|
|
@ -1332,7 +1335,8 @@ void QListView::setSelection(const QRect &rect, QItemSelectionModel::SelectionFl
|
|||
QItemSelection selection;
|
||||
|
||||
if (rect.width() == 1 && rect.height() == 1) {
|
||||
const QVector<QModelIndex> intersectVector = d->intersectingSet(rect.translated(horizontalOffset(), verticalOffset()));
|
||||
const QList<QModelIndex> intersectVector =
|
||||
d->intersectingSet(rect.translated(horizontalOffset(), verticalOffset()));
|
||||
QModelIndex tl;
|
||||
if (!intersectVector.isEmpty())
|
||||
tl = intersectVector.last(); // special case for mouse press; only select the top item
|
||||
|
|
@ -1345,7 +1349,7 @@ void QListView::setSelection(const QRect &rect, QItemSelectionModel::SelectionFl
|
|||
QModelIndex tl, br;
|
||||
// get the first item
|
||||
const QRect topLeft(rect.left() + horizontalOffset(), rect.top() + verticalOffset(), 1, 1);
|
||||
QVector<QModelIndex> intersectVector = d->intersectingSet(topLeft);
|
||||
QList<QModelIndex> intersectVector = d->intersectingSet(topLeft);
|
||||
if (!intersectVector.isEmpty())
|
||||
tl = intersectVector.last();
|
||||
// get the last item
|
||||
|
|
@ -1842,12 +1846,12 @@ QRect QListViewPrivate::mapToViewport(const QRect &rect, bool extend) const
|
|||
}
|
||||
|
||||
QModelIndex QListViewPrivate::closestIndex(const QRect &target,
|
||||
const QVector<QModelIndex> &candidates) const
|
||||
const QList<QModelIndex> &candidates) const
|
||||
{
|
||||
int distance = 0;
|
||||
int shortest = INT_MAX;
|
||||
QModelIndex closest;
|
||||
QVector<QModelIndex>::const_iterator it = candidates.begin();
|
||||
QList<QModelIndex>::const_iterator it = candidates.begin();
|
||||
|
||||
for (; it != candidates.end(); ++it) {
|
||||
if (!(*it).isValid())
|
||||
|
|
@ -1896,8 +1900,8 @@ QItemSelection QListViewPrivate::selection(const QRect &rect) const
|
|||
{
|
||||
QItemSelection selection;
|
||||
QModelIndex tl, br;
|
||||
const QVector<QModelIndex> intersectVector = intersectingSet(rect);
|
||||
QVector<QModelIndex>::const_iterator it = intersectVector.begin();
|
||||
const QList<QModelIndex> intersectVector = intersectingSet(rect);
|
||||
QList<QModelIndex>::const_iterator it = intersectVector.begin();
|
||||
for (; it != intersectVector.end(); ++it) {
|
||||
if (!tl.isValid() && !br.isValid()) {
|
||||
tl = br = *it;
|
||||
|
|
@ -1939,7 +1943,8 @@ bool QListViewPrivate::dropOn(QDropEvent *event, int *dropRow, int *dropCol, QMo
|
|||
}
|
||||
#endif
|
||||
|
||||
void QListViewPrivate::removeCurrentAndDisabled(QVector<QModelIndex> *indexes, const QModelIndex ¤t) const
|
||||
void QListViewPrivate::removeCurrentAndDisabled(QList<QModelIndex> *indexes,
|
||||
const QModelIndex ¤t) const
|
||||
{
|
||||
auto isCurrentOrDisabled = [this, current](const QModelIndex &index) {
|
||||
return !isIndexEnabled(index) || index == current;
|
||||
|
|
@ -2138,7 +2143,7 @@ void QListModeViewBase::dragMoveEvent(QDragMoveEvent *event)
|
|||
QPoint p = event->position().toPoint();
|
||||
QRect rect(p.x() + horizontalOffset(), p.y() + verticalOffset(), 1, 1);
|
||||
rect.adjust(-dd->spacing(), -dd->spacing(), dd->spacing(), dd->spacing());
|
||||
const QVector<QModelIndex> intersectVector = dd->intersectingSet(rect);
|
||||
const QList<QModelIndex> intersectVector = dd->intersectingSet(rect);
|
||||
QModelIndex index = intersectVector.count() > 0
|
||||
? intersectVector.last() : QModelIndex();
|
||||
dd->hover = index;
|
||||
|
|
@ -2217,7 +2222,7 @@ bool QListModeViewBase::dropOn(QDropEvent *event, int *dropRow, int *dropCol, QM
|
|||
QPoint p = event->position().toPoint();
|
||||
QRect rect(p.x() + horizontalOffset(), p.y() + verticalOffset(), 1, 1);
|
||||
rect.adjust(-dd->spacing(), -dd->spacing(), dd->spacing(), dd->spacing());
|
||||
const QVector<QModelIndex> intersectVector = dd->intersectingSet(rect);
|
||||
const QList<QModelIndex> intersectVector = dd->intersectingSet(rect);
|
||||
index = intersectVector.count() > 0
|
||||
? intersectVector.last() : QModelIndex();
|
||||
if (!index.isValid())
|
||||
|
|
@ -2630,9 +2635,9 @@ void QListModeViewBase::doStaticLayout(const QListViewLayoutInfo &info)
|
|||
Finds the set of items intersecting with \a area.
|
||||
In this function, itemsize is counted from topleft to the start of the next item.
|
||||
*/
|
||||
QVector<QModelIndex> QListModeViewBase::intersectingSet(const QRect &area) const
|
||||
QList<QModelIndex> QListModeViewBase::intersectingSet(const QRect &area) const
|
||||
{
|
||||
QVector<QModelIndex> ret;
|
||||
QList<QModelIndex> ret;
|
||||
int segStartPosition;
|
||||
int segEndPosition;
|
||||
int flowStartPosition;
|
||||
|
|
@ -2709,7 +2714,7 @@ QRect QListModeViewBase::mapToViewport(const QRect &rect) const
|
|||
|
||||
int QListModeViewBase::perItemScrollingPageSteps(int length, int bounds, bool wrap) const
|
||||
{
|
||||
QVector<int> positions;
|
||||
QList<int> positions;
|
||||
if (wrap)
|
||||
positions = segmentPositions;
|
||||
else if (!flowPositions.isEmpty()) {
|
||||
|
|
@ -2750,7 +2755,7 @@ int QListModeViewBase::perItemScrollToValue(int index, int scrollValue, int view
|
|||
return scrollValue;
|
||||
|
||||
itemExtent += spacing();
|
||||
QVector<int> hiddenRows = dd->hiddenRowIds();
|
||||
QList<int> hiddenRows = dd->hiddenRowIds();
|
||||
std::sort(hiddenRows.begin(), hiddenRows.end());
|
||||
int hiddenRowsBefore = 0;
|
||||
for (int i = 0; i < hiddenRows.size() - 1; ++i)
|
||||
|
|
@ -2899,7 +2904,7 @@ bool QIconModeViewBase::filterDropEvent(QDropEvent *e)
|
|||
QPoint end = e->position().toPoint() + offset;
|
||||
if (qq->acceptDrops()) {
|
||||
const Qt::ItemFlags dropableFlags = Qt::ItemIsDropEnabled|Qt::ItemIsEnabled;
|
||||
const QVector<QModelIndex> &dropIndices = intersectingSet(QRect(end, QSize(1, 1)));
|
||||
const QList<QModelIndex> &dropIndices = intersectingSet(QRect(end, QSize(1, 1)));
|
||||
for (const QModelIndex &index : dropIndices)
|
||||
if ((index.flags() & dropableFlags) == dropableFlags)
|
||||
return false;
|
||||
|
|
@ -2964,7 +2969,7 @@ bool QIconModeViewBase::filterDragMoveEvent(QDragMoveEvent *e)
|
|||
QModelIndex index;
|
||||
if (movement() == QListView::Snap) {
|
||||
QRect rect(snapToGrid(e->position().toPoint() + offset()), gridSize());
|
||||
const QVector<QModelIndex> intersectVector = intersectingSet(rect);
|
||||
const QList<QModelIndex> intersectVector = intersectingSet(rect);
|
||||
index = intersectVector.count() > 0 ? intersectVector.last() : QModelIndex();
|
||||
} else {
|
||||
index = qq->indexAt(e->position().toPoint());
|
||||
|
|
@ -3216,20 +3221,20 @@ void QIconModeViewBase::doDynamicLayout(const QListViewLayoutInfo &info)
|
|||
viewport()->update();
|
||||
}
|
||||
|
||||
QVector<QModelIndex> QIconModeViewBase::intersectingSet(const QRect &area) const
|
||||
QList<QModelIndex> QIconModeViewBase::intersectingSet(const QRect &area) const
|
||||
{
|
||||
QIconModeViewBase *that = const_cast<QIconModeViewBase*>(this);
|
||||
QBspTree::Data data(static_cast<void*>(that));
|
||||
QVector<QModelIndex> res;
|
||||
QList<QModelIndex> res;
|
||||
that->interSectingVector = &res;
|
||||
that->tree.climbTree(area, &QIconModeViewBase::addLeaf, data);
|
||||
that->interSectingVector = nullptr;
|
||||
return res;
|
||||
}
|
||||
|
||||
QRect QIconModeViewBase::itemsRect(const QVector<QModelIndex> &indexes) const
|
||||
QRect QIconModeViewBase::itemsRect(const QList<QModelIndex> &indexes) const
|
||||
{
|
||||
QVector<QModelIndex>::const_iterator it = indexes.begin();
|
||||
QList<QModelIndex>::const_iterator it = indexes.begin();
|
||||
QListViewItem item = indexToListViewItem(*it);
|
||||
QRect rect(item.x, item.y, item.w, item.h);
|
||||
for (; it != indexes.end(); ++it) {
|
||||
|
|
@ -3275,8 +3280,8 @@ int QIconModeViewBase::itemIndex(const QListViewItem &item) const
|
|||
return -1;
|
||||
}
|
||||
|
||||
void QIconModeViewBase::addLeaf(QVector<int> &leaf, const QRect &area,
|
||||
uint visited, QBspTree::Data data)
|
||||
void QIconModeViewBase::addLeaf(QList<int> &leaf, const QRect &area, uint visited,
|
||||
QBspTree::Data data)
|
||||
{
|
||||
QListViewItem *vi;
|
||||
QIconModeViewBase *_this = static_cast<QIconModeViewBase *>(data.ptr);
|
||||
|
|
|
|||
|
|
@ -150,7 +150,8 @@ protected:
|
|||
void resizeContents(int width, int height);
|
||||
QSize contentsSize() const;
|
||||
|
||||
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>()) override;
|
||||
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight,
|
||||
const QList<int> &roles = QList<int>()) override;
|
||||
void rowsInserted(const QModelIndex &parent, int start, int end) override;
|
||||
void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override;
|
||||
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ public:
|
|||
virtual bool doBatchedItemLayout(const QListViewLayoutInfo &info, int max) = 0;
|
||||
virtual void clear() = 0;
|
||||
virtual void setRowCount(int) = 0;
|
||||
virtual QVector<QModelIndex> intersectingSet(const QRect &area) const = 0;
|
||||
virtual QList<QModelIndex> intersectingSet(const QRect &area) const = 0;
|
||||
virtual void dataChanged(const QModelIndex &, const QModelIndex &) = 0;
|
||||
|
||||
virtual int horizontalScrollToValue(int index, QListView::ScrollHint hint,
|
||||
|
|
@ -198,11 +198,11 @@ class QListModeViewBase : public QCommonListViewBase
|
|||
public:
|
||||
QListModeViewBase(QListView *q, QListViewPrivate *d);
|
||||
|
||||
QVector<int> flowPositions;
|
||||
QVector<int> segmentPositions;
|
||||
QVector<int> segmentStartRows;
|
||||
QVector<int> segmentExtents;
|
||||
QVector<int> scrollValueMap;
|
||||
QList<int> flowPositions;
|
||||
QList<int> segmentPositions;
|
||||
QList<int> segmentStartRows;
|
||||
QList<int> segmentExtents;
|
||||
QList<int> scrollValueMap;
|
||||
|
||||
// used when laying out in batches
|
||||
int batchSavedPosition;
|
||||
|
|
@ -213,7 +213,7 @@ public:
|
|||
bool doBatchedItemLayout(const QListViewLayoutInfo &info, int max) override;
|
||||
void clear() override;
|
||||
void setRowCount(int rowCount) override { flowPositions.resize(rowCount); }
|
||||
QVector<QModelIndex> intersectingSet(const QRect &area) const override;
|
||||
QList<QModelIndex> intersectingSet(const QRect &area) const override;
|
||||
void dataChanged(const QModelIndex &, const QModelIndex &) override;
|
||||
|
||||
int horizontalScrollToValue(int index, QListView::ScrollHint hint,
|
||||
|
|
@ -251,14 +251,14 @@ public:
|
|||
QIconModeViewBase(QListView *q, QListViewPrivate *d) : QCommonListViewBase(q, d), interSectingVector(nullptr) {}
|
||||
|
||||
QBspTree tree;
|
||||
QVector<QListViewItem> items;
|
||||
QList<QListViewItem> items;
|
||||
QBitArray moved;
|
||||
|
||||
QVector<QModelIndex> draggedItems; // indices to the tree.itemVector
|
||||
QList<QModelIndex> draggedItems; // indices to the tree.itemVector
|
||||
mutable QPoint draggedItemsPos;
|
||||
|
||||
// used when laying out in batches
|
||||
QVector<QModelIndex> *interSectingVector; //used from within intersectingSet
|
||||
QList<QModelIndex> *interSectingVector; // used from within intersectingSet
|
||||
|
||||
//reimplementations
|
||||
int itemIndex(const QListViewItem &item) const override;
|
||||
|
|
@ -266,7 +266,7 @@ public:
|
|||
bool doBatchedItemLayout(const QListViewLayoutInfo &info, int max) override;
|
||||
void clear() override;
|
||||
void setRowCount(int rowCount) override;
|
||||
QVector<QModelIndex> intersectingSet(const QRect &area) const override;
|
||||
QList<QModelIndex> intersectingSet(const QRect &area) const override;
|
||||
|
||||
void scrollContentsBy(int dx, int dy, bool scrollElasticBand) override;
|
||||
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) override;
|
||||
|
|
@ -285,14 +285,13 @@ private:
|
|||
void initBspTree(const QSize &contents);
|
||||
QPoint initDynamicLayout(const QListViewLayoutInfo &info);
|
||||
void doDynamicLayout(const QListViewLayoutInfo &info);
|
||||
static void addLeaf(QVector<int> &leaf, const QRect &area,
|
||||
uint visited, QBspTree::Data data);
|
||||
QRect itemsRect(const QVector<QModelIndex> &indexes) const;
|
||||
static void addLeaf(QList<int> &leaf, const QRect &area, uint visited, QBspTree::Data data);
|
||||
QRect itemsRect(const QList<QModelIndex> &indexes) const;
|
||||
QRect draggedItemsRect() const;
|
||||
QPoint snapToGrid(const QPoint &pos) const;
|
||||
void updateContentsSize();
|
||||
QPoint draggedItemsDelta() const;
|
||||
void drawItems(QPainter *painter, const QVector<QModelIndex> &indexes) const;
|
||||
void drawItems(QPainter *painter, const QList<QModelIndex> &indexes) const;
|
||||
void moveItem(int index, const QPoint &dest);
|
||||
|
||||
};
|
||||
|
|
@ -309,7 +308,8 @@ public:
|
|||
|
||||
bool doItemsLayout(int num);
|
||||
|
||||
inline QVector<QModelIndex> intersectingSet(const QRect &area, bool doLayout = true) const {
|
||||
inline QList<QModelIndex> intersectingSet(const QRect &area, bool doLayout = true) const
|
||||
{
|
||||
if (doLayout) executePostedLayout();
|
||||
QRect a = (q_func()->isRightToLeft() ? flipX(area.normalized()) : area.normalized());
|
||||
return commonListView->intersectingSet(a);
|
||||
|
|
@ -363,7 +363,7 @@ public:
|
|||
|
||||
QRect mapToViewport(const QRect &rect, bool extend = true) const;
|
||||
|
||||
QModelIndex closestIndex(const QRect &target, const QVector<QModelIndex> &candidates) const;
|
||||
QModelIndex closestIndex(const QRect &target, const QList<QModelIndex> &candidates) const;
|
||||
QSize itemSize(const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
||||
|
||||
bool selectionAllowed(const QModelIndex &index) const override
|
||||
|
|
@ -395,8 +395,9 @@ public:
|
|||
return isPersistent(idx) && hiddenRows.contains(idx);
|
||||
}
|
||||
// helper to avoid checking for isPersistent and creating persistent indexes as above in isHidden
|
||||
QVector<int> hiddenRowIds() const {
|
||||
QVector<int> rowIds;
|
||||
QList<int> hiddenRowIds() const
|
||||
{
|
||||
QList<int> rowIds;
|
||||
rowIds.reserve(hiddenRows.size());
|
||||
for (const auto &idx : hiddenRows)
|
||||
rowIds += idx.row();
|
||||
|
|
@ -404,7 +405,7 @@ public:
|
|||
}
|
||||
inline bool isHiddenOrDisabled(int row) const { return isHidden(row) || !isIndexEnabled(modelIndex(row)); }
|
||||
|
||||
void removeCurrentAndDisabled(QVector<QModelIndex> *indexes, const QModelIndex ¤t) const;
|
||||
void removeCurrentAndDisabled(QList<QModelIndex> *indexes, const QModelIndex ¤t) const;
|
||||
|
||||
void scrollElasticBandBy(int dx, int dy);
|
||||
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ bool QListModel::clearItemData(const QModelIndex &index)
|
|||
if (std::all_of(beginIter, endIter, [](const QWidgetItemData& data) -> bool { return !data.value.isValid(); }))
|
||||
return true; //it's already cleared
|
||||
item->d->values.clear();
|
||||
emit dataChanged(index, index, QVector<int>{});
|
||||
emit dataChanged(index, index, QList<int> {});
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -336,7 +336,7 @@ void QListModel::sort(int column, Qt::SortOrder order)
|
|||
|
||||
emit layoutAboutToBeChanged({}, QAbstractItemModel::VerticalSortHint);
|
||||
|
||||
QVector < QPair<QListWidgetItem*,int> > sorting(items.count());
|
||||
QList<QPair<QListWidgetItem *, int>> sorting(items.count());
|
||||
for (int i = 0; i < items.count(); ++i) {
|
||||
QListWidgetItem *item = items.at(i);
|
||||
sorting[i].first = item;
|
||||
|
|
@ -374,7 +374,7 @@ void QListModel::ensureSorted(int column, Qt::SortOrder order, int start, int en
|
|||
return;
|
||||
|
||||
int count = end - start + 1;
|
||||
QVector < QPair<QListWidgetItem*,int> > sorting(count);
|
||||
QList<QPair<QListWidgetItem *, int>> sorting(count);
|
||||
for (int i = 0; i < count; ++i) {
|
||||
sorting[i].first = items.at(start + i);
|
||||
sorting[i].second = start + i;
|
||||
|
|
@ -454,7 +454,7 @@ QList<QListWidgetItem*>::iterator QListModel::sortedInsertionIterator(
|
|||
return std::lower_bound(begin, end, item, QListModelGreaterThan());
|
||||
}
|
||||
|
||||
void QListModel::itemChanged(QListWidgetItem *item, const QVector<int> &roles)
|
||||
void QListModel::itemChanged(QListWidgetItem *item, const QList<int> &roles)
|
||||
{
|
||||
const QModelIndex idx = index(item);
|
||||
emit dataChanged(idx, idx, roles);
|
||||
|
|
@ -744,9 +744,9 @@ void QListWidgetItem::setData(int role, const QVariant &value)
|
|||
if (!found)
|
||||
d->values.append(QWidgetItemData(role, value));
|
||||
if (QListModel *model = listModel()) {
|
||||
const QVector<int> roles((role == Qt::DisplayRole) ?
|
||||
QVector<int>({Qt::DisplayRole, Qt::EditRole}) :
|
||||
QVector<int>({role}));
|
||||
const QList<int> roles((role == Qt::DisplayRole)
|
||||
? QList<int>({ Qt::DisplayRole, Qt::EditRole })
|
||||
: QList<int>({ role }));
|
||||
model->itemChanged(this, roles);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,11 +40,11 @@
|
|||
#ifndef QLISTWIDGET_H
|
||||
#define QLISTWIDGET_H
|
||||
|
||||
#include <QtWidgets/qtwidgetsglobal.h>
|
||||
#include <QtWidgets/qlistview.h>
|
||||
#include <QtCore/qvariant.h>
|
||||
#include <QtCore/qvector.h>
|
||||
#include <QtWidgets/qtwidgetsglobal.h>
|
||||
#include <QtCore/qlist.h>
|
||||
#include <QtCore/qitemselectionmodel.h>
|
||||
#include <QtCore/qvariant.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(listwidget);
|
||||
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ public:
|
|||
const QList<QListWidgetItem*>::iterator &end,
|
||||
Qt::SortOrder order, QListWidgetItem *item);
|
||||
|
||||
void itemChanged(QListWidgetItem *item, const QVector<int> &roles = QVector<int>());
|
||||
void itemChanged(QListWidgetItem *item, const QList<int> &roles = QList<int>());
|
||||
|
||||
// dnd
|
||||
QStringList mimeTypes() const override;
|
||||
|
|
@ -167,7 +167,7 @@ class QListWidgetItemPrivate
|
|||
public:
|
||||
QListWidgetItemPrivate(QListWidgetItem *item) : q(item), theid(-1) {}
|
||||
QListWidgetItem *q;
|
||||
QVector<QWidgetItemData> values;
|
||||
QList<QWidgetItemData> values;
|
||||
int theid;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -190,8 +190,8 @@ public:
|
|||
int columnSectionAnchor;
|
||||
int columnResizeTimerID;
|
||||
int rowResizeTimerID;
|
||||
QVector<int> columnsToUpdate;
|
||||
QVector<int> rowsToUpdate;
|
||||
QList<int> columnsToUpdate;
|
||||
QList<int> rowsToUpdate;
|
||||
QHeaderView *horizontalHeader;
|
||||
QHeaderView *verticalHeader;
|
||||
#if QT_CONFIG(abstractbutton)
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ void QTableModel::setItem(int row, int column, QTableWidgetItem *item)
|
|||
&& view->horizontalHeader()->sortIndicatorSection() == column) {
|
||||
// sorted insertion
|
||||
Qt::SortOrder order = view->horizontalHeader()->sortIndicatorOrder();
|
||||
QVector<QTableWidgetItem*> colItems = columnItems(column);
|
||||
QList<QTableWidgetItem *> colItems = columnItems(column);
|
||||
if (row < colItems.count())
|
||||
colItems.remove(row);
|
||||
int sortedRow;
|
||||
|
|
@ -184,7 +184,7 @@ void QTableModel::setItem(int row, int column, QTableWidgetItem *item)
|
|||
// move to after all non-0 (sortable) items
|
||||
sortedRow = colItems.count();
|
||||
} else {
|
||||
QVector<QTableWidgetItem*>::iterator it;
|
||||
QList<QTableWidgetItem *>::iterator it;
|
||||
it = sortedInsertionIterator(colItems.begin(), colItems.end(), order, item);
|
||||
sortedRow = qMax((int)(it - colItems.begin()), 0);
|
||||
}
|
||||
|
|
@ -192,7 +192,7 @@ void QTableModel::setItem(int row, int column, QTableWidgetItem *item)
|
|||
emit layoutAboutToBeChanged({}, QAbstractItemModel::VerticalSortHint);
|
||||
// move the items @ row to sortedRow
|
||||
int cc = columnCount();
|
||||
QVector<QTableWidgetItem*> rowItems(cc);
|
||||
QList<QTableWidgetItem *> rowItems(cc);
|
||||
for (int j = 0; j < cc; ++j)
|
||||
rowItems[j] = tableItems.at(tableIndex(row, j));
|
||||
tableItems.remove(tableIndex(row, 0), cc);
|
||||
|
|
@ -454,7 +454,7 @@ bool QTableModel::setItemData(const QModelIndex &index, const QMap<int, QVariant
|
|||
QTableWidgetItem *itm = item(index);
|
||||
if (itm) {
|
||||
itm->view = nullptr; // prohibits item from calling itemChanged()
|
||||
QVector<int> rolesVec;
|
||||
QList<int> rolesVec;
|
||||
for (QMap<int, QVariant>::ConstIterator it = roles.constBegin(); it != roles.constEnd(); ++it) {
|
||||
const int role = (it.key() == Qt::EditRole ? Qt::DisplayRole : it.key());
|
||||
if (itm->data(role) != it.value()) {
|
||||
|
|
@ -492,7 +492,7 @@ bool QTableModel::clearItemData(const QModelIndex &index)
|
|||
if (std::all_of(beginIter, endIter, [](const QWidgetItemData& data) -> bool { return !data.value.isValid(); }))
|
||||
return true; //it's already cleared
|
||||
itm->values.clear();
|
||||
emit dataChanged(index, index, QVector<int>{});
|
||||
emit dataChanged(index, index, QList<int> {});
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -512,8 +512,8 @@ Qt::ItemFlags QTableModel::flags(const QModelIndex &index) const
|
|||
|
||||
void QTableModel::sort(int column, Qt::SortOrder order)
|
||||
{
|
||||
QVector<QPair<QTableWidgetItem*, int> > sortable;
|
||||
QVector<int> unsortable;
|
||||
QList<QPair<QTableWidgetItem *, int>> sortable;
|
||||
QList<int> unsortable;
|
||||
|
||||
sortable.reserve(rowCount());
|
||||
unsortable.reserve(rowCount());
|
||||
|
|
@ -528,7 +528,7 @@ void QTableModel::sort(int column, Qt::SortOrder order)
|
|||
const auto compare = (order == Qt::AscendingOrder ? &itemLessThan : &itemGreaterThan);
|
||||
std::stable_sort(sortable.begin(), sortable.end(), compare);
|
||||
|
||||
QVector<QTableWidgetItem*> sorted_table(tableItems.count());
|
||||
QList<QTableWidgetItem *> sorted_table(tableItems.count());
|
||||
QModelIndexList from;
|
||||
QModelIndexList to;
|
||||
const int numRows = rowCount();
|
||||
|
|
@ -565,7 +565,7 @@ void QTableModel::ensureSorted(int column, Qt::SortOrder order,
|
|||
int start, int end)
|
||||
{
|
||||
int count = end - start + 1;
|
||||
QVector < QPair<QTableWidgetItem*,int> > sorting;
|
||||
QList<QPair<QTableWidgetItem *, int>> sorting;
|
||||
sorting.reserve(count);
|
||||
for (int row = start; row <= end; ++row) {
|
||||
QTableWidgetItem *itm = item(row, column);
|
||||
|
|
@ -580,10 +580,10 @@ void QTableModel::ensureSorted(int column, Qt::SortOrder order,
|
|||
const auto compare = (order == Qt::AscendingOrder ? &itemLessThan : &itemGreaterThan);
|
||||
std::stable_sort(sorting.begin(), sorting.end(), compare);
|
||||
QModelIndexList oldPersistentIndexes, newPersistentIndexes;
|
||||
QVector<QTableWidgetItem*> newTable = tableItems;
|
||||
QVector<QTableWidgetItem*> newVertical = verticalHeaderItems;
|
||||
QVector<QTableWidgetItem*> colItems = columnItems(column);
|
||||
QVector<QTableWidgetItem*>::iterator vit = colItems.begin();
|
||||
QList<QTableWidgetItem *> newTable = tableItems;
|
||||
QList<QTableWidgetItem *> newVertical = verticalHeaderItems;
|
||||
QList<QTableWidgetItem *> colItems = columnItems(column);
|
||||
QList<QTableWidgetItem *>::iterator vit = colItems.begin();
|
||||
bool changed = false;
|
||||
for (int i = 0; i < sorting.count(); ++i) {
|
||||
int oldRow = sorting.at(i).second;
|
||||
|
|
@ -603,7 +603,7 @@ void QTableModel::ensureSorted(int column, Qt::SortOrder order,
|
|||
}
|
||||
// move the items @ oldRow to newRow
|
||||
int cc = columnCount();
|
||||
QVector<QTableWidgetItem*> rowItems(cc);
|
||||
QList<QTableWidgetItem *> rowItems(cc);
|
||||
for (int j = 0; j < cc; ++j)
|
||||
rowItems[j] = newTable.at(tableIndex(oldRow, j));
|
||||
newTable.remove(tableIndex(oldRow, 0), cc);
|
||||
|
|
@ -640,9 +640,9 @@ void QTableModel::ensureSorted(int column, Qt::SortOrder order,
|
|||
|
||||
Returns the non-0 items in column \a column.
|
||||
*/
|
||||
QVector<QTableWidgetItem*> QTableModel::columnItems(int column) const
|
||||
QList<QTableWidgetItem *> QTableModel::columnItems(int column) const
|
||||
{
|
||||
QVector<QTableWidgetItem*> items;
|
||||
QList<QTableWidgetItem *> items;
|
||||
int rc = rowCount();
|
||||
items.reserve(rc);
|
||||
for (int row = 0; row < rc; ++row) {
|
||||
|
|
@ -689,10 +689,10 @@ void QTableModel::updateRowIndexes(QModelIndexList &indexes,
|
|||
inserted in the interval (\a begin, \a end) according to
|
||||
the given sort \a order.
|
||||
*/
|
||||
QVector<QTableWidgetItem*>::iterator QTableModel::sortedInsertionIterator(
|
||||
const QVector<QTableWidgetItem*>::iterator &begin,
|
||||
const QVector<QTableWidgetItem*>::iterator &end,
|
||||
Qt::SortOrder order, QTableWidgetItem *item)
|
||||
QList<QTableWidgetItem *>::iterator
|
||||
QTableModel::sortedInsertionIterator(const QList<QTableWidgetItem *>::iterator &begin,
|
||||
const QList<QTableWidgetItem *>::iterator &end,
|
||||
Qt::SortOrder order, QTableWidgetItem *item)
|
||||
{
|
||||
if (order == Qt::AscendingOrder)
|
||||
return std::lower_bound(begin, end, item, QTableModelLessThan());
|
||||
|
|
@ -790,7 +790,7 @@ void QTableModel::clearContents()
|
|||
endResetModel();
|
||||
}
|
||||
|
||||
void QTableModel::itemChanged(QTableWidgetItem *item, const QVector<int> &roles)
|
||||
void QTableModel::itemChanged(QTableWidgetItem *item, const QList<int> &roles)
|
||||
{
|
||||
if (!item)
|
||||
return;
|
||||
|
|
@ -1374,9 +1374,9 @@ void QTableWidgetItem::setData(int role, const QVariant &value)
|
|||
values.append(QWidgetItemData(role, value));
|
||||
if (QTableModel *model = tableModel())
|
||||
{
|
||||
const QVector<int> roles((role == Qt::DisplayRole) ?
|
||||
QVector<int>({Qt::DisplayRole, Qt::EditRole}) :
|
||||
QVector<int>({role}));
|
||||
const QList<int> roles((role == Qt::DisplayRole)
|
||||
? QList<int>({ Qt::DisplayRole, Qt::EditRole })
|
||||
: QList<int>({ role }));
|
||||
model->itemChanged(this, roles);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,10 +40,10 @@
|
|||
#ifndef QTABLEWIDGET_H
|
||||
#define QTABLEWIDGET_H
|
||||
|
||||
#include <QtWidgets/qtwidgetsglobal.h>
|
||||
#include <QtWidgets/qtableview.h>
|
||||
#include <QtWidgets/qtwidgetsglobal.h>
|
||||
#include <QtCore/qlist.h>
|
||||
#include <QtCore/qvariant.h>
|
||||
#include <QtCore/qvector.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(tablewidget);
|
||||
|
||||
|
|
@ -168,7 +168,7 @@ private:
|
|||
|
||||
private:
|
||||
int rtti;
|
||||
QVector<QWidgetItemData> values;
|
||||
QList<QWidgetItemData> values;
|
||||
QTableWidget *view;
|
||||
QTableWidgetItemPrivate *d;
|
||||
Qt::ItemFlags itemFlags;
|
||||
|
|
|
|||
|
|
@ -145,12 +145,12 @@ public:
|
|||
const QPair<QTableWidgetItem*,int> &right);
|
||||
|
||||
void ensureSorted(int column, Qt::SortOrder order, int start, int end);
|
||||
QVector<QTableWidgetItem*> columnItems(int column) const;
|
||||
QList<QTableWidgetItem *> columnItems(int column) const;
|
||||
void updateRowIndexes(QModelIndexList &indexes, int movedFromRow, int movedToRow);
|
||||
static QVector<QTableWidgetItem*>::iterator sortedInsertionIterator(
|
||||
const QVector<QTableWidgetItem*>::iterator &begin,
|
||||
const QVector<QTableWidgetItem*>::iterator &end,
|
||||
Qt::SortOrder order, QTableWidgetItem *item);
|
||||
static QList<QTableWidgetItem *>::iterator
|
||||
sortedInsertionIterator(const QList<QTableWidgetItem *>::iterator &begin,
|
||||
const QList<QTableWidgetItem *>::iterator &end, Qt::SortOrder order,
|
||||
QTableWidgetItem *item);
|
||||
|
||||
bool isValid(const QModelIndex &index) const;
|
||||
inline long tableIndex(int row, int column) const
|
||||
|
|
@ -158,7 +158,7 @@ public:
|
|||
|
||||
void clear();
|
||||
void clearContents();
|
||||
void itemChanged(QTableWidgetItem *item, const QVector<int> &roles = QVector<int>());
|
||||
void itemChanged(QTableWidgetItem *item, const QList<int> &roles = QList<int>());
|
||||
|
||||
QTableWidgetItem *createItem() const;
|
||||
const QTableWidgetItem *itemPrototype() const;
|
||||
|
|
@ -175,9 +175,9 @@ public:
|
|||
|
||||
private:
|
||||
const QTableWidgetItem *prototype;
|
||||
QVector<QTableWidgetItem*> tableItems;
|
||||
QVector<QTableWidgetItem*> verticalHeaderItems;
|
||||
QVector<QTableWidgetItem*> horizontalHeaderItems;
|
||||
QList<QTableWidgetItem *> tableItems;
|
||||
QList<QTableWidgetItem *> verticalHeaderItems;
|
||||
QList<QTableWidgetItem *> horizontalHeaderItems;
|
||||
|
||||
// A cache must be mutable if get-functions should have const modifiers
|
||||
mutable QModelIndexList cachedIndexes;
|
||||
|
|
|
|||
|
|
@ -674,7 +674,8 @@ void QTreeView::setFirstColumnSpanned(int row, const QModelIndex &parent, bool s
|
|||
/*!
|
||||
\reimp
|
||||
*/
|
||||
void QTreeView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
|
||||
void QTreeView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight,
|
||||
const QList<int> &roles)
|
||||
{
|
||||
Q_D(QTreeView);
|
||||
|
||||
|
|
@ -1444,8 +1445,11 @@ void QTreeViewPrivate::adjustViewOptionsForIndex(QStyleOptionViewItem *option, c
|
|||
option->showDecorationSelected = (selectionBehavior & QTreeView::SelectRows)
|
||||
|| option->showDecorationSelected;
|
||||
|
||||
QVector<int> logicalIndices; // index = visual index of visible columns only. data = logical index.
|
||||
QVector<QStyleOptionViewItem::ViewItemPosition> viewItemPosList; // vector of left/middle/end for each logicalIndex, visible columns only.
|
||||
QList<int>
|
||||
logicalIndices; // index = visual index of visible columns only. data = logical index.
|
||||
QList<QStyleOptionViewItem::ViewItemPosition>
|
||||
viewItemPosList; // vector of left/middle/end for each logicalIndex, visible columns
|
||||
// only.
|
||||
const bool spanning = viewItems.at(row).spanning;
|
||||
const int left = (spanning ? header->visualIndex(0) : 0);
|
||||
const int right = (spanning ? header->visualIndex(0) : header->count() - 1 );
|
||||
|
|
@ -1466,7 +1470,7 @@ void QTreeViewPrivate::adjustViewOptionsForIndex(QStyleOptionViewItem *option, c
|
|||
void QTreeView::drawTree(QPainter *painter, const QRegion ®ion) const
|
||||
{
|
||||
Q_D(const QTreeView);
|
||||
const QVector<QTreeViewItem> viewItems = d->viewItems;
|
||||
const QList<QTreeViewItem> viewItems = d->viewItems;
|
||||
|
||||
QStyleOptionViewItem option = d->viewOptionsV1();
|
||||
const QStyle::State state = option.state;
|
||||
|
|
@ -1489,7 +1493,7 @@ void QTreeView::drawTree(QPainter *painter, const QRegion ®ion) const
|
|||
QPoint hoverPos = d->viewport->mapFromGlobal(QCursor::pos());
|
||||
d->hoverBranch = d->itemDecorationAt(hoverPos);
|
||||
|
||||
QVector<int> drawn;
|
||||
QList<int> drawn;
|
||||
bool multipleRects = (region.rectCount() > 1);
|
||||
for (const QRect &a : region) {
|
||||
const QRect area = (multipleRects
|
||||
|
|
@ -1542,7 +1546,9 @@ static inline bool ancestorOf(QObject *widget, QObject *other)
|
|||
return false;
|
||||
}
|
||||
|
||||
void QTreeViewPrivate::calcLogicalIndices(QVector<int> *logicalIndices, QVector<QStyleOptionViewItem::ViewItemPosition> *itemPositions, int left, int right) const
|
||||
void QTreeViewPrivate::calcLogicalIndices(
|
||||
QList<int> *logicalIndices, QList<QStyleOptionViewItem::ViewItemPosition> *itemPositions,
|
||||
int left, int right) const
|
||||
{
|
||||
const int columnCount = header->count();
|
||||
/* 'left' and 'right' are the left-most and right-most visible visual indices.
|
||||
|
|
@ -1682,8 +1688,9 @@ void QTreeView::drawRow(QPainter *painter, const QStyleOptionViewItem &option,
|
|||
&& index.parent() == hover.parent()
|
||||
&& index.row() == hover.row();
|
||||
|
||||
QVector<int> logicalIndices;
|
||||
QVector<QStyleOptionViewItem::ViewItemPosition> viewItemPosList; // vector of left/middle/end for each logicalIndex
|
||||
QList<int> logicalIndices;
|
||||
QList<QStyleOptionViewItem::ViewItemPosition>
|
||||
viewItemPosList; // vector of left/middle/end for each logicalIndex
|
||||
d->calcLogicalIndices(&logicalIndices, &viewItemPosList, left, right);
|
||||
|
||||
for (int currentLogicalSection = 0; currentLogicalSection < logicalIndices.count(); ++currentLogicalSection) {
|
||||
|
|
@ -2862,7 +2869,7 @@ int QTreeView::sizeHintForColumn(int column) const
|
|||
ensurePolished();
|
||||
int w = 0;
|
||||
QStyleOptionViewItem option = d->viewOptionsV1();
|
||||
const QVector<QTreeViewItem> viewItems = d->viewItems;
|
||||
const QList<QTreeViewItem> viewItems = d->viewItems;
|
||||
|
||||
const int maximumProcessRows = d->header->resizeContentsPrecision(); // To avoid this to take forever.
|
||||
|
||||
|
|
@ -3799,8 +3806,8 @@ QRect QTreeViewPrivate::itemDecorationRect(const QModelIndex &index) const
|
|||
return q->style()->subElementRect(QStyle::SE_TreeViewDisclosureItem, &opt, q);
|
||||
}
|
||||
|
||||
QVector<QPair<int, int> > QTreeViewPrivate::columnRanges(const QModelIndex &topIndex,
|
||||
const QModelIndex &bottomIndex) const
|
||||
QList<QPair<int, int>> QTreeViewPrivate::columnRanges(const QModelIndex &topIndex,
|
||||
const QModelIndex &bottomIndex) const
|
||||
{
|
||||
const int topVisual = header->visualIndex(topIndex.column()),
|
||||
bottomVisual = header->visualIndex(bottomIndex.column());
|
||||
|
|
@ -3820,7 +3827,7 @@ QVector<QPair<int, int> > QTreeViewPrivate::columnRanges(const QModelIndex &topI
|
|||
//let's sort the list
|
||||
std::sort(logicalIndexes.begin(), logicalIndexes.end());
|
||||
|
||||
QVector<QPair<int, int> > ret;
|
||||
QList<QPair<int, int>> ret;
|
||||
QPair<int, int> current;
|
||||
current.first = -2; // -1 is not enough because -1+1 = 0
|
||||
current.second = -2;
|
||||
|
|
@ -3854,8 +3861,8 @@ void QTreeViewPrivate::select(const QModelIndex &topIndex, const QModelIndex &bo
|
|||
const int top = viewIndex(topIndex),
|
||||
bottom = viewIndex(bottomIndex);
|
||||
|
||||
const QVector<QPair<int, int> > colRanges = columnRanges(topIndex, bottomIndex);
|
||||
QVector<QPair<int, int> >::const_iterator it;
|
||||
const QList<QPair<int, int>> colRanges = columnRanges(topIndex, bottomIndex);
|
||||
QList<QPair<int, int>>::const_iterator it;
|
||||
for (it = colRanges.begin(); it != colRanges.end(); ++it) {
|
||||
const int left = (*it).first,
|
||||
right = (*it).second;
|
||||
|
|
|
|||
|
|
@ -143,8 +143,8 @@ public:
|
|||
void doItemsLayout() override;
|
||||
void reset() override;
|
||||
|
||||
|
||||
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>()) override;
|
||||
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight,
|
||||
const QList<int> &roles = QList<int>()) override;
|
||||
void selectAll() override;
|
||||
|
||||
Q_SIGNALS:
|
||||
|
|
|
|||
|
|
@ -53,11 +53,11 @@
|
|||
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include "private/qabstractitemview_p.h"
|
||||
#include <QtCore/qabstractitemmodel.h>
|
||||
#include <QtCore/qlist.h>
|
||||
#if QT_CONFIG(animation)
|
||||
#include <QtCore/qvariantanimation.h>
|
||||
#endif
|
||||
#include <QtCore/qabstractitemmodel.h>
|
||||
#include <QtCore/qvector.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(treeview);
|
||||
|
||||
|
|
@ -170,8 +170,8 @@ public:
|
|||
int itemDecorationAt(const QPoint &pos) const;
|
||||
QRect itemDecorationRect(const QModelIndex &index) const;
|
||||
|
||||
|
||||
QVector<QPair<int, int> > columnRanges(const QModelIndex &topIndex, const QModelIndex &bottomIndex) const;
|
||||
QList<QPair<int, int>> columnRanges(const QModelIndex &topIndex,
|
||||
const QModelIndex &bottomIndex) const;
|
||||
void select(const QModelIndex &start, const QModelIndex &stop, QItemSelectionModel::SelectionFlags command);
|
||||
|
||||
QPair<int,int> startAndEndColumns(const QRect &rect) const;
|
||||
|
|
@ -182,12 +182,14 @@ public:
|
|||
|
||||
// logicalIndices: vector of currently visibly logical indices
|
||||
// itemPositions: vector of view item positions (beginning/middle/end/onlyone)
|
||||
void calcLogicalIndices(QVector<int> *logicalIndices, QVector<QStyleOptionViewItem::ViewItemPosition> *itemPositions, int left, int right) const;
|
||||
void calcLogicalIndices(QList<int> *logicalIndices,
|
||||
QList<QStyleOptionViewItem::ViewItemPosition> *itemPositions, int left,
|
||||
int right) const;
|
||||
int widthHintForIndex(const QModelIndex &index, int hint, const QStyleOptionViewItem &option, int i) const;
|
||||
QHeaderView *header;
|
||||
int indent;
|
||||
|
||||
mutable QVector<QTreeViewItem> viewItems;
|
||||
mutable QList<QTreeViewItem> viewItems;
|
||||
mutable int lastViewedItem;
|
||||
int defaultItemHeight; // this is just a number; contentsHeight() / numItems
|
||||
bool uniformRowHeights; // used when all rows have the same height
|
||||
|
|
|
|||
|
|
@ -407,7 +407,7 @@ bool QTreeModel::clearItemData(const QModelIndex &index)
|
|||
}
|
||||
itm->d->display[index.column()] = QVariant();
|
||||
itm->values[index.column()].clear();
|
||||
emit dataChanged(index, index, QVector<int>{});
|
||||
emit dataChanged(index, index, QList<int> {});
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -491,7 +491,7 @@ bool QTreeModel::insertColumns(int column, int count, const QModelIndex &parent)
|
|||
QTreeWidgetItem *child = children.at(row);
|
||||
if (child->children.count())
|
||||
itemstack.push(child);
|
||||
child->values.insert(column, count, QVector<QWidgetItemData>());
|
||||
child->values.insert(column, count, QList<QWidgetItemData>());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -622,7 +622,7 @@ void QTreeModel::ensureSorted(int column, Qt::SortOrder order,
|
|||
QList<QTreeWidgetItem*> lst = itm->children;
|
||||
|
||||
int count = end - start + 1;
|
||||
QVector < QPair<QTreeWidgetItem*,int> > sorting(count);
|
||||
QList<QPair<QTreeWidgetItem *, int>> sorting(count);
|
||||
for (int i = 0; i < count; ++i) {
|
||||
sorting[i].first = lst.at(start + i);
|
||||
sorting[i].second = start + i;
|
||||
|
|
@ -798,7 +798,7 @@ bool QTreeModel::isChanging() const
|
|||
if column is -1 then all columns have changed
|
||||
*/
|
||||
|
||||
void QTreeModel::emitDataChanged(QTreeWidgetItem *item, int column, const QVector<int> &roles)
|
||||
void QTreeModel::emitDataChanged(QTreeWidgetItem *item, int column, const QList<int> &roles)
|
||||
{
|
||||
if (signalsBlocked())
|
||||
return;
|
||||
|
|
@ -864,7 +864,7 @@ void QTreeModel::sortItems(QList<QTreeWidgetItem*> *items, int column, Qt::SortO
|
|||
return;
|
||||
|
||||
// store the original order of indexes
|
||||
QVector< QPair<QTreeWidgetItem*,int> > sorting(items->count());
|
||||
QList<QPair<QTreeWidgetItem *, int>> sorting(items->count());
|
||||
for (int i = 0; i < sorting.count(); ++i) {
|
||||
sorting[i].first = items->at(i);
|
||||
sorting[i].second = i;
|
||||
|
|
@ -1836,7 +1836,7 @@ void QTreeWidgetItem::setData(int column, int role, const QVariant &value)
|
|||
default:
|
||||
if (column < values.count()) {
|
||||
bool found = false;
|
||||
const QVector<QWidgetItemData> column_values = values.at(column);
|
||||
const QList<QWidgetItemData> column_values = values.at(column);
|
||||
for (int i = 0; i < column_values.count(); ++i) {
|
||||
if (column_values.at(i).role == role) {
|
||||
if (column_values.at(i).value == value)
|
||||
|
|
@ -1858,9 +1858,9 @@ void QTreeWidgetItem::setData(int column, int role, const QVariant &value)
|
|||
}
|
||||
|
||||
if (model) {
|
||||
const QVector<int> roles((role == Qt::DisplayRole || role == Qt::EditRole) ?
|
||||
QVector<int>({Qt::DisplayRole, Qt::EditRole}) :
|
||||
QVector<int>({role}));
|
||||
const QList<int> roles((role == Qt::DisplayRole || role == Qt::EditRole)
|
||||
? QList<int>({ Qt::DisplayRole, Qt::EditRole })
|
||||
: QList<int>({ role }));
|
||||
model->emitDataChanged(this, column, roles);
|
||||
if (role == Qt::CheckStateRole) {
|
||||
QTreeWidgetItem *p;
|
||||
|
|
@ -1888,7 +1888,7 @@ QVariant QTreeWidgetItem::data(int column, int role) const
|
|||
Q_FALLTHROUGH();
|
||||
default:
|
||||
if (column >= 0 && column < values.size()) {
|
||||
const QVector<QWidgetItemData> &column_values = values.at(column);
|
||||
const QList<QWidgetItemData> &column_values = values.at(column);
|
||||
for (const auto &column_value : column_values) {
|
||||
if (column_value.role == role)
|
||||
return column_value.value;
|
||||
|
|
|
|||
|
|
@ -40,11 +40,11 @@
|
|||
#ifndef QTREEWIDGET_H
|
||||
#define QTREEWIDGET_H
|
||||
|
||||
#include <QtWidgets/qtwidgetsglobal.h>
|
||||
#include <QtWidgets/qtreeview.h>
|
||||
#include <QtWidgets/qtreewidgetitemiterator.h>
|
||||
#include <QtWidgets/qtwidgetsglobal.h>
|
||||
#include <QtCore/qlist.h>
|
||||
#include <QtCore/qvariant.h>
|
||||
#include <QtCore/qvector.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(treewidget);
|
||||
|
||||
|
|
@ -201,7 +201,7 @@ private:
|
|||
|
||||
int rtti;
|
||||
// One item has a vector of column entries. Each column has a vector of (role, value) pairs.
|
||||
QVector< QVector<QWidgetItemData> > values;
|
||||
QList<QList<QWidgetItemData>> values;
|
||||
QTreeWidget *view;
|
||||
QTreeWidgetItemPrivate *d;
|
||||
QTreeWidgetItem *par;
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ public:
|
|||
|
||||
protected:
|
||||
QTreeModel(QTreeModelPrivate &, QTreeWidget *parent = nullptr);
|
||||
void emitDataChanged(QTreeWidgetItem *item, int column, const QVector<int> &roles);
|
||||
void emitDataChanged(QTreeWidgetItem *item, int column, const QList<int> &roles);
|
||||
void beginInsertItems(QTreeWidgetItem *parent, int row, int count);
|
||||
void endInsertItems();
|
||||
void beginRemoveItems(QTreeWidgetItem *parent, int row, int count);
|
||||
|
|
|
|||
|
|
@ -37,15 +37,14 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qboxlayout.h"
|
||||
#include "qapplication.h"
|
||||
#include "qwidget.h"
|
||||
#include "qboxlayout.h"
|
||||
#include "qlist.h"
|
||||
#include "qsizepolicy.h"
|
||||
#include "qvector.h"
|
||||
#include "qwidget.h"
|
||||
|
||||
#include "qlayoutengine_p.h"
|
||||
#include "qlayout_p.h"
|
||||
#include "qlayoutengine_p.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
@ -104,7 +103,7 @@ public:
|
|||
}
|
||||
|
||||
QList<QBoxLayoutItem *> list;
|
||||
QVector<QLayoutStruct> geomArray;
|
||||
QList<QLayoutStruct> geomArray;
|
||||
int hfwWidth;
|
||||
int hfwHeight;
|
||||
int hfwMinHeight;
|
||||
|
|
@ -271,7 +270,7 @@ void QBoxLayoutPrivate::setupGeom()
|
|||
|
||||
int n = list.count();
|
||||
geomArray.clear();
|
||||
QVector<QLayoutStruct> a(n);
|
||||
QList<QLayoutStruct> a(n);
|
||||
|
||||
QSizePolicy::ControlTypes controlTypes1;
|
||||
QSizePolicy::ControlTypes controlTypes2;
|
||||
|
|
@ -400,7 +399,7 @@ void QBoxLayoutPrivate::setupGeom()
|
|||
*/
|
||||
void QBoxLayoutPrivate::calcHfw(int w)
|
||||
{
|
||||
QVector<QLayoutStruct> &a = geomArray;
|
||||
QList<QLayoutStruct> &a = geomArray;
|
||||
int n = a.count();
|
||||
int h = 0;
|
||||
int mh = 0;
|
||||
|
|
@ -770,7 +769,7 @@ void QBoxLayout::setGeometry(const QRect &r)
|
|||
cr.width() - (left + right),
|
||||
cr.height() - (top + bottom));
|
||||
|
||||
QVector<QLayoutStruct> a = d->geomArray;
|
||||
QList<QLayoutStruct> a = d->geomArray;
|
||||
int pos = horz(d->dir) ? s.x() : s.y();
|
||||
int space = horz(d->dir) ? s.width() : s.height();
|
||||
int n = a.count();
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@
|
|||
#include "qlabel.h"
|
||||
#include "qlayout_p.h"
|
||||
#include "qlayoutengine_p.h"
|
||||
#include "qlist.h"
|
||||
#include "qrect.h"
|
||||
#include "qvector.h"
|
||||
#include "qwidget.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
|
@ -55,7 +55,7 @@ namespace {
|
|||
template <class T, int NumColumns>
|
||||
class FixedColumnMatrix {
|
||||
public:
|
||||
typedef QVector<T> Storage;
|
||||
typedef QList<T> Storage;
|
||||
|
||||
FixedColumnMatrix() { }
|
||||
|
||||
|
|
@ -169,7 +169,7 @@ public:
|
|||
void setLayout(int row, QFormLayout::ItemRole role, QLayout *layout);
|
||||
void setWidget(int row, QFormLayout::ItemRole role, QWidget *widget);
|
||||
|
||||
void arrangeWidgets(const QVector<QLayoutStruct>& layouts, QRect &rect);
|
||||
void arrangeWidgets(const QList<QLayoutStruct> &layouts, QRect &rect);
|
||||
|
||||
void updateSizes();
|
||||
|
||||
|
|
@ -215,11 +215,11 @@ public:
|
|||
int formMaxWidth;
|
||||
void calcSizeHints();
|
||||
|
||||
QVector<QLayoutStruct> vLayouts; // set by setupVerticalLayoutData;
|
||||
QList<QLayoutStruct> vLayouts; // set by setupVerticalLayoutData;
|
||||
int vLayoutCount; // Number of rows we calculated in setupVerticalLayoutData
|
||||
int maxLabelWidth; // the label width we calculated in setupVerticalLayoutData
|
||||
|
||||
QVector<QLayoutStruct> hfwLayouts;
|
||||
QList<QLayoutStruct> hfwLayouts;
|
||||
|
||||
int hSpacing = -1;
|
||||
int vSpacing = -1;
|
||||
|
|
@ -2167,7 +2167,7 @@ int QFormLayout::spacing() const
|
|||
}
|
||||
}
|
||||
|
||||
void QFormLayoutPrivate::arrangeWidgets(const QVector<QLayoutStruct>& layouts, QRect &rect)
|
||||
void QFormLayoutPrivate::arrangeWidgets(const QList<QLayoutStruct> &layouts, QRect &rect)
|
||||
{
|
||||
Q_Q(QFormLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -37,13 +37,13 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qgridlayout.h"
|
||||
#include "qapplication.h"
|
||||
#include "qwidget.h"
|
||||
#include "qgridlayout.h"
|
||||
#include "qlist.h"
|
||||
#include "qsizepolicy.h"
|
||||
#include "qvector.h"
|
||||
#include "qvarlengtharray.h"
|
||||
#include "qwidget.h"
|
||||
|
||||
#include "qlayoutengine_p.h"
|
||||
#include "qlayout_p.h"
|
||||
|
||||
|
|
@ -204,7 +204,7 @@ private:
|
|||
QSize findSize(int QLayoutStruct::*, int hSpacing, int vSpacing) const;
|
||||
void addData(QGridBox *b, const QGridLayoutSizeTriple &sizes, bool r, bool c);
|
||||
void setSize(int rows, int cols);
|
||||
void setupSpacings(QVector<QLayoutStruct> &chain, QGridBox *grid[], int fixedSpacing,
|
||||
void setupSpacings(QList<QLayoutStruct> &chain, QGridBox *grid[], int fixedSpacing,
|
||||
Qt::Orientation orientation);
|
||||
void setupLayoutData(int hSpacing, int vSpacing);
|
||||
void setupHfwLayoutData();
|
||||
|
|
@ -212,13 +212,13 @@ private:
|
|||
|
||||
int rr;
|
||||
int cc;
|
||||
QVector<QLayoutStruct> rowData;
|
||||
QVector<QLayoutStruct> colData;
|
||||
QVector<QLayoutStruct> *hfwData;
|
||||
QVector<int> rStretch;
|
||||
QVector<int> cStretch;
|
||||
QVector<int> rMinHeights;
|
||||
QVector<int> cMinWidths;
|
||||
QList<QLayoutStruct> rowData;
|
||||
QList<QLayoutStruct> colData;
|
||||
QList<QLayoutStruct> *hfwData;
|
||||
QList<int> rStretch;
|
||||
QList<int> cStretch;
|
||||
QList<int> rMinHeights;
|
||||
QList<int> cMinWidths;
|
||||
QList<QGridBox *> things;
|
||||
|
||||
int hfw_width;
|
||||
|
|
@ -390,9 +390,9 @@ void QGridLayoutPrivate::recalcHFW(int w)
|
|||
and put the results in hfwData.
|
||||
*/
|
||||
if (!hfwData)
|
||||
hfwData = new QVector<QLayoutStruct>(rr);
|
||||
hfwData = new QList<QLayoutStruct>(rr);
|
||||
setupHfwLayoutData();
|
||||
QVector<QLayoutStruct> &rData = *hfwData;
|
||||
QList<QLayoutStruct> &rData = *hfwData;
|
||||
|
||||
int h = 0;
|
||||
int mh = 0;
|
||||
|
|
@ -615,7 +615,7 @@ void QGridLayoutPrivate::addData(QGridBox *box, const QGridLayoutSizeTriple &siz
|
|||
}
|
||||
}
|
||||
|
||||
static void initEmptyMultiBox(QVector<QLayoutStruct> &chain, int start, int end)
|
||||
static void initEmptyMultiBox(QList<QLayoutStruct> &chain, int start, int end)
|
||||
{
|
||||
for (int i = start; i <= end; i++) {
|
||||
QLayoutStruct *data = &chain[i];
|
||||
|
|
@ -625,8 +625,8 @@ static void initEmptyMultiBox(QVector<QLayoutStruct> &chain, int start, int end)
|
|||
}
|
||||
}
|
||||
|
||||
static void distributeMultiBox(QVector<QLayoutStruct> &chain, int start, int end, int minSize,
|
||||
int sizeHint, QVector<int> &stretchArray, int stretch)
|
||||
static void distributeMultiBox(QList<QLayoutStruct> &chain, int start, int end, int minSize,
|
||||
int sizeHint, QList<int> &stretchArray, int stretch)
|
||||
{
|
||||
int i;
|
||||
int w = 0;
|
||||
|
|
@ -698,9 +698,8 @@ static QGridBox *&gridAt(QGridBox *grid[], int r, int c, int cc,
|
|||
return grid[(r * cc) + c];
|
||||
}
|
||||
|
||||
void QGridLayoutPrivate::setupSpacings(QVector<QLayoutStruct> &chain,
|
||||
QGridBox *grid[], int fixedSpacing,
|
||||
Qt::Orientation orientation)
|
||||
void QGridLayoutPrivate::setupSpacings(QList<QLayoutStruct> &chain, QGridBox *grid[],
|
||||
int fixedSpacing, Qt::Orientation orientation)
|
||||
{
|
||||
Q_Q(QGridLayout);
|
||||
int numRows = rr; // or columns if orientation is horizontal
|
||||
|
|
@ -868,7 +867,7 @@ void QGridLayoutPrivate::setupLayoutData(int hSpacing, int vSpacing)
|
|||
|
||||
void QGridLayoutPrivate::addHfwData(QGridBox *box, int width)
|
||||
{
|
||||
QVector<QLayoutStruct> &rData = *hfwData;
|
||||
QList<QLayoutStruct> &rData = *hfwData;
|
||||
if (box->hasHeightForWidth()) {
|
||||
int hint = box->heightForWidth(width);
|
||||
rData[box->row].sizeHint = qMax(hint, rData.at(box->row).sizeHint);
|
||||
|
|
@ -888,7 +887,7 @@ void QGridLayoutPrivate::addHfwData(QGridBox *box, int width)
|
|||
*/
|
||||
void QGridLayoutPrivate::setupHfwLayoutData()
|
||||
{
|
||||
QVector<QLayoutStruct> &rData = *hfwData;
|
||||
QList<QLayoutStruct> &rData = *hfwData;
|
||||
for (int i = 0; i < rr; i++) {
|
||||
rData[i] = rowData.at(i);
|
||||
rData[i].minimumSize = rData[i].sizeHint = rMinHeights.at(i);
|
||||
|
|
@ -944,7 +943,7 @@ void QGridLayoutPrivate::distribute(QRect r, int hSpacing, int vSpacing)
|
|||
r.adjust(+left, +top, -right, -bottom);
|
||||
|
||||
qGeomCalc(colData, 0, cc, r.x(), r.width());
|
||||
QVector<QLayoutStruct> *rDataPtr;
|
||||
QList<QLayoutStruct> *rDataPtr;
|
||||
if (has_hfw) {
|
||||
recalcHFW(r.width());
|
||||
qGeomCalc(*hfwData, 0, rr, r.y(), r.height());
|
||||
|
|
@ -953,7 +952,7 @@ void QGridLayoutPrivate::distribute(QRect r, int hSpacing, int vSpacing)
|
|||
qGeomCalc(rowData, 0, rr, r.y(), r.height());
|
||||
rDataPtr = &rowData;
|
||||
}
|
||||
QVector<QLayoutStruct> &rData = *rDataPtr;
|
||||
QList<QLayoutStruct> &rData = *rDataPtr;
|
||||
int i;
|
||||
|
||||
bool reverse = ((r.bottom() > rect.bottom()) || (r.bottom() == rect.bottom()
|
||||
|
|
@ -985,7 +984,7 @@ QRect QGridLayoutPrivate::cellRect(int row, int col) const
|
|||
if (row < 0 || row >= rr || col < 0 || col >= cc)
|
||||
return QRect();
|
||||
|
||||
const QVector<QLayoutStruct> *rDataPtr;
|
||||
const QList<QLayoutStruct> *rDataPtr;
|
||||
if (has_hfw && hfwData)
|
||||
rDataPtr = hfwData;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
#include "qlayout.h"
|
||||
#include "private/qlayoutengine_p.h"
|
||||
|
||||
#include "qvector.h"
|
||||
#include "qlist.h"
|
||||
#include "qwidget.h"
|
||||
|
||||
#include <qvarlengtharray.h>
|
||||
|
|
@ -73,8 +73,7 @@ static inline int fRound(Fixed64 i) {
|
|||
count is the count of items in the chain; pos and space give the
|
||||
interval (relative to parentWidget topLeft).
|
||||
*/
|
||||
void qGeomCalc(QVector<QLayoutStruct> &chain, int start, int count,
|
||||
int pos, int space, int spacer)
|
||||
void qGeomCalc(QList<QLayoutStruct> &chain, int start, int count, int pos, int space, int spacer)
|
||||
{
|
||||
int cHint = 0;
|
||||
int cMin = 0;
|
||||
|
|
|
|||
|
|
@ -94,9 +94,8 @@ struct QLayoutStruct
|
|||
int size;
|
||||
};
|
||||
|
||||
|
||||
Q_WIDGETS_EXPORT void qGeomCalc(QVector<QLayoutStruct> &chain, int start, int count,
|
||||
int pos, int space, int spacer = -1);
|
||||
Q_WIDGETS_EXPORT void qGeomCalc(QList<QLayoutStruct> &chain, int start, int count, int pos,
|
||||
int space, int spacer = -1);
|
||||
Q_WIDGETS_EXPORT QSize qSmartMinSize(const QSize &sizeHint, const QSize &minSizeHint,
|
||||
const QSize &minSize, const QSize &maxSize,
|
||||
const QSizePolicy &sizePolicy);
|
||||
|
|
|
|||
|
|
@ -416,9 +416,9 @@ static bool hasPlatformWindow(QWidget *widget)
|
|||
return widget && widget->windowHandle() && widget->windowHandle()->handle();
|
||||
}
|
||||
|
||||
static QVector<QRect> getSortedRectsToScroll(const QRegion ®ion, int dx, int dy)
|
||||
static QList<QRect> getSortedRectsToScroll(const QRegion ®ion, int dx, int dy)
|
||||
{
|
||||
QVector<QRect> rects;
|
||||
QList<QRect> rects;
|
||||
std::copy(region.begin(), region.end(), std::back_inserter(rects));
|
||||
if (rects.count() > 1) {
|
||||
std::sort(rects.begin(), rects.end(), [=](const QRect &r1, const QRect &r2) {
|
||||
|
|
@ -488,8 +488,8 @@ void QWidgetPrivate::moveRect(const QRect &rect, int dx, int dy)
|
|||
|
||||
const qreal factor = QHighDpiScaling::factor(q->windowHandle());
|
||||
if (overlappedExpose.isEmpty() || qFloor(factor) == factor) {
|
||||
const QVector<QRect> rectsToScroll
|
||||
= getSortedRectsToScroll(QRegion(sourceRect) - overlappedExpose, dx, dy);
|
||||
const QList<QRect> rectsToScroll =
|
||||
getSortedRectsToScroll(QRegion(sourceRect) - overlappedExpose, dx, dy);
|
||||
for (QRect rect : rectsToScroll) {
|
||||
if (repaintManager->bltRect(rect, dx, dy, pw)) {
|
||||
childExpose -= rect.translated(dx, dy);
|
||||
|
|
@ -570,8 +570,8 @@ void QWidgetPrivate::scrollRect(const QRect &rect, int dx, int dy)
|
|||
|
||||
const qreal factor = QHighDpiScaling::factor(q->windowHandle());
|
||||
if (overlappedExpose.isEmpty() || qFloor(factor) == factor) {
|
||||
const QVector<QRect> rectsToScroll
|
||||
= getSortedRectsToScroll(QRegion(sourceRect) - overlappedExpose, dx, dy);
|
||||
const QList<QRect> rectsToScroll =
|
||||
getSortedRectsToScroll(QRegion(sourceRect) - overlappedExpose, dx, dy);
|
||||
for (const QRect &rect : rectsToScroll) {
|
||||
if (repaintManager->bltRect(rect, dx, dy, q)) {
|
||||
childExpose -= rect.translated(dx, dy);
|
||||
|
|
@ -627,7 +627,9 @@ bool QWidgetRepaintManager::bltRect(const QRect &rect, int dx, int dy, QWidget *
|
|||
// ---------------------------------------------------------------------------
|
||||
|
||||
#ifndef QT_NO_OPENGL
|
||||
static void findTextureWidgetsRecursively(QWidget *tlw, QWidget *widget, QPlatformTextureList *widgetTextures, QVector<QWidget *> *nativeChildren)
|
||||
static void findTextureWidgetsRecursively(QWidget *tlw, QWidget *widget,
|
||||
QPlatformTextureList *widgetTextures,
|
||||
QList<QWidget *> *nativeChildren)
|
||||
{
|
||||
QWidgetPrivate *wd = QWidgetPrivate::get(widget);
|
||||
if (wd->renderToTexture) {
|
||||
|
|
@ -650,7 +652,7 @@ static void findAllTextureWidgetsRecursively(QWidget *tlw, QWidget *widget)
|
|||
{
|
||||
// textureChildSeen does not take native child widgets into account and that's good.
|
||||
if (QWidgetPrivate::get(widget)->textureChildSeen) {
|
||||
QVector<QWidget *> nativeChildren;
|
||||
QList<QWidget *> nativeChildren;
|
||||
auto tl = qt_make_unique<QPlatformTextureList>();
|
||||
// Look for texture widgets (incl. widget itself) from 'widget' down,
|
||||
// but skip subtrees with a parent of a native child widget.
|
||||
|
|
|
|||
|
|
@ -130,11 +130,11 @@ private:
|
|||
QBackingStore *store = nullptr;
|
||||
|
||||
QRegion dirty; // needsRepaint
|
||||
QVector<QWidget *> dirtyWidgets;
|
||||
QVector<QWidget *> dirtyRenderToTextureWidgets;
|
||||
QList<QWidget *> dirtyWidgets;
|
||||
QList<QWidget *> dirtyRenderToTextureWidgets;
|
||||
|
||||
QRegion topLevelNeedsFlush;
|
||||
QVector<QWidget *> needsFlushWidgets;
|
||||
QList<QWidget *> needsFlushWidgets;
|
||||
|
||||
QList<QWidget *> staticWidgets;
|
||||
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
|
|||
int posX = opt->rect.x() + (opt->rect.width() - markW)/2 + 1;
|
||||
int posY = opt->rect.y() + (opt->rect.height() - markH)/2;
|
||||
|
||||
QVector<QLineF> a;
|
||||
QList<QLineF> a;
|
||||
a.reserve(markH);
|
||||
|
||||
int i, xx, yy;
|
||||
|
|
|
|||
|
|
@ -379,7 +379,7 @@ void qDrawShadePanel(QPainter *p, int x, int y, int w, int h,
|
|||
light = pal.midlight().color();
|
||||
}
|
||||
QPen oldPen = p->pen(); // save pen
|
||||
QVector<QLineF> lines;
|
||||
QList<QLineF> lines;
|
||||
lines.reserve(2*lineWidth);
|
||||
|
||||
if (sunken)
|
||||
|
|
|
|||
|
|
@ -508,7 +508,7 @@ class QRenderRule
|
|||
{
|
||||
public:
|
||||
QRenderRule() : features(0), hasFont(false), pal(nullptr), b(nullptr), bg(nullptr), bd(nullptr), ou(nullptr), geo(nullptr), p(nullptr), img(nullptr), clipset(0) { }
|
||||
QRenderRule(const QVector<QCss::Declaration> &, const QObject *);
|
||||
QRenderRule(const QList<QCss::Declaration> &, const QObject *);
|
||||
|
||||
QRect borderRect(const QRect &r) const;
|
||||
QRect outlineRect(const QRect &r) const;
|
||||
|
|
@ -803,7 +803,7 @@ QHash<QStyle::SubControl, QRect> QStyleSheetStyle::titleBarLayout(const QWidget
|
|||
|
||||
int offsets[3] = { 0, 0, 0 };
|
||||
enum Where { Left, Right, Center, NoWhere } where = Left;
|
||||
QVector<ButtonInfo> infos;
|
||||
QList<ButtonInfo> infos;
|
||||
const int numLayouts = layout.size();
|
||||
infos.reserve(numLayouts);
|
||||
for (int i = 0; i < numLayouts; i++) {
|
||||
|
|
@ -915,8 +915,18 @@ static QStyle::StandardPixmap subControlIcon(int pe)
|
|||
return QStyle::SP_CustomBase;
|
||||
}
|
||||
|
||||
QRenderRule::QRenderRule(const QVector<Declaration> &declarations, const QObject *object)
|
||||
: features(0), hasFont(false), pal(nullptr), b(nullptr), bg(nullptr), bd(nullptr), ou(nullptr), geo(nullptr), p(nullptr), img(nullptr), clipset(0)
|
||||
QRenderRule::QRenderRule(const QList<Declaration> &declarations, const QObject *object)
|
||||
: features(0),
|
||||
hasFont(false),
|
||||
pal(nullptr),
|
||||
b(nullptr),
|
||||
bg(nullptr),
|
||||
bd(nullptr),
|
||||
ou(nullptr),
|
||||
geo(nullptr),
|
||||
p(nullptr),
|
||||
img(nullptr),
|
||||
clipset(0)
|
||||
{
|
||||
QPalette palette = QGuiApplication::palette(); // ###: ideally widget's palette
|
||||
ValueExtractor v(declarations, palette);
|
||||
|
|
@ -1602,14 +1612,15 @@ private:
|
|||
mutable QHash<const QObject *, QHash<QString, QString> > m_attributeCache;
|
||||
};
|
||||
|
||||
QVector<QCss::StyleRule> QStyleSheetStyle::styleRules(const QObject *obj) const
|
||||
QList<QCss::StyleRule> QStyleSheetStyle::styleRules(const QObject *obj) const
|
||||
{
|
||||
QHash<const QObject *, QVector<StyleRule> >::const_iterator cacheIt = styleSheetCaches->styleRulesCache.constFind(obj);
|
||||
QHash<const QObject *, QList<StyleRule>>::const_iterator cacheIt =
|
||||
styleSheetCaches->styleRulesCache.constFind(obj);
|
||||
if (cacheIt != styleSheetCaches->styleRulesCache.constEnd())
|
||||
return cacheIt.value();
|
||||
|
||||
if (!initObject(obj)) {
|
||||
return QVector<StyleRule>();
|
||||
return QList<StyleRule>();
|
||||
}
|
||||
|
||||
QStyleSheetStyleSelector styleSelector;
|
||||
|
|
@ -1645,7 +1656,7 @@ QVector<QCss::StyleRule> QStyleSheetStyle::styleRules(const QObject *obj) const
|
|||
styleSelector.styleSheets += appSs;
|
||||
}
|
||||
|
||||
QVector<QCss::StyleSheet> objectSs;
|
||||
QList<QCss::StyleSheet> objectSs;
|
||||
for (const QObject *o = obj; o; o = parentObject(o)) {
|
||||
QString styleSheet = o->property("styleSheet").toString();
|
||||
if (styleSheet.isEmpty())
|
||||
|
|
@ -1674,16 +1685,17 @@ QVector<QCss::StyleRule> QStyleSheetStyle::styleRules(const QObject *obj) const
|
|||
|
||||
StyleSelector::NodePtr n;
|
||||
n.ptr = const_cast<QObject *>(obj);
|
||||
QVector<QCss::StyleRule> rules = styleSelector.styleRulesForNode(n);
|
||||
QList<QCss::StyleRule> rules = styleSelector.styleRulesForNode(n);
|
||||
styleSheetCaches->styleRulesCache.insert(obj, rules);
|
||||
return rules;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Rendering rules
|
||||
static QVector<Declaration> declarations(const QVector<StyleRule> &styleRules, const QString &part, quint64 pseudoClass = PseudoClass_Unspecified)
|
||||
static QList<Declaration> declarations(const QList<StyleRule> &styleRules, const QString &part,
|
||||
quint64 pseudoClass = PseudoClass_Unspecified)
|
||||
{
|
||||
QVector<Declaration> decls;
|
||||
QList<Declaration> decls;
|
||||
for (int i = 0; i < styleRules.count(); i++) {
|
||||
const Selector& selector = styleRules.at(i).selectors.at(0);
|
||||
// Rules with pseudo elements don't cascade. This is an intentional
|
||||
|
|
@ -1813,7 +1825,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, int element, quint6
|
|||
return QRenderRule();
|
||||
|
||||
quint64 stateMask = 0;
|
||||
const QVector<StyleRule> rules = styleRules(obj);
|
||||
const QList<StyleRule> rules = styleRules(obj);
|
||||
for (int i = 0; i < rules.count(); i++) {
|
||||
const Selector& selector = rules.at(i).selectors.at(0);
|
||||
quint64 negated = 0;
|
||||
|
|
@ -1830,7 +1842,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, int element, quint6
|
|||
|
||||
|
||||
const QString part = QLatin1String(knownPseudoElements[element].name);
|
||||
QVector<Declaration> decls = declarations(rules, part, state);
|
||||
QList<Declaration> decls = declarations(rules, part, state);
|
||||
QRenderRule newRule(decls, obj);
|
||||
cache[state] = newRule;
|
||||
if ((state & stateMask) != state)
|
||||
|
|
@ -2120,8 +2132,7 @@ bool QStyleSheetStyle::hasStyleRule(const QObject *obj, int part) const
|
|||
if (!initObject(obj))
|
||||
return false;
|
||||
|
||||
|
||||
const QVector<StyleRule> &rules = styleRules(obj);
|
||||
const QList<StyleRule> &rules = styleRules(obj);
|
||||
if (part == PseudoElement_None) {
|
||||
bool result = obj && !rules.isEmpty();
|
||||
cache[part] = result;
|
||||
|
|
@ -2580,8 +2591,8 @@ void QStyleSheetStyle::setProperties(QWidget *w)
|
|||
// Set value for each property in the order of property final occurrence
|
||||
// since properties interact.
|
||||
|
||||
const QVector<Declaration> decls = declarations(styleRules(w), QString());
|
||||
QVector<int> finals; // indices in reverse order of each property's final occurrence
|
||||
const QList<Declaration> decls = declarations(styleRules(w), QString());
|
||||
QList<int> finals; // indices in reverse order of each property's final occurrence
|
||||
|
||||
{
|
||||
// scan decls for final occurrence of each "qproperty"
|
||||
|
|
@ -2844,7 +2855,7 @@ void QStyleSheetStyle::polish(QWidget *w)
|
|||
setPalette(w);
|
||||
|
||||
//set the WA_Hover attribute if one of the selector depends of the hover state
|
||||
QVector<StyleRule> rules = styleRules(w);
|
||||
QList<StyleRule> rules = styleRules(w);
|
||||
for (int i = 0; i < rules.count(); i++) {
|
||||
const Selector& selector = rules.at(i).selectors.at(0);
|
||||
quint64 negated = 0;
|
||||
|
|
|
|||
|
|
@ -45,14 +45,14 @@
|
|||
|
||||
#ifndef QT_NO_STYLE_STYLESHEET
|
||||
|
||||
#include "QtWidgets/qapplication.h"
|
||||
#include "QtWidgets/qstyleoption.h"
|
||||
#include "QtCore/qhash.h"
|
||||
#include "QtGui/qevent.h"
|
||||
#include "QtCore/qvector.h"
|
||||
#include "QtCore/qlist.h"
|
||||
#include "QtCore/qset.h"
|
||||
#include "QtWidgets/qapplication.h"
|
||||
#include "private/qcssparser_p.h"
|
||||
#include "QtGui/qbrush.h"
|
||||
#include "QtGui/qevent.h"
|
||||
#include "private/qcssparser_p.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ private:
|
|||
void setProperties(QWidget *);
|
||||
void setGeometry(QWidget *);
|
||||
void unsetStyleSheetFont(QWidget *) const;
|
||||
QVector<QCss::StyleRule> styleRules(const QObject *obj) const;
|
||||
QList<QCss::StyleRule> styleRules(const QObject *obj) const;
|
||||
bool hasStyleRule(const QObject *obj, int part) const;
|
||||
|
||||
QHash<QStyle::SubControl, QRect> titleBarLayout(const QWidget *w, const QStyleOptionTitleBar *tb) const;
|
||||
|
|
@ -184,7 +184,7 @@ public Q_SLOTS:
|
|||
void objectDestroyed(QObject *);
|
||||
void styleDestroyed(QObject *);
|
||||
public:
|
||||
QHash<const QObject *, QVector<QCss::StyleRule> > styleRulesCache;
|
||||
QHash<const QObject *, QList<QCss::StyleRule>> styleRulesCache;
|
||||
QHash<const QObject *, QHash<int, bool> > hasStyleRuleCache;
|
||||
typedef QHash<int, QHash<quint64, QRenderRule> > QRenderRules;
|
||||
QHash<const QObject *, QRenderRules> renderRulesCache;
|
||||
|
|
|
|||
|
|
@ -220,9 +220,9 @@ const QColor QColormap::colorAt(uint pixel) const
|
|||
return QColor();
|
||||
}
|
||||
|
||||
const QVector<QColor> QColormap::colormap() const
|
||||
const QList<QColor> QColormap::colormap() const
|
||||
{
|
||||
return QVector<QColor>();
|
||||
return QList<QColor>();
|
||||
}
|
||||
|
||||
QColormap &QColormap::operator=(const QColormap &colormap)
|
||||
|
|
|
|||
|
|
@ -41,10 +41,10 @@
|
|||
#define QCOLORMAP_H
|
||||
|
||||
#include <QtWidgets/qtwidgetsglobal.h>
|
||||
#include <QtCore/qatomic.h>
|
||||
#include <QtGui/qrgb.h>
|
||||
#include <QtCore/qvector.h>
|
||||
#include <QtGui/qwindowdefs.h>
|
||||
#include <QtCore/qatomic.h>
|
||||
#include <QtCore/qlist.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ public:
|
|||
uint pixel(const QColor &color) const;
|
||||
const QColor colorAt(uint pixel) const;
|
||||
|
||||
const QVector<QColor> colormap() const;
|
||||
const QList<QColor> colormap() const;
|
||||
|
||||
private:
|
||||
QColormap();
|
||||
|
|
|
|||
|
|
@ -475,7 +475,7 @@ QMatchData QCompletionEngine::filterHistory()
|
|||
const bool isFsModel = false;
|
||||
#endif
|
||||
Q_UNUSED(isFsModel)
|
||||
QVector<int> v;
|
||||
QList<int> v;
|
||||
QIndexMapper im(v);
|
||||
QMatchData m(im, -1, true);
|
||||
|
||||
|
|
@ -783,7 +783,7 @@ QMatchData QUnsortedModelEngine::filter(const QString& part, const QModelIndex&
|
|||
{
|
||||
QMatchData hint;
|
||||
|
||||
QVector<int> v;
|
||||
QList<int> v;
|
||||
QIndexMapper im(v);
|
||||
QMatchData m(im, -1, true);
|
||||
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class QIndexMapper
|
|||
public:
|
||||
QIndexMapper() : v(false), f(0), t(-1) { }
|
||||
QIndexMapper(int f, int t) : v(false), f(f), t(t) { }
|
||||
QIndexMapper(const QVector<int> &vec) : v(true), vector(vec), f(-1), t(-1) { }
|
||||
QIndexMapper(const QList<int> &vec) : v(true), vector(vec), f(-1), t(-1) { }
|
||||
|
||||
inline int count() const { return v ? vector.count() : t - f + 1; }
|
||||
inline int operator[] (int index) const { return v ? vector[index] : f + index; }
|
||||
|
|
@ -127,7 +127,7 @@ public:
|
|||
|
||||
private:
|
||||
bool v;
|
||||
QVector<int> vector;
|
||||
QList<int> vector;
|
||||
int f, t;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -735,7 +735,7 @@ void QSystemTrayIconPrivate::addPlatformMenu(QMenu *menu) const
|
|||
// be higher than 3 levels.
|
||||
const auto actions = menu->actions();
|
||||
for (QAction *action : actions) {
|
||||
QVector<QWidget*> associatedWidgets = action->associatedWidgets();
|
||||
QList<QWidget *> associatedWidgets = action->associatedWidgets();
|
||||
if (action->menu())
|
||||
addPlatformMenu(action->menu());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -543,7 +543,7 @@ void QDockAreaLayoutInfo::fitItems()
|
|||
}
|
||||
#endif
|
||||
|
||||
QVector<QLayoutStruct> layout_struct_list(item_list.size()*2);
|
||||
QList<QLayoutStruct> layout_struct_list(item_list.size() * 2);
|
||||
int j = 0;
|
||||
|
||||
int size = pick(o, rect.size());
|
||||
|
|
@ -853,7 +853,7 @@ static inline int grow(QLayoutStruct &ls, int delta)
|
|||
return ls.size - old_size;
|
||||
}
|
||||
|
||||
static int separatorMoveHelper(QVector<QLayoutStruct> &list, int index, int delta, int sep)
|
||||
static int separatorMoveHelper(QList<QLayoutStruct> &list, int index, int delta, int sep)
|
||||
{
|
||||
// adjust sizes
|
||||
int pos = -1;
|
||||
|
|
@ -937,7 +937,7 @@ int QDockAreaLayoutInfo::separatorMove(int index, int delta)
|
|||
Q_ASSERT(!tabbed);
|
||||
#endif
|
||||
|
||||
QVector<QLayoutStruct> list(item_list.size());
|
||||
QList<QLayoutStruct> list(item_list.size());
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
const QDockAreaLayoutItem &item = item_list.at(i);
|
||||
QLayoutStruct &ls = list[i];
|
||||
|
|
@ -2616,8 +2616,8 @@ void QDockAreaLayout::removePlaceHolder(const QString &name)
|
|||
|
||||
static inline int qMax(int i1, int i2, int i3) { return qMax(i1, qMax(i2, i3)); }
|
||||
|
||||
void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list,
|
||||
QVector<QLayoutStruct> *_hor_struct_list)
|
||||
void QDockAreaLayout::getGrid(QList<QLayoutStruct> *_ver_struct_list,
|
||||
QList<QLayoutStruct> *_hor_struct_list)
|
||||
{
|
||||
QSize center_hint(0, 0);
|
||||
QSize center_min(0, 0);
|
||||
|
|
@ -2670,7 +2670,7 @@ void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list,
|
|||
bottom_hint = bottom_hint.boundedTo(bottom_max).expandedTo(bottom_min);
|
||||
|
||||
if (_ver_struct_list != nullptr) {
|
||||
QVector<QLayoutStruct> &ver_struct_list = *_ver_struct_list;
|
||||
QList<QLayoutStruct> &ver_struct_list = *_ver_struct_list;
|
||||
ver_struct_list.resize(3);
|
||||
|
||||
// top --------------------------------------------------
|
||||
|
|
@ -2732,7 +2732,7 @@ void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list,
|
|||
}
|
||||
|
||||
if (_hor_struct_list != nullptr) {
|
||||
QVector<QLayoutStruct> &hor_struct_list = *_hor_struct_list;
|
||||
QList<QLayoutStruct> &hor_struct_list = *_hor_struct_list;
|
||||
hor_struct_list.resize(3);
|
||||
|
||||
// left --------------------------------------------------
|
||||
|
|
@ -2794,8 +2794,8 @@ void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list,
|
|||
}
|
||||
}
|
||||
|
||||
void QDockAreaLayout::setGrid(QVector<QLayoutStruct> *ver_struct_list,
|
||||
QVector<QLayoutStruct> *hor_struct_list)
|
||||
void QDockAreaLayout::setGrid(QList<QLayoutStruct> *ver_struct_list,
|
||||
QList<QLayoutStruct> *hor_struct_list)
|
||||
{
|
||||
|
||||
// top ---------------------------------------------------
|
||||
|
|
@ -2892,8 +2892,8 @@ void QDockAreaLayout::setGrid(QVector<QLayoutStruct> *ver_struct_list,
|
|||
|
||||
void QDockAreaLayout::fitLayout()
|
||||
{
|
||||
QVector<QLayoutStruct> ver_struct_list(3);
|
||||
QVector<QLayoutStruct> hor_struct_list(3);
|
||||
QList<QLayoutStruct> ver_struct_list(3);
|
||||
QList<QLayoutStruct> hor_struct_list(3);
|
||||
getGrid(&ver_struct_list, &hor_struct_list);
|
||||
|
||||
qGeomCalc(ver_struct_list, 0, 3, rect.top(), rect.height(), sep);
|
||||
|
|
@ -3251,7 +3251,7 @@ int QDockAreaLayout::separatorMove(const QList<int> &separator, const QPoint &or
|
|||
return delta;
|
||||
}
|
||||
|
||||
QVector<QLayoutStruct> list;
|
||||
QList<QLayoutStruct> list;
|
||||
|
||||
if (index == QInternal::LeftDock || index == QInternal::RightDock)
|
||||
getGrid(nullptr, &list);
|
||||
|
|
|
|||
|
|
@ -52,11 +52,10 @@
|
|||
//
|
||||
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include "QtCore/qrect.h"
|
||||
#include "QtCore/qpair.h"
|
||||
#include "QtCore/qlist.h"
|
||||
#include "QtCore/qvector.h"
|
||||
#include "QtWidgets/qlayout.h"
|
||||
#include "QtCore/qlist.h"
|
||||
#include "QtCore/qpair.h"
|
||||
#include "QtCore/qrect.h"
|
||||
|
||||
QT_REQUIRE_CONFIG(dockwidget);
|
||||
|
||||
|
|
@ -193,7 +192,7 @@ public:
|
|||
QMainWindowLayout *mainWindowLayout() const;
|
||||
|
||||
const int *sep;
|
||||
mutable QVector<QWidget*> separatorWidgets;
|
||||
mutable QList<QWidget *> separatorWidgets;
|
||||
QInternal::DockPosition dockPos;
|
||||
Qt::Orientation o;
|
||||
QRect rect;
|
||||
|
|
@ -238,7 +237,7 @@ public:
|
|||
QDockAreaLayoutInfo docks[4];
|
||||
int sep; // separator extent
|
||||
bool fallbackToSizeHints; //determines if we should use the sizehint for the dock areas (true until the layout is restored or the separator is moved by user)
|
||||
mutable QVector<QWidget*> separatorWidgets;
|
||||
mutable QList<QWidget *> separatorWidgets;
|
||||
|
||||
bool isValid() const;
|
||||
|
||||
|
|
@ -296,10 +295,8 @@ public:
|
|||
QLayoutItem *takeAt(int *x, int index);
|
||||
void deleteAllLayoutItems();
|
||||
|
||||
void getGrid(QVector<QLayoutStruct> *ver_struct_list,
|
||||
QVector<QLayoutStruct> *hor_struct_list);
|
||||
void setGrid(QVector<QLayoutStruct> *ver_struct_list,
|
||||
QVector<QLayoutStruct> *hor_struct_list);
|
||||
void getGrid(QList<QLayoutStruct> *ver_struct_list, QList<QLayoutStruct> *hor_struct_list);
|
||||
void setGrid(QList<QLayoutStruct> *ver_struct_list, QList<QLayoutStruct> *hor_struct_list);
|
||||
|
||||
QRect gapRect(const QList<int> &path) const;
|
||||
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ public:
|
|||
bool verticalTitleBar;
|
||||
|
||||
private:
|
||||
QVector<QLayoutItem*> item_list;
|
||||
QList<QLayoutItem *> item_list;
|
||||
QRect _titleArea;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@
|
|||
#include "qtimer.h"
|
||||
#include "qvalidator.h"
|
||||
#include "qvariant.h"
|
||||
#include "qvector.h"
|
||||
#include "qdebug.h"
|
||||
#if QT_CONFIG(textedit)
|
||||
#include "qtextedit.h"
|
||||
|
|
|
|||
|
|
@ -60,9 +60,9 @@
|
|||
#include "QtGui/qpainter.h"
|
||||
#include "QtGui/qevent.h"
|
||||
#endif
|
||||
#include "QtCore/qvector.h"
|
||||
#include "QtCore/qset.h"
|
||||
#include "QtCore/qbasictimer.h"
|
||||
#include "QtCore/qlist.h"
|
||||
#include "QtCore/qset.h"
|
||||
#include "private/qlayoutengine_p.h"
|
||||
#include "private/qwidgetanimator_p.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -409,7 +409,7 @@ void IconTiler::rearrange(QList<QWidget *> &widgets, const QRect &domain) const
|
|||
\internal
|
||||
Calculates the accumulated overlap (intersection area) between 'source' and 'rects'.
|
||||
*/
|
||||
int MinOverlapPlacer::accumulatedOverlap(const QRect &source, const QVector<QRect> &rects)
|
||||
int MinOverlapPlacer::accumulatedOverlap(const QRect &source, const QList<QRect> &rects)
|
||||
{
|
||||
int accOverlap = 0;
|
||||
for (const QRect &rect : rects) {
|
||||
|
|
@ -425,7 +425,7 @@ int MinOverlapPlacer::accumulatedOverlap(const QRect &source, const QVector<QRec
|
|||
Finds among 'source' the rectangle with the minimum accumulated overlap with the
|
||||
rectangles in 'rects'.
|
||||
*/
|
||||
QRect MinOverlapPlacer::findMinOverlapRect(const QVector<QRect> &source, const QVector<QRect> &rects)
|
||||
QRect MinOverlapPlacer::findMinOverlapRect(const QList<QRect> &source, const QList<QRect> &rects)
|
||||
{
|
||||
int minAccOverlap = -1;
|
||||
QRect minAccOverlapRect;
|
||||
|
|
@ -443,16 +443,16 @@ QRect MinOverlapPlacer::findMinOverlapRect(const QVector<QRect> &source, const Q
|
|||
\internal
|
||||
Gets candidates for the final placement.
|
||||
*/
|
||||
QVector<QRect> MinOverlapPlacer::getCandidatePlacements(const QSize &size, const QVector<QRect> &rects,
|
||||
const QRect &domain)
|
||||
QList<QRect> MinOverlapPlacer::getCandidatePlacements(const QSize &size, const QList<QRect> &rects,
|
||||
const QRect &domain)
|
||||
{
|
||||
QVector<QRect> result;
|
||||
QList<QRect> result;
|
||||
|
||||
QVector<int> xlist;
|
||||
QList<int> xlist;
|
||||
xlist.reserve(2 + rects.size());
|
||||
xlist << domain.left() << domain.right() - size.width() + 1;
|
||||
|
||||
QVector<int> ylist;
|
||||
QList<int> ylist;
|
||||
ylist.reserve(2 + rects.size());
|
||||
ylist << domain.top();
|
||||
if (domain.bottom() - size.height() + 1 >= 0)
|
||||
|
|
@ -481,14 +481,14 @@ QVector<QRect> MinOverlapPlacer::getCandidatePlacements(const QSize &size, const
|
|||
Finds all rectangles in 'source' not completely inside 'domain'. The result is stored
|
||||
in 'result' and also removed from 'source'.
|
||||
*/
|
||||
QVector<QRect> MinOverlapPlacer::findNonInsiders(const QRect &domain, QVector<QRect> &source)
|
||||
QList<QRect> MinOverlapPlacer::findNonInsiders(const QRect &domain, QList<QRect> &source)
|
||||
{
|
||||
const auto containedInDomain =
|
||||
[domain](const QRect &srcRect) { return domain.contains(srcRect); };
|
||||
|
||||
const auto firstOut = std::stable_partition(source.begin(), source.end(), containedInDomain);
|
||||
|
||||
QVector<QRect> result;
|
||||
QList<QRect> result;
|
||||
result.reserve(source.end() - firstOut);
|
||||
std::copy(firstOut, source.end(), std::back_inserter(result));
|
||||
|
||||
|
|
@ -502,9 +502,9 @@ QVector<QRect> MinOverlapPlacer::findNonInsiders(const QRect &domain, QVector<QR
|
|||
Finds all rectangles in 'source' that overlaps 'domain' by the maximum overlap area
|
||||
between 'domain' and any rectangle in 'source'. The result is stored in 'result'.
|
||||
*/
|
||||
QVector<QRect> MinOverlapPlacer::findMaxOverlappers(const QRect &domain, const QVector<QRect> &source)
|
||||
QList<QRect> MinOverlapPlacer::findMaxOverlappers(const QRect &domain, const QList<QRect> &source)
|
||||
{
|
||||
QVector<QRect> result;
|
||||
QList<QRect> result;
|
||||
result.reserve(source.size());
|
||||
|
||||
int maxOverlap = -1;
|
||||
|
|
@ -529,15 +529,15 @@ QVector<QRect> MinOverlapPlacer::findMaxOverlappers(const QRect &domain, const Q
|
|||
placement that overlaps the rectangles in 'rects' as little as possible while at the
|
||||
same time being as much as possible inside 'domain'.
|
||||
*/
|
||||
QPoint MinOverlapPlacer::findBestPlacement(const QRect &domain, const QVector<QRect> &rects,
|
||||
QVector<QRect> &source)
|
||||
QPoint MinOverlapPlacer::findBestPlacement(const QRect &domain, const QList<QRect> &rects,
|
||||
QList<QRect> &source)
|
||||
{
|
||||
const QVector<QRect> nonInsiders = findNonInsiders(domain, source);
|
||||
const QList<QRect> nonInsiders = findNonInsiders(domain, source);
|
||||
|
||||
if (!source.empty())
|
||||
return findMinOverlapRect(source, rects).topLeft();
|
||||
|
||||
QVector<QRect> maxOverlappers = findMaxOverlappers(domain, nonInsiders);
|
||||
QList<QRect> maxOverlappers = findMaxOverlappers(domain, nonInsiders);
|
||||
return findMinOverlapRect(maxOverlappers, rects).topLeft();
|
||||
}
|
||||
|
||||
|
|
@ -548,7 +548,7 @@ QPoint MinOverlapPlacer::findBestPlacement(const QRect &domain, const QVector<QR
|
|||
overlaps 'rects' as little as possible and 'domain' as much as possible.
|
||||
Returns the position of the resulting rectangle.
|
||||
*/
|
||||
QPoint MinOverlapPlacer::place(const QSize &size, const QVector<QRect> &rects,
|
||||
QPoint MinOverlapPlacer::place(const QSize &size, const QList<QRect> &rects,
|
||||
const QRect &domain) const
|
||||
{
|
||||
if (size.isEmpty() || !domain.isValid())
|
||||
|
|
@ -558,7 +558,7 @@ QPoint MinOverlapPlacer::place(const QSize &size, const QVector<QRect> &rects,
|
|||
return QPoint();
|
||||
}
|
||||
|
||||
QVector<QRect> candidates = getCandidatePlacements(size, rects, domain);
|
||||
QList<QRect> candidates = getCandidatePlacements(size, rects, domain);
|
||||
return findBestPlacement(domain, rects, candidates);
|
||||
}
|
||||
|
||||
|
|
@ -891,7 +891,7 @@ void QMdiAreaPrivate::place(Placer *placer, QMdiSubWindow *child)
|
|||
return;
|
||||
}
|
||||
|
||||
QVector<QRect> rects;
|
||||
QList<QRect> rects;
|
||||
rects.reserve(childWindows.size());
|
||||
QRect parentRect = q->rect();
|
||||
foreach (QMdiSubWindow *window, childWindows) {
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
QT_REQUIRE_CONFIG(mdiarea);
|
||||
|
||||
#include <QList>
|
||||
#include <QVector>
|
||||
#include <QList>
|
||||
#include <QRect>
|
||||
#include <QPoint>
|
||||
#include <QtWidgets/qapplication.h>
|
||||
|
|
@ -115,20 +115,22 @@ class Placer
|
|||
public:
|
||||
// Places the rectangle defined by 'size' relative to 'rects' and 'domain'.
|
||||
// Returns the position of the resulting rectangle.
|
||||
virtual QPoint place(
|
||||
const QSize &size, const QVector<QRect> &rects, const QRect &domain) const = 0;
|
||||
virtual QPoint place(const QSize &size, const QList<QRect> &rects,
|
||||
const QRect &domain) const = 0;
|
||||
virtual ~Placer() {}
|
||||
};
|
||||
|
||||
class MinOverlapPlacer : public Placer
|
||||
{
|
||||
QPoint place(const QSize &size, const QVector<QRect> &rects, const QRect &domain) const override;
|
||||
static int accumulatedOverlap(const QRect &source, const QVector<QRect> &rects);
|
||||
static QRect findMinOverlapRect(const QVector<QRect> &source, const QVector<QRect> &rects);
|
||||
static QVector<QRect> getCandidatePlacements(const QSize &size, const QVector<QRect> &rects, const QRect &domain);
|
||||
static QPoint findBestPlacement(const QRect &domain, const QVector<QRect> &rects, QVector<QRect> &source);
|
||||
static QVector<QRect> findNonInsiders(const QRect &domain, QVector<QRect> &source);
|
||||
static QVector<QRect> findMaxOverlappers(const QRect &domain, const QVector<QRect> &source);
|
||||
QPoint place(const QSize &size, const QList<QRect> &rects, const QRect &domain) const override;
|
||||
static int accumulatedOverlap(const QRect &source, const QList<QRect> &rects);
|
||||
static QRect findMinOverlapRect(const QList<QRect> &source, const QList<QRect> &rects);
|
||||
static QList<QRect> getCandidatePlacements(const QSize &size, const QList<QRect> &rects,
|
||||
const QRect &domain);
|
||||
static QPoint findBestPlacement(const QRect &domain, const QList<QRect> &rects,
|
||||
QList<QRect> &source);
|
||||
static QList<QRect> findNonInsiders(const QRect &domain, QList<QRect> &source);
|
||||
static QList<QRect> findMaxOverlappers(const QRect &domain, const QList<QRect> &source);
|
||||
};
|
||||
} // namespace QMdi
|
||||
|
||||
|
|
@ -149,9 +151,9 @@ public:
|
|||
#endif
|
||||
QMdiAreaTabBar *tabBar;
|
||||
QList<QMdi::Rearranger *> pendingRearrangements;
|
||||
QVector< QPointer<QMdiSubWindow> > pendingPlacements;
|
||||
QVector< QPointer<QMdiSubWindow> > childWindows;
|
||||
QVector<int> indicesToActivatedChildren;
|
||||
QList<QPointer<QMdiSubWindow>> pendingPlacements;
|
||||
QList<QPointer<QMdiSubWindow>> childWindows;
|
||||
QList<int> indicesToActivatedChildren;
|
||||
QPointer<QMdiSubWindow> active;
|
||||
QPointer<QMdiSubWindow> aboutToBecomeActive;
|
||||
QBrush background;
|
||||
|
|
|
|||
|
|
@ -121,9 +121,9 @@ class QTornOffMenu : public QMenu
|
|||
q->setFixedSize(size);
|
||||
}
|
||||
|
||||
QVector<QPointer<QWidget> > calcCausedStack() const override { return causedStack; }
|
||||
QList<QPointer<QWidget>> calcCausedStack() const override { return causedStack; }
|
||||
QPointer<QMenu> causedMenu;
|
||||
QVector<QPointer<QWidget> > causedStack;
|
||||
QList<QPointer<QWidget>> causedStack;
|
||||
bool initialized;
|
||||
};
|
||||
|
||||
|
|
@ -334,9 +334,9 @@ QRect QMenuPrivate::popupGeometry(int screen) const
|
|||
: QDesktopWidgetPrivate::availableGeometry(screen);
|
||||
}
|
||||
|
||||
QVector<QPointer<QWidget> > QMenuPrivate::calcCausedStack() const
|
||||
QList<QPointer<QWidget>> QMenuPrivate::calcCausedStack() const
|
||||
{
|
||||
QVector<QPointer<QWidget> > ret;
|
||||
QList<QPointer<QWidget>> ret;
|
||||
for(QWidget *widget = causedPopup.widget; widget; ) {
|
||||
ret.append(widget);
|
||||
if (QTornOffMenu *qtmenu = qobject_cast<QTornOffMenu*>(widget))
|
||||
|
|
@ -1387,7 +1387,8 @@ bool QMenuPrivate::mouseEventTaken(QMouseEvent *e)
|
|||
return false;
|
||||
}
|
||||
|
||||
void QMenuPrivate::activateCausedStack(const QVector<QPointer<QWidget> > &causedStack, QAction *action, QAction::ActionEvent action_e, bool self)
|
||||
void QMenuPrivate::activateCausedStack(const QList<QPointer<QWidget>> &causedStack, QAction *action,
|
||||
QAction::ActionEvent action_e, bool self)
|
||||
{
|
||||
QBoolBlocker guard(activationRecursionGuard);
|
||||
if(self)
|
||||
|
|
@ -1435,7 +1436,7 @@ void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e
|
|||
/* I have to save the caused stack here because it will be undone after popup execution (ie in the hide).
|
||||
Then I iterate over the list to actually send the events. --Sam
|
||||
*/
|
||||
const QVector<QPointer<QWidget> > causedStack = calcCausedStack();
|
||||
const QList<QPointer<QWidget>> causedStack = calcCausedStack();
|
||||
if (action_e == QAction::Trigger) {
|
||||
#if QT_CONFIG(whatsthis)
|
||||
if (!inWhatsThisMode)
|
||||
|
|
@ -1497,7 +1498,7 @@ void QMenuPrivate::_q_actionTriggered()
|
|||
if (!activationRecursionGuard && actionGuard) {
|
||||
//in case the action has not been activated by the mouse
|
||||
//we check the parent hierarchy
|
||||
QVector< QPointer<QWidget> > list;
|
||||
QList<QPointer<QWidget>> list;
|
||||
for(QWidget *widget = q->parentWidget(); widget; ) {
|
||||
if (qobject_cast<QMenu*>(widget)
|
||||
#if QT_CONFIG(menubar)
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ public:
|
|||
//item calculations
|
||||
QRect actionRect(QAction *) const;
|
||||
|
||||
mutable QVector<QRect> actionRects;
|
||||
mutable QList<QRect> actionRects;
|
||||
mutable QHash<QAction *, QWidget *> widgetItems;
|
||||
void updateActionRects() const;
|
||||
void updateActionRects(const QRect &screen) const;
|
||||
|
|
@ -437,7 +437,7 @@ public:
|
|||
QPointer<QWidget> widget;
|
||||
QPointer<QAction> action;
|
||||
};
|
||||
virtual QVector<QPointer<QWidget> > calcCausedStack() const;
|
||||
virtual QList<QPointer<QWidget>> calcCausedStack() const;
|
||||
QMenuCaused causedPopup;
|
||||
void hideUpToMenuBar();
|
||||
void hideMenu(QMenu *menu);
|
||||
|
|
@ -462,7 +462,8 @@ public:
|
|||
|
||||
//firing of events
|
||||
void activateAction(QAction *, QAction::ActionEvent, bool self=true);
|
||||
void activateCausedStack(const QVector<QPointer<QWidget> > &, QAction *, QAction::ActionEvent, bool);
|
||||
void activateCausedStack(const QList<QPointer<QWidget>> &, QAction *, QAction::ActionEvent,
|
||||
bool);
|
||||
|
||||
void _q_actionTriggered();
|
||||
void _q_actionHovered();
|
||||
|
|
|
|||
|
|
@ -1383,7 +1383,7 @@ void QMenuBarPrivate::handleReparent()
|
|||
// also a window (for shortcuts)
|
||||
QWidget *newWindow = newParent ? newParent->window() : nullptr;
|
||||
|
||||
QVector<QPointer<QWidget> > newParents;
|
||||
QList<QPointer<QWidget>> newParents;
|
||||
// Remove event filters on ex-parents, keep them on still-parents
|
||||
// The parents are always ordered in the vector
|
||||
foreach (const QPointer<QWidget> &w, oldParents) {
|
||||
|
|
|
|||
|
|
@ -81,8 +81,8 @@ public:
|
|||
//item calculations
|
||||
uint itemsDirty : 1;
|
||||
|
||||
QVector<int> shortcutIndexMap;
|
||||
mutable QVector<QRect> actionRects;
|
||||
QList<int> shortcutIndexMap;
|
||||
mutable QList<QRect> actionRects;
|
||||
void calcActionRects(int max_width, int start) const;
|
||||
QRect actionRect(QAction *) const;
|
||||
void updateGeometries();
|
||||
|
|
@ -124,7 +124,7 @@ public:
|
|||
|
||||
// reparenting
|
||||
void handleReparent();
|
||||
QVector<QPointer<QWidget> > oldParents;
|
||||
QList<QPointer<QWidget>> oldParents;
|
||||
|
||||
QList<QAction*> hiddenActions;
|
||||
//default action
|
||||
|
|
|
|||
|
|
@ -1985,8 +1985,7 @@ void QPlainTextEdit::paintEvent(QPaintEvent *e)
|
|||
fillBackground(&painter, contentsRect, bg);
|
||||
}
|
||||
|
||||
|
||||
QVector<QTextLayout::FormatRange> selections;
|
||||
QList<QTextLayout::FormatRange> selections;
|
||||
int blpos = block.position();
|
||||
int bllen = block.length();
|
||||
for (int i = 0; i < context.selections.size(); ++i) {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@
|
|||
#include "qstyleoption.h"
|
||||
#include "qtextstream.h"
|
||||
#include "qvarlengtharray.h"
|
||||
#include "qvector.h"
|
||||
#include "private/qlayoutengine_p.h"
|
||||
#include "private/qsplitter_p.h"
|
||||
#include "qtimer.h"
|
||||
|
|
@ -484,7 +483,7 @@ void QSplitterPrivate::doResize()
|
|||
Q_Q(QSplitter);
|
||||
QRect r = q->contentsRect();
|
||||
int n = list.count();
|
||||
QVector<QLayoutStruct> a(n*2);
|
||||
QList<QLayoutStruct> a(n * 2);
|
||||
int i;
|
||||
|
||||
bool noStretchFactorsSet = true;
|
||||
|
|
|
|||
|
|
@ -467,7 +467,7 @@ void QTabBarPrivate::layoutTabs()
|
|||
int hiddenTabs = 0;
|
||||
|
||||
Qt::Alignment tabAlignment = Qt::Alignment(q->style()->styleHint(QStyle::SH_TabBar_Alignment, nullptr, q));
|
||||
QVector<QLayoutStruct> tabChain(tabList.count() + 2);
|
||||
QList<QLayoutStruct> tabChain(tabList.count() + 2);
|
||||
|
||||
// We put an empty item at the front and back and set its expansive attribute
|
||||
// depending on tabAlignment and expanding.
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ Q_DECLARE_TYPEINFO(QToolBarAreaLayoutItem, Q_PRIMITIVE_TYPE);
|
|||
class QToolBarAreaLayoutLine
|
||||
{
|
||||
public:
|
||||
QToolBarAreaLayoutLine() {} // for QVector, don't use
|
||||
QToolBarAreaLayoutLine() { } // for QList, don't use
|
||||
QToolBarAreaLayoutLine(Qt::Orientation orientation);
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
|
@ -124,7 +124,7 @@ public:
|
|||
QRect rect;
|
||||
Qt::Orientation o;
|
||||
|
||||
QVector<QToolBarAreaLayoutItem> toolBarItems;
|
||||
QList<QToolBarAreaLayoutItem> toolBarItems;
|
||||
};
|
||||
Q_DECLARE_TYPEINFO(QToolBarAreaLayoutLine, Q_MOVABLE_TYPE);
|
||||
|
||||
|
|
@ -151,7 +151,7 @@ public:
|
|||
QRect itemRect(const QList<int> &path) const;
|
||||
int distance(const QPoint &pos) const;
|
||||
|
||||
QVector<QToolBarAreaLayoutLine> lines;
|
||||
QList<QToolBarAreaLayoutLine> lines;
|
||||
QRect rect;
|
||||
Qt::Orientation o;
|
||||
QInternal::DockPosition dockPos;
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ void QToolBarLayout::updateGeomArray() const
|
|||
that->expanding = false;
|
||||
that->empty = false;
|
||||
|
||||
QVector<QLayoutStruct> a(items.count() + 1); // + 1 for the stretch
|
||||
QList<QLayoutStruct> a(items.count() + 1); // + 1 for the stretch
|
||||
|
||||
int count = 0;
|
||||
for (int i = 0; i < items.count(); ++i) {
|
||||
|
|
@ -468,7 +468,7 @@ bool QToolBarLayout::layoutActions(const QSize &size)
|
|||
int rowPos = perp(o, rect.topLeft()) + perp(o, QSize(margins.top(), margins.left()));
|
||||
int i = 0;
|
||||
while (i < items.count()) {
|
||||
QVector<QLayoutStruct> a = geomArray;
|
||||
QList<QLayoutStruct> a = geomArray;
|
||||
|
||||
int start = i;
|
||||
int size = 0;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include <QtWidgets/qlayout.h>
|
||||
#include <private/qlayoutengine_p.h>
|
||||
#include <QVector>
|
||||
#include <QList>
|
||||
|
||||
QT_REQUIRE_CONFIG(toolbar);
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ private:
|
|||
QList<QToolBarItem*> items;
|
||||
QSize hint, minSize;
|
||||
bool dirty, expanding, empty, expandFlag;
|
||||
QVector<QLayoutStruct> geomArray;
|
||||
QList<QLayoutStruct> geomArray;
|
||||
QRect handRect;
|
||||
QToolBarExtension *extension;
|
||||
|
||||
|
|
|
|||
|
|
@ -578,7 +578,7 @@ void QWidgetLineControl::processInputMethodEvent(QInputMethodEvent *event)
|
|||
const int oldPreeditCursor = m_preeditCursor;
|
||||
m_preeditCursor = event->preeditString().length();
|
||||
m_hideCursor = false;
|
||||
QVector<QTextLayout::FormatRange> formats;
|
||||
QList<QTextLayout::FormatRange> formats;
|
||||
formats.reserve(event->attributes().size());
|
||||
for (int i = 0; i < event->attributes().size(); ++i) {
|
||||
const QInputMethodEvent::Attribute &a = event->attributes().at(i);
|
||||
|
|
@ -627,7 +627,7 @@ void QWidgetLineControl::processInputMethodEvent(QInputMethodEvent *event)
|
|||
*/
|
||||
void QWidgetLineControl::draw(QPainter *painter, const QPoint &offset, const QRect &clip, int flags)
|
||||
{
|
||||
QVector<QTextLayout::FormatRange> selections;
|
||||
QList<QTextLayout::FormatRange> selections;
|
||||
if (flags & DrawSelections) {
|
||||
QTextLayout::FormatRange o;
|
||||
if (m_selstart < m_selend) {
|
||||
|
|
|
|||
|
|
@ -2067,7 +2067,7 @@ void QWidgetTextControlPrivate::inputMethodEvent(QInputMethodEvent *e)
|
|||
QTextLayout *layout = block.layout();
|
||||
if (isGettingInput)
|
||||
layout->setPreeditArea(cursor.position() - block.position(), e->preeditString());
|
||||
QVector<QTextLayout::FormatRange> overrides;
|
||||
QList<QTextLayout::FormatRange> overrides;
|
||||
overrides.reserve(e->attributes().size());
|
||||
const int oldPreeditCursor = preeditCursor;
|
||||
preeditCursor = e->preeditString().length();
|
||||
|
|
@ -2087,9 +2087,9 @@ void QWidgetTextControlPrivate::inputMethodEvent(QInputMethodEvent *e)
|
|||
o.format = f;
|
||||
|
||||
// Make sure list is sorted by start index
|
||||
QVector<QTextLayout::FormatRange>::iterator it = overrides.end();
|
||||
QList<QTextLayout::FormatRange>::iterator it = overrides.end();
|
||||
while (it != overrides.begin()) {
|
||||
QVector<QTextLayout::FormatRange>::iterator previous = it - 1;
|
||||
QList<QTextLayout::FormatRange>::iterator previous = it - 1;
|
||||
if (o.start >= previous->start) {
|
||||
overrides.insert(it, o);
|
||||
break;
|
||||
|
|
@ -2107,7 +2107,7 @@ void QWidgetTextControlPrivate::inputMethodEvent(QInputMethodEvent *e)
|
|||
int start = cursor.position() - block.position();
|
||||
int end = start + e->preeditString().length();
|
||||
|
||||
QVector<QTextLayout::FormatRange>::iterator it = overrides.begin();
|
||||
QList<QTextLayout::FormatRange>::iterator it = overrides.begin();
|
||||
while (it != overrides.end()) {
|
||||
QTextLayout::FormatRange range = *it;
|
||||
int rangeStart = range.start;
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ public:
|
|||
int preeditCursor;
|
||||
bool hideCursor; // used to hide the cursor in the preedit area
|
||||
|
||||
QVector<QAbstractTextDocumentLayout::Selection> extraSelections;
|
||||
QList<QAbstractTextDocumentLayout::Selection> extraSelections;
|
||||
|
||||
QPalette palette;
|
||||
bool hasFocus;
|
||||
|
|
|
|||
Loading…
Reference in New Issue