.
.
.
.
View_tank1->setFlat(true);
View_tank1->setIcon (ButtonIcon);
//View_tank1->setFixedSize(16,16);
View_tank1
->setGeometry
( QRect( 160,
10,
16,
16 ));
View_tank1->setCursor(Qt::ArrowCursor);
connect(View_tank1, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank1, View_tank1->text());
View_tank2->setFlat(true);
View_tank2->setIcon (ButtonIcon);
//View_tank2->setFixedSize(16,16);
View_tank2
->setGeometry
( QRect( 350,
10,
16,
16 ));
View_tank2->setCursor(Qt::ArrowCursor);
connect(View_tank2, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank2, View_tank2->text());
View_tank3->setFlat(true);
View_tank3->setIcon (ButtonIcon);
//View_tank3->setFixedSize(16,16);
View_tank3
->setGeometry
( QRect( 550,
10,
16,
16 ));
View_tank3->setCursor(Qt::ArrowCursor);
connect(View_tank3, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank3, View_tank3->text());
View_tank4->setFlat(true);
View_tank4->setIcon (ButtonIcon);
//View_tank4->setFixedSize(16,16);
View_tank4
->setGeometry
( QRect( 760,
10,
16,
16 ));
View_tank4->setCursor(Qt::ArrowCursor);
connect(View_tank4, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank4, View_tank4->text());
View_tank5->setFlat(true);
View_tank5->setIcon (ButtonIcon);
//View_tank5->setFixedSize(16,16);
View_tank5
->setGeometry
( QRect( 160,
110,
16,
16 ));
View_tank5->setCursor(Qt::ArrowCursor);
connect(View_tank5, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank5, View_tank5->text());
View_tank6->setFlat(true);
View_tank6->setIcon (ButtonIcon);
//View_tank6->setFixedSize(16,16);
View_tank6
->setGeometry
( QRect( 350,
110,
16,
16 ));
View_tank6->setCursor(Qt::ArrowCursor);
connect(View_tank6, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank6, View_tank6->text());
View_tank7->setFlat(true);
View_tank7->setIcon (ButtonIcon);
//View_tank7->setFixedSize(16,16);
View_tank7
->setGeometry
( QRect( 550,
110,
16,
16 ));
View_tank7->setCursor(Qt::ArrowCursor);
connect(View_tank7, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank7, View_tank7->text());
View_tank8->setFlat(true);
View_tank8->setIcon (ButtonIcon);
//View_tank8->setFixedSize(16,16);
View_tank8
->setGeometry
( QRect( 760,
110,
16,
16 ));
View_tank8->setCursor(Qt::ArrowCursor);
connect(View_tank8, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank8, View_tank8->text());
View_tank9->setFlat(true);
View_tank9->setIcon (ButtonIcon);
//View_tank9->setFixedSize(16,16);
View_tank9
->setGeometry
( QRect( 160,
210,
16,
16 ));
View_tank9->setCursor(Qt::ArrowCursor);
connect(View_tank9, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank9, View_tank9->text());
View_tank10->setFlat(true);
View_tank10->setIcon (ButtonIcon);
//View_tank10->setFixedSize(16,16);
View_tank10
->setGeometry
( QRect( 350,
210,
16,
16 ));
View_tank10->setCursor(Qt::ArrowCursor);
connect(View_tank10, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank10, View_tank10->text());
View_tank11->setFlat(true);
View_tank11->setIcon (ButtonIcon);
//View_tank11->setFixedSize(16,16);
View_tank11
->setGeometry
( QRect( 550,
210,
16,
16 ));
View_tank11->setCursor(Qt::ArrowCursor);
connect(View_tank11, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank11, View_tank11->text());
View_tank12->setFlat(true);
View_tank12->setIcon (ButtonIcon);
//View_tank12->setFixedSize(16,16);
View_tank12
->setGeometry
( QRect( 760,
210,
16,
16 ));
View_tank12->setCursor(Qt::ArrowCursor);
connect(View_tank12, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank12, View_tank12->text());
View_tank13->setFlat(true);
View_tank13->setIcon (ButtonIcon);
//View_tank13->setFixedSize(16,16);
View_tank13
->setGeometry
( QRect( 160,
310,
16,
16 ));
View_tank13->setCursor(Qt::ArrowCursor);
connect(View_tank13, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank13, View_tank13->text());
View_tank14->setFlat(true);
View_tank14->setIcon (ButtonIcon);
//View_tank14->setFixedSize(16,16);
View_tank14
->setGeometry
( QRect( 350,
310,
16,
16 ));
View_tank14->setCursor(Qt::ArrowCursor);
connect(View_tank14, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank14, View_tank14->text());
View_tank15->setFlat(true);
View_tank15->setIcon (ButtonIcon);
View_tank15
->setGeometry
( QRect( 550,
310,
16,
16 ));
View_tank15->setCursor(Qt::ArrowCursor);
connect(View_tank15, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank15, View_tank15->text());
View_tank16->setFlat(true);
View_tank16->setIcon (ButtonIcon);
View_tank16
->setGeometry
( QRect( 760,
310,
16,
16 ));
View_tank16->setCursor(Qt::ArrowCursor);
connect(View_tank16, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank16, View_tank16->text());
connect(signalMapper,
SIGNAL(mapped
(QString)),
this,
SLOT(View_tank_Details
(QString)));
.
.
QSignalMapper *signalMapper;
signalMapper = new QSignalMapper(this);
.
.
View_tank1 = new QPushButton( "Tank1", this );
View_tank1->setFlat(true);
View_tank1->setIcon (ButtonIcon);
//View_tank1->setFixedSize(16,16);
View_tank1->setGeometry( QRect( 160, 10, 16, 16 ));
View_tank1->setCursor(Qt::ArrowCursor);
connect(View_tank1, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank1, View_tank1->text());
View_tank2 = new QPushButton( "Tank2", this );
View_tank2->setFlat(true);
View_tank2->setIcon (ButtonIcon);
//View_tank2->setFixedSize(16,16);
View_tank2->setGeometry( QRect( 350, 10, 16, 16 ));
View_tank2->setCursor(Qt::ArrowCursor);
connect(View_tank2, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank2, View_tank2->text());
View_tank3 = new QPushButton( "Tank3", this );
View_tank3->setFlat(true);
View_tank3->setIcon (ButtonIcon);
//View_tank3->setFixedSize(16,16);
View_tank3->setGeometry( QRect( 550, 10, 16, 16 ));
View_tank3->setCursor(Qt::ArrowCursor);
connect(View_tank3, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank3, View_tank3->text());
View_tank4 = new QPushButton( "Tank4", this );
View_tank4->setFlat(true);
View_tank4->setIcon (ButtonIcon);
//View_tank4->setFixedSize(16,16);
View_tank4->setGeometry( QRect( 760, 10, 16, 16 ));
View_tank4->setCursor(Qt::ArrowCursor);
connect(View_tank4, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank4, View_tank4->text());
View_tank5 = new QPushButton( "Tank5", this );
View_tank5->setFlat(true);
View_tank5->setIcon (ButtonIcon);
//View_tank5->setFixedSize(16,16);
View_tank5->setGeometry( QRect( 160, 110, 16, 16 ));
View_tank5->setCursor(Qt::ArrowCursor);
connect(View_tank5, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank5, View_tank5->text());
View_tank6 = new QPushButton( "Tank6", this );
View_tank6->setFlat(true);
View_tank6->setIcon (ButtonIcon);
//View_tank6->setFixedSize(16,16);
View_tank6->setGeometry( QRect( 350, 110, 16, 16 ));
View_tank6->setCursor(Qt::ArrowCursor);
connect(View_tank6, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank6, View_tank6->text());
View_tank7 = new QPushButton( "Tank7", this );
View_tank7->setFlat(true);
View_tank7->setIcon (ButtonIcon);
//View_tank7->setFixedSize(16,16);
View_tank7->setGeometry( QRect( 550, 110, 16, 16 ));
View_tank7->setCursor(Qt::ArrowCursor);
connect(View_tank7, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank7, View_tank7->text());
View_tank8 = new QPushButton( "Tank8", this );
View_tank8->setFlat(true);
View_tank8->setIcon (ButtonIcon);
//View_tank8->setFixedSize(16,16);
View_tank8->setGeometry( QRect( 760, 110, 16, 16 ));
View_tank8->setCursor(Qt::ArrowCursor);
connect(View_tank8, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank8, View_tank8->text());
View_tank9 = new QPushButton( "Tank9", this );
View_tank9->setFlat(true);
View_tank9->setIcon (ButtonIcon);
//View_tank9->setFixedSize(16,16);
View_tank9->setGeometry( QRect( 160, 210, 16, 16 ));
View_tank9->setCursor(Qt::ArrowCursor);
connect(View_tank9, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank9, View_tank9->text());
View_tank10 = new QPushButton( "Tank10", this );
View_tank10->setFlat(true);
View_tank10->setIcon (ButtonIcon);
//View_tank10->setFixedSize(16,16);
View_tank10->setGeometry( QRect( 350, 210, 16, 16 ));
View_tank10->setCursor(Qt::ArrowCursor);
connect(View_tank10, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank10, View_tank10->text());
View_tank11 = new QPushButton( "Tank11", this );
View_tank11->setFlat(true);
View_tank11->setIcon (ButtonIcon);
//View_tank11->setFixedSize(16,16);
View_tank11->setGeometry( QRect( 550, 210, 16, 16 ));
View_tank11->setCursor(Qt::ArrowCursor);
connect(View_tank11, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank11, View_tank11->text());
View_tank12 = new QPushButton( "Tank12", this );
View_tank12->setFlat(true);
View_tank12->setIcon (ButtonIcon);
//View_tank12->setFixedSize(16,16);
View_tank12->setGeometry( QRect( 760, 210, 16, 16 ));
View_tank12->setCursor(Qt::ArrowCursor);
connect(View_tank12, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank12, View_tank12->text());
View_tank13 = new QPushButton( "Tank13", this );
View_tank13->setFlat(true);
View_tank13->setIcon (ButtonIcon);
//View_tank13->setFixedSize(16,16);
View_tank13->setGeometry( QRect( 160, 310, 16, 16 ));
View_tank13->setCursor(Qt::ArrowCursor);
connect(View_tank13, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank13, View_tank13->text());
View_tank14 = new QPushButton( "Tank14", this );
View_tank14->setFlat(true);
View_tank14->setIcon (ButtonIcon);
//View_tank14->setFixedSize(16,16);
View_tank14->setGeometry( QRect( 350, 310, 16, 16 ));
View_tank14->setCursor(Qt::ArrowCursor);
connect(View_tank14, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank14, View_tank14->text());
View_tank15 = new QPushButton( "Tank15", this );
View_tank15->setFlat(true);
View_tank15->setIcon (ButtonIcon);
View_tank15->setGeometry( QRect( 550, 310, 16, 16 ));
View_tank15->setCursor(Qt::ArrowCursor);
connect(View_tank15, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank15, View_tank15->text());
View_tank16 = new QPushButton( "Tank16", this );
View_tank16->setFlat(true);
View_tank16->setIcon (ButtonIcon);
View_tank16->setGeometry( QRect( 760, 310, 16, 16 ));
View_tank16->setCursor(Qt::ArrowCursor);
connect(View_tank16, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(View_tank16, View_tank16->text());
connect(signalMapper, SIGNAL(mapped(QString)), this, SLOT(View_tank_Details(QString)));
To copy to clipboard, switch view to plain text mode
Bookmarks