Results 1 to 6 of 6

Thread: Can I delete qt creator menu entry using plugins?

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

    Post Can I delete qt creator menu entry using plugins?

    Hello all, when I make plugins I can use function am->actionContainer(Core::Constants::M_TOOLS)->addMenu(menu); to add my menu entry.

    But can I delete or hide existing menu entry? (For Example "File->Save all")

  2. #2
    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: Can I delete qt creator menu entry using plugins?

    Query the action manager for the command you want and hide or disable its QAction. But why would you want to do that?
    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.


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

    Default Re: Can I delete qt creator menu entry using plugins?

    I am making plugin that would check code style. And as programmers sometimes are too lazy to use such tool so I motivate them in doing so by not allowing them to save code that has bad style.
    Thanks for the answer.

  4. #4
    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: Can I delete qt creator menu entry using plugins?

    Are you sure this is the right approach? Usually such checks would be implemented when the code is committed to a shared repository. You could run your plugin automatically when a file is saved or you could show a dialog box asking the user whether he wants the code checked but disabling the ability to save the file completely can backfire in many situations. Besides, disabling a menu entry will not prevent the user from saving the file, e.g. if he closes the file, he'll be asked whether he wants to save it or not, how are you going to prevent that?
    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.


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

    Default Re: Can I delete qt creator menu entry using plugins?

    It is implemented in repository. I need to make it offline. I actually didn't knew that you can run your plugin automatically when a file is saved. Is it just a guess or do you really know that it is possible? Thanks in advance.

  6. #6
    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: Can I delete qt creator menu entry using plugins?

    Quote Originally Posted by mrsomeonee View Post
    It is implemented in repository. I need to make it offline.
    That's a bad idea, if you ask me. Forcing developers to clean the code before each and every compilation is a real productivity killer.

    I actually didn't knew that you can run your plugin automatically when a file is saved. Is it just a guess or do you really know that it is possible? Thanks in advance.
    I don't see why not, after all, it's all Qt/C++ code, you can implement whatever you like.
    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.


Similar Threads

  1. Qwt plugins in Qt Creator
    By marinear212 in forum Qwt
    Replies: 24
    Last Post: 11th April 2013, 18:39
  2. How to write plugins for Qt Creator
    By Wong in forum Qt Programming
    Replies: 3
    Last Post: 15th December 2010, 04:45
  3. Qt Designer Impossible to drag and drop the menu entry.
    By bred in forum Qt Tools
    Replies: 14
    Last Post: 27th October 2010, 06:21
  4. Using Qwt Plugins in Qt Creator from Qt SDK
    By marinear212 in forum Qwt
    Replies: 0
    Last Post: 22nd July 2010, 21:43
  5. Add a entry to the application menu
    By mace in forum Qt Programming
    Replies: 1
    Last Post: 28th April 2006, 06:32

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.