revisions

This commit is contained in:
pls.153 2022-08-02 09:38:20 +02:00
parent 856b44f1a3
commit 7d607e3d2d
3 changed files with 8 additions and 5 deletions

View file

@ -97,7 +97,7 @@ QVariant QT::block2(const QVariant& vCursor) {
QTextCursor* cursor = VAL(vCursor, TextCursor*);
if (cursor != nullptr) {
TextBlock* tmp = new TextBlock(cursor->block());
QTimer::singleShot(0, tmp, &QObject::deleteLater);
DELETE_LATER(tmp);
return VAR(TextBlock*, tmp);
}
return QVariant();
@ -173,7 +173,7 @@ QVariant QT::findBlockByLineNumber(const QVariant& vDocument, const QVariant& vN
QTextDocument* document = VAL(vDocument, QTextDocument*);
if (document != nullptr) {
TextBlock* tmp = new TextBlock(document->findBlockByLineNumber(vNumber.toInt()));
QTimer::singleShot(0, tmp, &QObject::deleteLater);
DELETE_LATER(tmp);
return VAR(TextBlock*, tmp);
}
return QVariant();
@ -191,7 +191,7 @@ QVariant QT::next(const QVariant& vBlock) {
QTextBlock* block = VAL(vBlock, TextBlock*);
if (block != nullptr) {
TextBlock* tmp = new TextBlock(block->next());
QTimer::singleShot(0, tmp, &QObject::deleteLater);
DELETE_LATER(tmp);
return VAR(TextBlock*, tmp);
}
return QVariant();
@ -217,7 +217,7 @@ QVariant QT::previous(const QVariant& vBlock) {
QTextBlock* block = VAL(vBlock, TextBlock*);
if (block != nullptr) {
TextBlock* tmp = new TextBlock(block->previous());
QTimer::singleShot(0, tmp, &QObject::deleteLater);
DELETE_LATER(tmp);
return VAR(TextBlock*, tmp);
}
return QVariant();

View file

@ -21,6 +21,9 @@
#define VAL(var, type) \
var.value<type>()
#define DELETE_LATER(var) \
QTimer::singleShot(0, var, &QObject::deleteLater)
QT_BEGIN_NAMESPACE
extern "C" { LIB_EXPORT QObject* ini(); }

View file

@ -49,7 +49,7 @@
;; limit zone
(set-style "red" (* 12 f))
(with-path ()
(arc 0 0 (- r (* 5 f))
(arc 0 0 (- r (* 6 f))
(to-rad (- 360
(* 180 (- 1 (q< |limit| *gauge*)))))
(to-rad 360)))