Dear Sirs and Madams!
I have following code chunk:
import QtQuick 2.3
import QtQuick.Window 2.1
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import QtQuick.Layouts 1.1
import "components"
ApplicationWindow
{
id: fsaWindowMain
property int fsaWindowWidth: 800
property int fsaWindowHeight: 400
property int fsaSpacingHoriz: 8
property int fsaSpacingVert: 8
property int fsaToolBarHeight: 48
visible: true
width: fsaWindowWidth
height: fsaWindowHeight
color: "black"
toolBar: fsaToolbarMain
statusBar: fsaStatusBarMain
ToolBar
{
id: fsaToolbarMain
width: parent.width
height: fsaToolBarHeight
fsaMenuItem
{
fsaMenuItemWidth: width
fsaMenuItemHeight: height
fsaMenuItemRadius: 32
fsaMenuItemText: "text1"
}
}
StatusBar
{
id: fsaStatusBarMain
width: parent.width
height: fsaToolbarMain.height
}
}
import QtQuick 2.3
import QtQuick.Window 2.1
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import QtQuick.Layouts 1.1
import "components"
ApplicationWindow
{
id: fsaWindowMain
property int fsaWindowWidth: 800
property int fsaWindowHeight: 400
property int fsaSpacingHoriz: 8
property int fsaSpacingVert: 8
property int fsaToolBarHeight: 48
visible: true
width: fsaWindowWidth
height: fsaWindowHeight
color: "black"
toolBar: fsaToolbarMain
statusBar: fsaStatusBarMain
ToolBar
{
id: fsaToolbarMain
width: parent.width
height: fsaToolBarHeight
fsaMenuItem
{
fsaMenuItemWidth: width
fsaMenuItemHeight: height
fsaMenuItemRadius: 32
fsaMenuItemText: "text1"
}
}
StatusBar
{
id: fsaStatusBarMain
width: parent.width
height: fsaToolbarMain.height
}
}
To copy to clipboard, switch view to plain text mode
Now, fsaMenuItem is declared in fsaMenuItem.qml in components subdir:
import QtQuick 2.0
Rectangle
{
id: fsaMenuItem
property int fsaMenuItemWidth: 128
property int fsaMenuItemHeight: parent.height
property int fsaMenuItemRadius: 32
property string fsaMenuItemText: ""
width: fsaMenuItemWidth
height: fsaMenuItemHeight
radius: fsaMenuItemRadius
Text
{
color: "white"
text: qsTr(fsaMenuItemText)
}
color: "black"
}
import QtQuick 2.0
Rectangle
{
id: fsaMenuItem
property int fsaMenuItemWidth: 128
property int fsaMenuItemHeight: parent.height
property int fsaMenuItemRadius: 32
property string fsaMenuItemText: ""
width: fsaMenuItemWidth
height: fsaMenuItemHeight
radius: fsaMenuItemRadius
Text
{
color: "white"
text: qsTr(fsaMenuItemText)
}
color: "black"
}
To copy to clipboard, switch view to plain text mode
And the directory hierhcary is as follows:dirHierchary.PNGWhy does import clause does not import fsaMenuItem?
Bookmarks