hi
i have a QTreeView with QDirModel,
on right click on a QTreeView lines, i display a menu context :
//slot
{
myAction
*propertyAction
= new myAction
(QIcon("../img/property.png"), tr
("&Proprietes"),
this, tr
("Ctrl+P"));
connect( propertyAction, SIGNAL( triggered() ), this->parent(), SLOT( showDialogInfo() ) );
treeMenu.addAction(propertyAction);
treeMenu.exec(point);
}
//slot
void MyTreeView::showContextMenu(QModelIndex index, QPoint point)
{
QString fP = ( (QDirModel *)model() )->fileInfo( index ).absoluteFilePath ();
myAction *propertyAction = new myAction(QIcon("../img/property.png"), tr("&Proprietes"), this, tr("Ctrl+P"));
connect( propertyAction, SIGNAL( triggered() ), this->parent(), SLOT( showDialogInfo() ) );
QMenu treeMenu;
treeMenu.addAction(propertyAction);
treeMenu.exec(point);
}
To copy to clipboard, switch view to plain text mode
and i have a QDialog, i want display on this QDialog all information of directory or file selected (name, path, permission, owner, size .....) with the slot showDialogInfo();
can i do
connect( propertyAction, SIGNAL( triggered() ), this->parent(), SLOT( showDialogInfo(fP) ) );
connect( propertyAction, SIGNAL( triggered() ), this->parent(), SLOT( showDialogInfo(fP) ) );
To copy to clipboard, switch view to plain text mode
this is my class mainwindow
{
Q_OBJECT
public:
myMainWindow
( QWidget * parent
= 0, Qt
::WindowFlags flags
= 0);
~myMainWindow();
private:
MyTreeView *localDir;
myDialog *dialog;
private slots:
void showDialogInfo();
};
void myMainWindow::showDialogInfo()
{
dialog->show();
}
class myMainWindow : public QMainWindow
{
Q_OBJECT
public:
myMainWindow( QWidget * parent = 0, Qt::WindowFlags flags = 0);
~myMainWindow();
private:
MyTreeView *localDir;
QComboBox *homeDir;
myDialog *dialog;
private slots:
void showDialogInfo();
};
void myMainWindow::showDialogInfo()
{
dialog->show();
}
To copy to clipboard, switch view to plain text mode
how can i emit a signal like actionCliked(QString filePath) in
void MyTreeView::showContextMenu(QModelIndex index, QPoint point)
To copy to clipboard, switch view to plain text mode
?
can that help me ? 
thank you 
[edit]
simply, my question is:
how can i send information (fP) from MyTreeView::showContextMenu() to myMainWindow::showDialogInfo() ?
[/edit]
Bookmarks