Question

I created this slot:

public slots:
   void openNSelect();

then in the function :

QFileDialog::getOpenFileName(this,tr("select file"),"/home/",tr("text file(*.txt)"));

it doesn't show me the dialog,if I write that line in some other function like in the QMainWindow constructor,it did show me the window. the project is created using kdevelop with mainwindow object.

Was it helpful?

Solution

Put some debugs to ensure the slot is actually firing. Half the time its a typo in the signal/slot connect that fails to wire up.

If not post more code so we can get a better idea.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top