彻底改版2.0
This commit is contained in:
28
third/qwtdemo/examples/controls/wheeltab.cpp
Normal file
28
third/qwtdemo/examples/controls/wheeltab.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#include "wheeltab.h"
|
||||
#include "wheelbox.h"
|
||||
#include <qlayout.h>
|
||||
|
||||
WheelTab::WheelTab( QWidget *parent ):
|
||||
QWidget( parent )
|
||||
{
|
||||
const int numBoxes = 4;
|
||||
|
||||
QGridLayout *layout1 = new QGridLayout();
|
||||
for ( int i = 0; i < numBoxes; i++ )
|
||||
{
|
||||
WheelBox *box = new WheelBox( Qt::Vertical, i );
|
||||
layout1->addWidget( box, i / 2, i % 2 );
|
||||
}
|
||||
|
||||
QGridLayout *layout2 = new QGridLayout();
|
||||
for ( int i = 0; i < numBoxes; i++ )
|
||||
{
|
||||
WheelBox *box = new WheelBox( Qt::Horizontal, i + numBoxes );
|
||||
layout2->addWidget( box, i / 2, i % 2 );
|
||||
}
|
||||
|
||||
QHBoxLayout *layout = new QHBoxLayout( this );
|
||||
layout->addLayout( layout1, 2 );
|
||||
layout->addLayout( layout2, 5 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user