首页| 论坛| 消息

标题:qml怎么去掉最大化按钮
作者:dcx013
日期:2016-07-11 10:07
内容:

qml怎么去掉最大化按钮,像360那样,qt5.7


#1 [咬蚊嚼渍 07-11 22:10]
在qml根视图,就是ApplicaptionWindow或Window里添加
flags: Qt.Window | Qt.FramelessWindowHint ;
就可以了。
然后自定义最大化最小化什么的这些按钮
#2 [cycloveu 08-10 09:20]
用QQuickView 可以实现 自定义标题栏+窗口阴影。 QQmlEngine+flags 可以自定义标题栏 但窗口阴影不能实现。
#3 [cuisy 07-01 08:04]
Rectangle {
id: titleRect;
color: "#00A600";
anchors.top: parent.top;
anchors.left: parent.left;
anchors.right: parent.right;
height: 25;
TitleButton { //关闭按钮
id: closeButtonDialog;
width: 20;
height: 18;
anchors.right: parent.right;
anchors.verticalCenter: parent.verticalCenter;
anchors.rightMargin: 2;
normalPath: "qrc:/Image/Close2.png";
enterPath: "qrc:/Image/Close3.png";
pressPath: "qrc:/Image/Close1.png";
onButtonClick: usrMngWnd.destroy();
}
Rectangle {
id: dragDialog;
anchors.top: titleRect.top;
anchors.left: titleRect.left;
&nbs ..
#4 [spark253649 07-01 16:39]
窗口阴影的话你主窗口透明里面的窗口比如rectangle加一个效果,可以参考Graphical Effects
#5 [dd759378563 08-02 18:31]
设置Flag为Qt::CustomizeWindowHint
如果你main.cpp里面用的是QQmlEngine,就在qml的根部ApplicationWindows里面写flags: Qt.Customi
zeWindowHint,
如果是用的QQuickView,就在main.cpp里面view.setFlags(Qt::CustomizeWindowHint);

回复 发表
主题 版块