amirb 1 ارسال شده در آذر 98 با سلام. چطور می تونم در کد زیر با اسکرول کردن در محدوده ی text area وقتی متن به انتها رسید خود صفحه اسکرول بشه؟ Page { id: page Flickable { id: flickable anchors.fill: parent anchors.margins: 5 boundsBehavior: Flickable.OvershootBounds contentHeight: contentItem.childrenRect.height + 10 Rectangle { id: rect width: 300 height: 200 color: "#00000000" border.width: 1 border.color: 'grey' radius: 5 anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top anchors.topMargin: 10 } Flickable { flickableDirection: Flickable.VerticalFlick anchors.fill: rect anchors.leftMargin: 5 anchors.rightMargin: 5 TextArea.flickable: TextArea { id: textarea horizontalAlignment: Text.AlignLeft wrapMode: TextEdit.WordWrap } } } } نقل قول به اشتراک گذاری این ارسال لینک به ارسال به اشتراک گذاری در سایت های دیگر
0 نیما غراب 7 ارسال شده در دی 98 (ویرایش شده) @amirb سلام بر شما. من مثال شما رو کمی تغییرات دادم، در قالب فایلی به نام NestedFlicker: // The file name is NestedFlicker.qml import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Window 2.12 Page { id: page visible: true anchors.fill: parent Flickable{ anchors.fill: parent contentHeight: objects.height flickableDirection: Flickable.VerticalFlick Item{ id: objects width: page.width height: childrenRect.height Rectangle { id: rect width: 300 height: 200 color: "#00000000" border.width: 1 border.color: 'grey' radius: 5 anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top anchors.topMargin: 10 Flickable { flickableDirection: Flickable.VerticalFlick anchors.fill: rect anchors.leftMargin: 5 anchors.rightMargin: 5 TextArea.flickable: TextArea { id: textarea horizontalAlignment: Text.AlignLeft wrapMode: TextEdit.WordWrap font.pointSize: 40 } } } Rectangle { id: rect2 width: 300 height: 1000 anchors.horizontalCenter: parent.horizontalCenter color: "Blue" y: page.height / 2 } } } } در فایل اصلی برنامه هم ازش نمونه ساختم: // The file name is main.qml import QtQuick 2.12 import QtQuick.Window 2.12 Window { visible: true minimumWidth: 800 minimumHeight: 600 NestedFlicker{ } } به طور عادی هر وقت Flickableشامل متن، به انتها برسه، Flickable بعدی نسبت به حرکات موس واکنش نشون می ده و نیاز به انجام کار خاص دیگهای نیست. ویرایش شده در دی 98 توسط نیما غراب نقل قول به اشتراک گذاری این ارسال لینک به ارسال به اشتراک گذاری در سایت های دیگر
با سلام.
چطور می تونم در کد زیر با اسکرول کردن در محدوده ی text area وقتی متن به انتها رسید خود صفحه اسکرول بشه؟
به اشتراک گذاری این ارسال
لینک به ارسال
به اشتراک گذاری در سایت های دیگر