Hack Forums
[C] Qt Desinger, lineEdit Problem - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C] Qt Desinger, lineEdit Problem (/showthread.php?tid=4802172)



Qt Desinger, lineEdit Problem - SIM-1866423 - May 1, 2015

Hi guys, ım working on QtDesinger to make some basic app.So I got little weird problem today.There following codes ;

PHP Code

<?php 
void MainWindow
::on_pushButton_2_clicked()
    
QString str = ui->lineEdit->text();
    
QMessageBox::information(this, "Hello World!", str);
} 

I'm writing to lineedit bla bla etc.. not return anything on my QMessageBox.I already check syntax just in case, but im really do not see anything wrong(but im still not sure)


[img]http://i.hizliresim.com/rQV8a3.png[/img]



Any idea what its return null ? 😧


* - TheComet - May 1, 2015

Does the lineEdit have a string in it?

Are you even sure it's null, and not just an empty string?


* - SIM-1866423 - May 1, 2015

(May 1, 2015 06:02 AM)TheComet Wrote:  Does the lineEdit have a string in it?

Are you even sure it's null, and not just an empty string?

Of course it does.I'm try %100 same way with that video ;

(2.45-2.56) Check it u can understand what I try to do.

https://www.youtube.com/watch?v=XauEGKUh5Xs&list=PL2D1942A4688E9D63&index=16


* - TheComet - May 1, 2015

What happens if you change it to this?

PHP Code

<?php 
#include <iostream>

void MainWindow::on_pushButton_2_clicked()
    
QString str = ui->lineEdit->text();
    
QMessageBox::information(this, "Hello World!", "This message should appear!");
    
std::cout << "String in message box is: \"" << str << "\"" << std::endl;
} 

What output do you get in the console?