Package com.trolltech.qt.gui

Examples of com.trolltech.qt.gui.QWidget


  /**
   * Creates the widget (tab), which can be used to edit trips.
   * @return The widget, which can be used to edit trips.
   */
  private QWidget createTripWidget() {
    QWidget resultWidget = new QWidget();
    QGridLayout gridLayout = new QGridLayout();
    gridLayout.addWidget(new QLabel("Record new Trips: "), 0, 0, 1, 2);

    tripWidget = new ListWidget(this);
    gridLayout.addWidget(tripWidget, 1, 0);
    QPushButton generateButton = new QPushButton("New");
    generateButton.clicked.connect(this, "onGenerateTripButton()");
    QPushButton editButton = new QPushButton("Edit");
    editButton.clicked.connect(this, "onEditTrip()");
    tripWidget.itemDoubleClicked.connect(this, "onEditTrip(QListWidgetItem)");
    QPushButton removeButton = new QPushButton("Remove");
    removeButton.clicked.connect(this, "onRemoveTrip()");
    tripWidget.onRemoveItem.connect(this, "onRemoveTrip(List)");
    QBoxLayout routeButtonBox = new QBoxLayout(Direction.TopToBottom);
    routeButtonBox.addWidget(generateButton);
    routeButtonBox.addWidget(editButton);
    routeButtonBox.addWidget(removeButton);
    gridLayout.addItem(routeButtonBox, 1, 1, 1, 1, AlignmentFlag.AlignTop);
   
    resultWidget.setLayout(gridLayout);
    return resultWidget;
  }
View Full Code Here


  /**
   * 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;
  }
View Full Code Here

    checkboxLayout.addWidget(displayRightToLeft);
    checkboxLayout.addWidget(checkForUpdates);
    checkboxLayout.addStretch(1);

   
    QWidget checkBoxGroup = new QWidget();
    checkBoxGroup.setLayout(checkboxLayout);

    QScrollArea scrollArea = new QScrollArea();
    scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAsNeeded);
    scrollArea.setVerticalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAsNeeded);
    scrollArea.setWidgetResizable(true);
View Full Code Here

public class PreviewDialog extends QDialog {

 
  public PreviewDialog(QWidget parent) {
   
    QWidget masterLabel = new QWidget();
   
    QVBoxLayout subLayout = new QVBoxLayout();
    setMouseTracking(true);
   
    PreviewImage imageLabel = new PreviewImage(masterLabel);
    imageLabel.ID = "Number 1";
        QImage image = new QImage(Global.getFileManager().getResDirPath("thumbnail.png"));
        imageLabel.setPixmap(QPixmap.fromImage(image).scaled(400, 400));
        subLayout.addWidget(imageLabel);

    PreviewImage imageLabel2 = new PreviewImage(masterLabel);
    imageLabel2.ID = "Number 2";
    QImage image2 = new QImage(Global.getFileManager().getResDirPath("thumbnail.png"));
        imageLabel2.setPixmap(QPixmap.fromImage(image2).scaled(400,400));
        subLayout.addWidget(imageLabel2);
        masterLabel.setLayout(subLayout);

        QScrollArea scrollArea = new QScrollArea();
        scrollArea.setWidget(masterLabel);
   
    QPushButton okButton = new QPushButton(tr("OK"));
View Full Code Here

TOP

Related Classes of com.trolltech.qt.gui.QWidget

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.