OH Lord its driving me crazy.. I found the error is here:
frase_autor = randurl->getFraseRandom ();
ui->label_author->setText (QString ("hola"));
ui->label_text->setFont (QFont("Courier", 8));
ui->label_text->setText (QString ("foo.bar ()"));
I`ll post the full code just in case:
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
stack_ventanas->addWidget (this->ui->centralWidget);
this->setCentralWidget (stack_ventanas);
randurl = new RandomInfo ();
}
void MainWindow
::accionFinalizada_Cancelada (QString url
){ ui->menuBar->show ();
frase_autor = randurl->getFraseRandom ();
ui->label_author->setText (frase_autor.at (1));
ui
->label_text
->setFont
(QFont("Courier",
8));
ui->label_text->setText (frase_autor.at (0));
if (stack_ventanas->currentIndex () != 0){
stack_ventanas->removeWidget (stack_ventanas->widget (1));
stack_ventanas->setCurrentIndex (0);
}
}
void MainWindow::on_actionFacturacion_triggered()
{
this->ui->menuBar->hide ();
tipo_factura->exec ();
wfact = new widgetFacturacion(this, this->handler, tipo_factura->getTipoFactura ());
connect (wfact,
SIGNAL(widgetClosed
(QString )) ,
this,
SLOT(accionFinalizada_Cancelada
(QString)));
stack_ventanas->addWidget (wfact);
stack_ventanas->setCurrentIndex (1);
}
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
stack_ventanas = new QStackedWidget;
stack_ventanas->addWidget (this->ui->centralWidget);
this->setCentralWidget (stack_ventanas);
randurl = new RandomInfo ();
frase_autor = QStringList ();
}
void MainWindow::accionFinalizada_Cancelada (QString url){
ui->menuBar->show ();
frase_autor = randurl->getFraseRandom ();
ui->label_author->setText (frase_autor.at (1));
ui->label_text->setFont (QFont("Courier", 8));
ui->label_text->setText (frase_autor.at (0));
if (stack_ventanas->currentIndex () != 0){
stack_ventanas->removeWidget (stack_ventanas->widget (1));
stack_ventanas->setCurrentIndex (0);
}
}
void MainWindow::on_actionFacturacion_triggered()
{
this->ui->menuBar->hide ();
tipo_factura->exec ();
wfact = new widgetFacturacion(this, this->handler, tipo_factura->getTipoFactura ());
connect (wfact, SIGNAL(widgetClosed (QString )) ,this, SLOT(accionFinalizada_Cancelada(QString)));
stack_ventanas->addWidget (wfact);
stack_ventanas->setCurrentIndex (1);
}
To copy to clipboard, switch view to plain text mode
Bookmarks