thatks my friend... It's work !!! :) regards
*============================================="El tamaño de tus logros depende del tamaño de tus metas." * *C++ and Qt Senior Developer* *Lic. Computer Science* *Buenos Aires, Argentina* 2015-10-06 2:21 GMT-03:00 Stenger Christian < [email protected]>: > Hi Freddy, > > > regarding the import error: you're importing the wrong way. You don't have > to import the file at all if it is located inside the same folder as your > main.qml file. > > So, first of all change the import to > > > import "qml"' > > > inside your main.qml. > > Now, ULineEdit.qml should be imported correctly, but it has other issues > to get it working.. (You will still get something like 'Element is not > creatable' - I don't exactly know what you're aiming at, but at first you > should replace > > > property Font fontEdit > > > by > > > property font fontEdit > > > Now you should be able to successfully import and run your code. Hope this > helps. > > > Kind regards, > > Christian > > ------------------------------ > *From:* qt-creator-bounces+christian.stenger= > [email protected] <qt-creator-bounces+christian.stenger= > [email protected]> on behalf of Freddy Martinez < > [email protected]> > *Sent:* Tuesday, October 6, 2015 6:04 AM > *To:* [email protected] > *Subject:* [Qt-creator] Import QML Errors > > Hello Guys… > > I have 2 qml files: > > main.qml and > qml/ULineEdit.qml > > as you can see, I have a main.qml file at the same level with the qml > folder which has a ULineEdit.qml > > this is my ULineEdit.qml > > import QtQuick 2.0 > > > > Rectangle { > > id: idEdit > > property double widthEdit : width > > property double heightEdit : height > > property string placeHolderText: "" > > property color underlineColor > > property color textColor > > property color placeHolderColor > > property Font fontEdit > > > // underline for lineEdit > > Rectangle{ > > id: underlineId > > color: underlineColor > > width: widthEdit > > height: heightEdit / 10.0 > > anchors.bottom: idEdit.bottom > > } > > > TextInput{ > > id: textId > > font: idEdit.fontEdit > > property bool showPlaceHolder: true > > > text: qsTr(placeHolderText) > > width: idEdit.widthEdit > > height: idEdit.height - underlineId.height - 2 > > anchors.bottom: underlineId.top > > verticalAlignment: Text.AlignVCenter > > horizontalAlignment: Text.AlignLeft > > > onTextChanged: { > > if (textId.text == "") > > { > > textId.text = idEdit.placeHolderText > > textId.color = idEdit.placeHolderColor > > textId.showPlaceHolder = true > > } > > > else > > { > > textId.font = idEdit.fontEdit > > textId.showPlaceHolder = false > > } > > } > > > onFocusChanged: { > > if (textId.focus == true) > > { > > if (textId.showPlaceHolder == true) > > { > > textId.text = ""; > > } > > } > > > else > > { > > // checking if we have to show the placeholder or not > > if (textId.showPlaceHolder == true) > > { > > textId.text = idEdit.placeHolderText > > textId.color = idEdit.placeHolderColor > > } > > } > > } > > > } > > } > > > > and this is my main.qml file > > import QtQuick 2.3 > > import QtQuick.Controls 1.2 > > import QtQuick.Window 2.0 > > > import "./qml" > > > Window { > > visible: true > > width: 640 > > height: 480 > > title: qsTr("Ultra4") > > color: "#F9F9F9" > > > Rectangle{ > > width: 100 > > height: 20 > > color: "black" > > > ULineEdit{ > > > widthEdit: 100 > > heightEdit: 20 > > } > > } > > } > > > > > the problem is that when I try to run my app, Qt Creator give the > following error: > > qrc:/main.qml:19 Type ULineEdit unavailable > qrc:/qml/ULineEdit.qml:4 Element is not creatable. > > What is the problem ? because I can’t see it… > > regards > > ============================================= > "El tamaño de tus logros depende del tamaño de tus metas." > C++ and Qt Senior Developer > Lic. Computer Science > Buenos Aires, Argentina > >
_______________________________________________ Qt-creator mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/qt-creator
