[英]Using unity menu bar in Qt
I have a simple Qt MainWindow: 我有一个简单的Qt MainWindow:
// ui/mainwindow.hpp
class MainWindow: public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget* parent = 0);
public slots:
private:
};
// ui/mainwindow.cpp
MainWindow::MainWindow(QWidget* parent): QMainWindow(parent)
{
QMenu* menuFile = menuBar()->addMenu(tr("File"));
menuFile->addAction(tr("Some"));
}
// Application entry
int main(int argc, char* argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
I'm noticing that with Ubuntu and Unity, the menu bar is not showing on the top of the screen but instead inside the application's window. 我注意到,使用Ubuntu和Unity时,菜单栏不是显示在屏幕顶部,而是显示在应用程序的窗口内部。
How do I make the menu bar show up on the top of the screen? 如何使菜单栏显示在屏幕顶部?
Which version of Qt are you using? 您正在使用哪个版本的Qt?
This is not really something that you influence on the app developer's side. 这实际上并不会影响应用程序开发人员。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.