1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349
|
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, QMetaObject, QObject, QPoint, QRect, QSize, QTime, QUrl, Qt) from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, QFont, QFontDatabase, QGradient, QIcon, QImage, QKeySequence, QLinearGradient, QPainter, QPalette, QPixmap, QRadialGradient, QTransform) from PySide6.QtWidgets import (QApplication, QCheckBox, QGridLayout, QGroupBox, QHBoxLayout, QLabel, QLineEdit, QMainWindow, QMenuBar, QPushButton, QRadioButton, QSizePolicy, QSpacerItem, QSpinBox, QStatusBar, QWidget)
class Ui_MainWindow(object): def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.resize(592, 549) self.centralwidget = QWidget(MainWindow) self.centralwidget.setObjectName(u"centralwidget") self.gridLayout_13 = QGridLayout(self.centralwidget) self.gridLayout_13.setObjectName(u"gridLayout_13") self.group_one_sheet = QGroupBox(self.centralwidget) self.group_one_sheet.setObjectName(u"group_one_sheet") self.group_one_sheet.setCheckable(True) self.group_one_sheet.setChecked(False) self.gridLayout = QGridLayout(self.group_one_sheet) self.gridLayout.setObjectName(u"gridLayout") self.group_one_sheet_head = QGroupBox(self.group_one_sheet) self.group_one_sheet_head.setObjectName(u"group_one_sheet_head") self.group_one_sheet_head.setCheckable(True) self.gridLayout_4 = QGridLayout(self.group_one_sheet_head) self.gridLayout_4.setObjectName(u"gridLayout_4") self.horizontalLayout_11 = QHBoxLayout() self.horizontalLayout_11.setObjectName(u"horizontalLayout_11") self.label_23 = QLabel(self.group_one_sheet_head) self.label_23.setObjectName(u"label_23")
self.horizontalLayout_11.addWidget(self.label_23)
self.spin_head_start = QSpinBox(self.group_one_sheet_head) self.spin_head_start.setObjectName(u"spin_head_start") self.spin_head_start.setMinimum(1) self.spin_head_start.setValue(1)
self.horizontalLayout_11.addWidget(self.spin_head_start)
self.label_24 = QLabel(self.group_one_sheet_head) self.label_24.setObjectName(u"label_24")
self.horizontalLayout_11.addWidget(self.label_24)
self.spin_head_end = QSpinBox(self.group_one_sheet_head) self.spin_head_end.setObjectName(u"spin_head_end") self.spin_head_end.setMinimum(1) self.spin_head_end.setMaximum(100) self.spin_head_end.setValue(5)
self.horizontalLayout_11.addWidget(self.spin_head_end)
self.horizontalLayout_11.setStretch(1, 1) self.horizontalLayout_11.setStretch(3, 1)
self.gridLayout_4.addLayout(self.horizontalLayout_11, 0, 0, 1, 1)
self.gridLayout.addWidget(self.group_one_sheet_head, 0, 0, 1, 1)
self.groupBox_3 = QGroupBox(self.group_one_sheet) self.groupBox_3.setObjectName(u"groupBox_3") self.gridLayout_9 = QGridLayout(self.groupBox_3) self.gridLayout_9.setObjectName(u"gridLayout_9") self.horizontalLayout_17 = QHBoxLayout() self.horizontalLayout_17.setObjectName(u"horizontalLayout_17") self.label_35 = QLabel(self.groupBox_3) self.label_35.setObjectName(u"label_35")
self.horizontalLayout_17.addWidget(self.label_35)
self.spin_line_start = QSpinBox(self.groupBox_3) self.spin_line_start.setObjectName(u"spin_line_start") self.spin_line_start.setValue(6)
self.horizontalLayout_17.addWidget(self.spin_line_start)
self.label_36 = QLabel(self.groupBox_3) self.label_36.setObjectName(u"label_36")
self.horizontalLayout_17.addWidget(self.label_36)
self.spin_line_end = QSpinBox(self.groupBox_3) self.spin_line_end.setObjectName(u"spin_line_end") self.spin_line_end.setEnabled(False) self.spin_line_end.setMinimum(-1) self.spin_line_end.setValue(-1)
self.horizontalLayout_17.addWidget(self.spin_line_end)
self.horizontalLayout_17.setStretch(1, 1) self.horizontalLayout_17.setStretch(3, 1)
self.gridLayout_9.addLayout(self.horizontalLayout_17, 0, 0, 1, 1)
self.gridLayout.addWidget(self.groupBox_3, 1, 0, 1, 1)
self.gridLayout_13.addWidget(self.group_one_sheet, 0, 0, 1, 1)
self.group_different_sheet = QGroupBox(self.centralwidget) self.group_different_sheet.setObjectName(u"group_different_sheet") self.group_different_sheet.setCheckable(True) self.group_different_sheet.setChecked(True) self.gridLayout_10 = QGridLayout(self.group_different_sheet) self.gridLayout_10.setObjectName(u"gridLayout_10") self.group_different_sheet_head = QGroupBox(self.group_different_sheet) self.group_different_sheet_head.setObjectName(u"group_different_sheet_head") self.group_different_sheet_head.setCheckable(True) self.gridLayout_11 = QGridLayout(self.group_different_sheet_head) self.gridLayout_11.setObjectName(u"gridLayout_11") self.horizontalLayout_18 = QHBoxLayout() self.horizontalLayout_18.setObjectName(u"horizontalLayout_18") self.label_37 = QLabel(self.group_different_sheet_head) self.label_37.setObjectName(u"label_37")
self.horizontalLayout_18.addWidget(self.label_37)
self.line_edit_head_sheet = QLineEdit(self.group_different_sheet_head) self.line_edit_head_sheet.setObjectName(u"line_edit_head_sheet")
self.horizontalLayout_18.addWidget(self.line_edit_head_sheet)
self.gridLayout_11.addLayout(self.horizontalLayout_18, 0, 0, 1, 1)
self.gridLayout_10.addWidget(self.group_different_sheet_head, 0, 0, 1, 1)
self.groupBox_9 = QGroupBox(self.group_different_sheet) self.groupBox_9.setObjectName(u"groupBox_9") self.gridLayout_12 = QGridLayout(self.groupBox_9) self.gridLayout_12.setObjectName(u"gridLayout_12") self.horizontalLayout_19 = QHBoxLayout() self.horizontalLayout_19.setObjectName(u"horizontalLayout_19") self.label_38 = QLabel(self.groupBox_9) self.label_38.setObjectName(u"label_38")
self.horizontalLayout_19.addWidget(self.label_38)
self.line_edit_line_sheet = QLineEdit(self.groupBox_9) self.line_edit_line_sheet.setObjectName(u"line_edit_line_sheet")
self.horizontalLayout_19.addWidget(self.line_edit_line_sheet)
self.gridLayout_12.addLayout(self.horizontalLayout_19, 0, 0, 1, 1)
self.gridLayout_10.addWidget(self.groupBox_9, 1, 0, 1, 1)
self.gridLayout_13.addWidget(self.group_different_sheet, 0, 1, 1, 1)
self.btn_generate_xml = QPushButton(self.centralwidget) self.btn_generate_xml.setObjectName(u"btn_generate_xml") self.btn_generate_xml.setMinimumSize(QSize(0, 35))
self.gridLayout_13.addWidget(self.btn_generate_xml, 2, 0, 1, 2)
self.groupBox_4 = QGroupBox(self.centralwidget) self.groupBox_4.setObjectName(u"groupBox_4") self.gridLayout_2 = QGridLayout(self.groupBox_4) self.gridLayout_2.setObjectName(u"gridLayout_2") self.group_xml_head = QGroupBox(self.groupBox_4) self.group_xml_head.setObjectName(u"group_xml_head") self.group_xml_head.setCheckable(True) self.gridLayout_8 = QGridLayout(self.group_xml_head) self.gridLayout_8.setObjectName(u"gridLayout_8") self.horizontalLayout_9 = QHBoxLayout() self.horizontalLayout_9.setObjectName(u"horizontalLayout_9") self.label_19 = QLabel(self.group_xml_head) self.label_19.setObjectName(u"label_19")
self.horizontalLayout_9.addWidget(self.label_19)
self.line_edit_head_root_name = QLineEdit(self.group_xml_head) self.line_edit_head_root_name.setObjectName(u"line_edit_head_root_name")
self.horizontalLayout_9.addWidget(self.line_edit_head_root_name)
self.label_20 = QLabel(self.group_xml_head) self.label_20.setObjectName(u"label_20")
self.horizontalLayout_9.addWidget(self.label_20)
self.line_edit_head_row_name = QLineEdit(self.group_xml_head) self.line_edit_head_row_name.setObjectName(u"line_edit_head_row_name")
self.horizontalLayout_9.addWidget(self.line_edit_head_row_name)
self.gridLayout_8.addLayout(self.horizontalLayout_9, 0, 0, 1, 1)
self.gridLayout_2.addWidget(self.group_xml_head, 2, 0, 1, 1)
self.groupBox_5 = QGroupBox(self.groupBox_4) self.groupBox_5.setObjectName(u"groupBox_5") self.groupBox_5.setCheckable(False) self.gridLayout_7 = QGridLayout(self.groupBox_5) self.gridLayout_7.setObjectName(u"gridLayout_7") self.horizontalLayout_7 = QHBoxLayout() self.horizontalLayout_7.setObjectName(u"horizontalLayout_7") self.label_15 = QLabel(self.groupBox_5) self.label_15.setObjectName(u"label_15")
self.horizontalLayout_7.addWidget(self.label_15)
self.line_edit_line_root_name = QLineEdit(self.groupBox_5) self.line_edit_line_root_name.setObjectName(u"line_edit_line_root_name")
self.horizontalLayout_7.addWidget(self.line_edit_line_root_name)
self.label_16 = QLabel(self.groupBox_5) self.label_16.setObjectName(u"label_16")
self.horizontalLayout_7.addWidget(self.label_16)
self.line_edit_line_row_name = QLineEdit(self.groupBox_5) self.line_edit_line_row_name.setObjectName(u"line_edit_line_row_name")
self.horizontalLayout_7.addWidget(self.line_edit_line_row_name)
self.horizontalLayout_7.setStretch(1, 1) self.horizontalLayout_7.setStretch(3, 1)
self.gridLayout_7.addLayout(self.horizontalLayout_7, 0, 0, 1, 1)
self.gridLayout_2.addWidget(self.groupBox_5, 3, 0, 1, 1)
self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.label = QLabel(self.groupBox_4) self.label.setObjectName(u"label")
self.horizontalLayout.addWidget(self.label)
self.radio_normal = QRadioButton(self.groupBox_4) self.radio_normal.setObjectName(u"radio_normal") self.radio_normal.setChecked(True)
self.horizontalLayout.addWidget(self.radio_normal)
self.radio_lower = QRadioButton(self.groupBox_4) self.radio_lower.setObjectName(u"radio_lower")
self.horizontalLayout.addWidget(self.radio_lower)
self.radio_upper = QRadioButton(self.groupBox_4) self.radio_upper.setObjectName(u"radio_upper")
self.horizontalLayout.addWidget(self.radio_upper)
self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout.addItem(self.horizontalSpacer)
self.check_trim = QCheckBox(self.groupBox_4) self.check_trim.setObjectName(u"check_trim")
self.horizontalLayout.addWidget(self.check_trim)
self.horizontalLayout.setStretch(4, 1) self.horizontalLayout.setStretch(5, 1)
self.gridLayout_2.addLayout(self.horizontalLayout, 0, 0, 1, 1)
self.verticalSpacer = QSpacerItem(20, 20, QSizePolicy.Minimum, QSizePolicy.Fixed)
self.gridLayout_2.addItem(self.verticalSpacer, 1, 0, 1, 1)
self.gridLayout_13.addWidget(self.groupBox_4, 1, 0, 1, 2)
MainWindow.setCentralWidget(self.centralwidget) self.menubar = QMenuBar(MainWindow) self.menubar.setObjectName(u"menubar") self.menubar.setGeometry(QRect(0, 0, 592, 21)) MainWindow.setMenuBar(self.menubar) self.statusbar = QStatusBar(MainWindow) self.statusbar.setObjectName(u"statusbar") MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"Excel to XML", None)) self.group_one_sheet.setTitle(QCoreApplication.translate("MainWindow", u"Excel Header and Records in One Sheet", None)) self.group_one_sheet_head.setTitle(QCoreApplication.translate("MainWindow", u"Header", None)) self.label_23.setText(QCoreApplication.translate("MainWindow", u"Column Span", None)) self.label_24.setText(QCoreApplication.translate("MainWindow", u"-", None))
self.spin_head_end.setToolTip("")
self.groupBox_3.setTitle(QCoreApplication.translate("MainWindow", u"Records", None)) self.label_35.setText(QCoreApplication.translate("MainWindow", u"Column Span", None)) self.label_36.setText(QCoreApplication.translate("MainWindow", u"-", None))
self.spin_line_end.setToolTip(QCoreApplication.translate("MainWindow", u"-1 represents to the last", None))
self.group_different_sheet.setTitle(QCoreApplication.translate("MainWindow", u"Excel Header and Records in Different Sheet", None)) self.group_different_sheet_head.setTitle(QCoreApplication.translate("MainWindow", u"Header", None)) self.label_37.setText(QCoreApplication.translate("MainWindow", u"Sheet Name", None)) self.line_edit_head_sheet.setPlaceholderText(QCoreApplication.translate("MainWindow", u"Default is 1st sheet ", None)) self.groupBox_9.setTitle(QCoreApplication.translate("MainWindow", u"Records", None)) self.label_38.setText(QCoreApplication.translate("MainWindow", u"Sheet Name", None)) self.line_edit_line_sheet.setPlaceholderText(QCoreApplication.translate("MainWindow", u"Default is 2nd sheet ", None)) self.btn_generate_xml.setText(QCoreApplication.translate("MainWindow", u"Generate XML", None)) self.groupBox_4.setTitle(QCoreApplication.translate("MainWindow", u"XML", None)) self.group_xml_head.setTitle(QCoreApplication.translate("MainWindow", u"Header", None)) self.label_19.setText(QCoreApplication.translate("MainWindow", u"Root Tag Name", None)) self.line_edit_head_root_name.setText(QCoreApplication.translate("MainWindow", u"file", None)) self.label_20.setText(QCoreApplication.translate("MainWindow", u"Row Tag Name", None)) self.line_edit_head_row_name.setText(QCoreApplication.translate("MainWindow", u"header", None)) self.groupBox_5.setTitle(QCoreApplication.translate("MainWindow", u"Records", None)) self.label_15.setText(QCoreApplication.translate("MainWindow", u"Root Tag Name", None)) self.line_edit_line_root_name.setText(QCoreApplication.translate("MainWindow", u"records", None)) self.label_16.setText(QCoreApplication.translate("MainWindow", u"Row tag Name", None)) self.line_edit_line_row_name.setText(QCoreApplication.translate("MainWindow", u"record", None)) self.label.setText(QCoreApplication.translate("MainWindow", u"Tag Case", None)) self.radio_normal.setText(QCoreApplication.translate("MainWindow", u"Normal", None)) self.radio_lower.setText(QCoreApplication.translate("MainWindow", u"Lower", None)) self.radio_upper.setText(QCoreApplication.translate("MainWindow", u"Upper", None)) self.check_trim.setText(QCoreApplication.translate("MainWindow", u"Trim Data", None))
|