File: wheeltab.cpp

package info (click to toggle)
qwt 6.1.4-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 23,808 kB
  • sloc: cpp: 57,687; xml: 182; makefile: 32
file content (28 lines) | stat: -rw-r--r-- 711 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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 );
}