Package com.trolltech.qt.gui

Examples of com.trolltech.qt.gui.QGridLayout


   */
  public TileWindow(QWidget parent){
    super(parent);
    scene = new DesignTileScene();
    view = new TileView(scene);
    layout = new QGridLayout();

    // Side bar setup
    QGridLayout sidebarLayout = new QGridLayout();
    sidebarScene = new QGraphicsScene(this);   
    QLineEdit textBox = new QLineEdit();
    sidebarView = new QGraphicsView(sidebarScene);
    slider = new TimingSlider(scene, textBox);
    slider.setFixedHeight(200);
    sidebarLayout.addWidget(new QLabel("Choose\nConstraint:"), 0, 0);
    sidebarLayout.addWidget(slider, 1, 0);
    sidebarLayout.addWidget(textBox, 2, 0);
    sidebarLayout.addWidget(new QLabel("ns"), 2, 1);
    sidebarView.setLayout(sidebarLayout);
    slider.sliderMoved.connect(slider, "updatePaths(Integer)");
    textBox.textChanged.connect(slider, "updateText(String)");
   
    QSplitter splitter = new QSplitter(Orientation.Horizontal);
View Full Code Here


       
        filterPatternLineEdit.textChanged.connect(this, "textFilterChanged()");
        filterSyntaxComboBox.currentIndexChanged.connect(this, "textFilterChanged()");
        filterCaseSensitivityCheckBox.toggled.connect(this, "textFilterChanged()");
       
        proxyLayout = new QGridLayout();
        proxyLayout.addWidget(view, 0, 0, 1, 4);
        proxyLayout.addWidget(filterPatternLabel, 1, 0);
        proxyLayout.addWidget(filterPatternLineEdit, 1, 1);
        proxyLayout.addWidget(filterSyntaxComboBox, 1, 2);
        proxyLayout.addWidget(filterCaseSensitivityCheckBox, 1, 3);
View Full Code Here

    this.setWindowTitle("Create Vehicle");
    setWindowModality(WindowModality.ApplicationModal);

    sumoRoutes = availableRoutes;

    QGridLayout gridLayout = new QGridLayout();

    QLabel label = new QLabel(
        "Create a new vehicle with the following properties:");
    gridLayout.addWidget(label, 0, 0, 1, 2, AlignmentFlag.AlignHCenter);

    QLabel idLabel = new QLabel("Id:");
    edit_id = new QLineEdit();
    edit_id.setText("Vehicle" + new Random().nextInt());
    gridLayout.addWidget(idLabel, 1, 0, 1, 1, AlignmentFlag.AlignLeft);
    gridLayout.addWidget(edit_id, 1, 1, 1, 1, AlignmentFlag.AlignRight);

    QLabel routeLabel = new QLabel("Route: ");
    routeWidget = new QComboBox();
    for (SumoRoute r : availableRoutes)
      routeWidget.addItem(r.getId());

    QLabel vehicleTypeLabel = new QLabel("Vehicle Type:");
    vehicleTypeCombo = new QComboBox();
    for (SumoVehicleType vt : SumoManager.getInstance().getVehicleTypes())
      vehicleTypeCombo.addItem(vt.getId());
   
    gridLayout.addWidget(routeLabel, 2, 0, 1, 1, AlignmentFlag.AlignLeft);
    gridLayout.addWidget(routeWidget, 2, 1, 1, 1, AlignmentFlag.AlignRight);

    gridLayout.addWidget(vehicleTypeLabel, 3, 0, 1, 1, AlignmentFlag.AlignLeft);
    gridLayout.addWidget(vehicleTypeCombo, 3, 1, 1, 1, AlignmentFlag.AlignRight);

    QLabel timeLabel = new QLabel("Dep.-Time:");
    timeSpin = new QSpinBox();
    timeSpin.setValue(0);
    ModelManager mm = ModelManager.getInstance();
    timeSpin.setMinimum(mm.getSimulationStartTime());
    timeSpin.setMaximum(mm.getSimulationEndTime());

    gridLayout.addWidget(timeLabel, 4, 0, 1, 1, AlignmentFlag.AlignLeft);
    gridLayout.addWidget(timeSpin, 4, 1, 1, 1, AlignmentFlag.AlignRight);

    QPushButton okButton = new QPushButton("OK");
    okButton.clicked.connect(this, "onCreateButton()");
    gridLayout.addWidget(okButton, 5, 1, 1, 1, AlignmentFlag.AlignRight);

    gridLayout.setColumnStretch(0, 2);
    gridLayout.setColumnStretch(1, 3);

    this.setLayout(gridLayout);

  }
View Full Code Here

   * 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

    setWindowIcon(ResourceLoader.getInstance().createIconFromLocalResource(
        getClass().getClassLoader(), "route.png"));
    setModal(true);
    this.networkView = nv;

    QGridLayout resultLayout = new QGridLayout();

    QLabel tripLabel = new QLabel(
        "Please enter the properties for the new trip:");

    QLabel idLabel = new QLabel("Id:");
    QLabel depTimeLabel = new QLabel("Start Time:");
    QLabel fromNodeLabel = new QLabel("From Edge:");
    QLabel toNodeLabel = new QLabel("To Edge:");
    QLabel vTypeLabel = new QLabel("Vehicle Type:");
    QLabel periodLabel = new QLabel("Emit interval:");
    QLabel repnoLabel = new QLabel("Replication number:");

    idText = new QLineEdit("Trip" + new Random().nextInt());
    depTimeSpin = new QSpinBox();
    ModelManager mm = ModelManager.getInstance();
    depTimeSpin.setMinimum(mm.getSimulationStartTime());
    depTimeSpin.setMaximum(mm.getSimulationEndTime());
    fromEdgeEdit = new QLineEdit();
    fromEdgeEdit.setEnabled(false);
    fromEdgeSelectButton = new QPushButton("Select");
    fromEdgeSelectButton.pressed.connect(this, "onFromNodeSelect()");
    toEdgeEdit = new QLineEdit();
    toEdgeEdit.setEnabled(false);
    toEdgeSelectButton = new QPushButton("Select");
    toEdgeSelectButton.pressed.connect(this, "onToNodeSelect()");
    typeCombo = new QComboBox();
    SumoManager sm = SumoManager.getInstance();
    List<SumoVehicleType> vTypes = sm.getVehicleTypes();
    for (SumoVehicleType v : vTypes) {
      typeCombo.addItem(v.getId());
    }
   
// _lg: this Dialog makes absoluteley no sense here
//    typeAddButton = new QPushButton("Add Vehicle Type");
//    typeAddButton.pressed.connect(this, "onTypeButtonSelect()");
    periodEdit = new QSpinBox();
    periodEdit.setMinimum(1);
    periodEdit.setMaximum(100000);
    periodEdit.setValue(1000);
    repnoEdit = new QSpinBox();
    repnoEdit.setValue(5);
    repnoEdit.setMinimum(0);
    repnoEdit.setMaximum(10000);

    QPushButton bOk = new QPushButton("OK");
    bOk.pressed.connect(this, "onOkButton()");
    bOk.setDefault(true);
    QPushButton bCancel = new QPushButton("Cancel");
    bCancel.pressed.connect(this, "onCancelButton()");
    QBoxLayout okCancelLayout = new QBoxLayout(Direction.RightToLeft);
    okCancelLayout.addWidget(bCancel, 0, AlignmentFlag.AlignRight);
    okCancelLayout.addWidget(bOk, 1, AlignmentFlag.AlignRight);

    resultLayout.addWidget(tripLabel, 0, 0, 1, 3);
    resultLayout.addWidget(idLabel, 1, 0, 1, 1);
    resultLayout.addWidget(depTimeLabel, 2, 0, 1, 1);
    resultLayout.addWidget(fromNodeLabel, 3, 0, 1, 1);
    resultLayout.addWidget(toNodeLabel, 4, 0, 1, 1);
    resultLayout.addWidget(vTypeLabel, 5, 0, 1, 1);
    resultLayout.addWidget(periodLabel, 6, 0, 1, 1);
    resultLayout.addWidget(repnoLabel, 7, 0, 1, 1);

    resultLayout.addWidget(idText, 1, 1, 1, 2);
    resultLayout.addWidget(depTimeSpin, 2, 1, 1, 2);
    resultLayout.addWidget(fromEdgeEdit, 3, 1, 1, 1);
    resultLayout.addWidget(fromEdgeSelectButton, 3, 2, 1, 1);
    resultLayout.addWidget(toEdgeEdit, 4, 1, 1, 1);
    resultLayout.addWidget(toEdgeSelectButton, 4, 2, 1, 1);
    resultLayout.addWidget(typeCombo, 5, 1, 1, 2);
//    resultLayout.addWidget(typeCombo, 5, 1, 1, 1);
//    resultLayout.addWidget(typeAddButton, 5, 2, 1, 1);
    resultLayout.addWidget(periodEdit, 6, 1, 1, 2);
    resultLayout.addWidget(repnoEdit, 7, 1, 1, 2);

    resultLayout.addLayout(okCancelLayout, 8, 0, 1, 3);

    resultLayout.setColumnStretch(0, 1);
    resultLayout.setColumnStretch(1, 5);
    resultLayout.setColumnStretch(2, 3);

    this.setLayout(resultLayout);
  }
View Full Code Here

    syntaxHighlighter = new Highlighter(sourceEdit.document());
    sourceEdit.textChanged.connect(this, "sourceEdited()");

    QVBoxLayout v = new QVBoxLayout();
    QFormLayout notebookLayout = new QFormLayout();
    QGridLayout dateLayout = new QGridLayout();
    titleLabel.setReadOnly(false);
    titleLabel.editingFinished.connect(this, "titleEdited()");
    browser.page().contentsChanged.connect(this, "contentChanged()");
    browser.page().selectionChanged.connect(this, "selectionChanged()");
    browser.page().mainFrame().javaScriptWindowObjectCleared.connect(this,
        "exposeToJavascript()");

    notebookBox.activated.connect(this, "notebookChanged()");
    resourceSignal = new NoteResourceSignal();
   
    QHBoxLayout tagLayout = new QHBoxLayout();
    v.addWidget(titleLabel, 0);
    notebookLayout.addRow(notebookLabel, notebookBox);
    tagLayout.addLayout(notebookLayout, 0);
    tagLayout.stretch(4);
    tagLayout.addWidget(tagLabel, 0);
    tagLayout.addWidget(tagEdit, 1);
    v.addLayout(tagLayout);

    QHBoxLayout urlLayout = new QHBoxLayout();
    urlLayout.addWidget(urlLabel, 0);
    urlLayout.addWidget(urlText, 0);
    v.addLayout(urlLayout);

    QHBoxLayout authorLayout = new QHBoxLayout();
    authorLayout.addWidget(authorLabel, 0);
    authorLayout.addWidget(authorText, 0);
    authorLayout.addWidget(geoBox);
    v.addLayout(authorLayout);

    dateLayout.addWidget(createdLabel, 0, 0);
    dateLayout.addWidget(createdDate, 0, 1);
    dateLayout.addWidget(createdTime, 0, 2);
    dateLayout.setColumnStretch(9, 100);
    dateLayout.addWidget(alteredLabel, 0, 3);
    dateLayout.addWidget(alteredDate, 0, 4);
    dateLayout.addWidget(alteredTime, 0, 5);
    dateLayout.addWidget(subjectLabel, 0, 6);
    dateLayout.addWidget(subjectDate, 0, 7);
    dateLayout.addWidget(subjectTime, 0, 8);
    v.addLayout(dateLayout, 0);

    undoButton = newEditorButton("undo", tr("Undo Change"));
    redoButton = newEditorButton("redo", tr("Redo Change"));
    cutButton = newEditorButton("cut", tr("Cut"));
View Full Code Here

      zoomSpinner.valueChanged.connect(this, "zoomChanged()");
     
      searchLayout = new SearchPanel(searchField, quotaBar, notebookTree, zoomSpinner);
       
       
        QGridLayout leftGrid = new QGridLayout();
        leftSplitter1.setContentsMargins(5, 0, 0, 7);
        leftSplitter1.setLayout(leftGrid);
      leftGrid.addWidget(searchLayout,1,1);
        leftGrid.addWidget(tagTree,2,1);
        leftGrid.addWidget(attributeTree,3,1);
        leftGrid.addWidget(savedSearchTree,4,1);
        leftGrid.addWidget(trashTree,5, 1);
       
        // Setup the browser window
        noteCache = new HashMap<String,String>();
        readOnlyCache = new HashMap<String, Boolean>();
        inkNoteCache = new HashMap<String, Boolean>();
View Full Code Here

        if (record.notebook.equals(notebooks.get(i).getName()))
          books.setCurrentIndex(i);
      }
    }
   
    QGridLayout grid = new QGridLayout();
    grid.addWidget(directory,0,1);
    grid.addWidget(folderButton,0,0);
    grid.addWidget(new QLabel(tr("Notebook")),1,0);
    grid.addWidget(books,1,1);
    grid.addWidget(new QLabel(tr("After Import")), 2,0);
    grid.addWidget(keep,2,1);
       
    QHBoxLayout buttonLayout = new QHBoxLayout();
    buttonLayout.addStretch(1);
    buttonLayout.addWidget(okButton);
    buttonLayout.addWidget(cancelButton);
View Full Code Here

    font = Global.getDefaultFont();
    fontSize = Global.getDefaultFontSize();
   
    // Group Box
    QGroupBox fontGroup = new QGroupBox(tr("New Note Defaults"));
    QGridLayout fontLayout = new QGridLayout();
    overrideFonts = new QCheckBox(tr("Override Defaults"));
    overrideFonts.setCheckable(true);
    overrideFonts.setChecked(Global.overrideDefaultFont());
    overrideFonts.clicked.connect(this, "toggleFontOverride(Boolean)");
    fontLayout.addWidget(overrideFonts,1,2);
   
   
    // Fonts
    fontList = new QComboBox();       
    fontList.activated.connect(this, "fontSelected(String)");
    fontLayout.addWidget(new QLabel(tr("Font")),2,1);
    fontLayout.addWidget(fontList,2,2);
   
    // Font Sizes
    fontSizeList = new QComboBox();       
    fontLayout.addWidget(fontSizeList,3,2);
    fontSizeList.activated.connect(this, "fontSizeSelected(String)");
    fontLayout.addWidget(new QLabel(tr("Size")),3,1);
    fontGroup.setLayout(fontLayout);
    fontLayout.setColumnStretch(2, 100);
    toggleFontOverride(Global.overrideDefaultFont());
    loadFonts();
    loadSettings();
   
   
View Full Code Here

TOP

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

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.