Package com.trolltech.qt.gui

Examples of com.trolltech.qt.gui.QGridLayout


    QPalette palette = new QPalette(palette());
      // Set background colour to black
      palette.setColor(ColorRole.Base, QColor.black);
      setPalette(palette);
     
    grid = new QGridLayout();
    setLayout(grid);
   
   
    picture = new QLabel();
/*   
 
View Full Code Here


  // Constructor
  public SetIcon(QIcon i, String path) {
    okPressed = false;
    this.path = path;
    setWindowTitle(tr("Set Icon"));
    QGridLayout grid = new QGridLayout();
    setWindowIcon(new QIcon(iconPath+"nevernote.png"));
    setLayout(grid);
   
    QGridLayout textGrid = new QGridLayout();
    textGrid.setContentsMargins(10, 10,-10, -10);
    useDefault = new QCheckBox();
    iconButton = new QPushButton();
    iconButton.setSizePolicy(Policy.Fixed, Policy.Fixed);
    iconButton.clicked.connect(this, "iconButtonPressed()");
    useDefault.setText(tr("Use Default"));
    iconButton.setIcon(i);
   
    textGrid.addWidget(iconButton,1,1);
    textGrid.addWidget(useDefault,2,1);
    useDefault.clicked.connect(this, "useDefaultIconChecked(Boolean)");
    grid.addLayout(textGrid,1,1);
   
    QGridLayout buttonGrid = new QGridLayout();
    ok = new QPushButton(tr("OK"));
    ok.clicked.connect(this, "okButtonPressed()");
    ok.setEnabled(false);
    QPushButton cancel = new QPushButton(tr("Cancel"));
    cancel.clicked.connect(this, "cancelButtonPressed()");
    buttonGrid.addWidget(ok, 3, 1);
    buttonGrid.addWidget(cancel, 3,2);
    grid.addLayout(buttonGrid,2,1);
  }
View Full Code Here

 
  // Constructor
  public StackNotebook() {
    okPressed = false;
    setWindowTitle(tr("Stack Notebook"));
    QGridLayout grid = new QGridLayout();
    setLayout(grid);
   
    QGridLayout textGrid = new QGridLayout();
    stack = new QComboBox();
    stack.setEditable(true);
    textGrid.addWidget(new QLabel(tr("Stack Name")), 1,1);
    textGrid.addWidget(stack, 1, 2);
    textGrid.setContentsMargins(10, 10,-10, -10);
    grid.addLayout(textGrid,1,1);
   
    QGridLayout buttonGrid = new QGridLayout();
    ok = new QPushButton(tr("OK"));
    ok.clicked.connect(this, "okButtonPressed()");
    ok.setEnabled(true);
    QPushButton cancel = new QPushButton(tr("Cancel"));
    cancel.clicked.connect(this, "cancelButtonPressed()");
    stack.currentStringChanged.connect(this, "textChanged(String)");
    buttonGrid.addWidget(ok, 3, 1);
    buttonGrid.addWidget(cancel, 3,2);
    grid.addLayout(buttonGrid,2,1);
  }
View Full Code Here

    setWindowIcon(new QIcon(iconPath+"spellCheck.png"));
    replacePressed = false;
    cancelPressed = false;
    this.checker = checker;
    setWindowTitle(tr("Spell Check"));
    QGridLayout grid = new QGridLayout();
    setLayout(grid);
    QGridLayout suggestionGrid = new QGridLayout();
    QGridLayout buttonGrid = new QGridLayout();
   
    currentWord = new QLabel(misspelledWord);
    replacementWord = new QLineEdit();
    suggestions = new QListWidget();
   
    replacementWord.textChanged.connect(this, "validateInput()");
    suggestions.itemSelectionChanged.connect(this, "replacementChosen()");
   
    suggestionGrid.addWidget(currentWord, 1, 1);
    suggestionGrid.addWidget(new QLabel(tr("Suggestion")), 2,1);
    suggestionGrid.addWidget(replacementWord, 3, 1);
    suggestionGrid.addWidget(suggestions,4,1);
    suggestionGrid.setContentsMargins(10, 10,  -10, -10);
    grid.addLayout(suggestionGrid,1,1);
   
    replace = new QPushButton(tr("Replace"));
    ignore = new QPushButton(tr("Ignore"));
    ignoreAll = new QPushButton(tr("Ignore All"));
    addToDictionary = new QPushButton(tr("Add To Dictionary"));
    replace.clicked.connect(this, "replaceButtonPressed()");
    ignore.clicked.connect(this, "ignoreButtonPressed()");
    ignoreAll.clicked.connect(this, "ignoreAllButtonPressed()");
    addToDictionary.clicked.connect(this, "addToDictionaryButtonPressed()");
    QPushButton cancel = new QPushButton(tr("Cancel"));
    cancel.clicked.connect(this, "cancelButtonPressed()");
    suggestionGrid.addWidget(replace, 1, 2);
    suggestionGrid.addWidget(ignore, 2, 2);
    suggestionGrid.addWidget(ignoreAll,3,2);
    suggestionGrid.addWidget(addToDictionary,4,2);
    suggestionGrid.setAlignment(addToDictionary, AlignmentFlag.AlignTop);
    buttonGrid.addWidget(new QLabel(), 1,1);
    buttonGrid.addWidget(cancel, 1,2);
    buttonGrid.addWidget(new QLabel(), 1,3);
    buttonGrid.setColumnStretch(1, 10);
    buttonGrid.setColumnStretch(3, 10);
    grid.addLayout(buttonGrid,2,1);
  }
View Full Code Here

 
  // Constructor
  public DatabaseStatus() {
    setWindowTitle(tr("Current Database Status"));
    setWindowIcon(new QIcon(iconPath+"database.png"));
    QGridLayout grid = new QGridLayout();
    setLayout(grid);
    noteCount = new QLabel();
    indexNeeded = new QLabel();
    syncNeeded = new QLabel();
    notebookCount = new QLabel();
    tagCount = new QLabel();
    savedSearchCount = new QLabel();   
    resourceCount = new QLabel();
    resourceIndexNeeded = new QLabel();
    indexCount = new QLabel();
   
    grid.addWidget(new QLabel(tr("Notebooks:")), 0,0);
    grid.addWidget(notebookCount, 0,1);
   
    grid.addWidget(new QLabel(tr("Tags:")), 1,0);
    grid.addWidget(tagCount, 1,1);
   
    grid.addWidget(new QLabel(tr("Total Notes:")), 2,0);
    grid.addWidget(noteCount, 2,1);
   
    grid.addWidget(new QLabel(tr("Unsynchronized Notes:")), 3,0);
    grid.addWidget(syncNeeded, 3, 1);
   
    grid.addWidget(new QLabel(tr("Unindexed Notes:")), 4,0);
    grid.addWidget(indexNeeded, 4, 1);
       
    grid.addWidget(new QLabel(tr("Attachments/Images:")), 5,0);
    grid.addWidget(resourceCount, 5,1);

    grid.addWidget(new QLabel(tr("Unindexed Attachments/Images:")), 6,0);
    grid.addWidget(resourceIndexNeeded, 6, 1);

    grid.addWidget(new QLabel(tr("Saved Searches:")),7,0);
    grid.addWidget(savedSearchCount, 7,1);
   
    grid.addWidget(new QLabel(tr("Words In Index")), 8,0);
    grid.addWidget(indexCount, 8,1);
     
    QGridLayout buttonLayout = new QGridLayout();
    ok = new QPushButton(tr("OK"));
    ok.clicked.connect(this, "okPushed()");
    buttonLayout.addWidget(ok, 1, 1);
    grid.addLayout(buttonLayout,9,1);
  }
View Full Code Here

  // Constructor
  public EnDecryptDialog() {
    okPressed = false;
    setWindowTitle(tr("Decrypt Text"));
    setWindowIcon(new QIcon(iconPath+"password.png"));
    QGridLayout grid = new QGridLayout();
    QGridLayout input = new QGridLayout();
    QGridLayout msgGrid = new QGridLayout();
    QGridLayout button = new QGridLayout();
    setLayout(grid);
   
   
    hint = new QLabel("");
    password = new QLineEdit("");
    password.setEchoMode(QLineEdit.EchoMode.Password);
    password2 = new QLineEdit("");
    password2.setEchoMode(QLineEdit.EchoMode.Password);
   
   
    input.addWidget(new QLabel(tr("Password")), 1,1);
    input.addWidget(password, 1, 2);
    input.addWidget(new QLabel(tr("Verify")), 2,1);
    input.addWidget(password2, 2, 2);
   
    permanent = new QCheckBox();
    permanent.setText(tr("Permanently Decrypt"));
    input.addWidget(permanent,3,2);

    remember = new QCheckBox();
    remember.setText(tr("Remember For This Session"));
    input.addWidget(remember,4,2);
   
    input.setContentsMargins(10, 10,  -10, -10);
    grid.addLayout(input, 1,1);
   
    msgGrid.addWidget(new QLabel(tr("Hint: ")), 1,1);
    msgGrid.addWidget(hint, 1, 2);
    msgGrid.addWidget(new QLabel(""), 1,3);
    msgGrid.setColumnStretch(3, 100);
    error = new QLabel();
    msgGrid.addWidget(error, 2, 2);
    grid.addLayout(msgGrid, 2, 1);   
   
    ok = new QPushButton("OK");
    ok.clicked.connect(this, "okButtonPressed()");
    ok.setEnabled(false);
   
    QPushButton cancel = new QPushButton(tr("Cancel"));
    cancel.clicked.connect(this, "cancelButtonPressed()");
    button.addWidget(ok, 1, 1);
    button.addWidget(cancel, 1,2);
    grid.addLayout(button, 3, 1);
   
    password.textChanged.connect(this, "validateInput()");
    password2.textChanged.connect(this, "validateInput()");
   
View Full Code Here

  public NotebookEdit() {
    okPressed = false;
    stackEdit = false;
    setWindowTitle(tr("Add Notebook"));
    setWindowIcon(new QIcon(iconPath+"notebook-green.png"));
    QGridLayout grid = new QGridLayout();
    setLayout(grid);
   
    QGridLayout textLayout = new QGridLayout();
    notebook = new QLineEdit();
    notebookLabel = new QLabel(tr("Notebook Name"));
    textLayout.addWidget(notebookLabel, 1,1);
    textLayout.addWidget(notebook, 1, 2);
    textLayout.setContentsMargins(10, 10,-10, -10);
    grid.addLayout(textLayout,1,1);
   
    localRemote = new QCheckBox();
    localRemote.setText(tr("Local Notebook"));
    localRemote.setChecked(false);
    grid.addWidget(localRemote, 2,1);

    isDefault = new QCheckBox();
    isDefault.setText(tr("Default Notebook"));
    isDefault.setChecked(false);
    isDefault.toggled.connect(this, "defaultNotebookChecked(Boolean)");
    grid.addWidget(isDefault, 3,1);

    QGridLayout buttonLayout = new QGridLayout();
    ok = new QPushButton(tr("OK"));
    ok.clicked.connect(this, "okButtonPressed()");
    ok.setEnabled(false);
    QPushButton cancel = new QPushButton(tr("Cancel"));
    cancel.clicked.connect(this, "cancelButtonPressed()");
    notebook.textChanged.connect(this, "textChanged()");
    buttonLayout.addWidget(ok, 1, 1);
    buttonLayout.addWidget(cancel, 1,2);
    grid.addLayout(buttonLayout,4,1);
  }
View Full Code Here

  // Constructor
  public InsertLinkDialog(boolean insert) {
    okPressed = false;
    setWindowTitle(tr("Insert Link"));
    setWindowIcon(new QIcon(iconPath+"link.png"));
    QGridLayout grid = new QGridLayout();
    QGridLayout input = new QGridLayout();
    QGridLayout button = new QGridLayout();
    setLayout(grid);
    insertHyperlink = insert;
   
   
    url = new QLineEdit("");
   
    input.addWidget(new QLabel(tr("Url")), 1,1);
    input.addWidget(url, 1, 2);
    input.setContentsMargins(10, 10,  -10, -10);
    grid.addLayout(input, 1,1);
     
    ok = new QPushButton(tr("OK"));
    ok.clicked.connect(this, "accept()");
    ok.setEnabled(false);
   
    QPushButton cancel = new QPushButton(tr("Cancel"));
    cancel.clicked.connect(this, "reject()");
    button.addWidget(ok, 1, 1);
    button.addWidget(cancel, 1,2);
    grid.addLayout(button, 3, 1);
    url.textChanged.connect(this, "validateInput()");
   
    setAttribute(Qt.WidgetAttribute.WA_DeleteOnClose);
  }
View Full Code Here

 
  // Constructor
  public TagEdit() {
    okPressed = false;
    setWindowTitle(tr("Add Tag"));
    QGridLayout grid = new QGridLayout();
    setWindowIcon(new QIcon(iconPath+"tag.png"));
    setLayout(grid);
   
    QGridLayout textGrid = new QGridLayout();
    tag = new QLineEdit();
    textGrid.addWidget(new QLabel(tr("Tag Name")), 1,1);
    textGrid.addWidget(tag, 1, 2);
   
    textGrid.setContentsMargins(10, 10,-10, -10);
    grid.addLayout(textGrid,1,1);

    useParentTag = new QCheckBox();
    useParentTag.setVisible(false);
    useParentTag.setChecked(false);
    grid.addWidget(useParentTag,2,1);
   
    QGridLayout buttonGrid = new QGridLayout();
    ok = new QPushButton(tr("OK"));
    ok.clicked.connect(this, "okButtonPressed()");
    ok.setEnabled(false);
    QPushButton cancel = new QPushButton(tr("Cancel"));
    cancel.clicked.connect(this, "cancelButtonPressed()");
    tag.textChanged.connect(this, "textChanged()");
    buttonGrid.addWidget(ok, 3, 1);
    buttonGrid.addWidget(cancel, 3,2);
    grid.addLayout(buttonGrid,3,1);
  }
View Full Code Here

  public AccountDialog() {
   
    // Setup window layout, title, & icon
    setWindowTitle(tr("Account Information"));
    setWindowIcon(new QIcon(new QIcon(iconPath+"account.png")));
    QGridLayout grid = new QGridLayout();
    setLayout(grid);
    QLabel premium;
    if (Global.isPremium())
      premium = new QLabel(tr("Premium"));
    else
      premium = new QLabel(tr("Free"));
   
    String userName = Global.username;
   
    // calculate the upload amount
    Long uploadAmt = Global.getUploadAmount();
    Long uploadLimit = Global.getUploadLimit();
    Long uploadLimitEnd = Global.getUploadLimitEnd();
    Long pct;
    if (uploadLimit > 0)
      pct = uploadAmt*100 / uploadLimit;
    else
      pct = new Long(0);
    String unit = tr(" Bytes");
   
    if (uploadAmt > 0) {
      uploadAmt = uploadAmt/1024;
      unit = tr(" KB");
    }
    if (uploadAmt >= 1024) {
      uploadAmt = uploadAmt / 1024;
      unit = tr(" MB");
    }
    if (uploadLimit > 0)
      uploadLimit = uploadLimit/1024/1024;
 
    //showing only date need
    String fmt = Global.getDateFormat() /* + " " + Global.getTimeFormat()*/;
    String dateTimeFormat = new String(fmt);
    SimpleDateFormat simple = new SimpleDateFormat(dateTimeFormat);
    StringBuilder endDate = new StringBuilder(simple.format(uploadLimitEnd));
   
    // Show limits
    QGroupBox limitGroup = new QGroupBox(tr("Account:"));

    QGridLayout textGrid = new QGridLayout();
    textGrid.addWidget(new QLabel(tr("User Name:")),1,1);
    textGrid.addWidget(new QLabel(userName), 1,2);
    textGrid.addWidget(new QLabel(tr("Account Type:")), 2,1);
    textGrid.addWidget(premium, 2, 2);
    textGrid.addWidget(new QLabel(tr("Limit:")), 3,1);
    textGrid.addWidget(new QLabel(uploadLimit.toString() +" MB"),3,2);
    textGrid.addWidget(new QLabel(tr("Uploaded In This Period:")), 4,1);
    if (uploadAmt > 0)
      textGrid.addWidget(new QLabel(uploadAmt.toString()+unit +" ("+pct+"%)"),4,2);
    else
      textGrid.addWidget(new QLabel(tr("Less than 1MB")),4,2);
    textGrid.addWidget(new QLabel(tr("Current Cycle Ends:")), 5,1);
    textGrid.addWidget(new QLabel(endDate.toString()),5,2);
    limitGroup.setLayout(textGrid);

    grid.addWidget(limitGroup, 1, 1);

    //UserAttributes attrib = Global.getUserAttributes();
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.