QDesignerFormWindowCursorInterface Class
QDesignerFormWindowCursorInterface 클래스를 사용하면 양식 창의 위젯 선택 항목을 쿼리하고 수정할 수 있으며 모든 양식 위젯의 속성을 수정할 수도 있습니다. 더 보기...
Header: | #include <QDesignerFormWindowCursorInterface> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Designer) target_link_libraries(mytarget PRIVATE Qt6::Designer) |
qmake: | QT += designer |
공용 타입
enum | MoveMode { MoveAnchor, KeepAnchor } |
enum | MoveOperation { NoMove, Start, End, Next, Prev, …, Down } |
공용 함수
virtual | ~QDesignerFormWindowCursorInterface() |
virtual QWidget * | current() const = 0 |
virtual QDesignerFormWindowInterface * | formWindow() const = 0 |
virtual bool | hasSelection() const = 0 |
bool | isWidgetSelected(QWidget *widget) const |
virtual bool | movePosition(QDesignerFormWindowCursorInterface::MoveOperation operation, QDesignerFormWindowCursorInterface::MoveMode mode = MoveAnchor) = 0 |
virtual int | position() const = 0 |
virtual void | resetWidgetProperty(QWidget *widget, const QString &name) = 0 |
virtual QWidget * | selectedWidget(int index) const = 0 |
virtual int | selectedWidgetCount() const = 0 |
virtual void | setPosition(int position, QDesignerFormWindowCursorInterface::MoveMode mode = MoveAnchor) = 0 |
virtual void | setProperty(const QString &name, const QVariant &value) = 0 |
virtual void | setWidgetProperty(QWidget *widget, const QString &name, const QVariant &value) = 0 |
virtual QWidget * | widget(int index) const = 0 |
virtual int | widgetCount() const = 0 |
상세 설명
QDesignerFormWindowCursorInterface는 연결된 양식 창의 텍스트 커서에 대한 인터페이스를 제공하는 편의 클래스로, 지정된 양식 창의 선택 항목을 쿼리하고 정의된 모드(MoveMode)와 이동(MoveOperation)에 따라 선택 항목의 초점을 변경할 수 있는 함수 모음을 제공합니다. 또한 이 인터페이스를 사용하여 양식의 위젯을 쿼리하고 속성을 변경할 수도 있습니다.
이 인터페이스는 직접 인스턴스화되는 것이 아니라 Qt Widgets Designer 의 현재 양식 창의 선택 및 위젯에 대한 액세스를 제공하기 위한 것입니다. QDesignerFormWindowInterface 은 항상 연결된 커서 인터페이스를 제공합니다. 지정된 위젯의 양식 창은 정적 QDesignerFormWindowInterface::findFormWindow() 함수를 사용하여 검색할 수 있습니다. 예를 들어
auto *formWindow = QDesignerFormWindowInterface::findFormWindow(myWidget); formWindow->cursor()->setProperty(myWidget, myProperty, newValue);
Qt Widgets Designer 의 form window manager 을 통해 Qt Widgets Designer 의 현재 양식 창을 검색할 수 있습니다.
양식 창의 커서 인터페이스가 있으면 hasSelection() 함수를 사용하여 양식 창에 선택 항목이 있는지 확인할 수 있습니다. widgetCount () 및 selectedWidgetCount() 함수를 사용하여 양식 창의 총 개수를 쿼리할 수 있습니다. current () 또는 selectedWidget() 함수를 사용하여 현재 선택된 위젯(또는 위젯)을 검색할 수 있습니다.
widget() 함수를 사용하여 양식 창의 위젯을 검색하고 isWidgetSelected() 함수를 사용하여 위젯이 선택되었는지 확인할 수 있습니다. setProperty () 함수를 사용하여 선택한 위젯의 속성을 설정하고 setWidgetProperty() 또는 resetWidgetProperty() 함수를 사용하여 특정 위젯의 속성을 수정할 수 있습니다.
마지막으로 setPosition() 및 movePosition() 함수를 사용하여 텍스트 커서의 position()를 변경하여 선택 내용을 변경할 수 있습니다.
QDesignerFormWindowInterface 및 QDesignerFormWindowManagerInterface 을참조하세요 .
멤버 유형 문서
enum QDesignerFormWindowCursorInterface::MoveMode
이 열거형은 텍스트 커서가 이동할 때 사용되는 다양한 모드를 설명합니다.
Constant | 값 | 설명 |
---|---|---|
QDesignerFormWindowCursorInterface::MoveAnchor | 0 | 앵커가 커서와 함께 새 위치로 이동합니다. |
QDesignerFormWindowCursorInterface::KeepAnchor | 1 | 앵커는 커서의 이전 위치에 유지됩니다. |
enum QDesignerFormWindowCursorInterface::MoveOperation
이 열거형은 양식 창에서 발생할 수 있는 텍스트 커서 작업의 유형을 설명합니다.
Constant | 값 | 설명 |
---|---|---|
QDesignerFormWindowCursorInterface::NoMove | 0 | 커서가 움직이지 않습니다. |
QDesignerFormWindowCursorInterface::Start | 1 | 포커스 체인의 시작 부분으로 커서를 이동합니다. |
QDesignerFormWindowCursorInterface::End | 2 | 포커스 체인의 끝으로 커서를 이동합니다. |
QDesignerFormWindowCursorInterface::Next | 3 | 포커스 체인에서 다음 위젯으로 커서를 이동합니다. |
QDesignerFormWindowCursorInterface::Prev | 4 | 초점 체인에서 이전 위젯으로 커서를 이동합니다. |
QDesignerFormWindowCursorInterface::Left | 5 | 커서가 왼쪽으로 이동합니다. |
QDesignerFormWindowCursorInterface::Right | 6 | 커서가 오른쪽으로 이동합니다. |
QDesignerFormWindowCursorInterface::Up | 7 | 커서가 위로 이동합니다. |
QDesignerFormWindowCursorInterface::Down | 8 | 커서가 아래로 이동합니다. |
멤버 함수 문서
[virtual constexpr noexcept]
QDesignerFormWindowCursorInterface::~QDesignerFormWindowCursorInterface()
커서 인터페이스를 삭제합니다.
[pure virtual]
QWidget *QDesignerFormWindowCursorInterface::current() const
양식 창에서 현재 선택된 위젯을 반환합니다.
selectedWidget()도 참조하세요 .
[pure virtual]
QDesignerFormWindowInterface *QDesignerFormWindowCursorInterface::formWindow() const
이 커서 인터페이스와 연관된 양식 창 인터페이스를 반환합니다.
[pure virtual]
bool QDesignerFormWindowCursorInterface::hasSelection() const
양식 창에 선택 항목이 포함되어 있으면 참을 반환하고, 그렇지 않으면 거짓을 반환합니다.
bool QDesignerFormWindowCursorInterface::isWidgetSelected(QWidget *widget) const
지정된 widget 을 선택하면 참을 반환하고, 그렇지 않으면 거짓을 반환합니다.
[pure virtual]
bool QDesignerFormWindowCursorInterface::movePosition(QDesignerFormWindowCursorInterface::MoveOperation operation, QDesignerFormWindowCursorInterface::MoveMode mode = MoveAnchor)
지정된 mode 을 사용하여 커서에서 지정된 operation 을 수행하고 성공적으로 완료되면 참을 반환하고 그렇지 않으면 거짓을 반환합니다.
position() 및 setPosition()도 참조하세요 .
[pure virtual]
int QDesignerFormWindowCursorInterface::position() const
커서 위치를 반환합니다.
setPosition() 및 movePosition()도 참조하세요 .
[pure virtual]
void QDesignerFormWindowCursorInterface::resetWidgetProperty(QWidget *widget, const QString &name)
지정된 widget 에 대해 지정된 name 속성을 기본값으로 재설정합니다.
setProperty() 및 setWidgetProperty()도 참조하세요 .
[pure virtual]
QWidget *QDesignerFormWindowCursorInterface::selectedWidget(int index) const
선택한 위젯 목록에서 지정된 index 을 가진 위젯을 반환합니다.
[pure virtual]
int QDesignerFormWindowCursorInterface::selectedWidgetCount() const
양식 창에서 선택한 위젯의 수를 반환합니다.
widgetCount()도 참조하세요 .
[pure virtual]
void QDesignerFormWindowCursorInterface::setPosition(int position, QDesignerFormWindowCursorInterface::MoveMode mode = MoveAnchor)
mode 을 사용하여 커서의 위치를 지정된 position 으로 설정하여 커서의 이동 방법을 지정합니다.
position() 및 movePosition()도 참조하세요 .
[pure virtual]
void QDesignerFormWindowCursorInterface::setProperty(const QString &name, const QVariant &value)
현재 선택된 위젯에 대해 지정된 name 속성을 지정된 value 으로 설정합니다.
setWidgetProperty() 및 resetWidgetProperty()도 참조하세요 .
[pure virtual]
void QDesignerFormWindowCursorInterface::setWidgetProperty(QWidget *widget, const QString &name, const QVariant &value)
주어진 widget 에 대해 주어진 name 속성을 지정된 value 로 설정합니다.
resetWidgetProperty() 및 setProperty()도 참조하세요 .
[pure virtual]
QWidget *QDesignerFormWindowCursorInterface::widget(int index) const
양식 창의 위젯 목록에서 지정된 index 을 가진 위젯을 반환합니다.
selectedWidget()도 참조하세요 .
[pure virtual]
int QDesignerFormWindowCursorInterface::widgetCount() const
양식 창에 있는 위젯의 수를 반환합니다.
selectedWidgetCount()도 참조하세요 .
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.