Coder Social home page Coder Social logo

showfl / toou-2d Goto Github PK

View Code? Open in Web Editor NEW
801.0 41.0 205.0 1.21 MB

基于Qt Quick(Qml) 跨平台技术打造的2D框架

Home Page: http://www.toou.net

License: MIT License

QMake 1.93% C++ 31.96% QML 65.37% JavaScript 0.43% Shell 0.12% Batchfile 0.20%
qt qml theme ini css cross-platform qss awesome quick framework

toou-2d's People

Contributors

showfl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

toou-2d's Issues

TImageButton的source属性问题

您好,我在使用imagebutton做四状态按钮时发现source属性需要改个名字,比如normalsource,否则做四状态按钮时,悬停后离开按钮区域时背景图片停留在hover的背景上不变。如有说法不妥之处请谅解,非常感谢你。

TToast bug?

按wiki的方法构建动态库,在使用TToast组件时出现以下异常:
qrc:/net.toou.2d/controls/TToast.qml:101: TypeError: Cannot read property of null

msvc STATICLIB build example error

in example.pro line 54
PRE_TARGETDEPS += $$OUT_PWD/../bin/Toou2D/lib$${LIBNAME}.a
but msvc don`t output *.a.

when I modify code:
PRE_TARGETDEPS += $$OUT_PWD/../bin/Toou2D/$${LIBNAME}.lib

QQmlApplicationEngine failed to load component
qrc:/main.qml:3:1: plugin cannot be loaded for module "Toou2D": ??????F:/Qt/5.15.2/msvc2019/qml/Toou2D/Toou2Dd.dll?????????????Qt??(????????????????汾??????汾??)

TRadioBox,TCheckBox在状态切换后,切换theme,border.color显示错误

复现步骤
1.打开demo程序
2.切换当前主题为theme-dark,将TRadioBox-A点成checked状态
3.切换theme-none,观察此时TRadioBox-A的bordercolor,并不是checked状态的bordercolor,错误。
4.TRadioBox同理。

问题分析
m_binderPropertys 存储的是控件初始化时的所有默认值。当用户操作或逻辑触发修改某些风格属性的值后,此时切换会none-theme,m_binderPropertys 并没有存储修改后的值,导致错误。

支持Linux平台吗

我开源了个项目,但是对Linux不熟悉,不知道这个2d框架能不能扩展Linux平台的qml组件库

Win10 Qt Creator 4.11.0 Qt 5.14.0 (MSVC 2017, 32 bit)编译失败

大家好
我从Github上拉去了最新版的Toou-2D源码,使用Qt Creator 4.11.0打开目录下的Toou-2D.pro后,进行了编译,编译报了很多错误。
E:\yangyouguo\QT\Toou-2D-master\example\main.qml:93: error: Expected token ;' E:\yangyouguo\QT\Toou-2D-master\src-toou2d\controls\TDialogBasic.qml:137: error: Expected token ;'
E:\yangyouguo\QT\Toou-2D-master\src-toou2d\controls\TNavigationBar.qml:32: error: 正则表达式未结束
E:\yangyouguo\QT\Toou-2D-master\src-toou2d\controls\TRadioBox.qml:16: error: 正则表达式未结束
E:\yangyouguo\QT\Toou-2D-master\src-toou2d\controls\TSwitch.qml:10: error: 正则表达式未结束

是我的使用方法不对吗?还是我忘记安装了什么?
求各位大神指点一二,不胜感激

按照wiki的方法构建Toou-2D失败

编译环境: Qt5.14 MSVC2017(32bit)
报错信息:
1. example\Demo.qml:142: error: Expected token )' 2. example\Ex_Dialog.qml:244: error: Expected token )'
3. 类似1、2的错误
报错信息截图如下:
批注 2020-02-06 171136

页面加载主题是崩溃

页面加载toou主题时,崩溃,有谁能告诉我这是为什么吗?是不是有什么配置配错了?
微信图片_20201028164751

运行自带Demo,控制台出现一些未定义错误

运行demo,

Cyclic dependency detected between "qrc:/net.toou.2d/controls/TToast.qml" and "qrc:/net.toou.2d/controls/TToast.qml"
Cyclic dependency detected between "qrc:/net.toou.2d/controls/TToast.qml" and "qrc:/net.toou.2d/controls/TRectangle.qml"
Cyclic dependency detected between "qrc:/net.toou.2d/controls/TToast.qml" and "qrc:/net.toou.2d/controls/TSVGIcon.qml"
Cyclic dependency detected between "qrc:/net.toou.2d/controls/TToast.qml" and "qrc:/net.toou.2d/controls/TIconButton.qml"
Cyclic dependency detected between "qrc:/net.toou.2d/controls/TToast.qml" and "qrc:/net.toou.2d/controls/TButton.qml"
Cyclic dependency detected between "qrc:/net.toou.2d/controls/TToast.qml" and "qrc:/net.toou.2d/controls/TMouseArea.qml"
Cyclic dependency detected between "qrc:/net.toou.2d/controls/TToast.qml" and "qrc:/net.toou.2d/controls/TLabel.qml"
Cyclic dependency detected between "qrc:/net.toou.2d/controls/TToast.qml" and "qrc:/net.toou.2d/controls/TAwesomeIcon.qml"
qrc:/net.toou.2d/controls/TPopover.qml:80:5: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }

点击切换主题按钮,主题菜单弹出后,控制台会报这些错误,

: otherData is undefined. Adding an object with a undefined member does not create a role for it.

大概看了下,没有看出来具体问题,开头那个循环依赖是什么问题,请教下?

cmake 构建脚本

您好,我想将您这个项目通过cmake方式构建,下面这个gist里包含了我构建使用的CMakeLists.txt和相关文件,程序在Linux下可以正常构建并运行,而在Mac 下能够构建成功却始终不能运行,调了好久不知道在哪里有问题,希望您能够指导指导。 😃 期待您的回复。

Toou2D cmake文件结构如下:

CMakeLists.txt
cmake
     |--Functions.cmake
     |--info.plist.in
     |--meta_Toou2D.hpp.in
icons
     |--develop
     |          |--Toou2DExample.icns
     |--release
     |          |--Toou2DExample.icns
     |--testing
                |--Toou2DExample.icns

tpopover

How do i set bodyComponent for tpopover, please?
The demo shows default component only.

TButton按下并滑动界面,滑动结束之后不会回弹

import QtQuick 2.0
import Toou2D 1.0

Item {
Loader{
id:cac_loader;
anchors.fill: parent;
asynchronous: true
onStatusChanged: bii.visible = status !==Loader.Ready
}

Component{
    id: cacComponent

    TFlickable{
        anchors.horizontalCenter: parent.horizontalCenter
        clip: true
        contentWidth:width;
        contentHeight: layout.height;
        scrollBar.horizontal: false;

        GridView{
            id:layout
            anchors.horizontalCenter: parent.horizontalCenter
            width: 1024
            height: 600

            cellWidth: 320
            cellHeight: 200


            model: cac_model
            delegate: cac_delegate
        }
    }
}

ListModel {
    id: cac_model

    ListElement {name: "空调一"}
    ListElement {name: "空调二"}
    ListElement {name: "空调三"}
    ListElement {name: "空调四"}
    ListElement {name: "空调五"}
    ListElement {name: "空调六"}
    ListElement {name: "空调七"}
    ListElement {name: "空调八"}
}

Component{
    id: cac_delegate

    TButton{
        label.text: name
        label.font.bold: true;
        label.color: "#FFF"
        background.color: "#6AC044"
        theme.groupName: "success"
        width: 300
        height: 200
    }
}

TBusyIndicator{
    id:bii;
    anchors.centerIn: parent;
}

Component.onCompleted: {
    cac_loader.sourceComponent = cacComponent;
}

}

T2DWorld 初始化多次,会奔溃

多个QQuickView窗口,在每个窗口初始化会奔溃,只能在一个窗口中初始化,但是在一个窗口中初始化,其他窗口用了组件

TDialog 自定义界面无法将初始化值传入

目的是想让 used_edit 和 total_edit 控件初始化时给其赋值,但是无论怎么操作都无法将值赋进去,一直无法找到 Item 中的对象

另外如何获取到 used_edit 和 total_edit 的值

import QtQuick 2.0
import Toou2D 1.0

TDialog {
    id: config_page
    titleText: ""
    modalclose: false


    property int min: 0
    property int max: 9999
    property int used: 0
    property int total: 300

    property var l: {"t1": "确定", "t2": "取消", "t3": "已用时间(分钟)", "t4": "使用寿命(分钟)", "t5": "刀具寿命"}

    Item {
        id: context
        width: 576 * wRate
        height: 200 * hRate

        property alias usedText: used_edit.text
        property alias totalText: total_edit.text

        anchors {
            top: parent.top
            topMargin: height24
        }

        TLabel {
            id: uesd_text
            width: (parent.width - height48) / 2
            height: height64
            text: l.t3
            font.pixelSize: fontSize20
            verticalAlignment: Qt.AlignVCenter
            anchors.left: parent.left
            anchors.leftMargin: width24
        }

        TInputField {
            id: used_edit
            width: uesd_text.width
            height: uesd_text.height
            placeholderLabel.text: l.t5
            inputMethodHints: Qt.ImhFormattedNumbersOnly
            anchors.left: uesd_text.right

            qtInput.validator: IntValidator {
                top: max
                bottom: min
            }
        }

        TLabel {
            id: total_text
            width: uesd_text.width
            height: uesd_text.height
            text: l.t4
            font.pixelSize: fontSize20
            verticalAlignment: Qt.AlignVCenter
            anchors.top: uesd_text.bottom
            anchors.topMargin: 12 * hRate
            anchors.left: uesd_text.left
        }

        TInputField {
            id: total_edit
            width: uesd_text.width
            height: uesd_text.height
            placeholderLabel.text: l.t5
            anchors.top: total_text.top
            anchors.left: total_text.right

            qtInput.validator: IntValidator {
                top: max
                bottom: min
            }
        }
    }

    buttons: [
        TDialogButton{
            label.text: qsTr(l.t1)
            label.font.pixelSize: fontSize20
            label.color: "#46A0FC"
            lighter: true
        },
        TDialogButton{
            label.text: qsTr(l.t2)
            label.font.bold: true
            label.font.pixelSize: fontSize20
        }
    ]

// 错误提示无法找到 context 对象
    onUsedChanged: context.usedText = used.toString()
    onTotalChanged: context.totalText = total.toString()
}

TDialogBase 内存泄漏

每次open 没有判断 是否已创建直接就create, 调用hideAndClose 或者close 没有destroy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.