×
Namespaces

Variants
Actions
Revision as of 09:29, 15 February 2012 by hamishwillee (Talk | contribs)

Archived:Exemplos de QWidgets

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): N95-1
Compatibility
Platform(s): S60 3rd Edition, FP1, FP2 S60 5th Edition
Symbian
S60 3rd Edition FP2
S60 3rd Edition FP1
S60 3rd Edition (initial release)
Article
Keywords: QTextEdit, QSpinBox, QSlider, QPushButton
Created: cabezonxdg (25 de agosto, 2009)
Last edited: hamishwillee (15 Feb 2012)


A definição de Widgets pode ser encontrada no artigo Widgets em Qt.

Contents

Introdução

Widgets são elementos visuais que quando combinados formam a interface do usuário de uma aplicação Qt. Abaixo são listado alguns exemplos de widgets:

Pré-requisitos

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

Exemplos

QSpinBox e QSlider

#include <QSlider>
#include <QSpinBox>
#include <QApplication>
 
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QWidget* w = new QWidget();
QHBoxLayout* l = new QHBoxLayout();
QSlider* sl = new QSlider( Qt::Horizontal );
QSpinBox* sb = new QSpinBox();
 
l->addWidget( sb );
l->addWidget( sl );
w->setLayout( l );
w->show();
return app.exec();
}
SliderQt.PNG
Exemplos de Widget: QSpinBox e QSlider

QPushButton

#include <QPushButton>
#include <QApplication>
 
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton* b = new QPushButton("Botão em Qt");
b->show();
return app.exec();
}
BotaoQt.PNG
Exemplos de Widget: QPushButton

QTextEdit

#include <QTextEdit>
#include <QApplication>
 
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QTextEdit* t = new QTextEdit("Campo de texto");
t->show();
return app.exec();
}
CampoTextoQt.PNG
Exemplos de Widget: QTextEdit
136 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.

×