File copying from a menu

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brandon

    File copying from a menu

    I'm attempting to have a file copied from a menu selection. The menu
    already exists, but it won't even create the menu item. If anyone has any
    ideas, please let me know.


  • Fredrik Lundh

    #2
    Re: File copying from a menu

    Brandon wrote:
    I'm attempting to have a file copied from a menu selection. The menu
    already exists, but it won't even create the menu item. If anyone has any
    ideas, please let me know.
    try cutting down your code to a minimal example that illustrates the
    problem, and post that code (that'll also allow us to figure out what
    library you're using to create the menu...).

    </F

    Comment

    • Brandon

      #3
      Re: File copying from a menu

      Ok, below is a portion of the code that first (near as I can tell because I
      had nothign to do with desgining the program) sets up the menu
      (setupMenuBar) and then adds the commands to be used with the items:

      def setupMenuBar(se lf):
      menubar = self.menuBar()
      file_ = menubar.addMenu ("&File")
      file_.addAction (self.importEx)
      file_.addAction (self.exitAct)

      def createActions(s elf):
      fileMenu = QtGui.QMenu(sel f.tr("&File"), self)

      self.importEx = QtGui.QAction(s elf.tr("&Import Excel Document"),
      self)
      self.importEx.s etShortcut(self .tr("Ctrl+E"))
      self.importEx.s etStatusTip(sel f.tr("Import Excel Document"))
      self.connect(se lf.importEx, QtCore.SIGNAL(" triggered()"),
      self.importExce l)

      self.exitAct = QtGui.QAction(s elf.tr("E&xit") , self)
      self.exitAct.se tShortcut(self. tr("Ctrl+Q"))
      self.exitAct.se tStatusTip(self .tr("Exit the application"))
      self.connect(se lf.exitAct, QtCore.SIGNAL(" triggered()"), self,
      QtCore.SLOT("cl ose()"))

      "Fredrik Lundh" <fredrik@python ware.comwrote in message
      news:mailman.21 91.1219732396.9 22.python-list@python.org ...
      Brandon wrote:
      >
      >I'm attempting to have a file copied from a menu selection. The menu
      >already exists, but it won't even create the menu item. If anyone has
      >any ideas, please let me know.
      >
      try cutting down your code to a minimal example that illustrates the
      problem, and post that code (that'll also allow us to figure out what
      library you're using to create the menu...).
      >
      </F
      >

      Comment

      • Brandon

        #4
        Re: File copying from a menu

        Turns out I was missing a few lines of code here-and-there, but now it's
        visible and working. Thanks to anyone who was looking into this for me.


        "Fredrik Lundh" <fredrik@python ware.comwrote in message
        news:mailman.21 91.1219732396.9 22.python-list@python.org ...
        Brandon wrote:
        >
        >I'm attempting to have a file copied from a menu selection. The menu
        >already exists, but it won't even create the menu item. If anyone has
        >any ideas, please let me know.
        >
        try cutting down your code to a minimal example that illustrates the
        problem, and post that code (that'll also allow us to figure out what
        library you're using to create the menu...).
        >
        </F
        >

        Comment

        Working...