View Single Post
Posts: 1,313 | Thanked: 2,978 times | Joined on Jun 2011 @ Finland
#19
Originally Posted by marmistrz View Post
But I've got another problem. I want to divide the program into multiple files but
Files are:
main.qml - the main one, only PageStackWindow
mainView.qml - Page used by main.qml

And I'm getting
Code:
Can't find variable: mainView
I tried importing
Code:
import "."
import "mainView.qml"
import "mainView.qml" as mainView
But nothing works.
thanx in advance
You should rename it to MainView.qml. Remove the imports, they're automatically imported. But the naming is important, ie. capital start letter.

So after that you can use it in main.qml like:

Code:
PageStackWindow {
  ...
  MainView {
    ...
  }
}
__________________
My N9/N950 projects:
 

The Following User Says Thank You to ajalkane For This Useful Post: