Exemplo n.º 1
0
 RID IndexScan::next() {
     RID res(-1,-1);
     if(!canDo)
         return res;
     switch(compOp_){
         case NO_OP:
             res = NoSearch();
             break;
         case EQ_OP:
             res = EqSearch();
             break;
         case LT_OP:
             res = LtSearch();
             break;
         case GT_OP:
             res = GtSearch();
             break;
         case LE_OP:
             res = LeSearch();
             break;
         case GE_OP:
             res = GeSearch();
             break;
         case NE_OP:
             res = NeSearch();
             break;
         default:
             break;
     }
     return res;
 }
Exemplo n.º 2
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QTextCodec *utfcodec = QTextCodec::codecForName("UTF-8");
    QTextCodec::setCodecForTr(utfcodec);
    QTextCodec::setCodecForCStrings(utfcodec);

    base = QSqlDatabase::addDatabase("QSQLITE"); //указываем тип базы

    ui->statusBar->addWidget(&stBar);

    connect(ui->tableView, SIGNAL(clicked(QModelIndex)), SLOT(TableRead(QModelIndex)));
    connect(ui->ButtonSave, SIGNAL(clicked()), SLOT(SaveBaseAll()));
    connect(ui->ButtonDelete, SIGNAL(clicked()), SLOT(DeleteRecord()));
    connect(ui->ButtonSearch, SIGNAL(clicked()), SLOT(Search()));
    connect(ui->ButtonDeleteFilter, SIGNAL(clicked()), SLOT(NoSearch()));
    connect(ui->ActionTruncate, SIGNAL(triggered()), SLOT(Truncate()));
    connect(ui->ButtonAddRecord, SIGNAL(clicked()), SLOT(AddRecord()));
    connect(ui->ActionNewBackup, SIGNAL(triggered()), SLOT(SaveBackup()));
    connect(ui->ActionLoadBackup, SIGNAL(triggered()), SLOT(LoadBackup()));
    connect(ui->AboutBase, SIGNAL(triggered()), SLOT(AboutBase()));
    connect(ui->ActionConvert, SIGNAL(triggered()), SLOT(ConvertFromOperaNotes()));
    connect(ui->ActionOpenBase, SIGNAL(triggered()), SLOT(OpenBase()));

    setAcceptDrops(true);
}