Skip to content

Commit d819928

Browse files
committed
[快捷键]更新添加和删除的快捷键
1 parent c5a7214 commit d819928

File tree

5 files changed

+56
-1
lines changed

5 files changed

+56
-1
lines changed

exe/pinout-generator.exe

2.5 KB
Binary file not shown.

project/menupin.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,21 @@ void Widget::menu_insert_event(QStringList &list)
5252
insertpin = list.at(0);
5353
}
5454

55+
void Widget::on_delbtn_clicked()
56+
{
57+
QTreeWidgetItem *curItem = ui->treeWidget->currentItem();
58+
QStringList pininfo;
59+
if(curItem == NULL)
60+
return;
61+
62+
QString pin = curItem->text(0);
63+
QMessageBox::StandardButton result = QMessageBox::question( this,"删除 Arduino Pin","你确定要删除 "+pin+" 这个引脚吗?");
64+
if(result == QMessageBox::No)
65+
return;
66+
pinmaplist.remove_item_by_arduinopin(pin);
67+
all_ui_component_refresh();
68+
}
69+
5570
void Widget::menu_remove_event(QStringList &list)
5671
{
5772
if(list.at(0).isEmpty())

project/widget.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ Widget::Widget(QWidget *parent)
1414
ui->project->setText(tr("<a href = 'https://github.com/RTduino/pinout-generator'>https://github.com/RTduino/pinout-generator</a>"));
1515
ui->fcpuedit->setStyleSheet("font-size:30px; color:rgb(255,0,0);");
1616
pinUI->setWindowModality(Qt::ApplicationModal);//设置界面不可点击
17-
ui->addbtn->setShortcut(tr("shift+a"));
17+
ui->addbtn->setShortcut(tr("a"));
18+
ui->delbtn->setShortcut(tr("d"));
1819
}
1920

2021
Widget::~Widget()

project/widget.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ private slots:
8888
void on_autor_linkActivated(const QString &link);
8989
void on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column);
9090
void on_ledbox_activated(const QString &arg1);
91+
void on_delbtn_clicked();
9192

9293
private:
9394
Ui::Widget *ui;

project/widget.ui

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,44 @@
845845
</property>
846846
</widget>
847847
</item>
848+
<item>
849+
<widget class="Line" name="line_23">
850+
<property name="orientation">
851+
<enum>Qt::Vertical</enum>
852+
</property>
853+
</widget>
854+
</item>
855+
<item>
856+
<widget class="Line" name="line_24">
857+
<property name="orientation">
858+
<enum>Qt::Vertical</enum>
859+
</property>
860+
</widget>
861+
</item>
862+
<item>
863+
<widget class="QPushButton" name="delbtn">
864+
<property name="minimumSize">
865+
<size>
866+
<width>100</width>
867+
<height>40</height>
868+
</size>
869+
</property>
870+
<property name="maximumSize">
871+
<size>
872+
<width>100</width>
873+
<height>40</height>
874+
</size>
875+
</property>
876+
<property name="font">
877+
<font>
878+
<pointsize>15</pointsize>
879+
</font>
880+
</property>
881+
<property name="text">
882+
<string>删除</string>
883+
</property>
884+
</widget>
885+
</item>
848886
<item>
849887
<widget class="Line" name="line_7">
850888
<property name="orientation">

0 commit comments

Comments
 (0)