Skip to content

feat(filelineedit): add browse button - #314

Closed
ZnPdCo wants to merge 2 commits into
Project-LemonLime:masterfrom
ZnPdCo:add-browser-button
Closed

feat(filelineedit): add browse button#314
ZnPdCo wants to merge 2 commits into
Project-LemonLime:masterfrom
ZnPdCo:add-browser-button

Conversation

@ZnPdCo

@ZnPdCo ZnPdCo commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

在 filelineedit 输入框控件右侧添加一个浏览按钮,可以选择文件。

Windows 下 和 linux 下的斜杠也能正确切换:

image

如果是在右边添加三个点的按钮,感觉要改 ui,有点懒?所以就这么处理了。

@alphagocc

Copy link
Copy Markdown
Member

这个有啥意义啊,我看不懂

@CoelacanthusHex

Copy link
Copy Markdown
Member

这个有啥意义啊,我看不懂

不用手写路径了吧,直接用文件选择器选

Comment thread src/filelineedit.cpp
FileLineEdit::FileLineEdit(QWidget *parent) : QLineEdit(parent) { completer = nullptr; }
FileLineEdit::FileLineEdit(QWidget *parent) : QLineEdit(parent) {
completer = nullptr;
QAction *browseAction = addAction(QIcon(":/icon/document-open.svg"), QLineEdit::TrailingPosition);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use QIcon::ThemeIcon::DocumentOpen instead.

@alphagocc

Copy link
Copy Markdown
Member

哦哦,懂了

@alphagocc

Copy link
Copy Markdown
Member

我建议还是改ui,可以抄一下其他地方的选文件怎么写的,designer 里面拖动一下应该挺快的。
在里面放个 icon 还是太怪异了

@ZnPdCo ZnPdCo closed this Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants