Skip to content

Commit 2a761ea

Browse files
committed
Add override and noexcept modifiers
- uses global includes where needed
1 parent c00ebf4 commit 2a761ea

8 files changed

+32
-24
lines changed

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/PythonQt.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ class PYTHONQT_EXPORT PythonQt : public QObject {
642642
PythonQtSignalReceiver* getSignalReceiver(QObject* obj);
643643

644644
PythonQt(int flags, const QByteArray& pythonQtModuleName);
645-
~PythonQt();
645+
~PythonQt() override;
646646
static PythonQt* _self;
647647
static int _uniqueModuleCount;
648648

@@ -659,7 +659,7 @@ class PYTHONQT_EXPORT PythonQtPrivate : public QObject {
659659

660660
public:
661661
PythonQtPrivate();
662-
~PythonQtPrivate();
662+
~PythonQtPrivate() override;
663663

664664
enum DecoratorTypes {
665665
StaticDecorator = 1,

src/PythonQtImporter.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@
4444

4545
#include "PythonQtPythonInclude.h"
4646

47-
#include "structmember.h"
48-
#include "osdefs.h"
49-
#include "marshal.h"
5047
#include "compile.h"
51-
#include <time.h>
48+
#include "marshal.h"
49+
#include "osdefs.h"
50+
#include "structmember.h"
51+
#include <ctime>
5252

5353
#include <qobject.h>
5454
#include <qstring.h>

src/PythonQtObjectPtr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
*/
4040
//----------------------------------------------------------------------------------
4141

42+
#include <PythonQt.h>
4243

43-
#include "PythonQt.h"
4444
QVariant PythonQtObjectPtr::evalScript(const QString& script, int start)
4545
{
4646
return PythonQt::self()->evalScript(_object, script, start);

src/PythonQtObjectPtr.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class PYTHONQT_EXPORT PythonQtObjectPtr
6464
}
6565

6666
//! rvalue copy constructor, does not need any incref/decref.
67-
PythonQtObjectPtr(PythonQtObjectPtr &&p)
67+
PythonQtObjectPtr(PythonQtObjectPtr &&p) noexcept
6868
:_object(p.takeObject()) {
6969
}
7070

@@ -95,7 +95,7 @@ class PYTHONQT_EXPORT PythonQtObjectPtr
9595
}
9696

9797
//! rvalue assignment operator that steals the reference from p
98-
PythonQtObjectPtr &operator=(PythonQtObjectPtr &&p) {
98+
PythonQtObjectPtr &operator=(PythonQtObjectPtr &&p) noexcept {
9999
if (_object) {
100100
setObject(nullptr);
101101
}
@@ -210,7 +210,7 @@ class PYTHONQT_EXPORT PythonQtSafeObjectPtr
210210
}
211211

212212
//! rvalue copy constructor, does not need any incref/decref.
213-
PythonQtSafeObjectPtr(PythonQtSafeObjectPtr &&p)
213+
PythonQtSafeObjectPtr(PythonQtSafeObjectPtr &&p) noexcept
214214
:_object(p._object) {
215215
p._object = nullptr;
216216
}
@@ -235,7 +235,7 @@ class PYTHONQT_EXPORT PythonQtSafeObjectPtr
235235
}
236236

237237
//! rvalue assignment operator that steals the reference from p
238-
PythonQtSafeObjectPtr &operator=(PythonQtSafeObjectPtr &&p) {
238+
PythonQtSafeObjectPtr &operator=(PythonQtSafeObjectPtr &&p) noexcept {
239239
if (_object) {
240240
setObject(nullptr);
241241
}

src/PythonQtQFileImporter.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@
4949
class PythonQtQFileImporter : public PythonQtImportFileInterface {
5050
public:
5151
PythonQtQFileImporter();
52-
~PythonQtQFileImporter();
52+
~PythonQtQFileImporter() override;
5353

54-
QByteArray readFileAsBytes (const QString &filename);
55-
56-
QByteArray readSourceFile (const QString &filename, bool &ok);
57-
58-
bool exists (const QString &filename);
59-
bool isEggArchive(const QString& filename);
60-
61-
QDateTime lastModifiedDate (const QString &filename);
54+
QByteArray readFileAsBytes (const QString &filename) override;
55+
56+
QByteArray readSourceFile (const QString &filename, bool &ok) override;
57+
58+
bool exists (const QString &filename) override;
59+
bool isEggArchive(const QString& filename) override;
60+
61+
QDateTime lastModifiedDate (const QString &filename) override;
6262

6363
};
6464

src/PythonQtSignalReceiver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class PythonQtSignalReceiver : public PythonQtSignalReceiverBase {
113113

114114
public:
115115
PythonQtSignalReceiver(QObject* obj);
116-
~PythonQtSignalReceiver();
116+
~PythonQtSignalReceiver() override;
117117

118118
//! add a signal handler
119119
bool addSignalHandler(const char* signal, PyObject* callable);
@@ -122,7 +122,7 @@ class PythonQtSignalReceiver : public PythonQtSignalReceiverBase {
122122
bool removeSignalHandler(const char* signal, PyObject* callable = nullptr);
123123

124124
//! we implement this method to simulate a number of slots that match the ids in _targets
125-
virtual int qt_metacall(QMetaObject::Call c, int id, void **arguments);
125+
int qt_metacall(QMetaObject::Call c, int id, void **arguments) override;
126126

127127
private:
128128
//! get the index of the signal

src/gui/PythonQtScriptingConsole.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ class PYTHONQT_EXPORT PythonQtScriptingConsole : public QTextEdit
5757
public:
5858
PythonQtScriptingConsole(QWidget* parent, const PythonQtObjectPtr& context, Qt::WindowFlags i = 0);
5959

60-
~PythonQtScriptingConsole();
60+
~PythonQtScriptingConsole() override;
6161

6262
public Q_SLOTS:
6363
//! execute current line
6464
void executeLine(bool storeOnly);
6565

6666
//! derived key press event
67-
void keyPressEvent (QKeyEvent * e);
67+
void keyPressEvent (QKeyEvent * e) override;
6868

6969
//! output from console
7070
void consoleMessage(const QString & message);

0 commit comments

Comments
 (0)