Use nullptr everywhere

Differential Revision: https://phabricator.kde.org/D3987
wilder
Kevin Funk 9 years ago
parent 94b9398183
commit 1c02848a4d
  1. 4
      autotests/kdescendantsproxymodel_smoketest.cpp
  2. 2
      autotests/kextracolumnsproxymodeltest.cpp
  3. 10
      autotests/klinkitemselectionmodeltest.cpp
  4. 4
      autotests/krecursivefilterproxymodeltest.cpp
  5. 2
      autotests/kselectionproxymodeltest.cpp
  6. 10
      autotests/kselectionproxymodeltestsuite.h
  7. 16
      autotests/proxymodeltestsuite/dynamictreemodel.h
  8. 2
      autotests/proxymodeltestsuite/dynamictreewidget.h
  9. 2
      autotests/proxymodeltestsuite/eventloggerregister.cpp
  10. 2
      autotests/proxymodeltestsuite/indexfinder.h
  11. 2
      autotests/proxymodeltestsuite/modelcommander.cpp
  12. 2
      autotests/proxymodeltestsuite/modeleventlogger.cpp
  13. 6
      autotests/proxymodeltestsuite/modeleventlogger.h
  14. 6
      autotests/proxymodeltestsuite/modelselector.cpp
  15. 6
      autotests/proxymodeltestsuite/modelselector.h
  16. 4
      autotests/proxymodeltestsuite/modelspy.cpp
  17. 4
      autotests/proxymodeltestsuite/modeltest.h
  18. 18
      autotests/proxymodeltestsuite/proxymodeltest.cpp
  19. 4
      autotests/proxymodeltestsuite/proxymodeltest.h
  20. 4
      src/kbreadcrumbselectionmodel.h
  21. 2
      src/kcheckableproxymodel.cpp
  22. 2
      src/kcheckableproxymodel.h
  23. 4
      src/kconcatenaterowsproxymodel.cpp
  24. 2
      src/kconcatenaterowsproxymodel.h
  25. 2
      src/kdescendantsproxymodel.h
  26. 2
      src/kextracolumnsproxymodel.h
  27. 2
      src/klinkitemselectionmodel.h
  28. 2
      src/kmodelindexproxymapper.h
  29. 2
      src/krearrangecolumnsproxymodel.h
  30. 2
      src/krecursivefilterproxymodel.h
  31. 8
      src/kselectionproxymodel.cpp
  32. 2
      src/kselectionproxymodel.h
  33. 8
      src/kvoidpointerfactory_p.h
  34. 2
      tests/proxymodeltestapp/breadcrumbdirectionwidget.h
  35. 12
      tests/proxymodeltestapp/breadcrumbnavigationwidget.h
  36. 4
      tests/proxymodeltestapp/breadcrumbswidget.h
  37. 2
      tests/proxymodeltestapp/checkablewidget.h
  38. 2
      tests/proxymodeltestapp/descendantpmwidget.h
  39. 2
      tests/proxymodeltestapp/kidentityproxymodelwidget.h
  40. 2
      tests/proxymodeltestapp/kreparentingproxymodel.cpp
  41. 2
      tests/proxymodeltestapp/kreparentingproxymodel.h
  42. 2
      tests/proxymodeltestapp/lessthanwidget.cpp
  43. 4
      tests/proxymodeltestapp/lessthanwidget.h
  44. 2
      tests/proxymodeltestapp/matchcheckingwidget.h
  45. 2
      tests/proxymodeltestapp/modelcommanderwidget.h
  46. 2
      tests/proxymodeltestapp/proxyitemselectionwidget.h
  47. 2
      tests/proxymodeltestapp/proxymodeltestwidget.h
  48. 4
      tests/proxymodeltestapp/recursivefilterpmwidget.h
  49. 2
      tests/proxymodeltestapp/reparentingpmwidget.h
  50. 4
      tests/proxymodeltestapp/scriptablereparentingwidget.h
  51. 2
      tests/proxymodeltestapp/selectioninqmlwidget.h
  52. 2
      tests/proxymodeltestapp/selectionpmwidget.h

@ -29,7 +29,7 @@ class TestData : public ProxyModelTestData
{
Q_OBJECT
public:
TestData(ProxyModelTest *parent = 0)
TestData(ProxyModelTest *parent = nullptr)
: ProxyModelTestData(parent)
{
@ -216,7 +216,7 @@ class DescendantsProxyModelTest : public ProxyModelTest
{
Q_OBJECT
public:
DescendantsProxyModelTest(QObject *parent = 0)
DescendantsProxyModelTest(QObject *parent = nullptr)
: ProxyModelTest(parent)
{
}

@ -395,7 +395,7 @@ private Q_SLOTS:
QCOMPARE(QModelIndex(persistentIndex), proxy.mapFromSource(sourcePersistentIndex));
});
ModelMoveLayoutChangeCommand layoutChangeCommand(&model, 0);
ModelMoveLayoutChangeCommand layoutChangeCommand(&model, nullptr);
layoutChangeCommand.setAncestorRowNumbers({0, 0, 0});
layoutChangeCommand.setStartRow(0);

@ -48,13 +48,13 @@ void KLinkItemSelectionModelTest::init()
void KLinkItemSelectionModelTest::cleanup()
{
delete m_mainSelectionModel;
m_mainSelectionModel = 0;
m_mainSelectionModel = nullptr;
delete m_mainModel;
m_mainModel = 0;
m_mainModel = nullptr;
delete m_subSelectionModel;
m_subSelectionModel = 0;
m_subSelectionModel = nullptr;
delete m_subModel;
m_subModel = 0;
m_subModel = nullptr;
}
void KLinkItemSelectionModelTest::testToggle()
@ -170,7 +170,7 @@ void KLinkItemSelectionModelTest::testChangeLinkedSelectionModel()
QCOMPARE(m_mainSelectionModel->selection().indexes().first().row(), 6);
QCOMPARE(m_subSelectionModel->selection().indexes().first().row(), 1);
QItemSelectionModel replacementSelectionModel(m_mainModel, 0);
QItemSelectionModel replacementSelectionModel(m_mainModel, nullptr);
{
auto idx = m_mainModel->index(7, 0);
replacementSelectionModel.select(idx, QItemSelectionModel::Select);

@ -131,7 +131,7 @@ static QString treeAsString(const QAbstractItemModel &model, const QModelIndex &
static void fillModel(QStandardItemModel &model, const QString &str)
{
QCOMPARE(str.count('['), str.count(']'));
QStandardItem *item = 0;
QStandardItem *item = nullptr;
QString data;
for ( int i = 0 ; i < str.length() ; ++i ) {
const QChar ch = str.at(i);
@ -623,7 +623,7 @@ private Q_SLOTS:
private:
QStandardItem *itemByText(const QStandardItemModel& model, const QString &text) const {
QModelIndexList list = model.match(model.index(0, 0), Qt::DisplayRole, text, 1, Qt::MatchRecursive);
return list.isEmpty() ? 0 : model.itemFromIndex(list.first());
return list.isEmpty() ? nullptr : model.itemFromIndex(list.first());
}
};

@ -36,7 +36,7 @@ class KSelectionProxyModelTest : public QObject
{
Q_OBJECT
public:
KSelectionProxyModelTest(QObject* parent = 0)
KSelectionProxyModelTest(QObject* parent = nullptr)
: QObject(parent),
days({
QStringLiteral("Monday"),

@ -29,10 +29,10 @@ class SelectionProxyModelTest : public ProxyModelTest
{
Q_OBJECT
public:
SelectionProxyModelTest(QObject *parent = 0)
SelectionProxyModelTest(QObject *parent = nullptr)
: ProxyModelTest(parent),
m_selectionModel(0),
m_modelSelector(0)
m_selectionModel(nullptr),
m_modelSelector(nullptr)
{
}
@ -66,7 +66,7 @@ private Q_SLOTS:
{
doCleanupTestCase();
delete m_modelSelector;
m_modelSelector = 0;
m_modelSelector = nullptr;
}
void cleanup()
@ -162,7 +162,7 @@ template< int num1 = 0,
class ImmediateSelectionStrategy : public ModelSelector
{
public:
ImmediateSelectionStrategy(ProxyModelTest *parent = 0)
ImmediateSelectionStrategy(ProxyModelTest *parent = nullptr)
: ModelSelector(parent)
{
if (num1 > 0) {

@ -45,7 +45,7 @@ public:
LastRole
};
explicit DynamicTreeModel(QObject *parent = 0);
explicit DynamicTreeModel(QObject *parent = nullptr);
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
QModelIndex parent(const QModelIndex &index) const Q_DECL_OVERRIDE;
@ -110,7 +110,7 @@ class PROXYMODELTESTSUITE_EXPORT ModelChangeCommand : public QObject
Q_OBJECT
public:
ModelChangeCommand(DynamicTreeModel *model, QObject *parent = 0);
ModelChangeCommand(DynamicTreeModel *model, QObject *parent = nullptr);
virtual ~ModelChangeCommand() {}
@ -226,7 +226,7 @@ class PROXYMODELTESTSUITE_EXPORT ModelInsertCommand : public ModelChangeCommand
public:
explicit ModelInsertCommand(DynamicTreeModel *model, QObject *parent = 0);
explicit ModelInsertCommand(DynamicTreeModel *model, QObject *parent = nullptr);
virtual ~ModelInsertCommand() {}
void interpret(const QString &treeString);
@ -248,7 +248,7 @@ class PROXYMODELTESTSUITE_EXPORT ModelInsertAndRemoveQueuedCommand : public Mode
public:
explicit ModelInsertAndRemoveQueuedCommand(DynamicTreeModel *model, QObject *parent = 0);
explicit ModelInsertAndRemoveQueuedCommand(DynamicTreeModel *model, QObject *parent = nullptr);
virtual ~ModelInsertAndRemoveQueuedCommand() {}
void doCommand() Q_DECL_OVERRIDE;
@ -273,7 +273,7 @@ class PROXYMODELTESTSUITE_EXPORT ModelRemoveCommand : public ModelChangeCommand
{
Q_OBJECT
public:
explicit ModelRemoveCommand(DynamicTreeModel *model, QObject *parent = 0);
explicit ModelRemoveCommand(DynamicTreeModel *model, QObject *parent = nullptr);
virtual ~ModelRemoveCommand() {}
void doCommand() Q_DECL_OVERRIDE;
@ -285,7 +285,7 @@ class PROXYMODELTESTSUITE_EXPORT ModelDataChangeCommand : public ModelChangeComm
{
Q_OBJECT
public:
explicit ModelDataChangeCommand(DynamicTreeModel *model, QObject *parent = 0);
explicit ModelDataChangeCommand(DynamicTreeModel *model, QObject *parent = nullptr);
virtual ~ModelDataChangeCommand() {}
@ -364,7 +364,7 @@ class PROXYMODELTESTSUITE_EXPORT ModelResetCommand : public ModelChangeCommand
{
Q_OBJECT
public:
ModelResetCommand(DynamicTreeModel *model, QObject *parent = 0);
ModelResetCommand(DynamicTreeModel *model, QObject *parent = nullptr);
virtual ~ModelResetCommand();
void setInitialTree(const QString &treeString);
@ -378,7 +378,7 @@ class PROXYMODELTESTSUITE_EXPORT ModelLayoutChangeCommand : public ModelChangeCo
{
Q_OBJECT
public:
ModelLayoutChangeCommand(DynamicTreeModel *model, QObject *parent = 0);
ModelLayoutChangeCommand(DynamicTreeModel *model, QObject *parent = nullptr);
virtual ~ModelLayoutChangeCommand();
struct PersistentChange {

@ -37,7 +37,7 @@ class PROXYMODELTESTSUITE_EXPORT DynamicTreeWidget : public QWidget
{
Q_OBJECT
public:
DynamicTreeWidget(DynamicTreeModel *rootModel, QWidget *parent = 0, Qt::WindowFlags f = 0);
DynamicTreeWidget(DynamicTreeModel *rootModel, QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
void setInitialTree(const QString &treeString);

@ -29,7 +29,7 @@ EventLoggerRegister::~EventLoggerRegister()
{
}
EventLoggerRegister *EventLoggerRegister::s_instance = 0;
EventLoggerRegister *EventLoggerRegister::s_instance = nullptr;
std::auto_ptr<EventLoggerRegister> EventLoggerRegister::s_destroyer;
EventLoggerRegister *EventLoggerRegister::instance(Behaviour behaviour)

@ -25,7 +25,7 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
class IndexFinder
{
public:
IndexFinder(QList<int> rows = QList<int>()) : m_rows(rows), m_model(0) {}
IndexFinder(QList<int> rows = QList<int>()) : m_rows(rows), m_model(nullptr) {}
IndexFinder(const QAbstractItemModel *model, QList<int> rows = QList<int>())
: m_rows(rows), m_model(model)

@ -250,7 +250,7 @@ void ModelCommander::execute(ModelChangeCommand *command)
m_currentCommand = command;
command->doCommand();
delete command;
command = 0;
command = nullptr;
}
ModelChangeCommand *ModelCommander::currentCommand()

@ -68,7 +68,7 @@ public:
class ModelWrapper : public QAbstractItemModel
{
public:
ModelWrapper(QAbstractItemModel */*model*/, QObject *parent = 0)
ModelWrapper(QAbstractItemModel */*model*/, QObject *parent = nullptr)
: QAbstractItemModel(parent)
{

@ -37,7 +37,7 @@ class PROXYMODELTESTSUITE_EXPORT PersistentChange : public QObject
Q_PROPERTY(QString newPath READ getNewPath)
public:
PersistentChange(QObject *parent = 0)
PersistentChange(QObject *parent = nullptr)
: QObject(parent)
{
@ -95,7 +95,7 @@ private:
Q_PROPERTY(QVariantList changes READ changes)
public:
ModelEvent(QObject *parent = 0);
ModelEvent(QObject *parent = nullptr);
// Type type() const;
QString type() const;
@ -150,7 +150,7 @@ class PROXYMODELTESTSUITE_EXPORT ModelEventLogger : public QObject
{
Q_OBJECT
public:
ModelEventLogger(QAbstractItemModel *model, QObject *parent = 0);
ModelEventLogger(QAbstractItemModel *model, QObject *parent = nullptr);
void writeLog();
virtual ~ModelEventLogger();

@ -21,9 +21,9 @@
ModelSelector::ModelSelector(ProxyModelTest *parent)
: ProxyModelTestData(parent),
m_model(0),
m_selectionModel(0),
m_rootModel(0)
m_model(nullptr),
m_selectionModel(nullptr),
m_rootModel(nullptr)
{
Q_ASSERT(parent);
}

@ -36,7 +36,7 @@ class PROXYMODELTESTSUITE_EXPORT ModelSelector : public ProxyModelTestData
{
Q_OBJECT
public:
ModelSelector(ProxyModelTest *ProxyModelTest = 0);
ModelSelector(ProxyModelTest *ProxyModelTest = nullptr);
void setWatchedModel(QAbstractItemModel *model);
@ -128,8 +128,8 @@ public Q_SLOTS:
protected Q_SLOTS:
void modelDestroyed()
{
m_model = 0;
m_selectionModel = 0;
m_model = nullptr;
m_selectionModel = nullptr;
}
protected:

@ -22,7 +22,7 @@
#include <QDebug>
ModelSpy::ModelSpy(QObject *parent)
: QObject(parent), QList<QVariantList>(), m_model(0), m_isSpying(false), m_lazyPersist(false)
: QObject(parent), QList<QVariantList>(), m_model(nullptr), m_isSpying(false), m_lazyPersist(false)
{
}
@ -169,7 +169,7 @@ void ModelSpy::modelReset()
void ModelSpy::modelDestroyed()
{
stopSpying();
m_model = 0;
m_model = nullptr;
}
void ModelSpy::rowsAboutToBeMoved(const QModelIndex &srcParent, int start, int end, const QModelIndex &destParent, int destStart)

@ -36,8 +36,8 @@ public:
Pedantic
};
ModelTest( QAbstractItemModel *model, QObject *parent = 0 );
ModelTest( QAbstractItemModel *model, Mode testType, QObject *parent = 0 );
ModelTest( QAbstractItemModel *model, QObject *parent = nullptr );
ModelTest( QAbstractItemModel *model, Mode testType, QObject *parent = nullptr );
private Q_SLOTS:
void nonDestructiveBasicTest();

@ -30,8 +30,8 @@ ProxyModelTest::ProxyModelTest(QObject *parent)
: QObject(parent),
m_rootModel(new DynamicTreeModel(this)),
m_sourceModel(m_rootModel),
m_proxyModel(0),
m_intermediateProxyModel(0),
m_proxyModel(nullptr),
m_intermediateProxyModel(nullptr),
m_modelSpy(new ModelSpy(this)),
m_modelCommander(new ModelCommander(m_rootModel, this))
{
@ -108,7 +108,7 @@ void ProxyModelTest::init()
const char *currentTest = QTest::currentTestFunction();
const char *currentTag = QTest::currentDataTag();
QVERIFY(currentTest != 0);
QVERIFY(currentTest != nullptr);
initRootModel(m_rootModel, currentTest, currentTag);
Q_ASSERT(sourceModel());
@ -143,10 +143,10 @@ void ProxyModelTest::cleanup()
{
QVERIFY(m_modelSpy->isEmpty());
m_modelSpy->stopSpying();
m_modelSpy->setModel(0);
m_proxyModel->setSourceModel(0);
m_modelSpy->setModel(nullptr);
m_proxyModel->setSourceModel(nullptr);
delete m_proxyModel;
m_proxyModel = 0;
m_proxyModel = nullptr;
QVERIFY(m_modelSpy->isEmpty());
}
@ -160,7 +160,7 @@ void ProxyModelTest::cleanupTestCase()
m_sourceModel = m_rootModel;
delete m_intermediateProxyModel;
m_intermediateProxyModel = 0;
m_intermediateProxyModel = nullptr;
m_modelSpy->clear();
}
@ -320,7 +320,7 @@ void ProxyModelTest::testSourceReset()
testMappings();
m_rootModel->clear(); // Resets the model.
testMappings(); // Calls some rowCount() etc which should test internal structures in the proxy.
m_proxyModel->setSourceModel(0);
m_proxyModel->setSourceModel(nullptr);
m_modelSpy->startSpying();
}
@ -352,7 +352,7 @@ void ProxyModelTest::testDestroyModel()
if (proxyModel->hasChildren()) {
m_modelSpy->startSpying();
delete m_sourceModel;
m_sourceModel = 0;
m_sourceModel = nullptr;
m_modelSpy->stopSpying();
testMappings();
// QCOMPARE(m_modelSpy->size(), 1);

@ -122,7 +122,7 @@ class PROXYMODELTESTSUITE_EXPORT ProxyModelTest : public QObject, protected Buil
{
Q_OBJECT
public:
ProxyModelTest(QObject *parent = 0);
ProxyModelTest(QObject *parent = nullptr);
virtual ~ProxyModelTest() {}
void setLazyPersistence(Persistence persistence);
@ -359,7 +359,7 @@ class PROXYMODELTESTSUITE_EXPORT ProxyModelTestData : public QObject, BuiltinTes
{
Q_OBJECT
public:
ProxyModelTestData(ProxyModelTest *parent = 0)
ProxyModelTestData(ProxyModelTest *parent = nullptr)
: QObject(parent), m_proxyModelTest(parent)
{
}

@ -115,8 +115,8 @@ public:
MakeBreadcrumbSelectionInSelf
};
explicit KBreadcrumbSelectionModel(QItemSelectionModel *selectionModel, QObject *parent = 0);
KBreadcrumbSelectionModel(QItemSelectionModel *selectionModel, BreadcrumbTarget target, QObject *parent = 0);
explicit KBreadcrumbSelectionModel(QItemSelectionModel *selectionModel, QObject *parent = nullptr);
KBreadcrumbSelectionModel(QItemSelectionModel *selectionModel, BreadcrumbTarget target, QObject *parent = nullptr);
virtual ~KBreadcrumbSelectionModel();
/**

@ -28,7 +28,7 @@ class KCheckableProxyModelPrivate
KCheckableProxyModelPrivate(KCheckableProxyModel *checkableModel)
: q_ptr(checkableModel),
m_itemSelectionModel(0)
m_itemSelectionModel(nullptr)
{
}

@ -65,7 +65,7 @@ class KITEMMODELS_EXPORT KCheckableProxyModel : public QIdentityProxyModel
{
Q_OBJECT
public:
KCheckableProxyModel(QObject *parent = 0);
KCheckableProxyModel(QObject *parent = nullptr);
~KCheckableProxyModel();
void setSelectionModel(QItemSelectionModel *itemSelectionModel);

@ -206,7 +206,7 @@ void KConcatenateRowsProxyModel::addSourceModel(QAbstractItemModel *sourceModel)
void KConcatenateRowsProxyModel::removeSourceModel(QAbstractItemModel *sourceModel)
{
Q_ASSERT(d->m_models.contains(sourceModel));
disconnect(sourceModel, 0, this, 0);
disconnect(sourceModel, nullptr, this, nullptr);
const int rowsRemoved = sourceModel->rowCount();
const int rowsPrior = d->computeRowsPrior(sourceModel); // location of removed section
@ -397,7 +397,7 @@ int KConcatenateRowsProxyModelPrivate::computeRowsPrior(const QAbstractItemModel
QAbstractItemModel *KConcatenateRowsProxyModelPrivate::sourceModelForRow(int row, int *sourceRow) const
{
int rowCount = 0;
QAbstractItemModel *selection = NULL;
QAbstractItemModel *selection = nullptr;
foreach (QAbstractItemModel *model, m_models) {
const int subRowCount = model->rowCount();
if (rowCount + subRowCount > row) {

@ -64,7 +64,7 @@ public:
* Creates a KConcatenateRowsProxyModel.
* @param parent optional parent
*/
KConcatenateRowsProxyModel(QObject *parent = 0);
KConcatenateRowsProxyModel(QObject *parent = nullptr);
/**
* Destructor.
*/

@ -77,7 +77,7 @@ public:
*
* @param parent The parent object.
*/
explicit KDescendantsProxyModel(QObject *parent = 0);
explicit KDescendantsProxyModel(QObject *parent = nullptr);
/**
* Destroys the descendant entities proxy model.

@ -54,7 +54,7 @@ public:
* Base class constructor.
* Remember to call setSourceModel afterwards, and appendColumn.
*/
explicit KExtraColumnsProxyModel(QObject *parent = 0);
explicit KExtraColumnsProxyModel(QObject *parent = nullptr);
/**
* Destructor.
*/

@ -103,7 +103,7 @@ public:
/**
Constructor.
*/
KLinkItemSelectionModel(QAbstractItemModel *targetModel, QItemSelectionModel *linkedItemSelectionModel, QObject *parent = 0);
KLinkItemSelectionModel(QAbstractItemModel *targetModel, QItemSelectionModel *linkedItemSelectionModel, QObject *parent = nullptr);
explicit KLinkItemSelectionModel(QObject *parent = Q_NULLPTR);

@ -95,7 +95,7 @@ public:
/**
* Constructor
*/
KModelIndexProxyMapper(const QAbstractItemModel *leftModel, const QAbstractItemModel *rightModel, QObject *parent = 0);
KModelIndexProxyMapper(const QAbstractItemModel *leftModel, const QAbstractItemModel *rightModel, QObject *parent = nullptr);
~KModelIndexProxyMapper();

@ -47,7 +47,7 @@ public:
* Creates a KRearrangeColumnsProxyModel proxy.
* Remember to call setSourceModel afterwards.
*/
explicit KRearrangeColumnsProxyModel(QObject *parent = 0);
explicit KRearrangeColumnsProxyModel(QObject *parent = nullptr);
/**
* Destructor.
*/

@ -90,7 +90,7 @@ public:
/**
Constructor
*/
explicit KRecursiveFilterProxyModel(QObject *parent = 0);
explicit KRecursiveFilterProxyModel(QObject *parent = nullptr);
/**
Destructor

@ -408,7 +408,7 @@ class KSelectionProxyModelPrivate
public:
KSelectionProxyModelPrivate(KSelectionProxyModel *model)
: q_ptr(model),
m_indexMapper(0),
m_indexMapper(nullptr),
m_startWithChildTrees(false),
m_omitChildren(false),
m_omitDescendants(false),
@ -423,7 +423,7 @@ public:
m_layoutChanging(false),
m_ignoreNextLayoutAboutToBeChanged(false),
m_ignoreNextLayoutChanged(false),
m_selectionModel(0),
m_selectionModel(nullptr),
m_filterBehavior(KSelectionProxyModel::InvalidBehavior)
{
}
@ -2013,7 +2013,7 @@ KSelectionProxyModel::KSelectionProxyModel(QItemSelectionModel *selectionModel,
}
KSelectionProxyModel::KSelectionProxyModel()
: QAbstractProxyModel(0), d_ptr(new KSelectionProxyModelPrivate(this))
: QAbstractProxyModel(nullptr), d_ptr(new KSelectionProxyModelPrivate(this))
{
}
@ -2169,7 +2169,7 @@ QModelIndex KSelectionProxyModel::mapToSource(const QModelIndex &proxyIndex) con
Q_ASSERT(proxyIndex.model() == this);
if (proxyIndex.internalPointer() == 0) {
if (proxyIndex.internalPointer() == nullptr) {
return d->mapTopLevelToSource(proxyIndex.row(), proxyIndex.column());
}

@ -96,7 +96,7 @@ public:
@p selectionModel The selection model used to filter what is presented by the proxy.
*/
// KF6: Remove the selectionModel from the constructor here.
explicit KSelectionProxyModel(QItemSelectionModel *selectionModel, QObject *parent = 0);
explicit KSelectionProxyModel(QItemSelectionModel *selectionModel, QObject *parent = nullptr);
/**
Default constructor. Allow the creation of a KSelectionProxyModel in QML

@ -51,8 +51,8 @@ class KVoidPointerFactory
public:
KVoidPointerFactory()
: m_previousPointer(0),
m_finalPointer(0)
: m_previousPointer(nullptr),
m_finalPointer(nullptr)
{
}
@ -82,8 +82,8 @@ public:
free(*it);
}
m_blocks.clear();
m_finalPointer = 0;
m_previousPointer = 0;
m_finalPointer = nullptr;
m_previousPointer = nullptr;
}
void *createPointer() const

@ -28,7 +28,7 @@ class BreadcrumbDirectionWidget : public QWidget
{
Q_OBJECT
public:
BreadcrumbDirectionWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
BreadcrumbDirectionWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
protected:
bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE;

@ -34,7 +34,7 @@ class CurrentItemLabel : public QLabel
{
Q_OBJECT
public:
CurrentItemLabel(QAbstractItemModel *model, QWidget *parent = 0, Qt::WindowFlags f = 0);
CurrentItemLabel(QAbstractItemModel *model, QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
private Q_SLOTS:
void rowsInserted(const QModelIndex &parent, int start, int end);
@ -50,7 +50,7 @@ class KBreadcrumbNavigationProxyModel : public KSelectionProxyModel
{
Q_OBJECT
public:
KBreadcrumbNavigationProxyModel(QItemSelectionModel *selectionModel, QObject *parent = 0);
KBreadcrumbNavigationProxyModel(QItemSelectionModel *selectionModel, QObject *parent = nullptr);
void setShowHiddenAscendantData(bool showHiddenAscendantData);
bool showHiddenAscendantData() const;
@ -66,7 +66,7 @@ class KNavigatingProxyModel : public KSelectionProxyModel
{
Q_OBJECT
public:
KNavigatingProxyModel(QItemSelectionModel *selectionModel, QObject *parent = 0);
KNavigatingProxyModel(QItemSelectionModel *selectionModel, QObject *parent = nullptr);
void setSourceModel(QAbstractItemModel *sourceModel) Q_DECL_OVERRIDE;
@ -94,8 +94,8 @@ public:
Forward,
Reverse
};
KForwardingItemSelectionModel(QAbstractItemModel *model, QItemSelectionModel *selectionModel, QObject *parent = 0);
KForwardingItemSelectionModel(QAbstractItemModel *model, QItemSelectionModel *selectionModel, Direction direction, QObject *parent = 0);
KForwardingItemSelectionModel(QAbstractItemModel *model, QItemSelectionModel *selectionModel, QObject *parent = nullptr);
KForwardingItemSelectionModel(QAbstractItemModel *model, QItemSelectionModel *selectionModel, Direction direction, QObject *parent = nullptr);
void select(const QModelIndex &index, SelectionFlags command) Q_DECL_OVERRIDE;
void select(const QItemSelection &selection, SelectionFlags command) Q_DECL_OVERRIDE;
@ -112,7 +112,7 @@ class BreadcrumbNavigationWidget : public QWidget
{
Q_OBJECT
public:
BreadcrumbNavigationWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
BreadcrumbNavigationWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
};

@ -34,7 +34,7 @@ class MultiSelectionModel : public QItemSelectionModel
{
Q_OBJECT
public:
MultiSelectionModel(QAbstractItemModel *model, QList<QItemSelectionModel *> selectionModels, QObject *parent = 0);
MultiSelectionModel(QAbstractItemModel *model, QList<QItemSelectionModel *> selectionModels, QObject *parent = nullptr);
public:
void select(const QModelIndex &index, SelectionFlags command) Q_DECL_OVERRIDE;
@ -48,7 +48,7 @@ class BreadcrumbsWidget : public QWidget
{
Q_OBJECT
public:
BreadcrumbsWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
BreadcrumbsWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
};

@ -28,7 +28,7 @@ class CheckableWidget : public QWidget
{
Q_OBJECT
public:
CheckableWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
CheckableWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
};

@ -38,7 +38,7 @@ class DescendantProxyModelWidget : public QWidget
{
Q_OBJECT
public:
DescendantProxyModelWidget(QWidget *parent = 0);
DescendantProxyModelWidget(QWidget *parent = nullptr);
virtual ~DescendantProxyModelWidget();
protected Q_SLOTS:

@ -28,7 +28,7 @@ class KIdentityProxyModelWidget : public QWidget
{
Q_OBJECT
public:
KIdentityProxyModelWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
KIdentityProxyModelWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
};
#endif

@ -68,7 +68,7 @@ class KReparentingProxyModelPrivate
If @p model is 0, the sourceModel is used
Returns an invalid index if there is no index below @p index.
*/
QModelIndex getIndexBelow(const QModelIndex &index, QAbstractItemModel *model = 0) const;
QModelIndex getIndexBelow(const QModelIndex &index, QAbstractItemModel *model = nullptr) const;
/**
Returns the last descendant of @p index or itself if it has no children

@ -100,7 +100,7 @@ class KReparentingProxyModel : public QAbstractProxyModel
{
Q_OBJECT
public:
KReparentingProxyModel(QObject *parent = 0);
KReparentingProxyModel(QObject *parent = nullptr);
virtual ~KReparentingProxyModel();

@ -27,7 +27,7 @@
ColoredTreeModel::ColoredTreeModel(QObject *parent)
: DynamicTreeModel(parent),
m_selectionModel(0),
m_selectionModel(nullptr),
m_lessThanColour(Qt::yellow),
m_greaterThanColour(Qt::red)
{

@ -31,7 +31,7 @@ class ColoredTreeModel : public DynamicTreeModel
{
Q_OBJECT
public:
ColoredTreeModel(QObject *parent = 0);
ColoredTreeModel(QObject *parent = nullptr);
/* reimp */ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
@ -50,7 +50,7 @@ class LessThanWidget : public QWidget
{
Q_OBJECT
public:
LessThanWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
LessThanWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
void insertGrid(QList<int> address);
private:

@ -32,7 +32,7 @@ class MatchCheckingWidget : public QWidget
{
Q_OBJECT
public:
MatchCheckingWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
MatchCheckingWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
private Q_SLOTS:
void matchChanged(const QString &matchData);

@ -33,7 +33,7 @@ class ModelCommanderWidget : public QWidget
{
Q_OBJECT
public:
ModelCommanderWidget(DynamicTreeModel *dynamicTreeModel, QWidget *parent = 0, Qt::WindowFlags f = 0);
ModelCommanderWidget(DynamicTreeModel *dynamicTreeModel, QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
private Q_SLOTS:
void initTest(QTreeWidgetItem *item);

@ -28,7 +28,7 @@ class ProxyItemSelectionWidget : public QWidget
{
Q_OBJECT
public:
ProxyItemSelectionWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
ProxyItemSelectionWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
};

@ -32,7 +32,7 @@ class ProxyModelTestWidget : public QWidget
{
Q_OBJECT
public:
explicit ProxyModelTestWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
explicit ProxyModelTestWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
private:
DynamicTreeModel *m_rootModel;

@ -38,7 +38,7 @@ class KRecursiveFilterProxyModelSubclass : public KRecursiveFilterProxyModel
{
Q_OBJECT
public:
KRecursiveFilterProxyModelSubclass(QObject *parent = 0)
KRecursiveFilterProxyModelSubclass(QObject *parent = nullptr)
: KRecursiveFilterProxyModel(parent)
{
@ -67,7 +67,7 @@ class RecursiveFilterProxyWidget : public QWidget
{
Q_OBJECT
public:
RecursiveFilterProxyWidget(QWidget *parent = 0);
RecursiveFilterProxyWidget(QWidget *parent = nullptr);
protected Q_SLOTS:
void reset();

@ -32,7 +32,7 @@ class ReparentingProxyModelWidget : public QWidget
{
Q_OBJECT
public:
ReparentingProxyModelWidget(QWidget *parent = 0);
ReparentingProxyModelWidget(QWidget *parent = nullptr);
private:
DynamicTreeModel *m_rootModel;

@ -34,7 +34,7 @@ class ScriptableReparentingProxyModel : public KReparentingProxyModel
{
Q_OBJECT
public:
ScriptableReparentingProxyModel(QObject *parent = 0);
ScriptableReparentingProxyModel(QObject *parent = nullptr);
/* reimp */ bool isDescendantOf(const QModelIndex &ancestor, const QModelIndex &descendant) const Q_DECL_OVERRIDE;
@ -49,7 +49,7 @@ class ScriptableReparentingWidget : public QWidget
{
Q_OBJECT
public:
ScriptableReparentingWidget(QAbstractItemModel *rootModel, QWidget *parent = 0, Qt::WindowFlags f = 0);
ScriptableReparentingWidget(QAbstractItemModel *rootModel, QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
private Q_SLOTS:
void textChanged();

@ -31,7 +31,7 @@ class DynamicTreeModel;
class SelectionInQmlWidget : public QWidget
{
public:
SelectionInQmlWidget(QWidget *parent = 0);
SelectionInQmlWidget(QWidget *parent = nullptr);
private:
DynamicTreeModel *m_rootModel;

@ -31,7 +31,7 @@ class DynamicTreeModel;
class SelectionProxyWidget : public QWidget
{
public:
SelectionProxyWidget(QWidget *parent = 0);
SelectionProxyWidget(QWidget *parent = nullptr);
protected:
QTreeView *createLabelledView(const QString &labelText, QWidget *parent);

Loading…
Cancel
Save