I new in qt and i have this problem, any solucion for this and use form extencion .ui
thanks.
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include<iostream>
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
std::cout<<"Valor de la x"<<std::endl;
connect(ui->X, SIGNAL(sliderMove()),this, SLOT(on_X_sliderMoved(int)));
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow
::changeEvent(QEvent *e
) {
switch (e->type()) {
ui->retranslateUi(this);
break;
default:
break;
}
}
void MainWindow::on_X_sliderMoved(int position)
{
position++;
std::cout<<"Valor de la x"<<position<<std::endl;
}
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include<iostream>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
std::cout<<"Valor de la x"<<std::endl;
connect(ui->X, SIGNAL(sliderMove()),this, SLOT(on_X_sliderMoved(int)));
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::changeEvent(QEvent *e)
{
QMainWindow::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
void MainWindow::on_X_sliderMoved(int position)
{
position++;
std::cout<<"Valor de la x"<<position<<std::endl;
}
To copy to clipboard, switch view to plain text mode
Bookmarks