Fluent-Qt

API 参考

EditingCommandRouter

为当前窗口中获得焦点的 Fluent 编辑器提供窗口级语义动作。

fluent::textfields::EditingCommandRouter

继承自 QObject

构造函数

explicit EditingCommandRouter(QWidget* scopeWindow, QObject* parent = nullptr)

创建作用于 scopeWindow 所属顶层窗口的编辑命令路由器。

方法

QWidget* scopeWindow() const

返回拥有当前命令作用域的顶层窗口。

bool hasActiveTarget() const

返回当前是否存在获得焦点的受支持 Fluent 编辑器。

QAction* action(Command command) const

返回由 Router 持有的指定命令 QAction。

QList<QAction*> actions() const

按语义命令顺序返回全部动作。

bool canExecute(Command command) const

返回指定命令当前是否可以作用于活动目标。

bool execute(Command command)

重新校验并对活动目标执行指定命令。

void refresh()

在不改变焦点的情况下重新计算活动命令能力。

信号

void activeTargetChanged(bool hasActiveTarget)

当前受支持编辑目标变化时发出。

枚举

enum class Command

通过稳定 QAction 实例暴露的编辑命令。

  • Undo
  • Redo
  • Cut
  • Copy
  • Paste
  • Delete
  • SelectAll

析构函数

Qt 基类完整成员:QObject