Namespaces
Variants
Actions
(Difference between revisions)

Archived:Como criar um Menu, usando um QPushButton

Jump to: navigation, search
 
m (new version 4.6 download link. novo link para download a versão 4,6 usando o Google translation)
Line 20: Line 20:
  
 
==Pré-requisitos==
 
==Pré-requisitos==
* [http://pepper.troll.no/s60prereleases/ Download the latest Qt for Symbian distribution from Qt].(Inglês)
+
Faça o download e instalar a última versão [[Qt for Symbian - Installation packages]], que possui links sobre como instalar a versão mais recente (Inglês)
* Instalar o Qt para Symbian:[[Instalando o Qt para S60| Instalando o Qt para S60]]
+
* Verifique este link e analise o guia de instalação: [http://pepper.troll.no/s60prereleases/doc/install-s60.html How to install the package].(Inglês)
+
 
+
  
 
==Código fonte==
 
==Código fonte==

Revision as of 12:12, 1 November 2009

Original em: Creating Menu from QPushButton (Qt for Symbian)

Article Metadata

Tested with
Devices(s): Emulator

Compatibility
Platform(s): S60 3rd Edition, S60 5th Edition

Article
Keywords: QPushButton
Created: (27 Jun 2009)
Last edited: jimgilmour1 (01 Nov 2009)

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

Faça o download e instalar a última versão Qt for Symbian - Installation packages, que possui links sobre como instalar a versão mais recente (Inglês)

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

158 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved