You can declare mydirectory as a member of the MainWindow class and then it will be available in all other member functions.
Not really Qt issue but more a C++/programming knowledge issue...
...
private:
private:
QMenu *menuFile;
QAction *Dateipath;
QString mydirectory; // Add this
To copy to clipboard, switch view to plain text mode
...
void MainWindow::selectdirectory()
{
// don't declare a local variable here, assign the value to the member variable
mydirectory = "home\users\........"
}
QString MainWindow
::getDirName() const {
return mydirectory; // and there we have it
}
void MainWindow::selectdirectory()
{
// don't declare a local variable here, assign the value to the member variable
mydirectory = "home\users\........"
}
QString MainWindow::getDirName() const
{
return mydirectory; // and there we have it
}
To copy to clipboard, switch view to plain text mode
...
There are many ways to do this, but this will do what you asked for...
Bookmarks