will explain the problem in detail. What I am doing is selecting a file from QFileDialog and then displaying that filename with path to the m_pLineEdit. When I click browse push button and it will emit a slot ChooseFile( ) and then I create a filedialog ,browse the desired file and then I set a selectedFile to the m_pLineEdit.
Here every thing I have been doing in ChosseFile( ) slot that is browse slot .
m_pLineEdit I have loading from UI desinger file using child ( const char * objName, const char * inheritsClass = 0) method.
void CMain1::ChosseFile()
{
QString strFileName
= fileDlg
->selectedFile
();
m_pLineEdit->setText (strFileName )
fileDlg->exec();
delete fileDlg;
}
void CMain1::ChosseFile()
{
QFileDialog * fileDlg = new QFileDialog(strPath,0,);
QString strFileName = fileDlg->selectedFile();
m_pLineEdit->setText (strFileName )
fileDlg->exec();
delete fileDlg;
}
To copy to clipboard, switch view to plain text mode
How do I get text() value from m_pLineEdit.
Bookmarks