File tree Expand file tree Collapse file tree 5 files changed +56
-1
lines changed
Expand file tree Collapse file tree 5 files changed +56
-1
lines changed Original file line number Diff line number Diff 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+
5570void Widget::menu_remove_event (QStringList &list)
5671{
5772 if (list.at (0 ).isEmpty ())
Original file line number Diff line number Diff 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
2021Widget::~Widget ()
Original file line number Diff line number Diff 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
9293private:
9394 Ui::Widget *ui;
Original file line number Diff line number Diff line change 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" >
You can’t perform that action at this time.
0 commit comments