├── controle.py └── formulario2.ui /controle.py: -------------------------------------------------------------------------------- 1 | from PyQt5 import uic,QtWidgets 2 | 3 | def funcao_principal(): 4 | linha1 = formulario.lineEdit.text() 5 | linha2 = formulario.lineEdit_2.text() 6 | linha3 = formulario.lineEdit_3.text() 7 | 8 | if formulario.radioButton.isChecked() : 9 | print("Categoria Eletronicos selecionada") 10 | elif formulario.radioButton_2.isChecked() : 11 | print("Categoria Informatica selecionada") 12 | else : 13 | print("Categoria Alimentos selecionada") 14 | 15 | print("Código:",linha1) 16 | print("Descricao:",linha2) 17 | print("Preco",linha3) 18 | 19 | 20 | app=QtWidgets.QApplication([]) 21 | formulario=uic.loadUi("formulario2.ui") 22 | formulario.pushButton.clicked.connect(funcao_principal) 23 | 24 | formulario.show() 25 | app.exec() -------------------------------------------------------------------------------- /formulario2.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 498 10 | 585 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | background-color: rgb(75, 255, 165); 18 | 19 | 20 | 21 | 22 | 23 | 24 | 200 25 | 420 26 | 111 27 | 51 28 | 29 | 30 | 31 | 32 | 15 33 | 34 | 35 | 36 | background-color: rgb(55, 102, 255); 37 | color: rgb(255, 255, 255); 38 | 39 | 40 | Enviar 41 | 42 | 43 | 44 | 45 | 46 | 50 47 | 80 48 | 81 49 | 31 50 | 51 | 52 | 53 | 54 | 15 55 | 56 | 57 | 58 | Código 59 | 60 | 61 | 62 | 63 | 64 | 50 65 | 130 66 | 91 67 | 31 68 | 69 | 70 | 71 | 72 | 15 73 | 74 | 75 | 76 | Descrição 77 | 78 | 79 | 80 | 81 | 82 | 50 83 | 180 84 | 71 85 | 20 86 | 87 | 88 | 89 | 90 | 15 91 | 92 | 93 | 94 | Preço 95 | 96 | 97 | 98 | 99 | 100 | 170 101 | 79 102 | 201 103 | 31 104 | 105 | 106 | 107 | 108 | 12 109 | 110 | 111 | 112 | background-color: rgb(255, 255, 255); 113 | 114 | 115 | 116 | 117 | 118 | 170 119 | 130 120 | 201 121 | 31 122 | 123 | 124 | 125 | 126 | 12 127 | 128 | 129 | 130 | background-color: rgb(255, 255, 255); 131 | 132 | 133 | 134 | 135 | 136 | 170 137 | 180 138 | 201 139 | 31 140 | 141 | 142 | 143 | 144 | 12 145 | 146 | 147 | 148 | background-color: rgb(255, 255, 255); 149 | 150 | 151 | 152 | 153 | 154 | 290 155 | 290 156 | 111 157 | 21 158 | 159 | 160 | 161 | 162 | 12 163 | 75 164 | true 165 | 166 | 167 | 168 | Eletrônicos 169 | 170 | 171 | 172 | 173 | 174 | 290 175 | 320 176 | 121 177 | 21 178 | 179 | 180 | 181 | 182 | 12 183 | 75 184 | true 185 | 186 | 187 | 188 | Informática 189 | 190 | 191 | 192 | 193 | 194 | 290 195 | 260 196 | 101 197 | 21 198 | 199 | 200 | 201 | 202 | 12 203 | 75 204 | true 205 | 206 | 207 | 208 | Alimentos 209 | 210 | 211 | 212 | 213 | 214 | 130 215 | 0 216 | 271 217 | 31 218 | 219 | 220 | 221 | 222 | 20 223 | 224 | 225 | 226 | color: rgb(0, 85, 255); 227 | 228 | 229 | Cadastro de produtos 230 | 231 | 232 | 233 | 234 | 235 | 170 236 | 250 237 | 101 238 | 31 239 | 240 | 241 | 242 | 243 | 15 244 | 245 | 246 | 247 | Categoria: 248 | 249 | 250 | 251 | 252 | 253 | 254 | 0 255 | 0 256 | 498 257 | 21 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | --------------------------------------------------------------------------------