简体   繁体   中英

How to include QtQuickControls

I've included to my project :

"import QtQuickQontrols 1.4"

But now I need to use ScrollBar , and for this, I need to include

"import QtQuickControls 2.2"

But when I include version 2.2 and delete 1.4, my project is ruined... MenuBar, TableView is under errors! Ok, when I include both this version it's errors , too! I did run qmake, and give me some advice what should I do to implement my ScrollBar. I've tried to add ScrollView, but inside this it doesn't work :

     ....
      ScrollBar.vertical: ScrollBar {...} ...}

If you need to import both controls 1 & 2, they will have name collisions. But you can rename them so they don't conflict:

import QtQuick.Controls 1.4 as QC1
import QtQuick.Controls 2.2 as QC2

QC1.MenuBar {
}

QC2.ScrollBar {
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM