×
Namespaces

Variants
Actions
(Difference between revisions)

Archived:Exemplos de QWidgets

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
hamishwillee (Talk | contribs)
m (Text replace - "<code cpp>" to "<code cpp-qt>")
 
Line 26: Line 26:
  
 
== QSpinBox e QSlider ==
 
== QSpinBox e QSlider ==
<code cpp>
+
<code cpp-qt>
 
#include <QSlider>
 
#include <QSlider>
 
#include <QSpinBox>
 
#include <QSpinBox>
Line 51: Line 51:
  
 
== QPushButton ==
 
== QPushButton ==
<code cpp>
+
<code cpp-qt>
 
#include <QPushButton>
 
#include <QPushButton>
 
#include <QApplication>
 
#include <QApplication>
Line 67: Line 67:
  
 
== QTextEdit ==
 
== QTextEdit ==
<code cpp>
+
<code cpp-qt>
 
#include <QTextEdit>
 
#include <QTextEdit>
 
#include <QApplication>
 
#include <QApplication>

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.
94 page views in the last 30 days.
×