View Full Version : How can I get instance of FileManager from QMainWindow in Qt Creator?
mrsomeonee
29th August 2011, 16:05
Hello all, I noticed that there's Core::FileManager *fileManager() const; public function in MainWindow.h and .cpp files. It returns instance of fileManager. But how do I get instance of main window?
PS. Core::ICore::instance()->mainWindow() returns instance of QMainWindow.
stampede
29th August 2011, 16:19
You ask two different questions:
How can I get instance of FileManager from QMainWindow in Qt Creator?
Sorry, but I have no idea of what FileManager could be. Ask the code author.
But how do I get instance of main window?
PS. Core::ICore::instance()->mainWindow() returns instance of QMainWindow.
Then try to qobject_cast this instance.
Hello all, I noticed that there's Core::FileManager *fileManager() const; public function in MainWindow.h and .cpp files.
What files ? Is it some kind of your personal project ? If yes, then how should we know anything about it ?
mrsomeonee
30th August 2011, 07:19
It's a source of a Qt creator. I am making a plugin for Qt creator.
stampede
30th August 2011, 07:58
Ok, so have you tried to use qobject_cast on the QMainWindow instance ?
wysota
30th August 2011, 08:18
It's a source of a Qt creator. I am making a plugin for Qt creator.
Why don't you post your questions in a proper sub-forum then?
ChrisW67
9th September 2011, 03:02
The ICore interface defines a ICore::fileManager() accessor in exactly the same way it defines mainWindow():
FileManager *fm = ICore::instance()->fileManager();
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.