tag:blogger.com,1999:blog-57022038999724884992024-03-04T21:30:19.340-08:00PHIRON - PÁGINA DA WEBBlog com a finalidade de compartilhar informações, especialmente programação em Python e QtPhironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.comBlogger49125tag:blogger.com,1999:blog-5702203899972488499.post-4221418295691666822018-10-04T16:58:00.001-07:002018-10-05T06:39:29.184-07:00Porque na minha opinião o lançamento do XboxOneX tão poderoso não foi, talvez uma boa jogada da MicrosoftQuando a microsoft lançou o XboxOne base ele era mais caro e menos potente que o Playstation4 base, a Sony ficou muito tempo jogando isso na cara da Microsoft, e mesmo quando ela lançou o XboxOneS este ainda não conseguiu superar o PS4 base.<br />
Então surgiu a necessidade de mais resolução e a Sony lançou um console um pouco melhor que o PS4 base com o único intuito de suportar resoluções superiores, o preço não é muito diferente que o PS4 regular, este novo console foi chamado de PS4 Pro, e se tornou uma ótima opção de novas compras, especialmente por causa do HD maior de 1TB.<br />
A microsoft que estava ressentida por causa dos problemas que teve com o XboxOne base lançou então um console super poderoso, o XboxOneX.<br />
Este novo console tem mais que o dobro do XboxOne base... e qual o problema?<br />
<br />
O problema é que mesmo com o poder adicionar do XboxOneX ele ainda não tem todo o poder para rodar todos os jogos em 4k nativamente, haja vista as configurações extremas que os computadores precisam ter para rodar em 4k, no final das contas, muitos jogos ainda rodam em resolução dinâmica ou em checkerboard assim como o PS4 Pro.<br />
<br />
E para piorar, ele precisa ficar preso dentro da compatibilidade com o XboxOne base, jogos não são apenas resolução mas também conteúdo.<br />
<br />
Vi um cara no combo infinito alegando que o XboxOneX não é segurado pelo XboxOne base porque quando se cria texturas e modelos 3D sempre são criados em alta qualidade e então são diminuídos para "caber" em locais menores, e eu concordo em partes, mas aqui vão meus argumentos:<br />
<br />
1 - Criar texturas e modelos mais detalhados é mais caro: Para criar modelos e texturas com maior qualidade é necessário mais tempo de desenvolvimento, mais atenção nos detalhes, alguns truques que funcionam em certa qualidade e nem tão bem em outra qualidade, se a base instalada de consoles e aparelhos não funcionam em 4k, os desenvolvedores irão optar por criar texturas e modelos medianos (Talvez mirando no PS4 Pro) e então melhora um ou outro detalhe no XboxOneX.<br />
<br />
2 - Jogos não são apenas resolução mas conteúdo também: Com o poder adicional do XboxOneX os jogos poderiam ser maiores, ter mais mapas e mecânicas mais complexas, mas como o jogo precisa funcionar no XboxOne base as desenvolvedoras optam por balizar "por baixo" e a única coisa que pode ser diferente são os gráficos e um pouco do framerate. Eu percebi bem isso jogando GTAV no meu notebook, os gráficos em si ficam bons, mas o jogo quase trava quando entra na cidade e tem um montão de gente e carros funcionando.<br />
<br />
3 - A base instalada do XboxOneX é pequena: Nesta geração o PS4 reina absoluto no mundo dos consoles, então as produtoras obviamente olham para o mercado, visto que a maioria dos jogos multiplataforma, por motivos óbvios, possuem uma fatia de venda maior no PS4. Seria desperdício de dinheiro a produtora investir em desenvolvimento tendo em vista o XboxOneX que possui uma base pequena até mesmo entre os consoles da Microsoft.<br />
<br />
4 - Os consoles estão freando até mesmo o PC: Hoje em dia certamente as produtoras olham com muito carinho o mercado dos consoles simplesmente por causa das vendas, o que ocorre é que jogos de PC sofrem concorrência com a pirataria, coisa que foi banida nesta oitava geração de videogames.<br />
<br />
Esse é o meu pensamento, eu acredito que seria mais inteligente por parte da Microsoft que eles lançassem alguma coisa próxima do PS4 pro e focassem no desenvolvimento da próxima geração, por este motivo acredito que o <a href="https://www.comboinfinito.com.br/principal/darksiders-3-nao-vai-utilizar-todo-o-potencial-do-xbox-one-x-e-a-culpa-e-do-xbox-one-base/">comentário da líder da THQ nórdic é salutar,</a> é uma coisa real.<br />
<br />
Para comparação: <a href="https://www.gamespot.com/articles/console-specs-compared-xbox-one-x-ps4-pro-switch-a/1100-6443665/">Lista de especificações XboxOne e PS4</a><br />
<br />Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com0tag:blogger.com,1999:blog-5702203899972488499.post-58017273122753333832016-12-14T16:59:00.003-08:002016-12-14T17:03:15.320-08:00Porque cobrar ISS sobre serviços de streaming é totalmente ridículo.Pagar impostos no Brasil é ridículo de qualquer forma, mas pelo fato de "vivermos em um estado de direito", esse é o preço por isso.<br />
Pelo fato de eu achar a ideologia anarcocapitalista tão utópica quanto o socialismo, eu não posso negar o fato de termos que pagar impostos, infelizmente precisamos do estado em maior ou menor grau.<br />
Ok, então vamos aos impostos, existem diversos deles, impostos sobre bens, sobre produção, sobre transações financeiras, sobre telecomunicações, energia, etc.<br />
Até o próprio imposto de renda, podemos discutir as alíquotas, mas em suma faz uma certa lógica termos que pagar.<br />
O estado fornece a infraestrutura ou as condições para manter o mercado financeiro, as rodovias, licencia as transmissões de radiofrequência (justifica o licenciamento visto que o espectro de transmissão também é limitado), isso tem sentido de ter impostos, claro que novamente podemos questionar as alíquotas, mas o estado precisa regular essas transações e operações para que não vire uma bagunça, obviamente ele tem um custo para fazer essas regulações.<br />
<br />
Aí que entro no mérito dos serviços de streaming, o que eles precisam é de internet. O provedor já paga os impostos pela internet, qual a justificativa de ter ISS sobre serviços como Netflix ou Spotify, ainda tem a complicação desse imposto ser municipal e a empresa ser multinacional com sede sei lá onde.<br />
<br />
O que vai ter de gente fazendo esquema com VPN e endereço internacional não tá escrito.<br />
<br />
Brasil, um país de tolos.Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com0tag:blogger.com,1999:blog-5702203899972488499.post-49955203902218434592016-04-18T03:41:00.002-07:002016-04-18T03:41:43.459-07:00Servidor CENTOS parou de autenticar no Active DirectoryTenho um servidor CENTOS 7.0 que é integrado no active Directory em um windows server 2008R2, ele autentica os usuários do domínio no servidor linux e funcionava muito bem.<br />
<br />
O que ocorreu é que depois de algumas atualizações ele parou de autenticar os usuários do domínio na máquina linux, depois de pesquisar bastante vi que só era necessário autenticar novamente a máquina no domínio com o comando:<br />
<br />
<pre style="background-color: #eeeeee; border: 0px; color: #222426; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;">net ads keytab create -U administrator</code></pre>
Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com1tag:blogger.com,1999:blog-5702203899972488499.post-82269726238513197932015-02-16T04:54:00.003-08:002015-02-16T04:58:40.454-08:00Sozi, uma excelente solução livre e gratuita para apresentações.<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;">Olá Amigos,</span></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;">Irei lhes apresentar
agora uma ferramenta que eu achei muito interessante, ela se chama
SOZI e é um plugin para o programa Inkscape.</span></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;">Com ela podemos
criar apresentações não lineares como o consagrado Prezi, com a
vantagem de ser gratuito e poder funcionar de maneira totalmente
offline.</span></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;">Para reproduzir a
sua apresentação, a única coisa que você necessita é de um
navegador mais moderno com suporte ao formato .svg como versões não
muito antigas do chrome ou firefox.</span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;">Como o programa
funciona em conjunto com o inkscape, você precisa planejar a sua
apresentação em uma tela e então desenhá-la.</span></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwb2NZ5_MliokOYOdYTZFgHVIixtFFZsOMH_MbCy7yETfE0MQQf3-SqUREn8FiBlY5KmSKNwAfUKAjIALAcfyUlcgCxyrpgB6-EnzrVVG6oMynyJ9-zbAb3DxjtKtsZRhaWf2-4PILnv9J/s1600/Captura+de+tela+de+2015-02-16+10:29:28.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwb2NZ5_MliokOYOdYTZFgHVIixtFFZsOMH_MbCy7yETfE0MQQf3-SqUREn8FiBlY5KmSKNwAfUKAjIALAcfyUlcgCxyrpgB6-EnzrVVG6oMynyJ9-zbAb3DxjtKtsZRhaWf2-4PILnv9J/s1600/Captura+de+tela+de+2015-02-16+10:29:28.png" height="179" width="320" /></span></a></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
</div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;">Imagine cada
“pedaço” desta tela como uma parte da sua apresentação, para
facilitar, crie grupos com a sua tela e então depois bloquei esse
grupos de modo que você não poderá selecionar os itens com o
mouse.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdNyO0p1LxS_oAhNWbiaE5wp-FXxaRTYxaOSt91X8ILEoZusA4n9JjxWrFYI-CkVuva43_m7mpaG573Y94F1oOaLd4daBXeGnIl7GhDb5dvwLhZSsFyn5lJskPwRtpPlG2UDU5Cl_YUro_/s1600/Captura+de+tela+de+2015-02-16+10:32:52.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdNyO0p1LxS_oAhNWbiaE5wp-FXxaRTYxaOSt91X8ILEoZusA4n9JjxWrFYI-CkVuva43_m7mpaG573Y94F1oOaLd4daBXeGnIl7GhDb5dvwLhZSsFyn5lJskPwRtpPlG2UDU5Cl_YUro_/s1600/Captura+de+tela+de+2015-02-16+10:32:52.png" height="179" width="320" /></span></a></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPFmEuZ2KlaM392zrC_XDRwCSl-W9E8nbh1J2eMUhGqMCHncs0TVkJii4fL-yC8tNodNskdwNgBvFWZ9EDSTwUhtffCwJRRfqVUfGMlyK1m9xX3AkcgQKWxM3Bd4y3Ent6JXP94cLKY3KZ/s1600/Captura+de+tela+de+2015-02-16+10:33:18.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPFmEuZ2KlaM392zrC_XDRwCSl-W9E8nbh1J2eMUhGqMCHncs0TVkJii4fL-yC8tNodNskdwNgBvFWZ9EDSTwUhtffCwJRRfqVUfGMlyK1m9xX3AkcgQKWxM3Bd4y3Ent6JXP94cLKY3KZ/s1600/Captura+de+tela+de+2015-02-16+10:33:18.png" height="179" width="320" /></span></a></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;">Após terminar de
criar a sua tela, selecione os pedaços com retângulos e então
preencha o ID do retângulo com um número que indique a ordem de
apresentação de cada quadro da sua apresentação, por exemplo, o
primeiro quadro você coloca o ID “1”, o segundo o ID “2” e
assim por diante.</span></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;">Após criar todos os
seus quadros, basta selecionar todos e então abrir o diálogo do
sozi, com o diálogo aberto clique no botão + e perceba que a opção
“elemento svg” irá se preencher com o id de 1 em diante, de
acordo com o seu preenchimento</span></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
</div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKk0ENHiDZKtUSvR3oGbbsv407jb1QhsBipVGELz5TqHGQjO0smOvx34W7Ih-0fwmMzWaijoJMJddxf22wg3CfPyofzlK8TjhbNpJTG7WzFPcFau-BpKe47ey93b7tgvrqlKz39Fpr9Icd/s1600/Captura+de+tela+de+2015-02-16+10:34:15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKk0ENHiDZKtUSvR3oGbbsv407jb1QhsBipVGELz5TqHGQjO0smOvx34W7Ih-0fwmMzWaijoJMJddxf22wg3CfPyofzlK8TjhbNpJTG7WzFPcFau-BpKe47ey93b7tgvrqlKz39Fpr9Icd/s1600/Captura+de+tela+de+2015-02-16+10:34:15.png" height="179" width="320" /></span></a></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;">Após isso, salve a
sua apresentação no formato .svg padrão e abra em algum navegador
da sua preferência.</span></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;">Deixarei uma
apresentação de exemplo para vocês verem e a que eu tirei os
screenshots, o sozi possui inúmeras outras funcionalidades, para o
meu uso que gosto de apresentações mais simples isso basta, o muito
que eu faço é adicionar imagens, mas para quem prefere coisas mais
elaboradas ele é capaz de fazer, usando camadas(layers), etc.</span></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
</div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;">Existem diversos
tutoriais, como o meu objetivo é apenas apresentar a ferramenta e
como eu mesmo não uso coisas muito elaboradas, creio que esse breve
texto cumpriu o seu objetivo.</span></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Site oficial do Sozi: <a href="http://sozi.baierouge.fr/" target="_blank">http://sozi.baierouge.fr/</a></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Site oficial do Inkscape: <a href="https://inkscape.org/pt/" target="_blank">https://inkscape.org/pt/</a></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<span style="font-family: Arial, Helvetica, sans-serif;">Download de arquivos de exemplo:</span></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<a href="http://arturfilho.mat.br/arquivos/exemplo_screenshot.svg" target="_blank"><span style="font-family: Arial, Helvetica, sans-serif;">Apresentação Screenshot</span></a></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<a href="http://arturfilho.mat.br/arquivos/exemplo_apresentacao_sozi_inkscape.svg" target="_blank"><span style="font-family: Arial, Helvetica, sans-serif;">Apresentação Exemplo</span></a></div>
<div style="line-height: 100%; margin-bottom: 0cm;">
<br /></div>
Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com0tag:blogger.com,1999:blog-5702203899972488499.post-68606465501822376132014-03-05T06:21:00.002-08:002014-03-05T06:27:04.322-08:00Antivírus para android é necessário?<span style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;">Eu sempre digo que antivírus para o android em função realmente de "antivírus" é praticamente inútil, e as empresas que o produzem sabem disso, é tanto que eles sempre vêm com outras funções que são interessantes e para algumas pessoas vale à pena sacrificar a performance do sistema.</span><br />
<br style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;" />
<span style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;">Mas para se proteger de pragas virtuais eles não são eficazes, e porque?</span><br />
<br style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;" />
<span style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;">O android usa um tipo de máquina virtual bem semelhante ao java, então todos os aplicativos rodam dentro da caixa de areia java.</span><br />
<br style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;" />
<span style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;">Além disso, a cada aplicativo instalado ele cria um usuário (tipo o usuário linux mesmo) limitado de maneira que apenas esse usuário criado possa alterar os arquivos do aplicativo isolando-o dos demais aplicativos e do sistema, agora você entende porque o usuário "root" é desabilitado por padrão né?</span><br />
<br style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;" />
<span style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;">E se ainda acha isso pouco, o android ainda usa o </span><a href="http://selinuxproject.org/page/Main_Page" rel="nofollow" style="background-color: white; color: #22229c; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px; text-decoration: none;" target="_blank">SELinux</a><span style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;"> para aumentar a segurança do sistema.</span><br />
<br style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;" />
<span style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;">Mas os malwares para android existem e isso é inegável.</span><br />
<br style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;" />
<span style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;">Essas pragas virtuais se aproveitam de falhas de aplicativos específicos (por exemplo, uma falha no programa de SMS que permite acesso aos seus contatos indevidamente, por padrão o SMS tem acesso aos seus contatos)</span><br />
<br style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;" />
<span style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;">E também de falhas no sistema em si o que ocorre em menor proporção, mas além de ter a falha precisa existir uma maneira de explorar essa falha e uma maneira são os aplicativos piratas e modificados que existem aos montes, alguns deles são instalados de maneira de alterar até mesmo o comportamento da play store e google play services que são programas chave no android.</span><br />
<br style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;" />
<span style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;">A outra maneira é a engenharia social, eu navego bastante no android e essa tarefa se tornou um parto, muitos sites que a gente acessa pedem para instalar esse ou outro aplicativo .apk diretamente, as versões mais recentes do android (4.x) possuem um aplicativo que verifica o aplicativo antes de instalá-lo mesmo se for de fora da play store, mas não é garantia que irá funcionar visto que é uma briga de gato e rato e todo dia eles lançam novos aplicativos maliciosos e o verificador busca na lista negra do google na internet.</span><br />
<br style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;" />
<span style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;">Uma maneira que encontrei de me prevenir de sites ficarem fazendo downloads de aplicativos .apk foi mudar o "user agent" do firefox mobile, você digita na barra de navegação: about</span><b style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;"></b><span style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;">:config e modifica o valor da configuração </span><span style="background-color: white; font-family: Helvetica; font-size: 13px;">"general.useragent.override" se ela não existir basta cria-la.</span><br />
<span style="background-color: white; font-family: Helvetica; font-size: 13px;"><br /></span>
<span style="background-color: white; font-family: Helvetica; font-size: 13px;">No meu caso eu usei a string do linux porque na do windows o computador ficava me enchendo para instalar plugins do windows (Vírus), e com o user agent do linux eles me limitam a exibir apenas as propagandas chatas mesmo.</span><br />
<span style="background-color: white; font-family: Helvetica; font-size: 13px;"><br /></span>
<span style="background-color: white; font-family: Helvetica; font-size: 13px;">Além disso, você </span><span style="background-color: white; font-family: Helvetica; font-size: 13px;"><b>jamais </b><span style="font-size: small;">deve deixar a opção "fontes desconhecidas" ativas por padrão, instale aplicativos fora da play store somente se você tem certeza absoluta da procedência dos mesmos.</span></span><br />
<span style="background-color: white; font-family: Helvetica; font-size: 13px;"><span style="font-size: small;"><br /></span></span>
<span style="background-color: white; font-family: Helvetica; font-size: 13px;"><span style="font-size: small;">No mais, os aplicativos da play store raramente ultrapassam os R$20,00 poxa gente, se o aplicativo é bom e resolveu o seu problema é justo pagar por ele não? <img alt="" border="0" class="inlineimg" src="http://e.cdn-hardware.com.br/comunidade/images/smilies/wink.gif" style="vertical-align: middle;" title="Wink" /></span></span><br />
<span style="background-color: white; font-family: Helvetica; font-size: 13px;"><span style="font-size: small;"><br /></span></span>
<span style="background-color: white; font-family: Helvetica; font-size: 13px;"><span style="font-size: small;"><a href="http://www.tecmundo.com.br/malware/52026-android-reune-97-dos-malwares-mas-so-0-1-esta-na-google-play.htm" target="_blank">Android reúne 97% das pragas para dispositivos móveis, mas apenas 0,1% está na play store</a></span></span><br />
<span style="background-color: white; font-family: Helvetica; font-size: 13px;"><br /></span>
Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com0tag:blogger.com,1999:blog-5702203899972488499.post-31067686438438099812013-11-08T03:52:00.002-08:002013-11-08T04:06:03.732-08:00Porque Somos Pobres?<div class="MsoNormal" style="text-indent: 18.0pt;">
Alguém já se perguntou o porquê
que somos pobres? Não digo individualmente mas sim de maneira geral, como
brasileiros, há um tempo atrás não me lembro onde, li um artigo onde uma pessoa
explicava a diferença entre percepção de riquezas entre os brasileiros e os
norte americanos e europeus. Ele dizia que um brasileiro para se considerar bem
sucedido e possuir “Status” na sociedade, precisa possuir bens.</div>
<div class="MsoNormal" style="text-indent: 18.0pt;">
<br /></div>
<ul style="margin-top: 0cm;" type="disc">
<li class="MsoNormal">Casa
própria bacana;</li>
<li class="MsoNormal">Carro
zero de preferência;</li>
<li class="MsoNormal">Computador,
roupas e celulares top de linha ou de marca.</li>
</ul>
<div class="MsoNormal" style="margin-left: 18.0pt;">
<br /></div>
<div class="MsoNormal" style="text-indent: 18.0pt;">
Note que com exceção da casa própria
todas as outras coisas são bens de consumo, coisas que não deveriam por si só
denotar riqueza ou “status”.</div>
<div class="MsoNormal" style="text-indent: 18.0pt;">
Ao analisarmos nosso mercado
percebemos que isso é a mais pura verdade, temos taxas de empréstimo/crediário
e financiamento altíssimas, as pessoas não pensam duas vezes em comprar
produtos eletrônicos em 12/24/36x mesmo que tais produtos tenham uma taxa de
depreciação de <b>25% ao ano </b>isso
significa que um produto eletrônico depois de <b>4 anos</b> perdeu completamente o seu valor de mercado, essa cultura
justifica o alto preço dos carros e produtos em geral, justifica por exemplo,<a href="http://nuux.org/planstation-4/#sthash.m3gDZl0h.dpbs" target="_blank">um videogame de R$4.000,00. </a></div>
<div class="MsoNormal" style="text-indent: 18.0pt;">
Nos Estados Unidos e Europa as
pessoas se preocupam mais com sua auto-suficiência financeira, na maioria das
vezes querem montar algum negócio para poder se sustentar ou então investem em
fundos de aposentadoria/investimentos ou poupança, dessa maneira eles garantem
o seu próprio futuro, dão preferência a compras maiores à vista, isso é
facilmente perceptível nos filmes e séries que assistimos, vemos os
adolescentes ou as pessoas juntando dinheiro para comprar carros e/ou produtos,
aqui no Brasil sempre procuramos financiamentos ou “consórcios” onde pagamos
quase sempre o dobro do preço de um produto que ao final do plano não vale
metade do valor original, em termos práticos, pagamos pelo menos três vezes o
que deveríamos em um carro ou produto, a depreciação de um carro de passeio é
de 20% ao ano, isso significa que a cada um ano o seu carro zero perde 20% do
valor.</div>
<br />
<div class="MsoNormal" style="text-indent: 18.0pt;">
Que é o maior beneficiado disso
tudo é o nosso maldito governo, que para se dar bem com os eleitores basta que
incentive o crédito e aqueça a economia para que possamos comprar as
quinquilharias que tanto almejamos, e a nossa qualidade de vida permanece a
mesma, continuamos com a nossa cidade sem infra-estrutura, continuamos sem saúde
e educação de qualidade, mas temos a televisão de <st1:metricconverter productid="32 polegadas" w:st="on">32 polegadas</st1:metricconverter> tela
plana 3D na sala com a programação imbecilizante, lavando a nossa mente e alma
e nos tornando escravos da sociedade de consumo, a escravidão nunca acabou de
verdade, apenas se tornou universal e se modernizou e hoje nos escravizamos
para poder sobreviver.</div>
Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com0tag:blogger.com,1999:blog-5702203899972488499.post-41503451683456411872013-10-22T08:45:00.000-07:002013-10-22T08:45:02.605-07:00Windows 7 64 bits, erro: "O subsistema necessário para suportar o tipo de imagem não está presente."Bom, me deparei com esse erro no computador de um cliente recentemente, logo de cara já levei em conta que era vírus, tirei o HD e coloquei em outro micro e ficou uma tarde inteira fazendo a verificação, como resultado removi mais de 30 ameaças do computador.<br />
<br />
Depois disso, todo tranquilo fui testar o computador e percebi que ao rodar os programas a seguinte mensagem era exibida:<br />
<br />
<blockquote>
"O subsistema necessário para suportar o tipo de imagem não está presente."</blockquote>
<br />
Fiquei muito intrigado e fui testar diversos programas e então percebi que eram apenas os programas de 32bits que não funcionavam, logo pensei que o vírus teria apagado ou desativado a camada de emulação de 32bits do windows. Após muita pesquisa descobri que só era possível desabilitar o WOW64 em sistemas de servidor, então fiquei ainda mais intrigado e então resolvi usar a ferramenta <b>sfc</b> que verifica os arquivos dll do sistema e os recupera quando necessário.<br />
<br />
Me desanimei depois de rodar algumas vezes porque o sistema sempre dava a mensagem de que havia recuperado algumas mas não todas, depois de executá-lo diversas vezes deu resultado, ele recuperou todas as dll's e o sistema voltou a funcionar.<br />
<br />
Eram realmente vírus bem destrutivos, o sistema só não parou de funcionar completamente porque por motivos de compatibilidade assim como muitos programas atuais os vírus são feitos para arquiteturas de 32bits, mas o windows 64bits isola os processos de 32 bits em um ambiente virtual emulado e foi por isso que o computador foi revivido e pude recuperá-lo.<br />
<br />
Após a recuperação passei o CCLeaner que acusou 1286 erros e instalei o Comodo Antivírus para me assegurar que problemas como esse não mais ocorrerão.<br />
<br />
Caso alguém passe por isso, essa é uma das soluções, a outra menos elegante é o famigerado format c:Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com1tag:blogger.com,1999:blog-5702203899972488499.post-69873796942873174642013-03-18T13:50:00.000-07:002013-03-18T13:50:18.115-07:00Programas que causam e minam a segurança do windowsRecentemente eu tive uma grande decepção com o <a href="http://www.alterdata.com.br/">programa Alterdata</a>, é um software ERP, de controle financeiro e contábil, um programa muito bom e aclamado pelos usuários em geral, ele é extremamente estável e possui um suporte muito bom, no entanto, fiquei muito insatisfeito com o quesito segurança.<br />
<br />
Precisei instalar o programa e perguntei ao suporte se era necessário que o usuário fosse administrador para que ele funcionasse, ele me disse que sim, mas que iria tentar instalar para ver.<br />
<br />
Tentamos instalar o software, infelizmente ele nem mesmo instalou como usuário limitado, mesmo digitando a senha de administrador quando solicitado, o fato, é que para que ele seja instalado é necessário que diversos instaladores sejam executados, seria ideal um assistente único onde fossem selecionados os módulos, pouparia tempo e trabalho para a instalação.<br />
<br />
Após instalado o suporte desativou o UAC e o firewall do windows para que o programa funcionasse adequadamente, fiquei profundamente decepcionado pois um programa de ponta como é o Alterdata e não possui uma política de segurança eficaz, ao fazer isso, abre o computador do cliente deles a toda a sorte de vírus e problemas, no meu post anterior eu postei as vantagens do UAC, ele previne que programas em geral executem tarefas administrativas sem o conhecimento do usuário, é um recurso excelente que não deveria ser desativado nunca.<br />
<br />
Esse problema não é exclusividade do Alterdata, existem diversos programas que possuem esse mesmo problema, o que me deixou surpreso é um programa com a qualidade técnica dele possuir essa falha, ou então, o consultor não é suficientemente treinado para lidar com isso.<br />
<br />
Fica aí a minha bronca com o Alterdata, por favor, corrijam o software para que ele funcione adequadamente com usuário limitado e com o firewall do windows e UAC ativados.<br />
Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com0tag:blogger.com,1999:blog-5702203899972488499.post-12818280516596287692013-03-18T13:41:00.000-07:002013-03-18T13:41:33.019-07:00Porque o Windows Ainda é inseguro?O windows nasceu e se iniciou no MS-DOS, era um sistema monousuário e monotarefa, sendo assim, era um sistema extremamente inseguro, só existia um usuário e esse usuário poderia fazer qualquer coisa no sistema, o DOS e as primeiras versões do windows amargaram com todo o tipo de vírus, muitas vezes apenas por colocar um disquete você tinha o seu sistema destruído.<br />
Nos primórdios, os vírus serviam apenas para bagunçar a vida das pessoas e nada mais. Com o advento do Windows NT as coisas mudaram, ele foi criado com um núcleo novo e independente do MS-DOS, que era somente emulado por retrocompatibilidade, ele foi feito com foco empresarial, onde é necessário um ambiente multiusuário e multitarefa. Na época foi lançado o Windows 98 com foco doméstico, ele até suportava mais de um usuário, mas esse suporte somente dizia a respeito de configurações e personalizações, não era um ambiente de segurança.<br />
Com o windows XP as coisas mudaram radicalmente e ele passou a ser um sistema multiusuário de verdade, os documentos, arquivos e configurações passaram a ser invioláveis e um usuário não poderia/conseguiria alterar as configurações do outro.<br />
Mesmo assim, o XP tinha diversas falhas de segurança, sem falar que o ambiente comum era monousuário e esse geralmente era administrador, os vírus e malwares em geral reinavam absolutos.<br />
Nessa época, com o advento de criptografia e senhas fortes, os crackers passaram a fornecer programas pagos de maneira ilegal que necessitavam de crack's para funcionar, ao instalar esse crack o computador do usuário é transformado em um nó de processamento ou em um distribuidor de spam's ao ser conectado à internet.<br />
A microsoft então lançou o Windows Vista que foi um marco, o primeiro sistema operacional Microsoft realmente seguro, com o <a href="http://pt.wikipedia.org/wiki/User_Account_Control">controle de contas de usuário (UAC)</a> infelizmente o recurso não foi bem recebido pelos usuários, acostumados a fazer qualquer coisa no computador sem serem perguntados, no mundo linux, ao realizar qualquer tarefa administrativa (nem sempre tão administrativa) é solicitada a senha do administrador.<br />
Com o desgosto pelo recurso, a microsoft o deixou menos intrusivo no windows 7, mesmo assim, muitas pessoas o desabilitam ou então concedem a permissão sem olhar exatamente o que está sendo feito, o ideal seria que caso a pessoa quisesse ver uma fotografia e ela solicitasse permissões administrativas, a pessoa desistisse de ver e se tocasse que se trata de um vírus, mas não é o que acontece.<br />
Ainda assim, o windows 7 é um sistema muito seguro, mas toda a segurança do windows 7 vai abaixo pois os usuários costumam instalar e usar muitos programas piratas que criam todo o tipo de brecha no sistema.<br />
<br />
Se as pessoas usassem o Windows sem usar programas piratas e tivessem atenção ao executar os programas, o sistema seria praticamente tão seguro quanto o linux, mas infelizmente, o uso de programas piratas aliados ao desconhecimento do usuário, ainda tornam o windows um sistema inseguro.<br />
Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com0tag:blogger.com,1999:blog-5702203899972488499.post-28335811986727586032013-03-18T13:26:00.000-07:002013-03-18T13:26:17.507-07:00Porque o linux é seguro?Bom, estou escrevendo aqui a respeito de um grande problema enfrentado no dia a dia do uso de computadores, que é a respeito da segurança de sistemas e de redes em geral.<br />
Atualmente, o sistema operacional que podemos dizer que é mais seguro são os BSD's em geral, seguidos das distros linux.<br />
Uma pergunta, porque uma distro linux é segura?<br />
<br />
Muitas pessoas irão citar um montão de coisas, algumas com fundamento e outras não, mas o fato é que as distribuições linux são muito seguras e por alguns motivos.:<br />
<br />
- Sistema de usuários muito forte: O linux nasceu multiusuário e multitarefa, o que isso quer dizer?<br />
Isso significa que cada processo executado é feito dentro de um espaço de usuário específico, por exemplo, um programa iniciado pelo usuário joão não consegue alterar nada no sistema principal e nem nos arquivos e ambiente do usuário josé, o sistema pode inclusive rodar duas "instâncias" do programa, uma com cada usuário.<br />
Então, hipoteticamente, se um usuário conseguisse baixar um vírus que fosse executável no linux, esse suposto vírus não conseguiria acessar o sistema principal.<br />
<br />
- Permissão de execução: Se um usuário baixar um arquivo executável da internet ou qualquer outro local, esse arquivo a priori não terá permissão de execução, nesse caso, o usuário terá que baixar o tal arquivo e somente depois ele terá que mudar os atributos do arquivo o tornando executável, isso significa que no linux não é possível um usuário executar um arquivo pensando se tratar de uma fotografia por exemplo, até mesmo porque, sistemas unix em geral não se importam com extensões de arquivos, eles lêem os metadados dos arquivos para reconhecerem o tipo do mesmo. Resta então ao cracker se aproveitar de alguma falha ou brecha no sistema.<br />
<br />
- Sistema aberto: As distros linux e o linux em si são sistemas de código aberto, isso significa que qualquer pessoa que queira pode acessar o código fonte dos programas e então detectar defeitos ou falhas, isso significa que os problemas do sistema são conhecidos e qualquer um pode criar a solução, essa solução quando eficaz é muitas vezes publicada e então quem anda sempre atento às publicações pode executar os passos para corrigir, geralmente, o problema é rapidamente resolvido com uma atualização, resta então ao cracker se aproveitar do usuário através de engenharia social, e quanto a isso é muito complicado e é necessário que o usuário tenha conhecimento, a vantagem do linux é que os usuários em geral usam sistemas automatizados de instalação que garantem a segurança do sistema.<br />
<br />
- Repositórios de programas: Diferentemente do mundo windows, no linux os programas são instalados através de repositórios de programas que fazem da tarefa de instalar simples e eficaz, as lojas de aplicativos dos smartphones e a própria windows store certamente se inspiraram nesse sistema que existe no linux há muitos anos.<br />
Com esse sistema, é evitado que o usuário instale programas de origem duvidosa que possa comprometer o sistema, atualmente, o android que é um sistema linux possui diversas pragas virtuais que aterrorizam os usuários, mas diferentemente do mundo windows, essas pragas são instaladas pelo próprio usuário, geralmente programas maliciosos na própria play store ou programas instalados fora dela.<br />
<br />
Todos esses motivos tornam a plataforma bastante segura, e vale lembrar que é possível ainda configurar as partições que podem executar programas e pastas, no entanto, caso o sistema venha a ganhar um bom número de usuários algum dia, eles podem usar de engenharia social para enganar as pessoas como ocorre no android, e a própria pessoa instalar o vírus semiconscientemente.<br />
<br />
Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com0tag:blogger.com,1999:blog-5702203899972488499.post-79302513757093927912013-01-09T12:32:00.002-08:002013-01-09T12:33:29.940-08:00Sony XPeria U - Não Comprem!!!Amigos, comprei um XPeria U, e vou postar as minhas impressões:<br />
<br />
- É um aparelho com uma tela magnífica, ótima e muitíssimo bem construído.<br />
- A ROM original da Sony é excelente, tão boa que nem existe previsão ou vontade de custom roms pra ele.<br />
- O Aparelho é rápido e responsível, com exceção da câmera no ICS, deve ter algum bug que provavelmente será corrigido no Jelly Bean.<br />
- O Preço é convidativo se você pesquisar.<br />
- Dual Core e uma boa placa aceleradora de vídeo.<br />
- Câmera 5MPx que tira excelentes fotos de dia/claro e razoáveis à noite/escuro.<br />
- Reproduz diversos vídeos usando o MXPlayer ou VLC, eu rodei até .MKV em HD sem nenhum engasgo.<br />
- Roda Liso os jogos compatíveis.<br />
- Multitouch com suporte até 4 toques simultâneos, bom para aplicativos e jogos.<br />
- Câmera Frontal VGA, bússola interna, faltou apenas o NFC que por enquanto tem pouca utilidade.<br />
<br />
<br />
Olhando assim parece ser uma boa aquisição, mas tem dois pontos que tornam a aquisição dele totalmente inviável.<br />
<br />
<br />
- Memória RAM 512MB, com o bom gerenciamento do Android a gente não sente tanta falta assim, o problema é quando se está em algum aplicativo e a gente recebe alguma ligação.<br />
<br />
<br />
- Memória Interna de 8BG, acessível 2GB para aplicativos e 4GB para arquivos do usuário. Bom, aqui é que mora o problema, muitos aplicativos carregam dados na memória interna, por exemplo, instalei o Dead Space que ocupou 400MB da memória para arquivos, que na prática possui somente 3.75GB, depois instalei o GPS OffLine Tom Tom, que comeu inicialmente 700MB mas depois de umas atualizações de mapas ocupou quase 2GB, ele suporta o modo USB Host e dá para adicionar Pendrives e etc no entanto essa solução é complexa e eu estou tendo dificuldades em encontrar o adaptador.<br />
<br />
<br />
Devido a esse único ponto negativo, compromete toda a beleza do aparelho, portanto, coloco esse post sincero para nortear outras pessoas que possam querer adquirílo.<br />
Planejo o mais breve possível trocar de aparelho e passar esse para outra pessoa.<br />
<br />
<br />
Até mais!Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com0tag:blogger.com,1999:blog-5702203899972488499.post-75966820197481554992012-04-14T09:36:00.000-07:002012-04-14T09:36:56.130-07:00Receita de Bolo: Relatório em PyQtOlá, depois de um questionamento, resolvi colocar esse método bem simples, imaginando que a pessoa tenha algum conhecimento em python e Qt.<br />
Esse método recebe uma string que é na forma de HTML, exemplo:<br />
<script src="http://pastebin.com/embed_js.php?i=ArY3DU5J"></script>
<br/>
Ele renderiza a string na forma de html usando a engine webkit e a imprime, eis o método aqui:<br />
<br />
<br />
<script src="http://pastebin.com/embed_js.php?i=BeyJ14Ab"></script>
<br/>
Qualquer dúvida, postem nos comentáriosPhironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com0tag:blogger.com,1999:blog-5702203899972488499.post-37332860202942646482011-11-24T06:14:00.001-08:002011-11-24T06:15:14.427-08:00Confisco Salarial dos Servidores de Educação em MG<span class="Apple-style-span" style="background-color: white; font-family: arial, sans-serif; font-size: 13px; line-height: 18px;">E segue o confisco salarial dos profissionais da educação em minas gerais, daqui a pouco o pobre será obrigado a colocar os seus filhos em escolas particulares devido à baixa qualidade de ensino.</span><br />
<br />
<span class="Apple-style-span" style="background-color: white; font-family: arial, sans-serif; font-size: 13px; line-height: 18px;">Os baixíssimos salários contribuem para que os profissionais de qualidade migrem para as universidades e serviços particulares.</span><br />
<br />
<span class="Apple-style-span" style="background-color: white; font-family: arial, sans-serif; font-size: 13px; line-height: 18px;">Os novos percentuais da progressão por escolaridade adicional do governo são ridículos, o professor além de ter que esperar aproximadamente 5 anos após concluir a escolaridade adicional, tem um percentual irrisório de apenas 10% de reajuste a cada título alcançado, isso quer dizer que na prática um professor com curso superior que faça mestrado terá um reajuste de 20% sobre R$1.320,00 e mesmo assim esse reajuste virá apenas depois de cerca 10 anos de feito o mestrado.</span><br />
<br />
<span class="Apple-style-span" style="background-color: white; font-family: arial, sans-serif; font-size: 13px; line-height: 18px;">Vale lembrar que o percentual anterior era de 22% para cada nível conquistado pelo professor.</span><br />
<br />
<span class="Apple-style-span" style="background-color: white; font-family: arial, sans-serif; font-size: 13px; line-height: 18px;">A propaganda do governo e a mídia não mostram mas essa é a triste realidade da educação em Minas Gerais.</span><br />
<span class="Apple-style-span" style="background-color: white; font-family: arial, sans-serif; font-size: 13px; line-height: 18px;"><br />
</span><br />
<span class="Apple-style-span" style="background-color: white; font-family: arial, sans-serif; font-size: 13px; line-height: 18px;"><a href="http://www.sindutemg.org.br/novosite/conteudo.php?MENU=1&LISTA=detalhe&ID=2812" target="_blank">Sind Ute MG</a></span>Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com0tag:blogger.com,1999:blog-5702203899972488499.post-10344820521308496642011-10-31T13:41:00.001-07:002011-10-31T13:49:03.373-07:00Zhotic, a loja de Perfumes Importados em Montes ClarosOrgulhosamente apresento a vocês a loja Zhotic, ela está localizada em Montes Claros - MG e oferece o que há de melhor em perfumes importados na região.<br />
Acesse o link : <a href="http://www.zhotic.com.br/">www.zhotic.com.br</a><br />
<br />
O melhor preço de perfumes de marca em Montes Claros.Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com0tag:blogger.com,1999:blog-5702203899972488499.post-89653400209966972472011-09-19T07:24:00.000-07:002011-09-28T06:36:20.396-07:00Software de Controle de Estoque - Desenvolvimento de Aplicações Gráficas Com Python e QtOlá Pessoal,
Estou desenvolvendo um software de controle de estoque para aprimorar os meus conhecimentos em Python3 e PyQt4, o programa que eu desenvolvi é uma versão em desenvolvimento e portanto não é indicado para uso em produção(caso alguém se interesse favor entrar em contato), serve como aprendizado e guia para quem quiser conhecer a linguagem e o seu potencial.<br />
<br />
<b>Download do Instalador Para Windows:</b> <a href="https://docs.google.com/leaf?id=0B7oT2If1vhbPYzI1YzEyMGEtMzEyMy00MmNlLWIwM2MtYjJkNzQzOTc3NTI1&hl=pt_BR">Download</a><br />
<br />
<b>Download do Código Fonte:</b> <a href="https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B7oT2If1vhbPNDU5NjE4ZDgtZTEyNS00MzRlLWEyZGYtMDNlNjEzMTJmZThk&hl=pt_BR">Download</a><br />
<br />
Espero que Sirva para quem gostaria/precisa aprender mais sobre programação Desktop Python.<br />
Eu utilizei o cx_Freeze para criar o instalador e aplicativo .exe para windows.Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com4Montes Claros - MG, Brasil-16.7368647 -43.8652467-17.2234602 -44.4969607 -16.2502692 -43.2335327tag:blogger.com,1999:blog-5702203899972488499.post-53438774246323983702011-05-05T16:08:00.000-07:002011-05-05T16:20:26.120-07:00Usando O Gnome3 sem o Gnome Shell - Modo ClássicoBom, o Gnome atualizou para a versão 3, pessoalmente estou gostando muito, porém como a interface mudou muito é natural que as pessoas não gostem.<br />
<br />
Esse pequeno tutorial irá servir para aqueles que querem deixar o gnome do modo "normal" clássico.<br />
<br />
A Primeira coisa a Fazer é acessar o Gnome Tweak Tool e assim ajustar algumas coisas como habilitar os botões de minimizar e maximizar, em seguida, você entra no<b><span style="font-size: large;"> gnome-control-center</span></b>, procura sobre as informações do sistema e então você seleciona gráficos, em gráficos selecione o modo reserva, no próximo logon você estará no gnome clássico.<br />
<br />
Bom, como uma imagem vale mais que mil palavras, aí vão elas:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-FKJh07DUWTw/TcMtIGglcZI/AAAAAAAACZk/7F9YIdpIH90/s1600/info+do+sistema.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-FKJh07DUWTw/TcMtIGglcZI/AAAAAAAACZk/7F9YIdpIH90/s1600/info+do+sistema.png" /></a></div><br />
Em Configurações do sistema escolha informações do sistema.<br />
depois escolha a opção gráficos.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-yc_o0iDxRC4/TcMtb-OHe2I/AAAAAAAACZo/I3y-ppe60Hg/s1600/modo+de+reserva.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-yc_o0iDxRC4/TcMtb-OHe2I/AAAAAAAACZo/I3y-ppe60Hg/s1600/modo+de+reserva.png" /></a></div><br />
Selecione o modo reserva...<br />
<br />
E Agora o Gnome 3 sem o Gnome Shell, vale lembrar que o compiz não é compatível ainda com ele, eu testei e simplesmente não funcionou, no entanto creio que usarei ele assim simplesmente porque o sistema está ridiculamente leve, deu uma nova vida ao meu notebook de 5 anos de idade.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-oyX4N3elOOY/TcMt3D393FI/AAAAAAAACZs/iqwTZQJTpzE/s1600/Gnome3+sem+shell.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-oyX4N3elOOY/TcMt3D393FI/AAAAAAAACZs/iqwTZQJTpzE/s1600/Gnome3+sem+shell.png" /></a></div><br />
Espero que gostem desse tutorial...Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com0tag:blogger.com,1999:blog-5702203899972488499.post-59464074144518426452011-04-11T14:58:00.000-07:002011-04-11T15:30:50.243-07:00Controle de Estoque em Desenvolvimento - Python3 e QtEstou fazendo um programinha simples em Python3 e Qt para controle de estoque, principalmente para o meu aprendizado e aperfeiçoamento.<br />
Vejo muitas pessoas perguntando sobre programção Gráfica usando o Python e minha resposta é sempre a mesma: "Python 3 e Qt são as melhores opções".<br />
<br />
- O python 3 é uma linguagem fácil e poderosa, ainda mais usando o Unicode por padrão não tem os erros e conversões chatas que tinha na versão 2.x<br />
<br />
- O Qt é um framework excelente e poderoso e <a href="http://doc.qt.nokia.com/">muito bem documentado</a>.<br />
<br />
O download do programa em desenvolvimento pode ser baixado aqui: <a href="https://docs.google.com/leaf?id=0B7oT2If1vhbPMGM5MDU1NzQtMTExMi00MmI5LTllNjMtN2M5YjgyMGViZDZk&hl=pt_BR">Download do Programa de Estoque em Desenvolvimento</a>, é necessário ter o interpretador python 3 instalado, download nesse link: <a href="http://www.python.org/download/releases/3.0/">Download do Interpretador Python3</a><br />
E é preciso ter instalado também o PyQt: <a href="http://www.riverbankcomputing.co.uk/software/pyqt/download">Downloado do PyQt.</a><br />
<br />
Para usuários windows a situação é fácil, para usuários Arch também, no entanto para quem usa ubuntu terá que procurar meios alternativos de instalar visto que o PyQt para Python3 não está nos repositórios oficiais.<br />
Qualquer dúvida ou sugestão favor postar nos comentários.<br />
<br />
OBS.: O banco de dados usado é o SQLite<br />
Favor não reparem os recursos de POG :DPhironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com4tag:blogger.com,1999:blog-5702203899972488499.post-89322264524265380582010-12-07T13:37:00.000-08:002010-12-07T14:03:46.883-08:00Uso de Python3 em programação desktop usando PyQt4O python3 é parcialmente incompatível com o Python2.x, e isso é um grande problema principalmente porque existem milhares de bibliotecas prontas e funcionando bem com o python2 , a realidade é que igualmente ao XP o python2.x vai demorar muito tempo para morrer, principalmente nos frameworks web que possuem uma boa gama de módulos prontinhos e funcionando.<br />
No entanto o Python3 trouxe consigo diversas melhorias com relação à sua versão anterior, e a mais notável com certeza é a de uso de strings unicode, agora é possível criar uma variável com o nome "maçã" por exemplo. Em especial, o PyQt4 também sofreu muitas mudanças, na realidade ele ficou mais simples, uma porcão de objetos que antes existiam no PyQt4 para python2.x não existem mais para o PyQt4 para python3, o que causa problemas ao tentar executar programas em PyQt4 escritos para rodarem no Python2.x, existem algumas "gambiarras" como essa abaixo, no entanto esse método possui algumas falhas graves em relação a uma outra opção que eu coloquei no final do post que é o uso da biblioteca sip do python3, nesse exemplo a QString irá funcionar, no entanto os métodos dela estarão ausente causando dores de cabeça, em seguida eu coloquei um exemplo de uma calculadora simples em PyQt feita por uma amiga que está estudando a linguagem e eu resolvi alterar algumas coisas para colocar como exemplo aqui, é um bom começo para estudo, o código principal pode ser salvo com o nome <b>calculadora.py</b> e o da classe de interface obrigatoriamente tem que ser <b>ui_calculadora.py</b> porque ele é importado para a classe principal.<br />
<br />
<div style="background: none repeat scroll 0% 0% rgb(255, 255, 255); color: black;"></div><pre><span style="color: maroon; font-weight: bold;">try</span><span style="color: #808030;">:</span>
<span style="color: maroon; font-weight: bold;">from</span> PyQt4<span style="color: #808030;">.</span>QtCore <span style="color: maroon; font-weight: bold;">import</span> QString
<span style="color: maroon; font-weight: bold;">except</span> <span style="color: #e34adc;">ImportError</span><span style="color: #808030;">:</span>
<span style="color: dimgrey;"># we are using Python3 so QString is not defined</span>
QString <span style="color: #808030;">=</span> <span style="color: #e34adc;">type</span><span style="color: #808030;">(</span><span style="color: #0000e6;">""</span><span style="color: #808030;">)</span> </pre><pre></pre><pre></pre><pre></pre><pre> </pre><pre>Eis o Exemplo em Python 2.x </pre><pre> </pre><pre></pre><div style="background: none repeat scroll 0% 0% rgb(255, 255, 255); color: black;"></div><pre><span style="color: dimgrey;">#!/usr/bin/python</span>
<span style="color: dimgrey;"># -*- coding: utf-8 -*-</span>
<span style="color: dimgrey;">#importação dos módulos das bibliotecas Qt</span>
<span style="color: maroon; font-weight: bold;">from</span> PyQt4<span style="color: #808030;">.</span>QtCore <span style="color: maroon; font-weight: bold;">import</span> <span style="color: #808030;">*</span>
<span style="color: maroon; font-weight: bold;">from</span> PyQt4<span style="color: #808030;">.</span>QtGui <span style="color: maroon; font-weight: bold;">import</span> <span style="color: #808030;">*</span>
<span style="color: maroon; font-weight: bold;">from</span> PyQt4 <span style="color: maroon; font-weight: bold;">import</span> QtCore
<span style="color: maroon; font-weight: bold;">import</span> ui_calculadora
<span style="color: dimgrey;">#Importação dos módulos personalizados</span>
<span style="color: maroon; font-weight: bold;">class</span> Calculadora<span style="color: #808030;">(</span>QMainWindow<span style="color: #808030;">,</span> ui_calculadora<span style="color: #808030;">.</span>Ui_Calculadora<span style="color: #808030;">)</span><span style="color: #808030;">:</span>
<span style="color: dimgrey;">'''</span>
<span style="color: dimgrey;"> Classe Principal que cria uma agenda eletrônica Simples :D</span>
<span style="color: dimgrey;"> '''</span>
<span style="color: dimgrey;"># método init construtor da classe...</span>
<span style="color: maroon; font-weight: bold;">def</span> <span style="color: #e34adc;">__init__</span><span style="color: #808030;">(</span>self<span style="color: #808030;">,</span> parent<span style="color: #808030;">=</span><span style="color: #e34adc;">None</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span>
<span style="color: dimgrey;">#os dois comandos abaixo inicializa a classe com as duas das quais ela herdou métodos e atributos</span>
<span style="color: dimgrey;">#QMainWindow que é uma classe base do Qt framework e ui_calculadora que é a interface criada</span>
<span style="color: #e34adc;">super</span><span style="color: #808030;">(</span>Calculadora<span style="color: #808030;">,</span> self<span style="color: #808030;">)</span><span style="color: #808030;">.</span><span style="color: #e34adc;">__init__</span><span style="color: #808030;">(</span>parent<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>setupUi<span style="color: #808030;">(</span>self<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>edicao <span style="color: #808030;">=</span> <span style="color: #e34adc;">True</span>
self<span style="color: #808030;">.</span>memoria <span style="color: #808030;">=</span> <span style="color: #008c00;">0</span>
<span style="color: dimgrey;">#conectando os objetos da interface com as funções</span>
self<span style="color: #808030;">.</span>connect<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnMemoriaNegativa<span style="color: #808030;">,</span> SIGNAL<span style="color: #808030;">(</span><span style="color: #0000e6;">"clicked()"</span><span style="color: #808030;">)</span><span style="color: #808030;">,</span> self<span style="color: #808030;">.</span>memoriaNegativa<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>connect<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnMemoriaPositiva<span style="color: #808030;">,</span> SIGNAL<span style="color: #808030;">(</span><span style="color: #0000e6;">"clicked()"</span><span style="color: #808030;">)</span><span style="color: #808030;">,</span> self<span style="color: #808030;">.</span>memoriaPositiva<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>connect<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnLimparMemoria<span style="color: #808030;">,</span> SIGNAL<span style="color: #808030;">(</span><span style="color: #0000e6;">"clicked()"</span><span style="color: #808030;">)</span><span style="color: #808030;">,</span> self<span style="color: #808030;">.</span>limparMemoria<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>connect<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnNumeros<span style="color: #808030;">,</span> SIGNAL<span style="color: #808030;">(</span><span style="color: #0000e6;">"buttonClicked(QAbstractButton*)"</span><span style="color: #808030;">)</span><span style="color: #808030;">,</span> self<span style="color: #808030;">.</span>botaoClickado<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>connect<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnIgual<span style="color: #808030;">,</span> SIGNAL<span style="color: #808030;">(</span><span style="color: #0000e6;">"clicked()"</span><span style="color: #808030;">)</span><span style="color: #808030;">,</span> self<span style="color: #808030;">.</span>resultado<span style="color: #808030;">)</span>
<span style="color: maroon; font-weight: bold;">def</span> limparMemoria<span style="color: #808030;">(</span>self<span style="color: #808030;">)</span><span style="color: #808030;">:</span>
self<span style="color: #808030;">.</span>memoria <span style="color: #808030;">=</span> <span style="color: #008c00;">0</span>
self<span style="color: #808030;">.</span>lblMensagem<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span><span style="color: #0000e6;">"0"</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>edicao <span style="color: #808030;">=</span> <span style="color: #e34adc;">False</span>
<span style="color: maroon; font-weight: bold;">def</span> memoriaNegativa<span style="color: #808030;">(</span>self<span style="color: #808030;">)</span><span style="color: #808030;">:</span>
self<span style="color: #808030;">.</span>memoria <span style="color: #808030;">-</span><span style="color: #808030;">=</span> <span style="color: #e34adc;">float</span><span style="color: #808030;">(</span><span style="color: #e34adc;">str</span><span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>txtCalculo<span style="color: #808030;">.</span>text<span style="color: #808030;">(</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>lblMensagem<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span><span style="color: #e34adc;">str</span><span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>memoria<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>edicao <span style="color: #808030;">=</span> <span style="color: #e34adc;">False</span>
<span style="color: maroon; font-weight: bold;">def</span> memoriaPositiva<span style="color: #808030;">(</span>self<span style="color: #808030;">)</span><span style="color: #808030;">:</span>
self<span style="color: #808030;">.</span>memoria <span style="color: #808030;">+</span><span style="color: #808030;">=</span> <span style="color: #e34adc;">float</span><span style="color: #808030;">(</span><span style="color: #e34adc;">str</span><span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>txtCalculo<span style="color: #808030;">.</span>text<span style="color: #808030;">(</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>lblMensagem<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span><span style="color: #e34adc;">str</span><span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>memoria<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>edicao <span style="color: #808030;">=</span> <span style="color: #e34adc;">False</span>
<span style="color: maroon; font-weight: bold;">def</span> botaoClickado<span style="color: #808030;">(</span>self<span style="color: #808030;">,</span> botao<span style="color: #808030;">)</span><span style="color: #808030;">:</span>
<span style="color: maroon; font-weight: bold;">if</span> self<span style="color: #808030;">.</span>edicao<span style="color: #808030;">:</span>
self<span style="color: #808030;">.</span>txtCalculo<span style="color: #808030;">.</span>insert<span style="color: #808030;">(</span>botao<span style="color: #808030;">.</span>text<span style="color: #808030;">(</span><span style="color: #808030;">)</span><span style="color: #808030;">.</span>toUpper<span style="color: #808030;">(</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
<span style="color: maroon; font-weight: bold;">else</span><span style="color: #808030;">:</span>
self<span style="color: #808030;">.</span>txtCalculo<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>botao<span style="color: #808030;">.</span>text<span style="color: #808030;">(</span><span style="color: #808030;">)</span><span style="color: #808030;">.</span>toUpper<span style="color: #808030;">(</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>edicao <span style="color: #808030;">=</span> <span style="color: #e34adc;">True</span>
<span style="color: maroon; font-weight: bold;">def</span> resultado<span style="color: #808030;">(</span>self<span style="color: #808030;">)</span><span style="color: #808030;">:</span>
<span style="color: maroon; font-weight: bold;">try</span><span style="color: #808030;">:</span>
resultado <span style="color: #808030;">=</span> <span style="color: #e34adc;">eval</span><span style="color: #808030;">(</span><span style="color: #e34adc;">str</span><span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>txtCalculo<span style="color: #808030;">.</span>text<span style="color: #808030;">(</span><span style="color: #808030;">)</span> <span style="color: #808030;">+</span> <span style="color: #0000e6;">"."</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>txtCalculo<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span><span style="color: #e34adc;">str</span><span style="color: #808030;">(</span>resultado<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>edicao <span style="color: #808030;">=</span> <span style="color: #e34adc;">False</span>
<span style="color: maroon; font-weight: bold;">except</span><span style="color: #808030;">:</span>
<span style="color: dimgrey;"># o caractere u antes da string indica que a mesma é unicode...</span>
QMessageBox<span style="color: #808030;">.</span>information<span style="color: #808030;">(</span>self<span style="color: #808030;">,</span> <span style="color: #0000e6;">u"Expressão incorreta"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">u"Você digitou uma expressão incorreta"</span><span style="color: #808030;">,</span>
buttons<span style="color: #808030;">=</span>QMessageBox<span style="color: #808030;">.</span>Ok<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>txtCalculo<span style="color: #808030;">.</span>clear<span style="color: #808030;">(</span><span style="color: #808030;">)</span>
<span style="color: dimgrey;">#Função que inicializa o aplicativo</span>
<span style="color: maroon; font-weight: bold;">if</span> <span style="color: #e34adc;">__name__</span> <span style="color: #808030;">=</span><span style="color: #808030;">=</span> <span style="color: #0000e6;">"__main__"</span><span style="color: #808030;">:</span>
<span style="color: maroon; font-weight: bold;">import</span> sys
app <span style="color: #808030;">=</span> QApplication<span style="color: #808030;">(</span>sys<span style="color: #808030;">.</span>argv<span style="color: #808030;">)</span>
formulario <span style="color: #808030;">=</span> Calculadora<span style="color: #808030;">(</span><span style="color: #808030;">)</span>
formulario<span style="color: #808030;">.</span>show<span style="color: #808030;">(</span><span style="color: #808030;">)</span>
app<span style="color: #808030;">.</span>exec_<span style="color: #808030;">(</span><span style="color: #808030;">)</span>
</pre><br />
Agora a Versão em Python3<br />
<br />
<br />
<div style="background: none repeat scroll 0% 0% rgb(255, 255, 255); color: black;"></div><pre><span style="color: dimgrey;">#!/usr/bin/python</span>
<span style="color: dimgrey;"># -*- coding: utf-8 -*-</span>
<span style="color: dimgrey;">#importação dos módulos das bibliotecas Qt</span>
<span style="color: maroon; font-weight: bold;">from</span> PyQt4<span style="color: #808030;">.</span>QtCore <span style="color: maroon; font-weight: bold;">import</span> <span style="color: #808030;">*</span>
<span style="color: maroon; font-weight: bold;">from</span> PyQt4<span style="color: #808030;">.</span>QtGui <span style="color: maroon; font-weight: bold;">import</span> <span style="color: #808030;">*</span>
<span style="color: maroon; font-weight: bold;">from</span> PyQt4 <span style="color: maroon; font-weight: bold;">import</span> QtCore
<span style="color: maroon; font-weight: bold;">import</span> ui_calculadora
<span style="color: dimgrey;">#Importação dos módulos personalizados</span>
<span style="color: maroon; font-weight: bold;">class</span> Calculadora<span style="color: #808030;">(</span>QMainWindow<span style="color: #808030;">,</span> ui_calculadora<span style="color: #808030;">.</span>Ui_Calculadora<span style="color: #808030;">)</span><span style="color: #808030;">:</span>
<span style="color: dimgrey;">'''</span>
<span style="color: dimgrey;"> Classe Principal que cria uma agenda eletrônica Simples :D</span>
<span style="color: dimgrey;"> '''</span>
<span style="color: dimgrey;"># método init construtor da classe...</span>
<span style="color: maroon; font-weight: bold;">def</span> <span style="color: #e34adc;">__init__</span><span style="color: #808030;">(</span>self<span style="color: #808030;">,</span> parent<span style="color: #808030;">=</span><span style="color: #e34adc;">None</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span>
<span style="color: dimgrey;">#os dois comandos abaixo inicializa a classe com as duas das quais ela herdou métodos e atributos</span>
<span style="color: dimgrey;">#QMainWindow que é uma classe base do Qt framework e ui_calculadora que é a interface criada</span>
<span style="color: #e34adc;">super</span><span style="color: #808030;">(</span>Calculadora<span style="color: #808030;">,</span> self<span style="color: #808030;">)</span><span style="color: #808030;">.</span><span style="color: #e34adc;">__init__</span><span style="color: #808030;">(</span>parent<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>setupUi<span style="color: #808030;">(</span>self<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>edicao <span style="color: #808030;">=</span> <span style="color: #e34adc;">True</span>
self<span style="color: #808030;">.</span>memoria <span style="color: #808030;">=</span> <span style="color: #008c00;">0</span>
<span style="color: dimgrey;">#conectando os objetos da interface com as funções</span>
self<span style="color: #808030;">.</span>connect<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnMemoriaNegativa<span style="color: #808030;">,</span> SIGNAL<span style="color: #808030;">(</span><span style="color: #0000e6;">"clicked()"</span><span style="color: #808030;">)</span><span style="color: #808030;">,</span> self<span style="color: #808030;">.</span>memoriaNegativa<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>connect<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnMemoriaPositiva<span style="color: #808030;">,</span> SIGNAL<span style="color: #808030;">(</span><span style="color: #0000e6;">"clicked()"</span><span style="color: #808030;">)</span><span style="color: #808030;">,</span> self<span style="color: #808030;">.</span>memoriaPositiva<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>connect<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnLimparMemoria<span style="color: #808030;">,</span> SIGNAL<span style="color: #808030;">(</span><span style="color: #0000e6;">"clicked()"</span><span style="color: #808030;">)</span><span style="color: #808030;">,</span> self<span style="color: #808030;">.</span>limparMemoria<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>connect<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnNumeros<span style="color: #808030;">,</span> SIGNAL<span style="color: #808030;">(</span><span style="color: #0000e6;">"buttonClicked(QAbstractButton*)"</span><span style="color: #808030;">)</span><span style="color: #808030;">,</span> self<span style="color: #808030;">.</span>botaoClickado<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>connect<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnIgual<span style="color: #808030;">,</span> SIGNAL<span style="color: #808030;">(</span><span style="color: #0000e6;">"clicked()"</span><span style="color: #808030;">)</span><span style="color: #808030;">,</span> self<span style="color: #808030;">.</span>resultado<span style="color: #808030;">)</span>
<span style="color: maroon; font-weight: bold;">def</span> limparMemoria<span style="color: #808030;">(</span>self<span style="color: #808030;">)</span><span style="color: #808030;">:</span>
self<span style="color: #808030;">.</span>memoria <span style="color: #808030;">=</span> <span style="color: #008c00;">0</span>
self<span style="color: #808030;">.</span>lblMensagem<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span><span style="color: #0000e6;">"0"</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>edicao <span style="color: #808030;">=</span> <span style="color: #e34adc;">False</span>
<span style="color: maroon; font-weight: bold;">def</span> memoriaNegativa<span style="color: #808030;">(</span>self<span style="color: #808030;">)</span><span style="color: #808030;">:</span>
self<span style="color: #808030;">.</span>memoria <span style="color: #808030;">-</span><span style="color: #808030;">=</span> <span style="color: #e34adc;">float</span><span style="color: #808030;">(</span><span style="color: #e34adc;">str</span><span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>txtCalculo<span style="color: #808030;">.</span>text<span style="color: #808030;">(</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>lblMensagem<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span><span style="color: #e34adc;">str</span><span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>memoria<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>edicao <span style="color: #808030;">=</span> <span style="color: #e34adc;">False</span>
<span style="color: maroon; font-weight: bold;">def</span> memoriaPositiva<span style="color: #808030;">(</span>self<span style="color: #808030;">)</span><span style="color: #808030;">:</span>
self<span style="color: #808030;">.</span>memoria <span style="color: #808030;">+</span><span style="color: #808030;">=</span> <span style="color: #e34adc;">float</span><span style="color: #808030;">(</span><span style="color: #e34adc;">str</span><span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>txtCalculo<span style="color: #808030;">.</span>text<span style="color: #808030;">(</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>lblMensagem<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span><span style="color: #e34adc;">str</span><span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>memoria<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>edicao <span style="color: #808030;">=</span> <span style="color: #e34adc;">False</span>
<span style="color: maroon; font-weight: bold;">def</span> botaoClickado<span style="color: #808030;">(</span>self<span style="color: #808030;">,</span> botao<span style="color: #808030;">)</span><span style="color: #808030;">:</span>
<span style="color: maroon; font-weight: bold;">if</span> self<span style="color: #808030;">.</span>edicao<span style="color: #808030;">:</span>
self<span style="color: #808030;">.</span>txtCalculo<span style="color: #808030;">.</span>insert<span style="color: #808030;">(</span>botao<span style="color: #808030;">.</span>text<span style="color: #808030;">(</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
<span style="color: maroon; font-weight: bold;">else</span><span style="color: #808030;">:</span>
self<span style="color: #808030;">.</span>txtCalculo<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>botao<span style="color: #808030;">.</span>text<span style="color: #808030;">(</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>edicao <span style="color: #808030;">=</span> <span style="color: #e34adc;">True</span>
<span style="color: maroon; font-weight: bold;">def</span> resultado<span style="color: #808030;">(</span>self<span style="color: #808030;">)</span><span style="color: #808030;">:</span>
<span style="color: maroon; font-weight: bold;">try</span><span style="color: #808030;">:</span>
resultado <span style="color: #808030;">=</span> <span style="color: #e34adc;">eval</span><span style="color: #808030;">(</span><span style="color: #e34adc;">str</span><span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>txtCalculo<span style="color: #808030;">.</span>text<span style="color: #808030;">(</span><span style="color: #808030;">)</span> <span style="color: #808030;">+</span> <span style="color: #0000e6;">"."</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>txtCalculo<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span><span style="color: #e34adc;">str</span><span style="color: #808030;">(</span>resultado<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>edicao <span style="color: #808030;">=</span> <span style="color: #e34adc;">False</span>
<span style="color: maroon; font-weight: bold;">except</span><span style="color: #808030;">:</span>
<span style="color: dimgrey;"># o caractere u antes da string indica que a mesma é unicode...</span>
QMessageBox<span style="color: #808030;">.</span>information<span style="color: #808030;">(</span>self<span style="color: #808030;">,</span> <span style="color: #0000e6;">"Expressão incorreta"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"Você digitou uma expressão incorreta"</span><span style="color: #808030;">,</span>
buttons<span style="color: #808030;">=</span>QMessageBox<span style="color: #808030;">.</span>Ok<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>txtCalculo<span style="color: #808030;">.</span>clear<span style="color: #808030;">(</span><span style="color: #808030;">)</span>
<span style="color: dimgrey;">#Função que inicializa o aplicativo</span>
<span style="color: maroon; font-weight: bold;">if</span> <span style="color: #e34adc;">__name__</span> <span style="color: #808030;">=</span><span style="color: #808030;">=</span> <span style="color: #0000e6;">"__main__"</span><span style="color: #808030;">:</span>
<span style="color: maroon; font-weight: bold;">import</span> sys
app <span style="color: #808030;">=</span> QApplication<span style="color: #808030;">(</span>sys<span style="color: #808030;">.</span>argv<span style="color: #808030;">)</span>
formulario <span style="color: #808030;">=</span> Calculadora<span style="color: #808030;">(</span><span style="color: #808030;">)</span>
formulario<span style="color: #808030;">.</span>show<span style="color: #808030;">(</span><span style="color: #808030;">)</span>
app<span style="color: #808030;">.</span>exec_<span style="color: #808030;">(</span><span style="color: #808030;">)</span>
</pre><br />
Agora o arquivo de interface(ui_calculadora.py) ele funciona normal em python2 ou 3, lembrando que ele foi feito usando o pyuic4 através de um arquivo ui do QtDesigner.<br />
<br />
<br />
<div style="background: none repeat scroll 0% 0% rgb(255, 255, 255); color: black;"></div><pre><span style="color: dimgrey;"># -*- coding: utf-8 -*-</span>
<span style="color: dimgrey;"># Form implementation generated from reading ui file 'calculadora.ui'</span>
<span style="color: dimgrey;">#</span>
<span style="color: dimgrey;"># Created: Tue Nov 30 20:07:38 2010</span>
<span style="color: dimgrey;"># by: PyQt4 UI code generator 4.8.1</span>
<span style="color: dimgrey;">#</span>
<span style="color: dimgrey;"># WARNING! All changes made in this file will be lost!</span>
<span style="color: maroon; font-weight: bold;">from</span> PyQt4 <span style="color: maroon; font-weight: bold;">import</span> QtCore<span style="color: #808030;">,</span> QtGui
<span style="color: maroon; font-weight: bold;">try</span><span style="color: #808030;">:</span>
_fromUtf8 <span style="color: #808030;">=</span> QtCore<span style="color: #808030;">.</span>QString<span style="color: #808030;">.</span>fromUtf8
<span style="color: maroon; font-weight: bold;">except</span> <span style="color: #e34adc;">AttributeError</span><span style="color: #808030;">:</span>
_fromUtf8 <span style="color: #808030;">=</span> <span style="color: #e34adc;">lambda</span> s<span style="color: #808030;">:</span> s
<span style="color: maroon; font-weight: bold;">class</span> Ui_Calculadora<span style="color: #808030;">(</span>object<span style="color: #808030;">)</span><span style="color: #808030;">:</span>
<span style="color: maroon; font-weight: bold;">def</span> setupUi<span style="color: #808030;">(</span>self<span style="color: #808030;">,</span> Calculadora<span style="color: #808030;">)</span><span style="color: #808030;">:</span>
Calculadora<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
Calculadora<span style="color: #808030;">.</span>resize<span style="color: #808030;">(</span><span style="color: #008c00;">419</span><span style="color: #808030;">,</span> <span style="color: #008c00;">344</span><span style="color: #808030;">)</span>
Calculadora<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">419</span><span style="color: #808030;">,</span> <span style="color: #008c00;">290</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>centralwidget <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QWidget<span style="color: #808030;">(</span>Calculadora<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"centralwidget"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout_3 <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QGridLayout<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout_3<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"gridLayout_3"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>txtCalculo <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QLineEdit<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>txtCalculo<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">401</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>txtCalculo<span style="color: #808030;">.</span>setAlignment<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>Qt<span style="color: #808030;">.</span>AlignRight<span style="color: #808030;">|</span>QtCore<span style="color: #808030;">.</span>Qt<span style="color: #808030;">.</span>AlignTrailing<span style="color: #808030;">|</span>QtCore<span style="color: #808030;">.</span>Qt<span style="color: #808030;">.</span>AlignVCenter<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>txtCalculo<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"txtCalculo"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout_3<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>txtCalculo<span style="color: #808030;">,</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">2</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnLimpar <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnLimpar<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnLimpar<span style="color: #808030;">.</span>setMaximumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">120</span><span style="color: #808030;">,</span> <span style="color: #008c00;">16777215</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnLimpar<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btnLimpar"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout_3<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnLimpar<span style="color: #808030;">,</span> <span style="color: #008c00;">2</span><span style="color: #808030;">,</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QGridLayout<span style="color: #808030;">(</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"gridLayout"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn7 <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn7<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn7<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btn7"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNumeros <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QButtonGroup<span style="color: #808030;">(</span>Calculadora<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNumeros<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btnNumeros"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNumeros<span style="color: #808030;">.</span>addButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn7<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn7<span style="color: #808030;">,</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn8 <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn8<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn8<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btn8"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNumeros<span style="color: #808030;">.</span>addButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn8<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn8<span style="color: #808030;">,</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn9 <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn9<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn9<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btn9"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNumeros<span style="color: #808030;">.</span>addButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn9<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn9<span style="color: #808030;">,</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #008c00;">2</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn4 <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn4<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn4<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btn4"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNumeros<span style="color: #808030;">.</span>addButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn4<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn4<span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn5 <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn5<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn5<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btn5"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNumeros<span style="color: #808030;">.</span>addButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn5<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn5<span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn6 <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn6<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn6<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btn6"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNumeros<span style="color: #808030;">.</span>addButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn6<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn6<span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">2</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn1 <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn1<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn1<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btn1"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNumeros<span style="color: #808030;">.</span>addButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn1<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn1<span style="color: #808030;">,</span> <span style="color: #008c00;">2</span><span style="color: #808030;">,</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn2 <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn2<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn2<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btn2"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNumeros<span style="color: #808030;">.</span>addButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn2<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn2<span style="color: #808030;">,</span> <span style="color: #008c00;">2</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn3 <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn3<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn3<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btn3"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNumeros<span style="color: #808030;">.</span>addButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn3<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn3<span style="color: #808030;">,</span> <span style="color: #008c00;">2</span><span style="color: #808030;">,</span> <span style="color: #008c00;">2</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNegativo <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNegativo<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNegativo<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btnNegativo"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnNegativo<span style="color: #808030;">,</span> <span style="color: #008c00;">3</span><span style="color: #808030;">,</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn0 <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn0<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn0<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btn0"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNumeros<span style="color: #808030;">.</span>addButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn0<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btn0<span style="color: #808030;">,</span> <span style="color: #008c00;">3</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnPonto <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnPonto<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnPonto<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btnPonto"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNumeros<span style="color: #808030;">.</span>addButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnPonto<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnPonto<span style="color: #808030;">,</span> <span style="color: #008c00;">3</span><span style="color: #808030;">,</span> <span style="color: #008c00;">2</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout_3<span style="color: #808030;">.</span>addLayout<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>gridLayout<span style="color: #808030;">,</span> <span style="color: #008c00;">3</span><span style="color: #808030;">,</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout_2 <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QGridLayout<span style="color: #808030;">(</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout_2<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"gridLayout_2"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnDiv <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnDiv<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnDiv<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btnDiv"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNumeros<span style="color: #808030;">.</span>addButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnDiv<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout_2<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnDiv<span style="color: #808030;">,</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMult <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMult<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMult<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btnMult"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNumeros<span style="color: #808030;">.</span>addButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnMult<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout_2<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnMult<span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMenos <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMenos<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMenos<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btnMenos"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNumeros<span style="color: #808030;">.</span>addButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnMenos<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout_2<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnMenos<span style="color: #808030;">,</span> <span style="color: #008c00;">2</span><span style="color: #808030;">,</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMais <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMais<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMais<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btnMais"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNumeros<span style="color: #808030;">.</span>addButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnMais<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout_2<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnMais<span style="color: #808030;">,</span> <span style="color: #008c00;">3</span><span style="color: #808030;">,</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnIgual <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnIgual<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnIgual<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btnIgual"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout_2<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnIgual<span style="color: #808030;">,</span> <span style="color: #008c00;">3</span><span style="color: #808030;">,</span> <span style="color: #008c00;">2</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMemoriaNegativa <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMemoriaNegativa<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMemoriaNegativa<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btnMemoriaNegativa"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout_2<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnMemoriaNegativa<span style="color: #808030;">,</span> <span style="color: #008c00;">2</span><span style="color: #808030;">,</span> <span style="color: #008c00;">2</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMemoriaPositiva <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMemoriaPositiva<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMemoriaPositiva<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btnMemoriaPositiva"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout_2<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnMemoriaPositiva<span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">2</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnLimparMemoria <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QPushButton<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnLimparMemoria<span style="color: #808030;">.</span>setMinimumSize<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QSize<span style="color: #808030;">(</span><span style="color: #008c00;">61</span><span style="color: #808030;">,</span> <span style="color: #008c00;">41</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnLimparMemoria<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"btnLimparMemoria"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout_2<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnLimparMemoria<span style="color: #808030;">,</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #008c00;">2</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout_3<span style="color: #808030;">.</span>addLayout<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>gridLayout_2<span style="color: #808030;">,</span> <span style="color: #008c00;">3</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>lblMensagem <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QLabel<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>lblMensagem<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">""</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>lblMensagem<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"lblMensagem"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>gridLayout_3<span style="color: #808030;">.</span>addWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>lblMensagem<span style="color: #808030;">,</span> <span style="color: #008c00;">2</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
Calculadora<span style="color: #808030;">.</span>setCentralWidget<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>centralwidget<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>menubar <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QMenuBar<span style="color: #808030;">(</span>Calculadora<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>menubar<span style="color: #808030;">.</span>setGeometry<span style="color: #808030;">(</span>QtCore<span style="color: #808030;">.</span>QRect<span style="color: #808030;">(</span><span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #008c00;">419</span><span style="color: #808030;">,</span> <span style="color: #008c00;">25</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>menubar<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"menubar"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>menu_Arquivo <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QMenu<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>menubar<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>menu_Arquivo<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"menu_Arquivo"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
Calculadora<span style="color: #808030;">.</span>setMenuBar<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>menubar<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>statusbar <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QStatusBar<span style="color: #808030;">(</span>Calculadora<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>statusbar<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"statusbar"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
Calculadora<span style="color: #808030;">.</span>setStatusBar<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>statusbar<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>actionSair <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QAction<span style="color: #808030;">(</span>Calculadora<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>actionSair<span style="color: #808030;">.</span>setObjectName<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"actionSair"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>menu_Arquivo<span style="color: #808030;">.</span>addAction<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>actionSair<span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>menubar<span style="color: #808030;">.</span>addAction<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>menu_Arquivo<span style="color: #808030;">.</span>menuAction<span style="color: #808030;">(</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>retranslateUi<span style="color: #808030;">(</span>Calculadora<span style="color: #808030;">)</span>
QtCore<span style="color: #808030;">.</span>QObject<span style="color: #808030;">.</span>connect<span style="color: #808030;">(</span>self<span style="color: #808030;">.</span>btnLimpar<span style="color: #808030;">,</span> QtCore<span style="color: #808030;">.</span>SIGNAL<span style="color: #808030;">(</span>_fromUtf8<span style="color: #808030;">(</span><span style="color: #0000e6;">"clicked()"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #808030;">,</span> self<span style="color: #808030;">.</span>txtCalculo<span style="color: #808030;">.</span>clear<span style="color: #808030;">)</span>
QtCore<span style="color: #808030;">.</span>QMetaObject<span style="color: #808030;">.</span>connectSlotsByName<span style="color: #808030;">(</span>Calculadora<span style="color: #808030;">)</span>
<span style="color: maroon; font-weight: bold;">def</span> retranslateUi<span style="color: #808030;">(</span>self<span style="color: #808030;">,</span> Calculadora<span style="color: #808030;">)</span><span style="color: #808030;">:</span>
Calculadora<span style="color: #808030;">.</span>setWindowTitle<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"Calculadora Simples"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnLimpar<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"&C"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn7<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"7"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn8<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"8"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn9<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"9"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn4<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"4"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn5<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"5"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn6<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"6"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn1<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"1"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn2<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"2"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn3<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"3"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnNegativo<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"+/-"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btn0<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"0"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnPonto<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"."</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnDiv<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"/"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMult<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"*"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMenos<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"-"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMais<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"+"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnIgual<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"="</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMemoriaNegativa<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"M-"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnMemoriaPositiva<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"M+"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>btnLimparMemoria<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"MC"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>menu_Arquivo<span style="color: #808030;">.</span>setTitle<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"&Arquivo"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
self<span style="color: #808030;">.</span>actionSair<span style="color: #808030;">.</span>setText<span style="color: #808030;">(</span>QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>translate<span style="color: #808030;">(</span><span style="color: #0000e6;">"Calculadora"</span><span style="color: #808030;">,</span> <span style="color: #0000e6;">"Sair"</span><span style="color: #808030;">,</span> <span style="color: #e34adc;">None</span><span style="color: #808030;">,</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">.</span>UnicodeUTF8<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
<span style="color: maroon; font-weight: bold;">if</span> <span style="color: #e34adc;">__name__</span> <span style="color: #808030;">=</span><span style="color: #808030;">=</span> <span style="color: #0000e6;">"__main__"</span><span style="color: #808030;">:</span>
<span style="color: maroon; font-weight: bold;">import</span> sys
app <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QApplication<span style="color: #808030;">(</span>sys<span style="color: #808030;">.</span>argv<span style="color: #808030;">)</span>
Calculadora <span style="color: #808030;">=</span> QtGui<span style="color: #808030;">.</span>QMainWindow<span style="color: #808030;">(</span><span style="color: #808030;">)</span>
ui <span style="color: #808030;">=</span> Ui_Calculadora<span style="color: #808030;">(</span><span style="color: #808030;">)</span>
ui<span style="color: #808030;">.</span>setupUi<span style="color: #808030;">(</span>Calculadora<span style="color: #808030;">)</span>
Calculadora<span style="color: #808030;">.</span>show<span style="color: #808030;">(</span><span style="color: #808030;">)</span>
sys<span style="color: #808030;">.</span><span style="color: #e34adc;">exit</span><span style="color: #808030;">(</span>app<span style="color: #808030;">.</span>exec_<span style="color: #808030;">(</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span>
</pre>As diferenças são poucas porque o programa é pequeno, porém em programas maiores onde adicionamos objetos como: <br />
QStringList e QString constantemente temos muitos problemas porque no PyQt para python3 os métodos ficarão diferentes por exemplo, o método QString para Strings maiúsculas é <b>.toUpper()</b> e para strings regulares do python é simplesmente <b>.upper()</b>.<br />
<br />
Dessa forma usando simplesmente a gambiarra que eu citei acima não irá funcionar porque quando invocarmos os métodos do QString eles não estarão presentes, felizmente existe no Python3 uma biblioteca que resolve isso pra nós, a sip, exemplo:<br />
<br />
<br />
<span style="color: red;">import</span> sip<br />
<br />
sip.setapi('QString', 1)<br />
<br />
<span style="color: red;">from</span> PyQt4 <span style="color: red;">import</span> QtCore<br />
<br />
Esse método funciona bem, no entanto quando temos funções que retornam QString's ou QStringList's do PyQt em Python2.x agora retornam objetos regulares do python e nem esse método e nem o anterior funcionam adequadamente, portanto é preciso realmente reescrever o código...Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com2tag:blogger.com,1999:blog-5702203899972488499.post-49721579425632785292010-11-30T08:54:00.000-08:002010-11-30T08:54:39.942-08:00A morte do XP..... porque será que ela nunca chega?<a href="http://blogs.forumpcs.com.br/bpiropo/2010/11/20/o-xp-morreu-de-novo/">Uma matéria muito bem escrita</a> pelo Benito Piropo no fórum pcs fala da "morte do XP" que teima em resistir tempos e mais tempos no mercado, ele fala sobre os recursos do mesmo e muitas coisas, só que pra mim, a resistências das pessoas em sair do XP é muito óbvia e simples.... o sistema opercional pouco importa na vida delas.<br />
A microsoft lançou dois sistemas operacionais excelentes após o XP voltado ao mercado de desktop, o Windows Vista e o Windows 7, o motivo do windows vista não ter ido adiante é simplesmente porque o XP cumpre muito bem o seu papel de sistema operacional e o Vista consumia uma quantidade grande de recursos pra época, o Windows 7 veio depois com o mesmo núcleo do Vista e ferramentas básicas, poderia ser simplesmente uma atualização, mas mercadologicamente não seria uma boa estratégia.<br />
Mesmo assim, o pessoal está migrando lentamente ao 7 simplesmente porque alguns programas não suportam mais o XP e porque o hardware moderno é mal aproveitado no XP também.<br />
Opa! citei aplicativos lá em cima, agora vocês me entendem não? O Windows XP não é grande coisa em termos de sistema opercional, tem ferramentas nativas pífias e é uma brecha no quesito segurança, no entanto, se você precisa de um programa editor de fotos, ele está lá funcionando de forma maviosa no XP, precisa de um programa de comunicação, ele está lá, precisa gerenciar um bordel? pronto tem o programa que roda no XP...<br />
A verdade é que nesses últimos anos o Windows XP angariou inúmeros aplicativos e as pessoas são bem servidas com ele, pra quê mudar então? porque eu iria migrar para uma interface diferenciada do que eu estou acostumado se tudo o que eu preciso está aqui?<br />
O usuário quer apenas resolver o seu problema e o sistema operacional que ele vai usar pouco importa, o fato das pessoas não gostarem e linux ou qualquer outro sistema operacional diferente não é por causa da "facilidade de uso", pois sou requisitado desde montar uma rede ou formatar um computador até a instalar uma webcam ou antivírus, por mais que o sistema seja "fácil" as pessoas aprendem apenas aquilo que as interessa.<br />
O sucesso inegável do Windows XP não está na sua robustez ou qualidade, está no fato que todos os aplicativos e provavelmente quase todo o hardware do qual você possa precisar irá funcionar e estará disponível pra ele, o sistema operacional para o usuário significa muito pouco ou nada, o que ele quer saber é se nesse computador ele poderá instalar o programa ou dispositivo que irá resolver o problema dele, e o XP em sua maioria atende bem esse propósito ele só vai morrer no dia em que termos programas apenas para o windows 7 ou vista e os computadores começarem a vir com dispositivos incompatíveis com ele.Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com0tag:blogger.com,1999:blog-5702203899972488499.post-2582737992076572472010-10-21T13:37:00.000-07:002010-10-21T14:14:12.714-07:00Exemplo de Classe em PyQtEu coloquei um exemplo anteriormente de código em PyQt e coloquei o link dos arquivos no 4shared, mas o link caiu e agora irei colocar mais um exemplo e vou comentar, e colocarei na tela mesmo.<br />
<br />
<pre><span style='color:#696969; '>#!/usr/bin/python</span>
<span style='color:#696969; '># -*- coding: utf-8 -*-</span>
<span style='color:#696969; '>#importando as classes Qt abaixo</span>
<span style='color:#800000; font-weight:bold; '>from</span> PyQt4<span style='color:#808030; '>.</span>QtCore <span style='color:#800000; font-weight:bold; '>import</span> <span style='color:#808030; '>*</span>
<span style='color:#800000; font-weight:bold; '>from</span> PyQt4<span style='color:#808030; '>.</span>QtGui <span style='color:#800000; font-weight:bold; '>import</span> <span style='color:#808030; '>*</span>
<span style='color:#800000; font-weight:bold; '>from</span> PyQt4 <span style='color:#800000; font-weight:bold; '>import</span> QtCore
<span style='color:#696969; '>#importando a interface criada no QtDesigner e transformada em classe</span>
<span style='color:#696969; '>#python através do comando pyuic</span>
<span style='color:#800000; font-weight:bold; '>from</span> interfaces <span style='color:#800000; font-weight:bold; '>import</span> ui_formCadastroBensImoveis
<span style='color:#800000; font-weight:bold; '>import</span> datas_Brasileiras
<span style='color:#800000; font-weight:bold; '>from</span> PyQt4<span style='color:#808030; '>.</span>QtSql <span style='color:#800000; font-weight:bold; '>import</span> <span style='color:#808030; '>*</span>
<span style='color:#696969; '>'''</span>
<span style='color:#696969; '>nesse sistema, os objetos checkbox alteram o estado dos dicionários com </span>
<span style='color:#696969; '>chaves com nomes homônimos aos checkbox, dessa forma, a alteração</span>
<span style='color:#696969; '>das chaves do dicionário é transparente e ele fica gravado </span>
<span style='color:#696969; '>no banco de dados</span>
<span style='color:#696969; '>'''</span>
<span style='color:#800000; font-weight:bold; '>class</span> FormCadastroBensImoveis<span style='color:#808030; '>(</span>QMainWindow<span style='color:#808030; '>,</span>
ui_formCadastroBensImoveis<span style='color:#808030; '>.</span>Ui_cadastroBensImoveis<span style='color:#808030; '>,</span> datas_Brasileiras<span style='color:#808030; '>.</span>Datas_cpf<span style='color:#808030; '>)</span><span style='color:#808030; '>:</span>
<span style='color:#696969; '>'''</span>
<span style='color:#696969; '> Classe de cadastro de bens imóveis</span>
<span style='color:#696969; '> tudo que iniciar com txt são caixas de texto </span>
<span style='color:#696969; '> da classe principal da interface gráfica do programa, </span>
<span style='color:#696969; '> o que for iniciado com cmb são os objetos</span>
<span style='color:#696969; '> combobox e com radio os radiobox, checkbox são checkbox etc</span>
<span style='color:#696969; '> '''</span>
<span style='color:#800000; font-weight:bold; '>def</span> <span style='color:#e34adc; '>__init__</span><span style='color:#808030; '>(</span>self<span style='color:#808030; '>,</span> parent<span style='color:#808030; '>=</span><span style='color:#e34adc; '>None</span><span style='color:#808030; '>,</span> bancodados<span style='color:#808030; '>=</span><span style='color:#0000e6; '>''</span><span style='color:#808030; '>,</span> usuario<span style='color:#808030; '>=</span><span style='color:#0000e6; '>'0000'</span><span style='color:#808030; '>)</span><span style='color:#808030; '>:</span>
<span style='color:#e34adc; '>super</span><span style='color:#808030; '>(</span>FormCadastroBensImoveis<span style='color:#808030; '>,</span> self<span style='color:#808030; '>)</span><span style='color:#808030; '>.</span><span style='color:#e34adc; '>__init__</span><span style='color:#808030; '>(</span>parent<span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>setupUi<span style='color:#808030; '>(</span>self<span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>dic <span style='color:#808030; '>=</span> <span style='color:#800080; '>{</span><span style='color:#800080; '>}</span>
self<span style='color:#808030; '>.</span>promptComando <span style='color:#808030; '>=</span> QSqlQuery<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>usuario <span style='color:#808030; '>=</span> usuario
self<span style='color:#808030; '>.</span>populaComboIgreja<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>validarCamposNumericos<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>fazerConexoes<span style='color:#808030; '>(</span><span style='color:#e34adc; '>True</span><span style='color:#808030; '>)</span>
<span style='color:#800000; font-weight:bold; '>def</span> fazerConexoes<span style='color:#808030; '>(</span>self<span style='color:#808030; '>,</span> novo<span style='color:#808030; '>=</span><span style='color:#e34adc; '>True</span><span style='color:#808030; '>)</span><span style='color:#808030; '>:</span>
<span style='color:#696969; '>'''</span>
<span style='color:#696969; '> Essa função faz as conexões dos objetos</span>
<span style='color:#696969; '> com os sinais e eventos, função de salvar não está aqui</span>
<span style='color:#696969; '> porque quando eu usar esse mesmo módulo como alteração</span>
<span style='color:#696969; '> eu irei usar o botão com a função alterar.</span>
<span style='color:#696969; '> a biblioteca partial permite criar funções </span>
<span style='color:#696969; '> sob demanda desse modo eu economizo muitas linhas</span>
<span style='color:#696969; '> de código, as funções que são parecidas</span>
<span style='color:#696969; '> são criadas automaticamente</span>
<span style='color:#696969; '> '''</span>
<span style='color:#800000; font-weight:bold; '>from</span> functools <span style='color:#800000; font-weight:bold; '>import</span> partial
<span style='color:#800000; font-weight:bold; '>from</span> cadastros <span style='color:#800000; font-weight:bold; '>import</span> sair
self<span style='color:#808030; '>.</span>connect<span style='color:#808030; '>(</span>self<span style='color:#808030; '>.</span>txtDataConstrucao<span style='color:#808030; '>,</span> SIGNAL<span style='color:#808030; '>(</span><span style='color:#0000e6; '>'editingFinished()'</span><span style='color:#808030; '>)</span>
<span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>validarData<span style='color:#808030; '>)</span>
<span style='color:#696969; '>#A função findChildren retorna uma lista com </span>
<span style='color:#696969; '>#todos os objetos que responderem </span>
<span style='color:#696969; '>#a um tipo ou função específica.</span>
lista <span style='color:#808030; '>=</span> self<span style='color:#808030; '>.</span>findChildren<span style='color:#808030; '>(</span>QCheckBox<span style='color:#808030; '>)</span>
<span style='color:#800000; font-weight:bold; '>for</span> objeto <span style='color:#800000; font-weight:bold; '>in</span> lista<span style='color:#808030; '>:</span>
self<span style='color:#808030; '>.</span>connect<span style='color:#808030; '>(</span>objeto<span style='color:#808030; '>,</span> SIGNAL<span style='color:#808030; '>(</span><span style='color:#0000e6; '>'stateChanged(int)'</span><span style='color:#808030; '>)</span><span style='color:#808030; '>,</span>
self<span style='color:#808030; '>.</span>alt_diversos<span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>dic<span style='color:#808030; '>[</span>unicode<span style='color:#808030; '>(</span>objeto<span style='color:#808030; '>.</span>objectName<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'utf-8'</span><span style='color:#808030; '>)</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#0000e6; '>u"não"</span>
self<span style='color:#808030; '>.</span>connect<span style='color:#808030; '>(</span>self<span style='color:#808030; '>.</span>txtDataConstrucao<span style='color:#808030; '>,</span> SIGNAL<span style='color:#808030; '>(</span><span style='color:#0000e6; '>"editingFinished ()"</span><span style='color:#808030; '>)</span><span style='color:#808030; '>,</span>
self<span style='color:#808030; '>.</span>validarData<span style='color:#808030; '>)</span>
<span style='color:#800000; font-weight:bold; '>if</span> novo<span style='color:#808030; '>:</span>
self<span style='color:#808030; '>.</span>connect<span style='color:#808030; '>(</span>self<span style='color:#808030; '>.</span>btnSalvar<span style='color:#808030; '>,</span> SIGNAL<span style='color:#808030; '>(</span><span style='color:#0000e6; '>'clicked()'</span><span style='color:#808030; '>)</span><span style='color:#808030; '>,</span>
self<span style='color:#808030; '>.</span>salvarDados<span style='color:#808030; '>)</span>
<span style='color:#800000; font-weight:bold; '>def</span> validarCamposNumericos<span style='color:#808030; '>(</span>self<span style='color:#808030; '>)</span><span style='color:#808030; '>:</span>
<span style='color:#696969; '>'''Essa função valida os campos numéricos usando o objeto </span>
<span style='color:#696969; '> QDoubleValidator, ele é muito bom e eficiente,</span>
<span style='color:#696969; '> tem muitas vantagens sobre a máscara, novamente,</span>
<span style='color:#696969; '> eu uso um laço for aqui para deixar a função</span>
<span style='color:#696969; '> mais compacta e pythoniana :)</span>
<span style='color:#696969; '> '''</span>
validarReal <span style='color:#808030; '>=</span> QDoubleValidator<span style='color:#808030; '>(</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>99999</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>)</span>
validarReal<span style='color:#808030; '>.</span>setDecimals<span style='color:#808030; '>(</span><span style='color:#008c00; '>2</span><span style='color:#808030; '>)</span>
listaObj <span style='color:#808030; '>=</span> <span style='color:#808030; '>[</span>self<span style='color:#808030; '>.</span>txtAreaAverbadaCasaOracao<span style='color:#808030; '>,</span>
self<span style='color:#808030; '>.</span>txtAreaAverbadaTerreno<span style='color:#808030; '>,</span>
self<span style='color:#808030; '>.</span>txtAreaRealCasaOracao<span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>txtareaRealTerreno<span style='color:#808030; '>]</span>
<span style='color:#800000; font-weight:bold; '>for</span> objeto <span style='color:#800000; font-weight:bold; '>in</span> listaObj<span style='color:#808030; '>:</span>
objeto<span style='color:#808030; '>.</span>setValidator<span style='color:#808030; '>(</span>validarReal<span style='color:#808030; '>)</span>
<span style='color:#800000; font-weight:bold; '>def</span> populaComboIgreja<span style='color:#808030; '>(</span>self<span style='color:#808030; '>,</span> tudo<span style='color:#808030; '>=</span><span style='color:#e34adc; '>False</span><span style='color:#808030; '>)</span><span style='color:#808030; '>:</span>
<span style='color:#696969; '>'''</span>
<span style='color:#696969; '> Essa função popula o combo igreja</span>
<span style='color:#696969; '> '''</span>
comando <span style='color:#808030; '>=</span> QString<span style='color:#808030; '>(</span>"SELECT cod_relatorio<span style='color:#808030; '>,</span> nome_localidade FROM \
bens_imoveis WHERE e_administracao LIKE <span style='color:#0000e6; '>'sim'</span>"<span style='color:#808030; '>)</span>
<span style='color:#800000; font-weight:bold; '>if</span> tudo<span style='color:#808030; '>:</span>
comando <span style='color:#808030; '>=</span> QString<span style='color:#808030; '>(</span>"SELECT cod_localidade<span style='color:#808030; '>,</span> nome_localidade \
FROM bens_imoveis"<span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>cmbAdministracao<span style='color:#808030; '>.</span>clear<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>exec_<span style='color:#808030; '>(</span>comando<span style='color:#808030; '>)</span>
listaAdministracao <span style='color:#808030; '>=</span> QStringList<span style='color:#808030; '>(</span><span style='color:#0000e6; '>''</span><span style='color:#808030; '>)</span>
<span style='color:#800000; font-weight:bold; '>while</span> self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>next<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>:</span>
listaAdministracao <span style='color:#808030; '><</span><span style='color:#808030; '><</span> self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>value<span style='color:#808030; '>(</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>toString<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>\
<span style='color:#808030; '>+</span> <span style='color:#0000e6; '>" - "</span> <span style='color:#808030; '>+</span> self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>value<span style='color:#808030; '>(</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>toString<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>cmbAdministracao<span style='color:#808030; '>.</span>addItems<span style='color:#808030; '>(</span>listaAdministracao<span style='color:#808030; '>)</span>
<span style='color:#800000; font-weight:bold; '>def</span> alt_diversos<span style='color:#808030; '>(</span>self<span style='color:#808030; '>)</span><span style='color:#808030; '>:</span>
<span style='color:#696969; '>'''Essa função altera os valores das chaves do dicionário</span>
<span style='color:#696969; '> quando os objetos checkbox são clicados, a função sender()</span>
<span style='color:#696969; '> retorna o objeto que enviou o sinal, como as chaves</span>
<span style='color:#696969; '> do dicionário tem os nomes dos objetos então fica fácil</span>
<span style='color:#696969; '> usar essa função pois as chaves correspondentes</span>
<span style='color:#696969; '> a cada objeto são alteradas de acordo </span>
<span style='color:#696969; '> com o nome do objeto que enviou o sinal.</span>
<span style='color:#696969; '> '''</span>
<span style='color:#800000; font-weight:bold; '>if</span> self<span style='color:#808030; '>.</span>sender<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>isChecked<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>=</span><span style='color:#808030; '>=</span> <span style='color:#e34adc; '>True</span><span style='color:#808030; '>:</span>
enviador <span style='color:#808030; '>=</span> unicode<span style='color:#808030; '>(</span>self<span style='color:#808030; '>.</span>sender<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>objectName<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>,</span>
<span style='color:#0000e6; '>'utf-8'</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>dic<span style='color:#808030; '>[</span>enviador<span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> QString<span style='color:#808030; '>(</span><span style='color:#0000e6; '>"sim"</span><span style='color:#808030; '>)</span>
<span style='color:#800000; font-weight:bold; '>else</span><span style='color:#808030; '>:</span>
enviador <span style='color:#808030; '>=</span> unicode<span style='color:#808030; '>(</span>self<span style='color:#808030; '>.</span>sender<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>objectName<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>,</span>
<span style='color:#0000e6; '>'utf-8'</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>dic<span style='color:#808030; '>[</span>enviador<span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#0000e6; '>u"não"</span>
<span style='color:#800000; font-weight:bold; '>def</span> salvarDados<span style='color:#808030; '>(</span>self<span style='color:#808030; '>)</span><span style='color:#808030; '>:</span>
<span style='color:#696969; '>''' Essa é a função que salva os dados do formulário</span>
<span style='color:#696969; '> '''</span>
comando <span style='color:#808030; '>=</span> QString<span style='color:#808030; '>(</span>"INSERT INTO bens_imoveis<span style='color:#808030; '>(</span>cod_relatorio<span style='color:#808030; '>,</span>\
nome_localidade<span style='color:#808030; '>,</span>administracao<span style='color:#808030; '>,</span>registro_imovel<span style='color:#808030; '>,</span>e_administracao<span style='color:#808030; '>,</span>\
alvara_construcao<span style='color:#808030; '>,</span>alvara_funcionamento<span style='color:#808030; '>,</span>CEI<span style='color:#808030; '>,</span>CND<span style='color:#808030; '>,</span>contrato<span style='color:#808030; '>,</span>escritura<span style='color:#808030; '>,</span>\
habite_se<span style='color:#808030; '>,</span>projeto_arquitetonico<span style='color:#808030; '>,</span>projeto_eletrico<span style='color:#808030; '>,</span>projeto_estrutural<span style='color:#808030; '>,</span>\
projeto_hidraulico<span style='color:#808030; '>,</span>projeto_incendio<span style='color:#808030; '>,</span>registro<span style='color:#808030; '>,</span>data_construcao<span style='color:#808030; '>,</span>\
situacao<span style='color:#808030; '>,</span>area_real_terreno<span style='color:#808030; '>,</span>area_averbada_terreno<span style='color:#808030; '>,</span>areaReal_casaOracao<span style='color:#808030; '>,</span>\
areaAverbada_casaOracao<span style='color:#808030; '>,</span>justificativaDificuldade<span style='color:#808030; '>,</span>usuario<span style='color:#808030; '>)</span> \
VALUES<span style='color:#808030; '>(</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>,</span><span style='color:#808030; '>?</span><span style='color:#808030; '>)</span>"<span style='color:#808030; '>)</span>
administracao <span style='color:#808030; '>=</span> QString<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
<span style='color:#800000; font-weight:bold; '>if</span> self<span style='color:#808030; '>.</span>cmbAdministracao<span style='color:#808030; '>.</span>currentText<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>!</span><span style='color:#808030; '>=</span> <span style='color:#0000e6; '>""</span><span style='color:#808030; '>:</span>
administracao <span style='color:#808030; '>=</span> self<span style='color:#808030; '>.</span>cmbAdministracao<span style='color:#808030; '>.</span>currentText<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>split<span style='color:#808030; '>(</span><span style='color:#0000e6; '>" - "</span><span style='color:#808030; '>)</span><span style='color:#808030; '>[</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>prepare<span style='color:#808030; '>(</span>comando<span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>txtcodRelatorio<span style='color:#808030; '>.</span>text<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>txtNomeLocalidade<span style='color:#808030; '>.</span>text<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>replace<span style='color:#808030; '>(</span><span style='color:#0000e6; '>" - "</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>"-"</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> administracao<span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>3</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>txtRegistroImovel<span style='color:#808030; '>.</span>text<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>dic<span style='color:#808030; '>[</span><span style='color:#0000e6; '>"checkAdministracao"</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>5</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>dic<span style='color:#808030; '>[</span><span style='color:#0000e6; '>"checkAlvaraConstrucao"</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>6</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>dic<span style='color:#808030; '>[</span><span style='color:#0000e6; '>"checkAlvaraFuncionamento"</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>7</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>dic<span style='color:#808030; '>[</span><span style='color:#0000e6; '>"checkCEI"</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>8</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>dic<span style='color:#808030; '>[</span><span style='color:#0000e6; '>"checkCND"</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>9</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>dic<span style='color:#808030; '>[</span><span style='color:#0000e6; '>"checkContrato"</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>10</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>dic<span style='color:#808030; '>[</span><span style='color:#0000e6; '>"checkEscritura"</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>11</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>dic<span style='color:#808030; '>[</span><span style='color:#0000e6; '>"checkHabitese"</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>12</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>dic<span style='color:#808030; '>[</span><span style='color:#0000e6; '>"checkProjArquitetonico"</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>13</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>dic<span style='color:#808030; '>[</span><span style='color:#0000e6; '>"checkProjEletrico"</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>14</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>dic<span style='color:#808030; '>[</span><span style='color:#0000e6; '>"checkProjEstrutural"</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>dic<span style='color:#808030; '>[</span><span style='color:#0000e6; '>"checkProjHidraulico"</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>16</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>dic<span style='color:#808030; '>[</span><span style='color:#0000e6; '>"checkProjIncendio"</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>17</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>dic<span style='color:#808030; '>[</span><span style='color:#0000e6; '>"checkRegistro"</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>18</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>conversor_data<span style='color:#808030; '>(</span>self<span style='color:#808030; '>.</span>txtDataConstrucao<span style='color:#808030; '>.</span>text<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>19</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>cmbSituacao<span style='color:#808030; '>.</span>currentText<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>20</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>txtareaRealTerreno<span style='color:#808030; '>.</span>text<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>replace<span style='color:#808030; '>(</span><span style='color:#0000e6; '>","</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>"."</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>21</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>txtAreaAverbadaTerreno<span style='color:#808030; '>.</span>text<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>replace<span style='color:#808030; '>(</span><span style='color:#0000e6; '>","</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>"."</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>txtAreaRealCasaOracao<span style='color:#808030; '>.</span>text<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>replace<span style='color:#808030; '>(</span><span style='color:#0000e6; '>","</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>"."</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>23</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>txtAreaAverbadaCasaOracao<span style='color:#808030; '>.</span>text<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>replace<span style='color:#808030; '>(</span><span style='color:#0000e6; '>","</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>"."</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>textoJustificativa<span style='color:#808030; '>.</span>toPlainText<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>bindValue<span style='color:#808030; '>(</span><span style='color:#008c00; '>25</span><span style='color:#808030; '>,</span> self<span style='color:#808030; '>.</span>usuario<span style='color:#808030; '>)</span>
<span style='color:#800000; font-weight:bold; '>if</span> self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>exec_<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>:</span>
<span style='color:#e34adc; '>id</span> <span style='color:#808030; '>=</span> <span style='color:#e34adc; '>str</span><span style='color:#808030; '>(</span>self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>lastInsertId<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>toInt<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span>
QMessageBox<span style='color:#808030; '>.</span>warning<span style='color:#808030; '>(</span>self<span style='color:#808030; '>,</span> unicode<span style='color:#808030; '>(</span><span style='color:#0000e6; '>"O número do registro gravado foi: "</span><span style='color:#808030; '>,</span>
<span style='color:#0000e6; '>"utf-8"</span><span style='color:#808030; '>)</span><span style='color:#808030; '>,</span> unicode<span style='color:#808030; '>(</span><span style='color:#0000e6; '>"Número de Registro: "</span> <span style='color:#808030; '>+</span> <span style='color:#e34adc; '>id</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>"utf-8"</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>limpar_dados<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
<span style='color:#800000; font-weight:bold; '>else</span><span style='color:#808030; '>:</span>
textoErro <span style='color:#808030; '>=</span> self<span style='color:#808030; '>.</span>promptComando<span style='color:#808030; '>.</span>lastError<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>text<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
QMessageBox<span style='color:#808030; '>.</span>warning<span style='color:#808030; '>(</span>self<span style='color:#808030; '>,</span> unicode<span style='color:#808030; '>(</span><span style='color:#0000e6; '>"Falha ao Gravar o Registro"</span><span style='color:#808030; '>,</span>
<span style='color:#0000e6; '>"utf-8"</span><span style='color:#808030; '>)</span><span style='color:#808030; '>,</span> unicode<span style='color:#808030; '>(</span><span style='color:#0000e6; '>"O código do erro foi: "</span> <span style='color:#808030; '>+</span> textoErro<span style='color:#808030; '>,</span> <span style='color:#0000e6; '>"utf-8"</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span>
<span style='color:#800000; font-weight:bold; '>def</span> limpar_dados<span style='color:#808030; '>(</span>self<span style='color:#808030; '>,</span> tudo<span style='color:#808030; '>=</span><span style='color:#e34adc; '>True</span><span style='color:#808030; '>)</span><span style='color:#808030; '>:</span>
<span style='color:#696969; '>'''</span>
<span style='color:#696969; '> Essa função limpa os campos do formulário, o interessante</span>
<span style='color:#696969; '> é que eu resolvi usar laços for associados com listas,</span>
<span style='color:#696969; '> achei dessa forma uma maneira mais "pythoniana" :)</span>
<span style='color:#696969; '> '''</span>
<span style='color:#696969; '># Esse laço coloca todas as chaves do dicionário como "não"</span>
<span style='color:#800000; font-weight:bold; '>for</span> chaves <span style='color:#800000; font-weight:bold; '>in</span> self<span style='color:#808030; '>.</span>dic<span style='color:#808030; '>.</span>keys<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>:</span>
self<span style='color:#808030; '>.</span>dic<span style='color:#808030; '>[</span>chaves<span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#0000e6; '>u"não"</span>
lista <span style='color:#808030; '>=</span> self<span style='color:#808030; '>.</span>findChildren<span style='color:#808030; '>(</span>QLineEdit<span style='color:#808030; '>)</span>
<span style='color:#696969; '>#Esse laço pega a lista anterior de objetos texto e coloca </span>
<span style='color:#696969; '>#em todos o texto vazio</span>
<span style='color:#800000; font-weight:bold; '>for</span> objeto <span style='color:#800000; font-weight:bold; '>in</span> lista<span style='color:#808030; '>:</span>
objeto<span style='color:#808030; '>.</span>setText<span style='color:#808030; '>(</span><span style='color:#0000e6; '>''</span><span style='color:#808030; '>)</span>
<span style='color:#696969; '># Essa lista pega os objetos "checkbox" e o laço seguinte </span>
<span style='color:#696969; '>#desmarca todos eles.</span>
lista <span style='color:#808030; '>=</span> self<span style='color:#808030; '>.</span>findChildren<span style='color:#808030; '>(</span>QCheckBox<span style='color:#808030; '>)</span>
<span style='color:#800000; font-weight:bold; '>for</span> objeto <span style='color:#800000; font-weight:bold; '>in</span> lista<span style='color:#808030; '>:</span>
objeto<span style='color:#808030; '>.</span>setChecked<span style='color:#808030; '>(</span><span style='color:#e34adc; '>False</span><span style='color:#808030; '>)</span>
<span style='color:#800000; font-weight:bold; '>if</span> tudo<span style='color:#808030; '>:</span>
self<span style='color:#808030; '>.</span>cmbAdministracao<span style='color:#808030; '>.</span>setCurrentIndex<span style='color:#808030; '>(</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>cmbAdministracao<span style='color:#808030; '>.</span>setFocus<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>populaComboIgreja<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>textoJustificativa<span style='color:#808030; '>.</span>setPlainText<span style='color:#808030; '>(</span><span style='color:#0000e6; '>""</span><span style='color:#808030; '>)</span>
self<span style='color:#808030; '>.</span>cmbSituacao<span style='color:#808030; '>.</span>setCurrentIndex<span style='color:#808030; '>(</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>)</span>
</pre><br />
Eu usei um programinha bacana chamado colored para criar o código html para colar aqui no blog, isso vai ajudar demais agora pois colocarei todos os códigos aqui.Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com2tag:blogger.com,1999:blog-5702203899972488499.post-47311946495423379892010-10-08T16:27:00.000-07:002010-10-08T16:27:18.654-07:00Nokia 5230 Como modem no linux entre outrosA cada dia que passa me acostumo mais e mais com o linux e suas facilidades, comprei essa semana um nokia 5230, preferi esse modelo por esses principais motivos:<br />
<ul><li> Preço: Realmente convidativo, em diversos sites na internet o valor dele é de R$468,00 aqui na cidade estava esse valor também, porém essa semana subiu, só encontrei um modelo de vitrine na TIMAX por R$528,00 depois de chorar muito consegui baixar para R$495,00, estou super satisfeito com o mesmo, como não preciso de câmera, Wifi o 3G e o GPS foram o diferencial.</li>
<li>Symbian: O symbian apesar de defasado ainda é uma boa pedida e tem muita coisa pra ele.</li>
<li>3G: Como tenho uma boa câmera e um note para acesso wifi, ambos eram dispensáveis no aparelho.</li>
<li>GPS: O que eu posso dizer? é ótimo e muito bacana :D</li>
</ul>A minha preocupação era o acesso 3G usando o mesmo como modem no linux, para o windows é simples, você instala o nokia pc suite e configura depois de instalar os drivers do aparelho, nem precisa dizer que o PC suite não tem versão para linux né?<br />
Mesmo assim decidi arriscar, o custo benefício era excelente e mesmo porque navegar pelo aparelho é razoável, porém depois que eu coloquei o bicho no ubuntu não é que o network manager reconheceu tudo na hora e está funcionando redondo? Não precisei instalar <b>nada</b> e a configuração do network manager é transparente e só next > next > finish.<br />
Se alguém pretende adquirir o mesmo e está receoso quanto ao uso no linux, pode comprar sem medo que é uma ótima pedida! Funciona tudo tranquilamente.<br />
O único porém é que como ele não carrega via usb o carregador tem que ficar pendurado junto com o cabo usb, a velocidade que ele atinge é maior que o do W580i, aqui em montes claros o W580i chegava a 56Kbps no GPRS e o 5230 chega aos 147Kbps em média no EDGE.<br />
Show de Bola! (principalmente a R$0,50 ao dia hehe)Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com0tag:blogger.com,1999:blog-5702203899972488499.post-69389275571506281092010-09-17T12:09:00.000-07:002010-09-17T12:09:46.519-07:00Infinity Web da TIMEsse foi o plano mais incrível lançado por uma operadora que eu já vi, a TIM deu uma bola dentro e tanto dessa vez, porém apesar de tudo, o foco da TIM além da classe C é com certeza as lojas on line de aplicativos como a Android Store e Ovi Store da nokia.<br />
Agora a pessoa poderá acessar do seu celular as lojas de aplicativos online e realizar a compra dos aplicativos sem se preocupar com a tarifação da internet.<br />
A concorrência com certeza é a melhor coisa que existe para os consumidores, agora você pode usar os diversos serviços online que existem para os aparelhos celulares sem ver todo o seu crédito ir embora.Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com2tag:blogger.com,1999:blog-5702203899972488499.post-72088233052935085562010-07-15T12:09:00.000-07:002010-07-15T12:09:02.173-07:00X11 Forwarding no Ubuntu 10.04Estava a quebrar a cabeça com o X11 Forwarding no Ubuntu Server 10.04, porém vendo a buglist do ubuntu descobri a solução postada pelo usuário <a href="https://launchpad.net/%7Easaijo">asaijo</a> basta adicionar -4 na linha do /etc/default/ssh<br />
<br />
no arquivo mude a linha de:<br />
<br />
<wbr></wbr>SSHD_OPTS=<br />
<br />
para:<br />
<br />
SSHD_OPTS=-4<br />
isso faz com que o ssh-server use o IPv4.<br />
depois reinicie o ssh-server:<br />
# /etc/init.d/ssh restartPhironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com0tag:blogger.com,1999:blog-5702203899972488499.post-17550317447740769002010-06-24T14:47:00.000-07:002010-06-24T14:48:32.916-07:00Considerações interessantes sobre programação em VB.NET Vs Qt Java e PythonTradicionalmente sempre optei por programar em sistemas mais "livres", livre no quesito liberdade de criação, nunca vi com bons olhos a plataforma .Net da MS (e continuo não vendo hehe). Porém vontade e ideologia não enche barriga, por isso desenvolvo nessa plataforma também.<br />
Aqui vai algumas impressões de um programador Pythoniano, java e C++ eventual, vale lembrar que eu não tenho qualificação, conhecimento e nem pretensão de dizer se alguma linguagem é superior à outra, se em algum momento do texto eu ser tendencioso ou dar a preferência à algum aspecto, o mesmo se baseia unicamente em opiniao e experiência estritamente pessoal.<br />
<br />
Antes de iniciar gostaria de definir duas palavrinas para vocês:<br />
<b><br />
</b><br />
<b>fácil:</b> adj. Que se faz sem dificuldade: trabalho fácil. <span ondblclick="javascript:DefinePalavra(getSel());" style="cursor: pointer;" title="Duplo clique para ver definição">Que se consegue sem grande trabalho.</span> / Claro, inteligível<br />
<br />
<b>simples: </b><span style="color: #999999; font-size: 9px;"> </span><span ondblclick="javascript:DefinePalavra(getSel());" style="cursor: pointer;" title="Duplo clique para ver definição">Que não é composto.</span><span style="color: #999999; font-size: 9px;"> ,. </span><span ondblclick="javascript:DefinePalavra(getSel());" style="cursor: pointer;" title="Duplo clique para ver definição">Que não é complicado.</span><span style="color: #999999; font-size: 9px;"> </span><span ondblclick="javascript:DefinePalavra(getSel());" style="cursor: pointer;" title="Duplo clique para ver definição">Sem ornatos nem enfeites.</span><span style="color: #999999; font-size: 9px;"> </span><span ondblclick="javascript:DefinePalavra(getSel());" style="cursor: pointer;" title="Duplo clique para ver definição">De fácil interpretação.</span><span style="color: #999999; font-size: 9px;"></span><span ondblclick="javascript:DefinePalavra(getSel());" style="cursor: pointer;" title="Duplo clique para ver definição">Puro; claro</span><span style="color: #999999; font-size: 9px;">. </span><span ondblclick="javascript:DefinePalavra(getSel());" style="cursor: pointer;" title="Duplo clique para ver definição">Singelo; inocente.</span><span style="color: #999999; font-size: 9px;">. </span><span ondblclick="javascript:DefinePalavra(getSel());" style="cursor: pointer;" title="Duplo clique para ver definição">Mero; natural.</span><span style="color: #999999; font-size: 9px;">. </span><span ondblclick="javascript:DefinePalavra(getSel());" style="cursor: pointer;" title="Duplo clique para ver definição">Ingénuo; crédulo.</span><span style="color: #999999; font-size: 9px;"></span><span style="color: #999999; font-size: 9px;">. </span><span ondblclick="javascript:DefinePalavra(getSel());" style="cursor: pointer;" title="Duplo clique para ver definição">Exclusivo.</span><br />
<br />
Eu sempre tive uma pequena ressalva quanto o modo de desenho visual em GTK+ e Qt, os layouts, no Glade por exemplo você tem que criar os layouts e depois colocar os "widgets" (botões, caixas de texto, etc)em containers para organizar a sua interface, fazer isso em um aplicativo gráfico é um tanto tedioso e o Visual Studio, Delphi, Netbeans e afins não precisam usar esse recurso, em Qt (utilizando o Qtdesigner) o desenho é mais flexível que no Glade, porém a aplicação dos layouts é praticamente obrigatória para que a sua interface fique mais bem acabada.<br />
No Visual Studio e no Netbeans conforme você vai adicionando os objetos os mesmos vão apresentando as "linhas guias" e fica fácil fácil alinhar os objetos de iteração.<br />
Só que após um tempo programando no Visual Studio é que percebi as vantagens do Jeito Qt e GTK de ser.<br />
A programação da interface via código é extremamente simples desse modo e o redimensionamento da tela ao maximizar é excelente também, não existem problemas ao aumentar o tamanho da mesma pois os "conteiners layout" se ajustam automaticamente sem causar transtornos. É muito simples trabalhar com Layouts e Containers dessa maneira.<br />
Percebi uma coisa interessante, usar o Visual Studio e o Netbeans é<b> fácil, mas não é simples</b>. É extremamente difícil compreender como funciona a construção da GUI no Netbeans e No Visual Studio é realmente muuito difícil, é muito fácil trabalhar mas não é simples.<br />
<br />
Já sobre a programação eu percebi que usando o Visual Studio a mesma é realmente muito fácil, a gente fica só movendo ícones de lá pra cá e boas, muitas delas a gente nem sabe exatamente o que faz mas tem que colocar lá porque senão o programa não funciona, no visual studio para trabalharmos com os bancos de dados precisamos utilzar diversos tipos de variáveis: recordset, dataadapter, comand, conexão e fora as strings.<br />
Para programar em Qt e usar banco de dados a gente precisa apenas de uma variável QSqlQuery uma Database e as strings que eventualmente precisaremos! pronto, o uso é muito simples e inteligível, e se usar uma ide como o netbeans fica muito fácil mesmo.<br />
Outra coisa que eu percebi que o pessoal do trolltech desenvolveu e que é extremamente eficiente são os sinais e slots da Qt depois que você começa a utilizar fica realmente simples o código, ágil e fácil de programar.<br />
Cada linguagem de programação possui seus pontos fortes e fracos, e na maioria das vezes o costume e conhecimento do programador é que define qual é realmente a "melhor", estou gostando muito e achando os recursos do Qt fantásticos e das API gráficas que venho utilizado atualmente é a mais rica em recursos, mais customizável e mais simples de utilizar.Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com0tag:blogger.com,1999:blog-5702203899972488499.post-92068650937683036102010-06-22T10:20:00.000-07:002010-06-22T14:04:37.661-07:00A "Idiocracia" da InformáticaQuando eu comecei a mexer em micros na década de 90 onde para cada vez que se ligava um computador era preciso programar um editor de texto em basic, para automatizar um pouquinho as tarefas era possível salvar os programas em fita cassete, quem não entendesse nada de inglês simplesmente não conseguia usar o micro, era coisa de pessoal super capacitado.<br />
Felizmente as coisa melhoraram muito daquele tempo para cá, só não me entra na cabeça o paradoxo seguinte:<br />
<br />
- Na época onde computadores eram menos importantes e não poderiam armazenar a VIDA das pessoas os que o utilizavam tinham total e completo conhecimento sobre o mesmo e eram capazes de resolver os seus próprios problemas e olha que se tivesse algum era muito difícil de encontrar, não tinha o "Oráculo" Google.<br />
- Hoje em dia os computadores armazenam todos os dados importantes da vida da pessoa e muitas outras coisas e o pessoal não tem o mínimo de interesse em aprender nem que seja um pouco a respeito do uso e funcionamento do mesmo, o que vivemos é uma idiocracia da informática, é triste mas vemos usuários fazendo as coisas mais estúpidas, eu concordo que nem todo mundo tem que ser um "expert" em informática e que temos mais o que fazer, mas para quem não sabe, com um mínimo de conhecimento é possível usar o Windows XP sem antivírus e nunca pegar um vírus sequer, e mais ainda, se pegar, identificar que pegou e remover manualmente.<br />
<br />
Se for o caso, apenas um antivírus simples como o MS Security essentials e um pequeno conhecimento a pessoa praticamente não tem problemas com o tal.<br />
Infelizmente com a democratização do computador e as ferramentas que facilitam o manuseio do mesmo as pessoas passaram a desprezar o conhecimento e o estudo do mesmo, como disse anteriormente, não é preciso que todo mundo vire geek porém é preciso sim que as pessoas aprendam o mínimo do funcionamento do computador, tem gente que perde trabalhos, horas preciosas e importantes por simplesmente salvar o arquivo no local errado ou por não saber qual extensão de arquivo utilizar.Phironhttp://www.blogger.com/profile/15434023285576976483noreply@blogger.com0