Re: [Development] How to speed up QML for KDE5 without QML compiler
在 2015年09月16日 17:51, Konstantin Tokarev 写道: > 16.09.2015, 07:04, "Leslie Zhai" <xiang.z...@i-soft.com.cn>: >> Hi great Qt and KDE developers, >> >> I like QML, it is high speed development language, easy to create candy >> UI and not difficult to debug. KDE4 began to use it in some projects, >> for example, KScreen`s kcm module, it used QML to take place of >> traditional QWidget. and KDE5, it is full of QML, for example, kwin`s >> tabbox, plasma-desktop and plasma-workspace`s applet, sddm, etc. >> >> For a new PC, there is no sharp difference between QML and QWidget, but >> in a very very old PC, how old? about 7 years ago, QML is very slow! and >> it needs to close all effects for KDE5, even that when clicked, for >> example, calendar applet, it hang about 3+ seconds to showPopup. >> >> There is commercial QML compiler, a very small example tried to use it >> https://github.com/AOSC-Dev/AOSC-VersionHelper2 >> But is it suitable for huge projects just like KDE5 if bought a >> commercial license? because not all KF5 components follow the Qt Quick >> Compiler`s resource.qrc way, so is it able to compile? for example, >> kickoff applet (the start menu of KDE5). >> >> -- >> Regards, >> Leslie Zhai - a KDE developer > You might want to use generic approach working for any scripting language: > 1) profile; 2) find bottlenecks; 3) rewrite them in "fast" language (C++ here) > > As for rewrite from QML to C++: > > 1. Try to move all business logic and computations to C++ classes, make this > code > available to QML via QObject-derived classes (see "Defining QML Types from > C++" > document and also docs for qmlRegisterType and qmlRegisterSingletonType) > > 2. Identify reusable QML items and rewrite them in C++ using class derived > from QQuickItem. See "Writing QML Extensions with C++" document. Yes, plasma-framework https://projects.kde.org/projects/frameworks/plasma-framework/repository developed QML Extension Plugin and easy-to-import in QML example https://github.com/xiangzhai/plasma-helloworld But such as plasma-workspace`s krunner https://projects.kde.org/projects/kde/workspace/plasma-workspace/repository/revisions/master/show/krunner and kwin`s tabbox https://projects.kde.org/projects/kde/workspace/kwin/repository/revisions/master/show/tabbox I prefer to directly operate QML object in C++ via objectName too, so in this situation, it is not able to use QML Compiler, right? then is it better to re-architecture some KDE5 projects to follow the QML Extension Plugin way? And is there some benchmark to compare before and after compiled with QML Compiler for small and big project? > > Another possible cause of sluggish performance is suboptimal usage of OpenGL. > Try to use best drivers available for your graphics hardware. You might also > consider using OpenGL profiling tools. Thanks for your advice ;-) I will fallback to light DE when OpenGL profiling score is low. > -- Leslie Zhai ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
[Development] How to speed up QML for KDE5 without QML compiler
Hi great Qt and KDE developers, I like QML, it is high speed development language, easy to create candy UI and not difficult to debug. KDE4 began to use it in some projects, for example, KScreen`s kcm module, it used QML to take place of traditional QWidget. and KDE5, it is full of QML, for example, kwin`s tabbox, plasma-desktop and plasma-workspace`s applet, sddm, etc. For a new PC, there is no sharp difference between QML and QWidget, but in a very very old PC, how old? about 7 years ago, QML is very slow! and it needs to close all effects for KDE5, even that when clicked, for example, calendar applet, it hang about 3+ seconds to showPopup. There is commercial QML compiler, a very small example tried to use it https://github.com/AOSC-Dev/AOSC-VersionHelper2 But is it suitable for huge projects just like KDE5 if bought a commercial license? because not all KF5 components follow the Qt Quick Compiler`s resource.qrc way, so is it able to compile? for example, kickoff applet (the start menu of KDE5). -- Regards, Leslie Zhai - a KDE developer ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
[Development] Qt5 QML TouchPoint pressure always return -1, but QWidget tabletEvent works well
Hi Qt developers, In Qt5.3.1 qtdeclarative/examples/quick/touchinteraction, There is MultiPointTouchArea and TouchPoint example, but TouchPoint touch1.pressure, it always print out -1 Why?! because Qt5 removed X11 and Xi relatived part? https://github.com/krre/AprilBrush-Desktop/blob/master/cpp/wacom/wacom_unix.cpp#L31 In Qt5.3.1 qtbase/examples/widgets/widgets/tablet, QTabletEvent event-pressure() print out the value in the [0.0, 1.0] range. So how to get the correct pressure value from MultiPointTouchArea and TouchPoint in QML? please someone give me some advice, thanks a lot! -- Regards Leslie Zhai xiang.z...@i-soft.com.cn a KDE developer ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
Re: [Development] NO effect setAttribute(Qt::WA_X11NetWmWindowTypeDock, true) for Qt5?
Hi Jorgen, Thanks for your reply :) Yes! It has to setWindowFlags(Qt::BypassWindowManagerHint | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint) for Qt5 to act like the DOCK https://github.com/xiangzhai/qtpanel/blob/master/panelwindow.cpp#L143 And there is NO x11EventFilter for Qt5 any more, so I use MyXcbEventFilter based on QAbstractNativeEventFilter to handle xcb_generic_event_t* event https://github.com/xiangzhai/qtpanel/blob/master/x11support.cpp#L37 Perhaps it is easy to migrate to Qt5 towards general applications such as WEB BROWSER https://github.com/xiangzhai/youaremyeyes/tree/master/src/browser only need to change some APIs and header files depend on different QT_VERSION. BUT it is not easy for special ones, for example, WINDOW MANAGER https://github.com/xiangzhai/eggwm DESKTOP ENVIROMENT https://github.com/xiangzhai/qtpanel it needs to be familiar with some relative libraries ... sort of thing Happy International Labour Day! Thanks for your reply again :) Regards, Leslie Zhai xiang.z...@i-soft.com.cn Hi On Wednesday 30 April 2014 10:32:15 Leslie Zhai wrote: Hi Qt developers, I migrated qtpanel from Qt4 to Qt5 but setAttribute(Qt::WA_X11NetWmWindowTypeDock, true) has NO effect for Qt5 https://github.com/xiangzhai/qtpanel/blob/master/panelwindow.cpp#L138 qtpanel-qt4 snapshot https://www.dropbox.com/s/nwebtd03fy4sght/qtpanel-qt4.png BUT qtpanel-qt5 https://www.dropbox.com/s/dxt7z5ya26fr6ss/qtpanel-qt5.png I need to setWindowFlags(Qt::FramelessWindowHint | Qt::CustomizeWindowHint) to act like a dock for Qt5? but there is no need for Qt4. Please someone give me some advice, thanks a lot! The top level widget uses a QWindow in Qt 5. Because of the platform abstraction layer (QWindow and QPlatformWindow), the platform dependent widget attributes often doesn't have an effect in Qt 5. I have had a couple of stabs on solving this, but it has led to a big fat nothing so far. However, your mail just show yet another example for the need for a pattern to solve this. The other day Laszlo got a patch integrated which adds a new module called QtPlatformHeaders which (as the name implies) should only contain headers and no library. So I desided to use the new module and have another stab at adding an api for setting platform specific properties in change: https://codereview.qt-project.org/#change,84484 Jørgen ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
[Development] NO effect setAttribute(Qt::WA_X11NetWmWindowTypeDock, true) for Qt5?
Hi Qt developers, I migrated qtpanel from Qt4 to Qt5 but setAttribute(Qt::WA_X11NetWmWindowTypeDock, true) has NO effect for Qt5 https://github.com/xiangzhai/qtpanel/blob/master/panelwindow.cpp#L138 qtpanel-qt4 snapshot https://www.dropbox.com/s/nwebtd03fy4sght/qtpanel-qt4.png BUT qtpanel-qt5 https://www.dropbox.com/s/dxt7z5ya26fr6ss/qtpanel-qt5.png I need to setWindowFlags(Qt::FramelessWindowHint | Qt::CustomizeWindowHint) to act like a dock for Qt5? but there is no need for Qt4. Please someone give me some advice, thanks a lot! Regards, Leslie Zhai xiang.z...@i-soft.com.cn ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
[Development] qtwayland.pro is not able to support custom define enviroment variable?
Hi Elvis and qt5 wayland developers, I git log to show Elvis commit to the repos recently, Giulio and Robin reviewed it :) so perhaps you are able to answer my simple question. I follow the http://qt-project.org/wiki/QtWayland and http://wayland.freedesktop.org/qt5.html But when I qmake under qtwayland project directory, it thrown WARNING shown as below: Project WARNING: No xkbcommon 0.2.0 or higher found, disabling support for it And my qmake shown as below: qmake -v QMake version 3.0 Using Qt version 5.3.0 in /home/zhaixiang/qt/qt5/lib libxkbcommon shown as below: pkg-config --cflags --libs xkbcommon -I/home/zhaixiang/wayland/include -L/home/zhaixiang/wayland/lib -lxkbcommon Does qtwayland.pro support custom define enviroment variable? Please someone give me some advice, thanks a lot! Regards, Leslie Zhai xiang.z...@i-soft.com.cn ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
Re: [Development] qtwayland.pro is not able to support custom define enviroment variable
Hi Jørgen, Thanks for your reply :) http://lists.qt-project.org/pipermail/development/2014-April/016420.html Oh yeah, I forgot to add xkbcommon to the pkgconfig list :P I will rebuild QtBase with pkg-config support, and I am able to confirm I set LD_LIBRART_PATH, but what is CPLUS_INCLUDE_PATH? please someone give me some advice, thanks a lot! Regards, Leslie Zhai xiang.z...@i-soft.com.cn ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
[Development] Does Qt5 support multiple touch devices for X Window?
Hi qt developers users, Does Qt5 support multiple touch devices for X Window? For example, 9 projected capacitive touch screen devices experienced as a super big touch screen, shown as below link: https://raw.github.com/xiangzhai/myblog/master/MTX11-Note/mtm.jpg When I touched the FIRST screen, X Window rendered the mouse in the FIRST monitor, but touched the second or others, X Window still rendered it in the FIRST monitor, X Window fail to transform the coordinate matrix. I sent an email to xorg-devel http://lists.x.org/archives/xorg-devel/2013-October/038263.html and a nice people named Peter gave me some advice about XSetWacom http://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Dual_and_Multi-Monitor_Set_Up But I prefer to use read /dev/input/eventX file descriptor based on Linux Multi-Touch Protocol B https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt And handled multiply touch devices simultaneously, when got ABS_MT_POSITION_X and ABS_MT_POSITION_Y, transformed the corrdinate based on the touch device (Monitor) logical position https://raw.github.com/xiangzhai/myblog/master/MTX11-Note/MT.conf Is there a common way provided by Qt5? Please someone give me some advice, thanks a lot! Best Regards, Leslie ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
[Development] how to double buffer for qt3
Hi qt developers, I know qt3 is too old, but there are some projects still developed by it. I know how to use Xext double buffer https://github.com/xiangzhai/myblog/blob/master/MTX11-Note/myxwin.cpp#L61 but have no idea about qt3 for drawing ellipse with moving mouse`s position. The source code shown as below: void Qt3DbeBuf::mouseMoveEvent(QMouseEvent * me) { point_t point; point.x = me-x(); point.y = me-y(); m_points.push_back(point); update(); } void Qt3DbeBuf::paintEvent(QPaintEvent * pe) { QRect rect(pe-rect()); QPixmap pixmap(rect.size()); pixmap.fill(this, 0, 0); QPainter painter(this); QPainter dbpainter(pixmap); int i; dbpainter.translate(-rect.x(), -rect.y()); dbpainter.setBrush(Qt::white); for (i = 0; i m_points.size(); i++) dbpainter.drawEllipse(m_points[i].x, m_points[i].y, 10, 10); painter.drawPixmap(0, 0, pixmap); } But it still flickr, maybe double buffer have no effect? Please some one give me some advice, thanks a lot! Best Regards, Leslie ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development