×
Namespaces

Variants
Actions
(Difference between revisions)

Archived:Exemplos de QWidgets

From Nokia Developer Wiki
Jump to: navigation, search
cabezonxdg (Talk | contribs)
(Created page with 'A definição de Widgets pode ser encontrada no artigo Widgets em Qt. = Introdução = Widgets são elementos visuais que quando combinados formam a interface do usuário de…')
 
hamishwillee (Talk | contribs)
m (Text replace - "<code cpp>" to "<code cpp-qt>")
 
(17 intermediate revisions by 4 users not shown)
Line 1: Line 1:
A definição de Widgets pode ser encontrada no artigo [[Widgets em Qt]].
+
{{Archived|language=Lang-Portuguese|timestamp=20120216044643|user=[[User:Hamishwillee|&lt;br /&gt;----]]|[[: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.}}
 +
[[Category:Lang-Portuguese]][[Category:Qt C++ UI]][[Category:Code Snippet]][[Category:MeeGo Harmattan]][[Category:Symbian]][[Category:S60 3rd Edition (initial release)]][[Category:S60 3rd Edition FP1]][[Category:S60 3rd Edition FP2]]
 +
{{Abstract|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}}
 +
{{ArticleMetaData <!-- v1.2 -->
 +
|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]]) -->
 +
|devices= N95-1
 +
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
 +
|platform= S60 3rd Edition, FP1, FP2
 +
|devicecompatability= <!-- Compatible devices (e.g.: All* (must have GPS) ) -->
 +
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 +
|signing= <!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
 +
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= QTextEdit, QSpinBox, QSlider, QPushButton
 +
|language= Lang-Portuguese
 +
|translated-by= <!-- [[User:XXXX]] -->
 +
|translated-from-title= <!-- Title only -->
 +
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20090825
 +
|author= [[User:Cabezonxdg]]
 +
}}
  
= 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:
 
 
= Exemplos =
 
 
== QSpinBox e QSlider ==
 
== QSpinBox e QSlider ==
[[Image:SliderQt.PNG|center]]
+
<code cpp-qt>
 +
#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();
 +
}
 +
 
 +
</code>
 +
[[File:SliderQt.PNG|center]]
 
<div align=center>'''Exemplos de Widget: QSpinBox e QSlider'''</div>
 
<div align=center>'''Exemplos de Widget: QSpinBox e QSlider'''</div>
  
 
== QPushButton ==
 
== QPushButton ==
[[Image:BotaoQt.PNG|center]]
+
<code cpp-qt>
 +
#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();
 +
}
 +
</code>
 +
[[File:BotaoQt.PNG|center]]
 
<div align=center>'''Exemplos de Widget: QPushButton'''</div>
 
<div align=center>'''Exemplos de Widget: QPushButton'''</div>
  
 
== QTextEdit ==
 
== QTextEdit ==
 +
<code cpp-qt>
 +
#include <QTextEdit>
 +
#include <QApplication>
  
[[Image:CampoTextoQt.PNG|center]]
+
int main(int argc, char *argv[])
 +
{
 +
    QApplication app(argc, argv);
 +
    QTextEdit* t = new QTextEdit("Campo de texto");
 +
    t->show();
 +
    return app.exec();
 +
}
 +
</code>
 +
[[File:CampoTextoQt.PNG|center]]
 
<div align=center>'''Exemplos de Widget: QTextEdit'''</div>
 
<div align=center>'''Exemplos de Widget: QTextEdit'''</div>
 
[[Category:Lang-PT]]
 
[[Category:Qt (Português)]]
 

Latest revision as of 04:14, 11 October 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.

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

Article Metadata

Testado com
Aparelho(s): N95-1

Compatibilidade
Artigo
Palavras-chave: QTextEdit, QSpinBox, QSlider, QPushButton
Criado por cabezonxdg em 25 Aug 2009
Última alteração feita por hamishwillee em 11 Oct 2012

[edit] 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

[edit] 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

[edit] 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
This page was last modified on 11 October 2012, at 04:14.
112 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.

×