Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm working on a project that needs to call a modal window with a toolbar to do some work on some data before it's loaded. The reason I need the toolbar is the user has a few different possible options that can be combined.

The obvious choice here is a Modal dialog (which I have working right now). The issue is I want a toolbar. This is a two part question:

  1. Is it possible to add a toolbar to a QDialog? (also is it possible to do this in Qt Designer?)
  2. If 1. is not possible, how can I make a QMainWindow modal?
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
400 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can simply use the setMenuBar function of the layout manager that is installed on your QDialog:

myDialog->layout()->setMenuBar(myMenuBar);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...