×
Namespaces

Variants
Actions
(Difference between revisions)

Archived:Como criar um Menu, usando um QPushButton

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (Hamishwillee - Tidy wiki text)
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update)
Line 1: Line 1:
[[Category:Lang-Portuguese]][[Category:Qt]][[Category:Code Examples]][[Category:MeeGo]][[Category:Symbian]]
+
{{Archived|language=Lang-Portuguese|timestamp=20120216050358|user=[[User:Hamishwillee|<br />----]]|[[:Category:Qt Quick|Qt Quick]] should be used for all UI development on mobile devices. The approach described in this article (based on {{Qapiname|QWidget}}) is deprecated.}}
{{ArticleMetaData
+
[[Category:Lang-Portuguese]][[Category:QWidget UI]][[Category:Code Snippet]][[Category:MeeGo]][[Category:Symbian]]
 +
{{ArticleMetaData <!-- v1.2 -->
 
|sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) -->
 
|sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) -->
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
|devices=Emulator
+
|devices= Emulator
|sdk=<!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
+
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
|platform=S60 3rd Edition, S60 5th Edition
+
|platform= S60 3rd Edition, S60 5th Edition
|devicecompatability=<!-- Compatible devices (e.g.: All* (must have GPS) ) -->
+
|devicecompatability= <!-- Compatible devices (e.g.: All* (must have GPS) ) -->
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->  
+
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
|signing=<!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
+
|signing= <!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
|capabilities=<!-- Capabilities required (e.g. Location, NetworkServices.) -->
+
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
|keywords=QPushButton
+
|keywords= QPushButton
|language=Lang-Portuguese
+
|language= Lang-Portuguese
|translated-by=[[User:Valderind4]]
+
|translated-by= [[User:Mind freak]]
|translated-from-title=Creating Context Menu from QPushButton
+
|translated-from-title= Creating Context Menu from QPushButton
|translated-from-id=60712 <!-- automated guess -->
+
|translated-from-id= 60712 <!-- automated guess -->
|review-by=<!-- After re-review: [[User:username]] -->
+
|review-by= <!-- After re-review: [[User:username]] -->
 
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 
|update-by= <!-- After significant update: [[User:username]]-->
 
|update-by= <!-- After significant update: [[User:username]]-->
 
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 
|update-timestamp= <!-- After significant update: YYYYMMDD -->
|creationdate=20090911
+
|creationdate= 20090911
|author=[[User:Mind freak]]
+
|author= [[User:Mind freak]]
 
}}
 
}}
  
Line 29: Line 30:
  
 
==Pré-requisitos==
 
==Pré-requisitos==
Baixe e instale a versão atual do Qt para Symbian segundo as instruções [[Qt para Symbian|deste artigo]].
+
Baixe e instale a versão atual do Qt segundo as instruções [[Qt (Portuguese)|deste artigo]].
  
 
==Código fonte==
 
==Código fonte==
Line 62: Line 63:
 
==Captura de tela==
 
==Captura de tela==
  
[[Image:Mybutton001001.jpg]]
+
[[File:Mybutton001001.jpg]]
  
  
 
==Links relacionados==
 
==Links relacionados==
* [[Como usar um QPushButton, em Qt para Symbian| Como usar um QPushButton, em Qt para Symbian]]
+
* [[Como usar um QPushButton]]
  
 
<!-- Translation --> [[en:Creating Context Menu from QPushButton]]
 
<!-- Translation --> [[en:Creating Context Menu from QPushButton]]

Revision as of 08:03, 16 February 2012

Archived.pngAquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

Qt Quick should be used for all UI development on mobile devices. The approach described in this article (based on QWidget) is deprecated.

Article Metadata

Testado com
Aparelho(s): Emulator

Compatibilidade
Plataforma(s): S60 3rd Edition, S60 5th Edition
Symbian

Artigo
Palavras-chave: QPushButton
Tradução:
Por mind_freak
Última alteração feita por hamishwillee em 16 Feb 2012

Contents

Introdução

Associa um popup menu a um push button.

Isso transforma o botão em um botão de menu, que em alguns estilos, produzirá um pequeno triângulo à direita do texto do botão.

Pré-requisitos

Baixe e instale a versão atual do Qt segundo as instruções deste artigo.

Código fonte

Arquivo fonte

#include "button.h"
#include "ui_button.h"
 
button::button(QWidget *parent)
: QWidget(parent)
{
win=new QWidget(this);
win->resize(400,500);
lay=new QHBoxLayout(this);
menu=new QMenu(this);
menu->addMenu("Nokia");
menu->addMenu("N96");
menu->addMenu("N97");
but1=new QPushButton("Menu",this);
but1->setMenu(menu);
lay->addWidget(but1);
win->setLayout(lay);
win->win->setStyleSheet("* { background-color:rgb(125,100,50);color:rgb(200,150,100); padding: 7px}}");
}
 
button::~button()
{
// No need to delete any object that has a parent which is properly deleted.
}

Captura de tela

Mybutton001001.jpg


Links relacionados

110 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×