Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML Connecting two or more QML files

QML Connecting two or more QML files

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 3 Posters 973 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    d.ko100v
    wrote on last edited by
    #1

    Hello, I'm new to QML start a week before, now I have a problem, with connection between many QML files, Best way to explane it is, imagine the week of the day, every day is in another file. And i have a navigation arrows at top,
    Im trying to swipe from monday till sunday and back if i want, i hope you got what i mean, and i will really be greathfull if someone who is more familiar help me, Thank you for your time, have a nice day

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      Go to Qt Assistant and look for QML Tutorial 2 - QML Components. This will surely help you.

      It is similar to the following.
      @
      // Main.QML
      Rectangle {
      id : top

      Week {
      id : week

      }

      MouseArea {

      }
      }

      //Week.QML
      {

      }
      @/

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Tomme
        wrote on last edited by
        #3

        If I were you, I would have a look to "ListView" to easily have a swipe (see orientation to have a vertical view).

        Set the property model to 7.

        Now, use Loader to choose the correct Qml component according to the index.

        It should be something like this :
        @ListView {
        Component {
        id: dayLoader;
        Loader {
        source: {
        if(index==0) return "MondayView.qml";
        if(index==1) return "TuesdayView.qml";
        ...
        }
        }
        model : 7;
        delegate : dayLoader;
        }@

        I hope it helps...

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved