-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ole André Vadla Ravnås
committed
Aug 16, 2014
1 parent
4279399
commit be13891
Showing
8 changed files
with
70 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include "nativepointer.h" | ||
|
||
NativePointer::NativePointer(QObject *parent) : | ||
QObject(parent) | ||
{ | ||
} | ||
|
||
QString NativePointer::fromBaseAndOffset(QString base, int offset) | ||
{ | ||
int numericBase = base.startsWith("0x") ? 16 : 10; | ||
qlonglong result = base.toLongLong(0, numericBase) + offset; | ||
return (numericBase == 16 ? "0x" : "") + QString::number(result, numericBase); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef NATIVEPOINTER_H | ||
#define NATIVEPOINTER_H | ||
|
||
#include <QObject> | ||
|
||
class NativePointer : public QObject | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit NativePointer(QObject *parent = 0); | ||
|
||
Q_INVOKABLE QString fromBaseAndOffset(QString base, int offset); | ||
|
||
signals: | ||
|
||
public slots: | ||
|
||
}; | ||
|
||
#endif // NATIVEPOINTER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters