You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
293 B

  1. #include "creatitem.h"
  2. Item *creatItem(const QString &type)
  3. {
  4. if (type == "常开") return new Contact(type);
  5. if (type == "常闭") return new Contact(type);
  6. if (type == "线圈") return new Coil(type);
  7. if (type == "比较") return new Comparator(type);
  8. return nullptr;
  9. }