Merge branch '1.2'
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
#include <QLoggingCategory>
|
||||
#include <QElapsedTimer>
|
||||
|
||||
// clazy:excludeall=ctor-missing-parent-argument,missing-qobject-macro,range-loop,missing-typeinfo,detaching-member,function-args-by-ref,non-pod-global-static,reserve-candidates,qstring-allocations
|
||||
|
||||
using namespace KDDockWidgets;
|
||||
using namespace KDDockWidgets::Testing;
|
||||
|
||||
|
||||
@@ -37,7 +37,9 @@ namespace Testing {
|
||||
|
||||
class WarningObserver
|
||||
{
|
||||
Q_DISABLE_COPY(WarningObserver)
|
||||
public:
|
||||
WarningObserver() = default;
|
||||
virtual ~WarningObserver();
|
||||
virtual void onFatal() = 0;
|
||||
};
|
||||
|
||||
@@ -313,9 +313,9 @@ bool AddDockWidget::hasParams() const
|
||||
void AddDockWidget::updateDescription()
|
||||
{
|
||||
if (m_params.relativeToName.isEmpty())
|
||||
m_description = QStringLiteral("AddDockWidget %1 to %2").arg(dockStr(m_params.dockWidgetName)).arg(KDDockWidgets::locationStr(m_params.location));
|
||||
m_description = QStringLiteral("AddDockWidget %1 to %2").arg(dockStr(m_params.dockWidgetName), KDDockWidgets::locationStr(m_params.location));
|
||||
else
|
||||
m_description = QStringLiteral("AddDockWidget %1 to %2, relative to %3").arg(dockStr(m_params.dockWidgetName)).arg(KDDockWidgets::locationStr(m_params.location)).arg(dockStr(m_params.relativeToName));
|
||||
m_description = QStringLiteral("AddDockWidget %1 to %2, relative to %3").arg(dockStr(m_params.dockWidgetName), KDDockWidgets::locationStr(m_params.location), dockStr(m_params.relativeToName));
|
||||
}
|
||||
|
||||
void AddDockWidget::execute_impl()
|
||||
|
||||
@@ -50,8 +50,9 @@ Q_ENUM_NS(OperationType)
|
||||
|
||||
|
||||
///@brief Describes a testable action.
|
||||
class OperationBase {
|
||||
|
||||
class OperationBase
|
||||
{
|
||||
Q_DISABLE_COPY(OperationBase)
|
||||
public:
|
||||
typedef std::shared_ptr<OperationBase> Ptr;
|
||||
typedef QVector<OperationBase::Ptr> List;
|
||||
@@ -88,6 +89,7 @@ protected:
|
||||
|
||||
class CloseViaDockWidgetAPI : public OperationBase
|
||||
{
|
||||
Q_DISABLE_COPY(CloseViaDockWidgetAPI)
|
||||
public:
|
||||
explicit CloseViaDockWidgetAPI(Fuzzer *);
|
||||
|
||||
@@ -103,6 +105,7 @@ protected:
|
||||
|
||||
class HideViaDockWidgetAPI : public OperationBase
|
||||
{
|
||||
Q_DISABLE_COPY(HideViaDockWidgetAPI)
|
||||
public:
|
||||
explicit HideViaDockWidgetAPI(Fuzzer *);
|
||||
|
||||
@@ -118,6 +121,7 @@ protected:
|
||||
|
||||
class ShowViaDockWidgetAPI : public OperationBase
|
||||
{
|
||||
Q_DISABLE_COPY(ShowViaDockWidgetAPI)
|
||||
public:
|
||||
explicit ShowViaDockWidgetAPI(Fuzzer *);
|
||||
|
||||
@@ -133,6 +137,7 @@ protected:
|
||||
|
||||
class AddDockWidget : public OperationBase
|
||||
{
|
||||
Q_DISABLE_COPY(AddDockWidget)
|
||||
public:
|
||||
explicit AddDockWidget(Fuzzer *);
|
||||
|
||||
@@ -149,6 +154,7 @@ private:
|
||||
|
||||
class AddDockWidgetAsTab : public OperationBase
|
||||
{
|
||||
Q_DISABLE_COPY(AddDockWidgetAsTab)
|
||||
public:
|
||||
explicit AddDockWidgetAsTab(Fuzzer *);
|
||||
|
||||
@@ -166,6 +172,7 @@ private:
|
||||
|
||||
class SaveLayout : public OperationBase
|
||||
{
|
||||
Q_DISABLE_COPY(SaveLayout)
|
||||
public:
|
||||
explicit SaveLayout(Fuzzer *);
|
||||
|
||||
@@ -181,6 +188,7 @@ protected:
|
||||
|
||||
class RestoreLayout : public OperationBase
|
||||
{
|
||||
Q_DISABLE_COPY(RestoreLayout)
|
||||
public:
|
||||
explicit RestoreLayout(Fuzzer *);
|
||||
|
||||
|
||||
@@ -106,20 +106,20 @@ int main(int argv, char**argc)
|
||||
}
|
||||
|
||||
bool ok = false;
|
||||
const int subsetNumber = app.arguments()[1].toInt(&ok);
|
||||
const int subsetNumber = app.arguments().at(1).toInt(&ok);
|
||||
if (!ok) {
|
||||
qWarning() << "Invalid number" << app.arguments()[1];
|
||||
qWarning() << "Invalid number" << app.arguments().at(1);
|
||||
return -1;
|
||||
}
|
||||
|
||||
const int subsetPercentage = app.arguments()[2].toInt(&ok);
|
||||
const int subsetPercentage = app.arguments().at(2).toInt(&ok);
|
||||
if (!ok) {
|
||||
qWarning() << "Invalid number" << app.arguments()[2];
|
||||
qWarning() << "Invalid number" << app.arguments().at(2);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (subsetPercentage > 100 || subsetPercentage <= 0) {
|
||||
qWarning() << "Invalid percentage" << app.arguments()[2];
|
||||
qWarning() << "Invalid percentage" << app.arguments().at(2);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -992,7 +992,8 @@ void TestMultiSplitter::tst_insertAnotherRoot()
|
||||
|
||||
QCOMPARE(root1->hostWidget()->asQWidget(), host1);
|
||||
QCOMPARE(item2->hostWidget()->asQWidget(), host1);
|
||||
for (Item *item : root1->items_recursive()) {
|
||||
const auto &items = root1->items_recursive();
|
||||
for (Item *item : items) {
|
||||
QCOMPARE(item->hostWidget()->asQWidget(), host1);
|
||||
QVERIFY(item->isVisible());
|
||||
}
|
||||
@@ -1586,7 +1587,7 @@ void TestMultiSplitter::tst_separatorMoveCrash()
|
||||
root->insertItem(item6, Item::Location_OnRight);
|
||||
|
||||
ItemContainer *c = item5->parentContainer();
|
||||
auto separator = c->separators()[0];
|
||||
auto separator = c->separators().constFirst();
|
||||
|
||||
const int available5 = item5->availableLength(Qt::Horizontal);
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#ifndef KDDOCKWIDGETS_TESTS_UTILS_H
|
||||
#define KDDOCKWIDGETS_TESTS_UTILS_H
|
||||
|
||||
// clazy:excludeall=ctor-missing-parent-argument,missing-qobject-macro,range-loop,missing-typeinfo,detaching-member,function-args-by-ref,non-pod-global-static,reserve-candidates,qstring-allocations
|
||||
|
||||
#include "KDDockWidgets.h"
|
||||
#include "DropIndicatorOverlayInterface_p.h"
|
||||
#include "DockWidgetBase.h"
|
||||
|
||||
Reference in New Issue
Block a user