()
| 126 | |
| 127 | |
| 128 | def create_target_combobox(): |
| 129 | combo = QComboBox() |
| 130 | combo.setView(QListView()) |
| 131 | combo.setItemDelegate(QStyledItemDelegate()) |
| 132 | |
| 133 | target_icon = get_icon('target') |
| 134 | |
| 135 | targets = [ |
| 136 | ('x86_64-pc-windows-msvc', 'Windows MSVC (x64)'), |
| 137 | ('i686-pc-windows-msvc', 'Windows MSVC (x86)'), |
| 138 | ('x86_64-pc-windows-gnu', 'Windows GNU (x64)'), |
| 139 | ('i686-pc-windows-gnu', 'Windows GNU (x86)'), |
| 140 | ('aarch64-pc-windows-msvc', 'Windows MSVC (ARM64)'), |
| 141 | ] |
| 142 | |
| 143 | for target, label in targets: |
| 144 | combo.addItem(target_icon, label, target) |
| 145 | |
| 146 | import platform |
| 147 | os_name = platform.system().lower() |
| 148 | if os_name == "windows": |
| 149 | default_target = "x86_64-pc-windows-msvc" |
| 150 | else: |
| 151 | default_target = "x86_64-pc-windows-gnu" |
| 152 | |
| 153 | for i in range(combo.count()): |
| 154 | if combo.itemData(i) == default_target: |
| 155 | combo.setCurrentIndex(i) |
| 156 | break |
| 157 | |
| 158 | return combo |
no test coverage detected