Minor fixes for copied code and demo content
This commit is contained in:
parent
9df9421baf
commit
6cbb433aaa
@ -2,17 +2,17 @@
|
||||
# RUN: npm run automoc after updating moc.json
|
||||
{
|
||||
"sources": [
|
||||
"..\\src\\cpp\\autogen\\nwidget_moc.cpp",
|
||||
"..\\src\\cpp\\autogen\\nlabel_moc.cpp",
|
||||
"..\\src\\cpp\\autogen\\ncheckbox_moc.cpp",
|
||||
"..\\src\\cpp\\autogen\\ndial_moc.cpp",
|
||||
"..\\src\\cpp\\autogen\\nlineedit_moc.cpp",
|
||||
"..\\src\\cpp\\autogen\\nmainwindow_moc.cpp",
|
||||
"..\\src\\cpp\\autogen\\nprogressbar_moc.cpp",
|
||||
"..\\src\\cpp\\autogen\\npushbutton_moc.cpp",
|
||||
"..\\src\\cpp\\autogen\\nspinbox_moc.cpp",
|
||||
"..\\src\\cpp\\autogen\\nradiobutton_moc.cpp",
|
||||
"..\\src\\cpp\\autogen\\nplaintextedit_moc.cpp",
|
||||
"..\\src\\cpp\\autogen\\nscrollarea_moc.cpp"
|
||||
"../src/cpp/autogen/nwidget_moc.cpp",
|
||||
"../src/cpp/autogen/nlabel_moc.cpp",
|
||||
"../src/cpp/autogen/ncheckbox_moc.cpp",
|
||||
"../src/cpp/autogen/ndial_moc.cpp",
|
||||
"../src/cpp/autogen/nlineedit_moc.cpp",
|
||||
"../src/cpp/autogen/nmainwindow_moc.cpp",
|
||||
"../src/cpp/autogen/nprogressbar_moc.cpp",
|
||||
"../src/cpp/autogen/npushbutton_moc.cpp",
|
||||
"../src/cpp/autogen/nspinbox_moc.cpp",
|
||||
"../src/cpp/autogen/nradiobutton_moc.cpp",
|
||||
"../src/cpp/autogen/nplaintextedit_moc.cpp",
|
||||
"../src/cpp/autogen/nscrollarea_moc.cpp"
|
||||
]
|
||||
}
|
||||
@ -45,6 +45,8 @@
|
||||
- [QWidget (View)](api/QWidget.md)
|
||||
- [QSpinBox ()](api/QSpinBox.md)
|
||||
- [QAbstractScrollArea ()](api/QAbstractScrollArea.md)
|
||||
- [QAbstractSlider ()](api/QAbstractSlider.md)
|
||||
- [QDial ()](api/QDial.md)
|
||||
- [QScrollArea ()](api/QScrollArea.md)
|
||||
- [QPlainTextEdit (TextEdit)](api/QPlainTextEdit.md)
|
||||
- [QLabel (Text/Image)](api/QLabel.md)
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
## Class: QDial
|
||||
|
||||
> Create and control spin box widgets.
|
||||
> Create and control dial slider widgets.
|
||||
|
||||
**This class is a JS wrapper around Qt's [QDial class](https://doc.qt.io/qt-5/qdial.html)**
|
||||
|
||||
A `QDial` provides ability to add and manipulate native spin box widgets.
|
||||
A `QDial` provides ability to add and manipulate native dial slider widgets.
|
||||
|
||||
**QDial inherits from [QAbstractSlider](api/QAbstractSlider.md)**
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
|
||||
#include "qDial_wrap.h"
|
||||
#include "qdial_wrap.h"
|
||||
#include "src/cpp/QtWidgets/QWidget/qwidget_wrap.h"
|
||||
#include "src/cpp/Extras/Utils/nutils.h"
|
||||
#include <QWidget>
|
||||
|
||||
18
src/demo.ts
18
src/demo.ts
@ -10,12 +10,10 @@ import {
|
||||
QWidget,
|
||||
QIcon,
|
||||
QDial,
|
||||
QDialEvents,
|
||||
QPlainTextEdit
|
||||
} from "./index";
|
||||
import { QScrollArea } from "./lib/QtWidgets/QScrollArea";
|
||||
import { QPixmap } from "./lib/QtGui/QPixmap";
|
||||
import { Orientation } from "./lib/QtEnums";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
@ -32,22 +30,6 @@ checkbox.setChecked(true);
|
||||
|
||||
const dial = new QDial();
|
||||
checkbox.setObjectName("dial");
|
||||
dial.setWrapping(true);
|
||||
dial.setNotchesVisible(true);
|
||||
dial.setSingleStep(10);
|
||||
dial.setSingleStep(5);
|
||||
dial.setMinimum(55);
|
||||
dial.setMaximum(95);
|
||||
setInterval(() => {
|
||||
dial.setValue(Math.floor(Math.random() * 100));
|
||||
console.log(dial.minimum(), dial.maximum(), dial.value());
|
||||
}, 500);
|
||||
dial.addEventListener(QDialEvents.sliderReleased, () => {
|
||||
console.log('RELEASED!');
|
||||
});
|
||||
dial.addEventListener(QDialEvents.sliderPressed, () => {
|
||||
console.log('PRESSED!');
|
||||
});
|
||||
|
||||
const lineEdit = new QLineEdit();
|
||||
lineEdit.setPlaceholderText("Enter your thoughts here");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user