- enhancement: add help link for regular expression in search dialog
This commit is contained in:
parent
b1cc0457ea
commit
9cc51a150d
1
NEWS.md
1
NEWS.md
|
@ -1,5 +1,6 @@
|
|||
Red Panda C++ Version 1.0.4
|
||||
- fix: hide function tips, when move or resize the main window
|
||||
- enhancement: add help link for regular expression in search dialog
|
||||
|
||||
Red Panda C++ Version 1.0.3
|
||||
- fix: when oj problem grabbed by competitive companion received,
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "../qsynedit/Search.h"
|
||||
#include "../qsynedit/SearchRegex.h"
|
||||
#include "../project.h"
|
||||
#include "../settings.h"
|
||||
#include <QMessageBox>
|
||||
#include <QDebug>
|
||||
|
||||
|
@ -466,6 +467,20 @@ std::shared_ptr<SearchResultTreeItem> SearchDialog::batchFindInEditor(SynEdit *e
|
|||
return parentItem;
|
||||
}
|
||||
|
||||
void SearchDialog::showEvent(QShowEvent *event)
|
||||
{
|
||||
QDialog::showEvent(event);
|
||||
if (pSettings->environment().language()=="zh_CN") {
|
||||
ui->txtRegExpHelp->setText(
|
||||
QString("<html><head/><body><p><a href=\"%1\"><span style=\" text-decoration: underline; color:#0000ff;\">(?)</span></a></p></body></html>")
|
||||
.arg("https://www.runoob.com/regexp/regexp-tutorial.html"));
|
||||
} else {
|
||||
ui->txtRegExpHelp->setText(
|
||||
QString("<html><head/><body><p><a href=\"%1\"><span style=\" text-decoration: underline; color:#0000ff;\">(?)</span></a></p></body></html>")
|
||||
.arg("https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference"));
|
||||
}
|
||||
}
|
||||
|
||||
QTabBar *SearchDialog::tabBar() const
|
||||
{
|
||||
return mTabBar;
|
||||
|
|
|
@ -72,6 +72,10 @@ private:
|
|||
PSynSearchBase mSearchEngine;
|
||||
PSynSearchBase mBasicSearchEngine;
|
||||
PSynSearchBase mRegexSearchEngine;
|
||||
|
||||
// QWidget interface
|
||||
protected:
|
||||
void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // SEARCHDIALOG_H
|
||||
|
|
|
@ -126,10 +126,50 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkRegExp">
|
||||
<property name="text">
|
||||
<string>Regular Expression</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkRegExp">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Regular Expression</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="txtRegExpHelp">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><a href="https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference"><span style=" text-decoration: underline; color:#0000ff;">(?)</span></a></p></body></html></string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
@ -253,7 +293,7 @@
|
|||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
|
@ -299,7 +339,7 @@
|
|||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
|
|
Loading…
Reference in New Issue