예제 #1
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    isPaused(false),
    isSearching(false)
{
    ui->setupUi(this);
    connect(ui->pushButton, SIGNAL(released()), this, SLOT(btn1Clicked()));
    connect(ui->pushButton_2, SIGNAL(released()), this, SLOT(btn2Clicked()));
    page_viewer.connectWithUI(ui->listWidget, ui->textBrowser);
    connect(ui->checkBox_3, SIGNAL(toggled(bool)), &page_viewer, SLOT(refreshHeaders(bool)));
    connect(&thread_controller, SIGNAL(textFound(QString,QString,QVector<QPoint>)),
            &page_viewer, SLOT(addPage(QString,QString,QVector<QPoint>)));
    connect(&thread_controller, SIGNAL(progressChanged(int)), ui->progressBar, SLOT(setValue(int)));
    connect(&thread_controller, SIGNAL(searchFinished()), this, SLOT(searchFinished()));
}
예제 #2
0
void EnrollDialog::initializeUI()
{
  grid = new QGridLayout();

  lblMsg = new QLabel(tr("Introduzca su RUT"));
  lblMsg->setAlignment(Qt::AlignCenter);
  lblMsg->setStyleSheet("font-size: 12px;"
      "color: #FFFFFF;"
      "text-align: center;"
      "font-style: normal;"
      "font-weight: bold;");

  edtRut = new QLineEdit();
  edtRut->resize(100, 50);
  edtRut->setStyleSheet("background:rgb(0,102,153);"
      "color:rgb(255,255,255);"
      "font-size:18px;"
      "padding-right: 10px;");

  btnDelete = new QPushButton();
  btnDelete->resize(50, 50);
  btnDelete->setFlat(true);
  btnDelete->setStyleSheet("background-image: url(:/img/Resources/images/borrar.bmp);"
      "background-repeat: no repeat;"
      "background-position: center center;"
      "color:rgb(255,255,255);"
      "font-size:18px");
  connect(btnDelete, SIGNAL(clicked()), this, SLOT(btnDeleteClicked()));

  btn1 = new QPushButton();
  btn1->resize(50, 50);
  btn1->setFlat(true);
  btn1->setStyleSheet("background-image: url(:/img/Resources/images/1.bmp);"
      "background-repeat: no repeat;"
      "background-position: center center;"
      "color:rgb(255,255,255);"
      "font-size:18px");
  connect(btn1, SIGNAL(clicked()), this, SLOT(btn1Clicked()));

  btn2 = new QPushButton();
  btn2->resize(50, 50);
  btn2->setFlat(true);
  btn2->setStyleSheet("background-image: url(:/img/Resources/images/2.bmp);"
      "background-repeat: no repeat;"
      "background-position: center center;"
      "color:rgb(255,255,255);"
      "font-size:18px");
  connect(btn2, SIGNAL(clicked()), this, SLOT(btn2Clicked()));

  btn3 = new QPushButton();
  btn3->resize(50, 50);
  btn3->setFlat(true);
  btn3->setStyleSheet("background-image: url(:/img/Resources/images/3.bmp);"
      "background-repeat: no repeat;"
      "background-position: center center;"
      "color:rgb(255,255,255);"
      "font-size:18px");
  connect(btn3, SIGNAL(clicked()), this, SLOT(btn3Clicked()));

  btn4 = new QPushButton();
  btn4->resize(50, 50);
  btn4->setFlat(true);
  btn4->setStyleSheet("background-image: url(:/img/Resources/images/4.bmp);"
      "background-repeat: no repeat;"
      "background-position: center center;"
      "color:rgb(255,255,255);"
      "font-size:18px");
  connect(btn4, SIGNAL(clicked()), this, SLOT(btn4Clicked()));

  btn5 = new QPushButton();
  btn5->resize(50, 50);
  btn5->setFlat(true);
  btn5->setStyleSheet("background-image: url(:/img/Resources/images/5.bmp);"
      "background-repeat: no repeat;"
      "background-position: center center;"
      "color:rgb(255,255,255);"
      "font-size:18px");
  connect(btn5, SIGNAL(clicked()), this, SLOT(btn5Clicked()));

  btn6 = new QPushButton();
  btn6->resize(50, 50);
  btn6->setFlat(true);
  btn6->setStyleSheet("background-image: url(:/img/Resources/images/6.bmp);"
      "background-repeat: no repeat;"
      "background-position: center center;"
      "color:rgb(255,255,255);"
      "font-size:18px");
  connect(btn6, SIGNAL(clicked()), this, SLOT(btn6Clicked()));

  btn7 = new QPushButton();
  btn7->resize(50, 50);
  btn7->setFlat(true);
  btn7->setStyleSheet("background-image: url(:/img/Resources/images/7.bmp);"
      "background-repeat: no repeat;"
      "background-position: center center;"
      "color:rgb(255,255,255);"
      "font-size:18px");
  connect(btn7, SIGNAL(clicked()), this, SLOT(btn7Clicked()));

  btn8 = new QPushButton();
  btn8->resize(50, 50);
  btn8->setFlat(true);
  btn8->setStyleSheet("background-image: url(:/img/Resources/images/8.bmp);"
      "background-repeat: no repeat;"
      "background-position: center center;"
      "color:rgb(255,255,255);"
      "font-size:18px");
  connect(btn8, SIGNAL(clicked()), this, SLOT(btn8Clicked()));

  btn9 = new QPushButton();
  btn9->resize(50, 50);
  btn9->setFlat(true);
  btn9->setStyleSheet("background-image: url(:/img/Resources/images/9.bmp);"
      "background-repeat: no repeat;"
      "background-position: center center;"
      "color:rgb(255,255,255);"
      "font-size:18px");
  connect(btn9, SIGNAL(clicked()), this, SLOT(btn9Clicked()));

  btn0 = new QPushButton();
  btn0->resize(50, 50);
  btn0->setFlat(true);
  btn0->setStyleSheet("background-image: url(:/img/Resources/images/0.bmp);"
      "background-repeat: no repeat;"
      "background-position: center center;"
      "color:rgb(255,255,255);"
      "font-size:18px");
  connect(btn0, SIGNAL(clicked()), this, SLOT(btn0Clicked()));

  btnHyphen = new QPushButton();
  btnHyphen->resize(50, 50);
  btnHyphen->setFlat(true);
  btnHyphen->setStyleSheet("background-image: url(:/img/Resources/images/guion.bmp);"
      "background-repeat: no repeat;"
      "background-position: center center;"
      "color:rgb(255,255,255);"
      "font-size:18px");
  connect(btnHyphen, SIGNAL(clicked()), this, SLOT(btnHyphenClicked()));

  btnK = new QPushButton();
  btnK->resize(50, 50);
  btnK->setFlat(true);
  btnK->setStyleSheet("background-image: url(:/img/Resources/images/k.bmp);"
      "background-repeat: no repeat;"
      "background-position: center center;"
      "color:rgb(255,255,255);"
      "font-size:18px");
  connect(btnK, SIGNAL(clicked()), this, SLOT(btnKClicked()));

  btnOk = new QPushButton();
  btnOk->resize(50, 50);
  btnOk->setFlat(true);
  btnOk->setStyleSheet("background-image: url(:/img/Resources/images/aceptar.bmp);"
      "background-repeat: no repeat;"
      "background-position: center center;"
      "color:rgb(255,255,255);"
      "font-size:18px");
  connect(btnOk, SIGNAL(clicked()), this, SLOT(btnOkClicked()));

  btnCancel = new QPushButton();
  btnCancel->resize(50, 50);
  btnCancel->setFlat(true);
  btnCancel->setStyleSheet("background-image: url(:/img/Resources/images/cancelar.bmp);"
      "background-repeat: no repeat;"
      "background-position: center center;"
      "color:rgb(255,255,255);"
      "font-size:18px");
  connect(btnCancel, SIGNAL(clicked()), this, SLOT(btnCancelClicked()));

  lblEmpresa = new QLabel();
  lblEmpresa->setAlignment(Qt::AlignCenter);
  lblEmpresa->setStyleSheet("font-size: 18px;"
                            "color: #FFFFFF;"
                            "font-style: normal;");

  lblName= new QLabel();
  lblName->setAlignment(Qt::AlignCenter);
  lblName->setStyleSheet("font-size: 18px;"
                         "color: #FFFFFF;"
                         "font-style: normal;");

  lblMsgScreen2= new QLabel();
  lblMsgScreen2->setAlignment(Qt::AlignCenter);
  lblMsgScreen2->setStyleSheet("font-size: 18px;"
                               "color: #FFFFFF;"
                               "font-style: normal;");

  // widget, row, col, rowSpan, colSpan
  grid->addWidget(lblMsg, 0, 0, 1, 4, Qt::AlignCenter);
  grid->addWidget(edtRut, 1, 0, 1, 3, Qt::AlignCenter);
  grid->addWidget(btnDelete, 1, 3, 1, 1, Qt::AlignCenter);

  grid->addWidget(btn1, 2, 0, 1, 1, Qt::AlignCenter);
  grid->addWidget(btn2, 2, 1, 1, 1, Qt::AlignCenter);
  grid->addWidget(btn3, 2, 2, 1, 1, Qt::AlignCenter);

  grid->addWidget(btn4, 3, 0, 1, 1, Qt::AlignCenter);
  grid->addWidget(btn5, 3, 1, 1, 1, Qt::AlignCenter);
  grid->addWidget(btn6, 3, 2, 1, 1, Qt::AlignCenter);
  grid->addWidget(btnHyphen, 3, 3, 1, 1, Qt::AlignCenter);

  grid->addWidget(btn7, 4, 0, 1, 1, Qt::AlignCenter);
  grid->addWidget(btn8, 4, 1, 1, 1, Qt::AlignCenter);
  grid->addWidget(btn9, 4, 2, 1, 1, Qt::AlignCenter);
  grid->addWidget(btnK, 4, 3, 1, 1, Qt::AlignCenter);

  grid->addWidget(btnCancel, 5, 0, 1, 1, Qt::AlignCenter);
  grid->addWidget(btn0, 5, 1, 1, 1, Qt::AlignCenter);
  grid->addWidget(btnOk, 5, 2, 1, 1, Qt::AlignCenter);

  setStyleSheet("background:rgb(0,101,153);");
  setLayout(grid);
}