Translations:Development/Tutorials/First program/17/fr: Difference between revisions

From KDE TechBase
(Created page with "Maintenant nous avons fait toute l'initialisation KDE nécessaire, et nous pouvons commencer à faire des choses intéressantes avec notre application. Nous allons créer une...")
 
(No difference)

Latest revision as of 09:30, 17 May 2019

Information about message (contribute)
This message has no documentation. If you know where or how this message is used, you can help other translators by adding documentation to this message.
Message definition (Development/Tutorials/First program)
Now we've done all the necessary setup, we can move on to doing interesting things with our application. We're going to create a popup box but we're going to customise one of the buttons. To do this customisation, we need to use a {{class|KGuiItem}} object. The first argument in the {{class|KGuiItem}} constructor is the text that will appear on the item (in our case, a button). Then we have an option of setting an icon for the button but we don't want one so we just give it <tt>QString()</tt>. We then set the tooltip (what appears when you hover over an item) and finally the "What's This?" (accessed through right-clicking or Shift-F1) text.

Maintenant nous avons fait toute l'initialisation KDE nécessaire, et nous pouvons commencer à faire des choses intéressantes avec notre application. Nous allons créer une fenêtre qui s'ouvre mais en presonalisant un de ses boutons. Pour faire cette adaptation, nous avons besoin de d'utiliser un objet KGuiItem . Le premier argument du constructeur de KGuiItem est le texte à afficher sur l'élément (dans notre cas, le bouton). Puis nous avons une option pour définir une icône pour le bouton mais nous n'en voulons pas donc nous passons simplement QString(). Nous fixons ensuite l'infobulle (ce qui apparait quand vous survolez un élément) et finalement le texte du "Qu'est-ce que c'est ?" (accédé via le clic-droit ou par Maj-F1).