Results 1 to 6 of 6

Thread: How can I get instance of FileManager from QMainWindow in Qt Creator?

  1. #1
    Join Date
    Aug 2011
    Posts
    11
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How can I get instance of FileManager from QMainWindow in Qt Creator?

    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.

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: How can I get instance of FileManager from QMainWindow in Qt Creator?

    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 ?

  3. #3
    Join Date
    Aug 2011
    Posts
    11
    Qt products
    Qt4
    Platforms
    Unix/X11

    Post Re: How can I get instance of FileManager from QMainWindow in Qt Creator?

    It's a source of a Qt creator. I am making a plugin for Qt creator.

  4. #4
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: How can I get instance of FileManager from QMainWindow in Qt Creator?

    Ok, so have you tried to use qobject_cast on the QMainWindow instance ?

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How can I get instance of FileManager from QMainWindow in Qt Creator?

    Quote Originally Posted by mrsomeonee View Post
    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?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How can I get instance of FileManager from QMainWindow in Qt Creator?

    The ICore interface defines a ICore::fileManager() accessor in exactly the same way it defines mainWindow():
    Qt Code:
    1. FileManager *fm = ICore::instance()->fileManager();
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 3
    Last Post: 13th November 2011, 09:12
  2. Replies: 2
    Last Post: 29th June 2011, 16:45
  3. Replies: 2
    Last Post: 22nd November 2010, 21:24
  4. Replies: 0
    Last Post: 17th November 2010, 18:07
  5. From QClipboard to OS FileManager
    By wirasto in forum Qt Programming
    Replies: 0
    Last Post: 28th May 2010, 13:54

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.