0

I have a QtToolBar in my code that i can update via a script, although when i update the toolbar it doesnt add more options.

        self.addToolBarBreak()
        self.bmv = {}
        for i in events.info["bookmarks"]:
            self.bmv.update({i[0]: QAction(i[0], self)})
            self.bmv[i[0]].triggered.connect(lambda: events.callBookmarkClicked(i[1]))
            self.actionbar.addAction(self.bmv[i[0]])

For example, When i use the array: [['google', 'google.com'], ['poggingfish', 'pogging.fish']] as the bookmarks and open the program all i see is:

Window only displaying google

And when i click the google bookmark, the callBookMarkClicked is called with the bookmark url pogging.fish.

poggingfish
  • 17
  • 1
  • 6

1 Answers1

0
        self.bmv = {}
    for i in events.info["bookmarks"]:
        self.bmv.update({i[0]: QAction(i[0], self)})
        self.bmv[i[0]].triggered.connect(lambda _, value=i[1]: events.callBookmarkClicked(value))
        self.actionbar.addAction(self.bmv[i[0]])

Here is the solution to the problem if anyone is curious.

poggingfish
  • 17
  • 1
  • 6