示例#1
0
int my_close(int fd, int iline, char *pcfile)
{
	int r;
	r = save_close(fd);
	if (r == 0) del_fd_list(&g_pfdheader, fd, iline, pcfile);
	return r;
}
filter_expr_text_editor::filter_expr_text_editor(QWidget* parent): QDialog(parent)
{
  QVBoxLayout *topLayout = new QVBoxLayout( this );
  topLayout->setSpacing(5);
  topLayout->setMargin(5);

  m_edit=new QPlainTextEdit(this);
//  m_edit->setWordWrap(QMultiLineEdit::FixedColumnWidth);
//  m_edit->setWrapColumnOrWidth(40);
  m_edit->setTabChangesFocus(true);

  topLayout->addWidget(m_edit);

  QHBoxLayout* buttons = new QHBoxLayout();
  topLayout->addLayout(buttons);
  QPushButton* w = new QPushButton(tr("OK"), this);
  connect(w, SIGNAL(clicked()), this, SLOT(save_close()));

  QPushButton* w2 = new QPushButton(tr("Help"), this);
  connect(w2, SIGNAL(clicked()), this, SLOT(help()));

  QPushButton* w1 = new QPushButton(tr("Cancel"), this);
  connect(w1, SIGNAL(clicked()), this, SLOT(cancel()));

  QPushButton* btns[]={w,w2,w1};
  for (int i=0; i<3; i++) {
    buttons->addStretch(10);
    buttons->addWidget(btns[i]);
  }
  buttons->addStretch(10);
  //  topLayout->addLayout (buttons, 10);
  setWindowTitle(tr("Filter expression"));
  resize(500, 200);
}
示例#3
0
sql_editor::sql_editor(QWidget* parent): QDialog(parent)
{
  QVBoxLayout *topLayout = new QVBoxLayout( this );
  topLayout->setSpacing(5);
  topLayout->setMargin(5);

  m_edit=new QPlainTextEdit(this);
//  m_edit->setWordWrap(QMultiLineEdit::FixedColumnWidth);
//  m_edit->setWrapColumnOrWidth(40);
  m_edit->setTabChangesFocus(true);

  topLayout->addWidget(m_edit);

  QHBoxLayout* buttons = new QHBoxLayout();
  topLayout->addLayout(buttons);
  QPushButton* w = new QPushButton(tr("OK"), this);
  connect(w, SIGNAL(clicked()), this, SLOT(save_close()));
#if 0
  // TODO when a help section will be available for SQL queries
  QPushButton* w2 = new QPushButton(tr("Help"), this);
  connect(w2, SIGNAL(clicked()), this, SLOT(help()));
#endif

  QPushButton* w1 = new QPushButton(tr("Cancel"), this);
  connect(w1, SIGNAL(clicked()), this, SLOT(cancel()));

  QPushButton* btns[]={w,/*w2,*/w1};
  for (uint i=0; i<sizeof(btns)/sizeof(btns[0]); i++) {
    buttons->addStretch(10);
    buttons->addWidget(btns[i]);
  }
  buttons->addStretch(10);
  //  topLayout->addLayout (buttons, 10);
  setWindowTitle(tr("SQL subquery"));
  resize(500, 200);
}