Exemplo n.º 1
0
about_app::about_app(QWidget *parent):sub_win(parent) {
	this->setWindowTitle("About Asitor");
	QVBoxLayout* vbox = new QVBoxLayout(this);
	about_text = new QLabel("Asitor is an open-source, cross-platform, student information management system.", this);
	about_ok = new QPushButton("Okay", this);
	vbox->addWidget(about_text, 1);
	vbox->addWidget(about_ok, 0, Qt::AlignRight);
	setLayout(vbox);
	connect(about_ok, SIGNAL(clicked()), this, SLOT(close_me()));
}
void ribi::QtCanvasDialog::keyPressEvent(QKeyEvent* event)
{
  if (event->key() == Qt::Key_Escape)
  {
    close();
    close_me();
    return;
  }
  m_qtcanvas->keyPressEvent(event);
}
Exemplo n.º 3
0
new_db::new_db(QWidget *parent):sub_win(parent) {
	this->setWindowTitle("New Database");
	this->resize(400,200);
	this->setWindowFlags(Qt::WindowCloseButtonHint);
	admin_email = new QLabel("Admin Email: ", this);
	password = new QLabel("Password: "******"Choose Folder: ", this);
	give_db_name = new QLabel("Database File Name: ");
	email_line = new QLineEdit(this);
	pass_line = new QLineEdit(this);
	pass_line->setEchoMode(QLineEdit::Password);
	dir_line = new QLineEdit(this);
	db_name_line = new QLineEdit(this);
	nokay = new QPushButton("Okay", this);
	ncancel = new QPushButton("Cancel", this);
	browse = new QPushButton("Browse..", this);

	QGridLayout* grid = new QGridLayout();
	grid->addWidget(admin_email, 0, 0);
	grid->addWidget(email_line, 0, 1);
	grid->addWidget(password, 1, 0);
	grid->addWidget(pass_line, 1, 1);
	grid->addWidget(give_db_name, 2, 0);
	grid->addWidget(db_name_line, 2, 1);

	QVBoxLayout *vbox = new QVBoxLayout(this);
	vbox->addLayout(grid);
	vbox->addSpacing(10);

	QGridLayout* grid2 = new QGridLayout();

	grid2->addWidget(choose_dir, 0, 1);
	grid2->addWidget(browse, 0, 2);
	grid2->addWidget(dir_line, 0, 3);
	vbox->addLayout(grid2);

	QHBoxLayout* hbox = new QHBoxLayout();
	hbox->addWidget(nokay, 1, Qt::AlignRight);
	hbox->addWidget(ncancel, 0);

	vbox->addStretch(1);
	vbox->addLayout(hbox);

	setLayout(vbox);

	connect(browse, SIGNAL(clicked()), this, SLOT(on_browse()));
	connect(nokay, SIGNAL(clicked()), this, SLOT(on_okay()));
	connect(ncancel, SIGNAL(clicked()), this, SLOT(close_me()));
}
Exemplo n.º 4
0
close_db::close_db(QWidget *parent): sub_win(parent) {
	this->setWindowTitle("Close Database");
	ask_close = new QLabel("Do you really want to close this database ??", this);
	cancel_close_db = new QPushButton("No", this);
	ok_close_db = new QPushButton("Yes", this);

	QVBoxLayout *vbox = new QVBoxLayout(this);
	
	QHBoxLayout *hbox = new QHBoxLayout();
	hbox->addWidget(ask_close);
	vbox->addLayout(hbox);
	
	hbox = new QHBoxLayout();
	hbox->addWidget(ok_close_db, 1, Qt::AlignRight);
	hbox->addWidget(cancel_close_db, 0);

	vbox->addLayout(hbox);

	setLayout(vbox);

	connect(cancel_close_db, SIGNAL(clicked()), this, SLOT(close_me()));
}
void ribi::QtCanvasDialog::OnQtCanvasDestroy()
{
  close_me();
  m_show_child = false;
  close();
}