MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); QTime time = QTime::currentTime(); qsrand((uint)time.msec()); QDir dir; readFile(dir.path() + "/vocabulario.txt"); ui->openLineEdit->setText(dir.path() + "/vocabulario.txt"); ui->spanishRB->setChecked(true); ui->correctLabel->setText("0"); ui->correctLabel->setStyleSheet("QLabel {color : red; }"); connect(ui->refreshButton, SIGNAL(clicked()), this, SLOT(refresh_clicked())); connect(ui->changeButton, SIGNAL(clicked()), this, SLOT(change_clicked())); connect(ui->spanish_lineEdit, SIGNAL(returnPressed()), this, SLOT(refresh_clicked())); connect(ui->slovak_lineEdit, SIGNAL(returnPressed()), this, SLOT(refresh_clicked())); connect(ui->openButton, SIGNAL(clicked()), this, SLOT(open_clicked())); refresh_clicked(); }
void initialize_form(void) { QHBoxLayout* layout = new QHBoxLayout(widget_); layout->addWidget(&combobox_); layout->addWidget(&button_); widget_->setLayout(layout); button_.setText("open"); connect(&button_, SIGNAL(clicked()), widget_, SLOT(open_clicked())); }
MainWindow::MainWindow(QWidget *parent) : QWidget(parent){ setWindowTitle("Babylon"); //create button open=new QPushButton("Open"); save1=new QPushButton("Save to TIFF"); save2=new QPushButton("Save to JPG"); quit=new QPushButton("Quit"); zoomIn=new QPushButton("ZoomIn"); zoomOut=new QPushButton("ZoomOut"); webView=new QPushButton("GoogleMaps"); reset=new QPushButton("Reset"); submit=new QPushButton("Submit"); //create checkBox movable=new QCheckBox("movable"); movable->setChecked(true); //default //create layout QVBoxLayout *layout1=new QVBoxLayout; QGridLayout *layout=new QGridLayout; //create label & textline scaleLabel=new QLabel("scale"); xlabel=new QLabel("longitude(°)"); ylabel=new QLabel("latitude(°)"); valueLabel=new QLabel("Value"); minlabel=new QLabel("min"); maxlabel=new QLabel("Max"); scaleLine=new QLineEdit; xline=new QLineEdit; yline=new QLineEdit; valueLine=new QLineEdit; minline=new QLineEdit; maxline=new QLineEdit; //layout button layout1->addWidget(open); layout1->addWidget(quit); layout1->addWidget(save1); layout1->addWidget(save2); layout1->addWidget(zoomIn); layout1->addWidget(zoomOut); layout1->addWidget(webView); layout1->addWidget(reset); layout1->addWidget(movable); save1->setEnabled(false); save2->setEnabled(false); //layout textline layout1->addWidget(scaleLabel); layout1->addWidget(scaleLine); layout1->addWidget(ylabel); layout1->addWidget(yline); layout1->addWidget(xlabel); layout1->addWidget(xline); layout1->addWidget(valueLabel); layout1->addWidget(valueLine); layout1->addWidget(minlabel); layout1->addWidget(minline); layout1->addWidget(maxlabel); layout1->addWidget(maxline); layout1->addWidget(submit); layout1->addStretch(); //connect button & checkBox connect(open,SIGNAL(clicked()),this,SLOT(open_clicked())); connect(quit,SIGNAL(clicked()),this,SLOT(quit_clicked())); connect(save1,SIGNAL(clicked()),this,SLOT(save1_clicked())); connect(save2,SIGNAL(clicked()),this,SLOT(save2_clicked())); connect(zoomIn,SIGNAL(clicked()),this,SLOT(zoomIn_clicked())); connect(zoomOut,SIGNAL(clicked()),this,SLOT(zoomOut_clicked())); connect(webView,SIGNAL(clicked()),this,SLOT(webView_clicked())); connect(reset,SIGNAL(clicked()),this,SLOT(reset_clicked())); connect(movable,SIGNAL(stateChanged(int)),this,SLOT(move_checked(int))); connect(submit,SIGNAL(clicked()),this,SLOT(submit_clicked())); //create Pixmap & Painter pixmap=new QPixmap(QSize(YOKO,TATE)); pixmap2=new QPixmap(QSize(720,20)); painter=new QPainter(pixmap); painter2=new QPainter(pixmap2); //create_ColorBar first_color_bar(); item=new Item(); //BinaryPicture item->setPixmap(*pixmap); item->setScale(scale); item->setFlag(QGraphicsItem::ItemIsMovable,true); item2=new QGraphicsPixmapItem(*pixmap2); //ColorBar item2->setScale(1.3); scene=new QGraphicsScene(QRect(0, 0, 1440, 720)); //BinaryPicture scene->addItem(item); scene2=new QGraphicsScene(QRect(0, 0, 720, 20)); //ColorBar scene2->addItem(item2); view=new QGraphicsView(scene); view->setBackgroundBrush(QBrush(Qt::gray)); view2=new QGraphicsView(scene2); view2->setBackgroundBrush(QBrush(Qt::black)); layout->addLayout(layout1,0,1); //Button etc. layout->addWidget(view,0,0); //BinaryPicture layout->addWidget(view2,1,0); //ColorBar //statusBar(FileName) lb=new QLabel(); QStatusBar *statusBar = new QStatusBar(); statusBar->addWidget(lb); //setLayout layout->addWidget(statusBar,2,0); setLayout(layout); }
void LoadRemotePatchWindow::patch_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* col) { open_clicked(); }