Home > Mobile >  Please help greatly, urgent urgent!!!!! QML Menu or right-click Menu or the mouse to click a picture
Please help greatly, urgent urgent!!!!! QML Menu or right-click Menu or the mouse to click a picture

Time:10-31

On the first source
LeftTopPage. QML
 
The import QtQuick 2.5
The import QtQuick. Controls 1.4
0.2 as the import Material Mater

A Rectangle {
Id: topPage;
//width: 300;
//height: 80;
Color: "transparent";

The property alias imageSource: image. The source;
The property string name: "Joe";
The property string desc: "ajajajajajaj";

The Row {
Id: row;
Anchors. VerticalCenter: parent. VerticalCenter;
Anchors. Left: the parent. Left;
Anchors. LeftMargin: 10;
Spacing: 10;

A Rectangle {
Id: faceState;
Width: topPage. Height - 10;
Height: topPage. Height - 10;
Color: "transparent";

A Rectangle {
Id: imageRect;
Anchors. CenterIn: faceState;
Width: faceState. Height;
Height: faceState. Height;
The radius: faceState. Height/2;
Color: "transparent"

ImageCircle {
Id: image;
Anchors. The fill: the parent;
Border: 1;
Source: "http://img5.duitang.com/uploads/item/201410/27/20141027124824_e4hjS.png";
}

}
A Rectangle {
Id: userState;
Anchors. Bottom: faceState. Bottom;
Anchors. Right: the parent. Right;
Color: "transparent";
Width: faceState. Height/4;
Height: faceState. Height/4;
The radius: faceState. Height/8;
ImageCircle {
Id: tipImage;
Anchors. The fill: the parent;
border: 0;
Source: "QRC:/state/onLine. The PNG";
}
MouseArea {
Id: mouseArea;
Anchors. The fill: the parent;
OnClicked: {
MenuState. Popup ();
}
}
}
}
The Column {
Id: the column;
Spacing: 10;
The Text {
Id: userName;
Width: topPage. Width * 2/3;
Color: Mater. The Palette. Colors. Red (" 600 ");
The font. PixelSize: Mater. Units. Dp (32);
The font, bold: true,
The font family: "regular script";
Text: the name;
}
The Text {
Id: the description;
Width: topPage. Width * 2/3;
The font. PixelSize: Mater. Units. Dp (20);
Elide: Text. ElideRight;
The font family: "regular script";
Text: desc;
MouseArea {
Id: mouseAreaText;
Anchors. The fill: the parent;
HoverEnabled: true,
}
Mater. The Tooltip {
Id: toolTip;
MouseArea: mouseAreaText;
Text: desc;
}
}
}
}

The Menu {
Id: menuState;
MenuItem {
Text: "online";
IconName: "onLine";
IconSource: "QRC:/state/onLine. The PNG";
OnTriggered: {
TipImage. Source="QRC:/state/onLine. PNG";
TipImage. RepaintUI ();
UserState. Color="transparent";
}
}
MenuItem {
Text: "busy";
IconName: "busy";
IconSource: "QRC:/state/busy. PNG";
OnTriggered: {
TipImage. Source=iconSource;
TipImage. RepaintUI ();
UserState. Color="transparent";
}
}
MenuItem {
Text: "offline";
IconName: "offLine";
IconSource: "QRC:/state/offLine. PNG";
OnTriggered: {
TipImage. Source=iconSource;
TipImage. RepaintUI ();
UserState. Color="transparent";
}
}
MenuItem {
Text: "stealth";
IconName: "hide";
IconSource: "QRC:/state/hide. PNG";
OnTriggered: {
TipImage. Source=iconSource;
TipImage. RepaintUI ();
UserState. Color="transparent";
}
}
}
}

qmlscene alone is used to carry out the page menu no problem, in a Window element also no problem, can only
Landing interface Window with LeftTopPage elements nested in a Window. The Window login Window elements of QML elements behind the first Window Window element
After a second Window element Window LeftTopPage. QML this page after clicking on the menu would collapse, greatly please help solve, I just started using QML

CodePudding user response:

man you didn't consider the source and
  •  Tags:  
  • Qt
  • Related