Original em: How to Implement QToolBox in Qt for Symbian
| ID | Creation date | 21 July 2009 | |
| Platform | S60 3rd Edition/S60 5th Edition | Tested on devices | S60 Emulator |
| Category | Qt for Symbian | Subcategory | UI design |
| Keywords (APIs, classes, methods, functions): QToolBox |
Uma toolBox é um widget que mostra uma coluna de abas, uma sobre a outra, com o item corrente mostrado abaixo da aba atual. Cada aba possui uma posição de índice na coluna de abas.
Isto é usado geralmente em muitas IDE'S, como no Qt Creator, onde a toolBox contem todos os widgets que podem ser arrastados e usados na construção de uma janela ou diálogo.
#include <QtGui/QWidget>
#include<QToolBox>
#include<QHBoxLayout>
#include<QPushButton>
class tool : public QWidget
{
Q_OBJECT
public:
tool(QWidget *parent = 0);
~tool();
private:
QToolBox *box;
QHBoxLayout *lay;
QPushButton *but1;
QPushButton *but2;
QPushButton *but3;
};
#endif // TOOL_H
#include "tool.h"
tool::tool(QWidget *parent)
: QWidget(parent)
{
box=new QToolBox(this);
lay=new QHBoxLayout(this);
but1=new QPushButton("Nokia N97",this);
but2=new QPushButton("Nokia E51",this);
but3=new QPushButton("Nokia 5800 XM",this);
box->addItem(but1,"Nokia N-Series");
box->addItem(but2,"Nokia E-series");
box->addItem(but3,"Xpress music");
lay->addWidget(box);
setLayout(lay);
setStyleSheet("* { background-color:rgb(0,0,0);color:rgb(200,150,100); padding: 7px}}");
showMaximized();
}
tool::~tool()
{
// No need to delete any object that has a parent which is properly deleted.
}
Mais sobre QToolBox
No related wiki articles found