QLineEdit添加左侧或右侧的图标

QLineEdit添加左侧或右侧的图标

247
247
2023-04-10 / 0 评论 / 75 阅读 / 正在检测是否收录...
    QAction *searchAction = new QAction(ui.LineEdit);
    searchAction->setIcon(QIcon(":/resource/query.png"));
    ui.LineEdit->addAction(searchAction,QLineEdit::TrailingPosition);
        //QLineEdit::LeadingPosition 在左侧
0

评论 (0)

取消