Sinais e slots Veja também | Referências | Menu de navegação«Signals & Slots - QtCore 5.1»expandindo-oe

Qt


linguagem de programaçãoQtpadrão observerwidgetsinterfaces gráficascallbacksCC++ponteiroscallback interfaces gráficas de usuário (GUI)




"Sinais e slots" é uma construção de linguagem de programação, introduzida no Qt para a comunicação entre objetos[1] que torna fácil implementar o padrão observer de maneira compacta. O conceito é que widgets de interfaces gráficas podem enviar sinais contendo informações de eventos que podem ser recebidos por outras widgets / controles usando funções especiais conhecidas como slots. Isso é semelhante às callbacks em C/C++ (ponteiros de função), mas o sistema de sinais/slots garante que os argumentos da callback tenham os tipos corretos.


O sistema de sinais e slots se encaixa bem com a forma em que interfaces gráficas de usuário (GUI) são projetadas. Mas esse sistema também pode ser usado para usos diferentes de GUIs, como por exemplo, notificação de eventos assíncronos (incluindo sockets, pipes, dispositivos seriais, etc.) ou para associar eventos de tempo limite com as devidas instâncias de objeto e métodos ou funções. É fácil de usar e sem a necessidade de escrever código para registro/cancelamento/invocação, porque o Qt Meta Object Compiler (MOC, ou "compilador de metaobjetos") gera automaticamente a infra-estrutura necessária.


Uma metáfora comumente usada é uma planilha. Uma planilha tem células que observam célula(s) de origem. Quando a célula de origem for alterada, as células dependentes são atualizados a partir do evento.



Veja também |


  • Padrão observer

  • Sistema de metaobjetos




Referências |




  1. «Signals & Slots - QtCore 5.1» 





Ícone de esboço
Este artigo sobre Informática é um esboço. Você pode ajudar a Wikipédia expandindo-o.

Popular posts from this blog

Which organization defines CJK Unified Ideographs? The Next CEO of Stack OverflowCharacters which have several different shapesHow useful are the kanji in reading Chinese?Can Chinese readers scan large amounts of text faster/more accurately than their alphabet-using counterparts?丼: why is “well” also “bowl of food”?What Does Unicode 8.0 Mean For Chinese?How are blanks indicated for placeholders in Chinese (like ???)Is there a dictionary of standard character variants?How to display CJK Extension F?How is it decided as to which character is used on the tech terminology?How does 子 come to mean 'midnight'?

Shenzhen Football Club Índice Elenco atual | Títulos | Referências Ligações externas | Menu de navegaçãoGooglenotíciaslivrosacadêmicoeditar«"Elenco"»Site oficialexpandindo-oeee

Was it really necessary for the Lunar Module to have 2 stages?Did the Apollo lunar module descent stage have a role as a sort of service module?How was reserve fuel calculated for the Apollo missions?Could the Apollo LM abort mode be engaged after touchdown? What would have happened if it was?Is true that Armstrong was not designated as first to walk on the moon?Where is the first Lunar soil sample currently located?Could a single crew member fly the Apollo LM?How much mass could the Saturn V rockets have landed on the Moon if nothing was coming back?What was the Apollo service module propellant used for on the LEO missions?Could the Apollo LM abort mode be engaged after touchdown? What would have happened if it was?Did the combined Command and Service Module and Lunar Module perform another 180° turn after transposition, docking and extraction?How did the Lunar Module dock with the rest of Apollo 11 and what is the “CSM”?Was there a technical reason why Apollo 10 didn't land on the moon?How long is the Apollo Lunar Module extraction window?