How do i do this?
void MainWindow::on_pushButton_clicked()
{
QString stirng
= ui
->lineEdit
->text
();
one = "color : red" ;
two = "color : pink" ;
three = "color : green" ;
four = "color : violet" ;
if(stirng != '\0')
{
ui->lineEdit_2->setText(stirng);
if(i==1)
{
ui->lineEdit_2->setStyleSheet(one);
i++;
}
else if(i==2)
{
ui->lineEdit_2->setStyleSheet(two);
i++;
}
else if(i==3)
{
ui->lineEdit_2->setStyleSheet(three);
i++;
}
else
{
ui->lineEdit_2->setStyleSheet(four);
i = 1 ;
}
}
}
int MainWindow::i = 1 ;
void MainWindow::on_pushButton_clicked()
{
QString stirng = ui->lineEdit->text();
QString one , two , three , four ;
one = "color : red" ;
two = "color : pink" ;
three = "color : green" ;
four = "color : violet" ;
if(stirng != '\0')
{
ui->lineEdit_2->setText(stirng);
if(i==1)
{
ui->lineEdit_2->setStyleSheet(one);
i++;
}
else if(i==2)
{
ui->lineEdit_2->setStyleSheet(two);
i++;
}
else if(i==3)
{
ui->lineEdit_2->setStyleSheet(three);
i++;
}
else
{
ui->lineEdit_2->setStyleSheet(four);
i = 1 ;
}
}
}
int MainWindow::i = 1 ;
To copy to clipboard, switch view to plain text mode
But not useful
Bookmarks