aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/pysidetest/testobject.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/tests/pysidetest/testobject.h')
-rw-r--r--sources/pyside6/tests/pysidetest/testobject.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/sources/pyside6/tests/pysidetest/testobject.h b/sources/pyside6/tests/pysidetest/testobject.h
index 88652bcca..a095a382e 100644
--- a/sources/pyside6/tests/pysidetest/testobject.h
+++ b/sources/pyside6/tests/pysidetest/testobject.h
@@ -8,12 +8,15 @@
#include <QtWidgets/QApplication>
+#include <QtCore/QList>
#include <QtCore/QObject>
#include <QtCore/QMetaType>
#include <QtCore/QVariant>
QT_FORWARD_DECLARE_CLASS(QDebug)
+using IntList = QList<int>;
+
class IntValue
{
public:
@@ -23,16 +26,16 @@ public:
int value;
};
-typedef IntValue TypedefValue;
+using TypedefValue = IntValue;
class PYSIDETEST_API TestObject : public QObject
{
Q_OBJECT
public:
- static void createApp() { int argc=0; new QApplication(argc, 0); };
+ static void createApp() { int argc=0; new QApplication(argc, nullptr); };
static int checkType(const QVariant& var) { return var.metaType().id(); }
- TestObject(int idValue, QObject* parent = 0) : QObject(parent), m_idValue(idValue) {}
+ TestObject(int idValue, QObject* parent = nullptr) : QObject(parent), m_idValue(idValue) {}
int idValue() const { return m_idValue; }
static int staticMethodDouble(int value) { return value * 2; }
void addChild(QObject* c) { m_children.append(c); emit childrenChanged(m_children); }
@@ -44,6 +47,14 @@ public:
void emitSignalWithDefaultValue_bool();
void emitSignalWithTypedefValue(int value);
+ void emitSignalWithContainerTypedefValue(const IntList &il);
+
+ void emitFlagsSignal(Qt::Alignment alignment);
+
+ static constexpr auto LATIN1_TEST_FIELD = QLatin1StringView("test");
+
+ void setQLatin1String(QLatin1String v);
+ QString qLatin1String() const;
signals:
void idValue(int newValue);
@@ -52,16 +63,18 @@ signals:
void childrenChanged(const QList<QObject*>&);
void signalWithDefaultValue(bool value = false);
void signalWithTypedefValue(TypedefValue value);
+ void signalWithContainerTypedefValue(const IntList &il);
+ void flagsSignal(Qt::Alignment alignment);
private:
int m_idValue;
QList<QObject*> m_children;
+ QString m_qLatin1String;
};
PYSIDETEST_API QDebug operator<<(QDebug dbg, TestObject &testObject);
-typedef int PySideInt;
-
+using PySideInt = int;
namespace PySideCPP {
@@ -100,8 +113,7 @@ namespace PySideCPP2 {
enum Enum1 { Option1 = 1, Option2 = 2 };
-
-typedef long PySideLong;
+using PySideLong = long;
class PYSIDETEST_API TestObjectWithoutNamespace : public QObject
{