简体   繁体   English

在标题栏添加按钮

[英]Adding a button to the title bar

I am writing a C++ application using Qt4 and looking to implement a GUI similar to Firefox 4. That is, I need to remove the default context menu in the top left corner of the window and replace it with three buttons. 我正在使用Qt4编写C ++应用程序,并希望实现类似于Firefox 4的GUI。也就是说,我需要删除窗口左上角的默认上下文菜单,并用三个按钮替换它。 If you notice the button in Firefox 4 is right at the top in the title bar and I am uncertain as to how this can be implemented. 如果您注意到Firefox 4中的按钮位于标题栏的顶部,那么我不确定如何实现。

You can obtain the behaviour described by implementing a tool bar. 您可以通过实现工具栏获得描述的行为。 More information can be found at QT documentation on QToolBar 可以在QToolBar上的QT文档中找到更多信息

It won't be easy and will not be cross-platform. 这将不容易,也不会跨平台。 Read this thread in the qt forums. 在qt论坛中阅读此主题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM