/**
* Creates the widget (tab), which can be used to edit routes.
* @return The widget, which can be used to edit routes.
*/
private QWidget createRouteWidget() {
QWidget resultWidget = new QWidget();
QGridLayout gridLayout = new QGridLayout();
gridLayout.addWidget(new QLabel("Record new Routes: "), 0, 0, 1, 2);
routeWidget = new ListWidget(this);
gridLayout.addWidget(routeWidget, 1, 0);
QPushButton generateButton = new QPushButton("Record...");
generateButton.clicked.connect(this, "onGenerateRouteButton()");
QPushButton removeButton = new QPushButton("Remove");
removeButton.clicked.connect(this, "onRemoveRoute()");
routeWidget.onRemoveItem.connect(this, "onRemoveRoute(List)");
QBoxLayout routeButtonBox = new QBoxLayout(Direction.TopToBottom);
routeButtonBox.addWidget(generateButton);
routeButtonBox.addWidget(removeButton);
gridLayout.addItem(routeButtonBox, 1, 1, 1, 1, AlignmentFlag.AlignTop);
gridLayout.addWidget(new QLabel("Add vehicles driving the routes: "),
2, 0, 1, 2);
vehicleWidget = new ListWidget(this);
gridLayout.addWidget(vehicleWidget, 3, 0);
QPushButton addVehicleButton = new QPushButton("Add Vehicle...");
QPushButton deleteVehicleButton = new QPushButton("Remove");
deleteVehicleButton.clicked.connect(this, "onRemoveVehicle()");
vehicleWidget.onRemoveItem.connect(this, "onRemoveVehicle(List)");
addVehicleButton.clicked.connect(this, "onAddVehicleButton()");
QBoxLayout vehicleButtonBox = new QBoxLayout(Direction.TopToBottom);
vehicleButtonBox.addWidget(addVehicleButton);
vehicleButtonBox.addWidget(deleteVehicleButton);
gridLayout
.addItem(vehicleButtonBox, 3, 1, 1, 1, AlignmentFlag.AlignTop);
gridLayout.setColumnStretch(0, 5);
gridLayout.setColumnStretch(1, 1);
resultWidget.setLayout(gridLayout);
return resultWidget;
}