Re: QLabel setText Problem
Where did you try to place that line?
Re: QLabel setText Problem
In the dialog containing the QLabel * labelFilename
hope that helps..
thanks for the reply!
Patrick.
Re: QLabel setText Problem
Could you post an example of non-working code?
Re: QLabel setText Problem
Code:
/*
ProcessingDlg.Cpp
*/
#include "MainWindow.h"
#include <QtGui>
#include <QCloseEvent >
#include "ProcessingDlg.h"
#include "Config.h"
ProcessingDlg
::ProcessingDlg(QWidget *parent, MainWindow
*h
){
setupUi(this);
}
{
help->m_pProcessDlg = false;
delete help->m_pProcessDlg;
m_pevent->accept();
}
Code:
/*
ProcessingDlg.h
*/
#ifndef PROCESSINGDLG_H
#define PROCESSINGDLG_H
#include"ui_Processing.h"
class MainWindow;
class ProcessingDlg
: public QDialog,
public Ui
::Process{
Q_OBJECT
public:
ProcessingDlg
(QWidget *parent,MainWindow
*h
);
MainWindow *help;
protected:
public slots:
private:
Ui::Process ui;
public:
};
#endif
Code:
if(!m_pProcessDlg)
m_pProcessDlg = new ProcessingDlg(m_pTab,this);
// Make FIle List of Directory
QFileInfoList m_pFinfo = CurrentDir.entryInfoList();
m_pEntries = m_pFinfo.count();
m_pProcessDlg->progressBar->setMaximum(m_pEntries);
m_pProcessDlg->progressBar->setValue(m_pCurrentEnt);
if(!CurrentDir.cd(DirPath))
{
QMessageBox::information(this,tr
("Error"),tr
("Can't Cd into %1").
arg(DirPath
));
return false;
}
m_pProcessDlg->labelDirectory->setText(DirPath);
Hope this helps , thanks again for your time , it's greatly appreciated!
Patrick
Re: QLabel setText Problem
Quote:
Originally Posted by
pmabie
help->m_pProcessDlg = false;
delete help->m_pProcessDlg;
This is wrong --- the second line should be first.
Quote:
Originally Posted by
pmabie
if(!m_pProcessDlg)
m_pProcessDlg = new ProcessingDlg(m_pTab,this);
...
m_pProcessDlg->labelDirectory->setText(DirPath);
Do you invoke exec() on m_pProcessDlg anywhere?
P.S. Please use [code] tags for code snippets, not [qtclass]. The latter is for linking to Qt docs.
Re: QLabel setText Problem
Really sorry , I will remember that .
I am doing a show();
Patrick.
Re: QLabel setText Problem
Quote:
Originally Posted by
pmabie
I am doing a show();
OK, then maybe you declare m_pProcessDlg more than once?
Re: QLabel setText Problem
I will check on that , but I pretty sure that it's in my mainwindow.h :)
Thanks!
Re: QLabel setText Problem
Checked it out , only one time, I tried to setText before the show() worked fine , after I show it , I lose contact ....
thanks alot for you time!
Patrick.
Re: QLabel setText Problem
Then maybe you have some kind of a loop that blocks the event loop and you simply can't see that the text was changed.