Logo Search packages:      
Sourcecode: qtoctave version File versions  Download package

bool Operations::input_dialog ( QString  title,
QString  label,
QString &  input 
)

Shows simple dialog with one label and line edit.

Parameters:
title Dialog title.
label Dialog label.
input Value of line edit
Returns:
true if user press ok button.

Definition at line 403 of file operations.cpp.

References copy_clipboard_callback().

Referenced by simple_comand().

{
      copy_clipboard_ok=false;
      
      //Se muestra el cuadro de di´┐Żogo.
      QDialog dialog(main_window);
      dialog.setWindowTitle(title);
      QVBoxLayout layout;
      dialog.setLayout(&layout);
      
      QLabel matrix_label(label,&dialog);
      layout.addWidget(&matrix_label);
      matrix_label.show();
      
      QLineEdit matrix_lineedit(&dialog);
      matrix_lineedit.setText(matrix);
      layout.addWidget(&matrix_lineedit);
      matrix_lineedit.show();
      
      QHBoxLayout buttons_layout;
      layout.addLayout(&buttons_layout);
      QPushButton ok_button("Ok", &dialog);
      buttons_layout.addWidget(&ok_button);
      ok_button.show();
      connect(&ok_button,SIGNAL(clicked()),&dialog,SLOT(accept()));
      
      QPushButton copy_clipboard_button("Copy to clipboard", &dialog);
      buttons_layout.addWidget(&copy_clipboard_button);
      copy_clipboard_button.show();
      connect(&copy_clipboard_button,SIGNAL(clicked()),&dialog,SLOT(accept()));
      connect(&copy_clipboard_button,SIGNAL(clicked()),this,SLOT(copy_clipboard_callback()));
      
      QPushButton cancel_button("Cancel", &dialog);
      buttons_layout.addWidget(&cancel_button);
      cancel_button.show();
      connect(&cancel_button,SIGNAL(clicked()),&dialog,SLOT(reject()));
      
      dialog.exec();
      
      input=matrix_lineedit.text();
      
      if (dialog.result()==QDialog::Accepted && !input.isEmpty()) return true;
      return false;
}


Generated by  Doxygen 1.6.0   Back to index