Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/142.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ QT中是否有类似GTK Headerbars的东西?_C++_Qt_Gtk_Qml - Fatal编程技术网

C++ QT中是否有类似GTK Headerbars的东西?

C++ QT中是否有类似GTK Headerbars的东西?,c++,qt,gtk,qml,C++,Qt,Gtk,Qml,我最近在读《操作系统基础》杂志,看到了这篇文章。它谈到了新的,以及它对设计和用户体验的所有好处。我想知道,对于Qt/QML来说,这样的事情可能吗? 我希望系统托盘菜单更易于导航,点击精度更低,最后我使用了以下功能: m_tray_menu->setStyleSheet( "QMenu {" "background-color: white;" "margin: 10px;" "}" "QMenu::item {" "padding: 2px

我最近在读《操作系统基础》杂志,看到了这篇文章。它谈到了新的,以及它对设计和用户体验的所有好处。我想知道,对于Qt/QML来说,这样的事情可能吗?

我希望系统托盘菜单更易于导航,点击精度更低,最后我使用了以下功能:

 m_tray_menu->setStyleSheet(
"QMenu {"
    "background-color: white;"
      "margin: 10px;"
 "}"

 "QMenu::item {"
      "padding: 2px 25px 2px 20px;"
     "margin: 10px;"
      "border: 1px solid transparent;"
     "font: 20px;"
     "height: 50px;"
     "width: 250px;"
 "}"

 "QMenu::item:selected {"
      "border-color: black;"
      "background: rgba(0, 255, 0, 150);"
 "}"
 );
所有QML的整个样式都使用类似的css样式语法或QS,正如文档中有时提到的那样

另外,如果您想脱离桌面环境的窗口装饰,请使用Qt窗口标志和Qt窗口小部件属性,您可以随心所欲地制作任何东西

例如:

MyWidget::MyWidget(QWidget * parent): QWidget(parent)
{
    this->setWindowFlags(Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint);
    this->setAttribute(Qt::WA_TranslucentBackground);
    // this->setAttribute(Qt::WA_NoSystemBackground);// automatically set by previous attribute
}
希望有帮助