跳到內容

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k 主題 77.4k 貼文
  • QML source code visible in executable.

    5
    0 評價
    5 貼文
    2k 瀏覽
    p3c0P
    Hi, The only solution for this currently is to use "QtQuickCompiler":http://doc.qt.digia.com/QtQuickCompiler/. But unfortunately this is not available in Qt Open Source. If you have an enterprise license you can use it.
  • Singleton Context Issues

    2
    0 評價
    2 貼文
    681 瀏覽
    K
    I just found the problem: @var newScreen = Qt.createComponent("qrc:/" + fileName);@ If i dont prefix with qrc:/ it will try to load the file from qrc:/singletonfolder/ Good news is that everything is working !!!
  • Create a 2D Plot with zoom in in qml

    1
    0 評價
    1 貼文
    666 瀏覽
    尚無回覆
  • Qml ListView currentIndex Issue

    6
    0 評價
    6 貼文
    5k 瀏覽
    B
    I was having this same problem, and I had trouble following the solution posted. I eventually figured out a different solution, so I thought I'd post to help out anyone else seeing this problem. Here's what I did: @property int iCurrentSelection: 0 ... function setCurrentSelection( iComboIndex ) { iCurrentSelection = iComboIndex; } ... ComboBox { id: imageCombo width: 150 currentIndex: iCurrentSelection model: ListModel { id: cbSettingsItems3 ListElement { text: "Lung"; } ListElement { text: "Bone"; } } // onActivated is called when the user // sets the combo via the dropdown onActivated: { onImageChanged( index ); iCurrentSelection = currentIndex; } // onCurrentIndexChanged is called whenever the // combo is changed (dropdown or code), // but code changes stop calling it // when the ui is changed. onCurrentIndexChanged: { iCurrentSelection = currentIndex; }@ The important part of the code is the "iCurrentSelection = currentIndex;" lines inside the onActivated and onCurrentIndexChanged calls. This re-connects the "iCurrentSelection" property to the currentIndex. This means that if you change the iCurrentSelection value, the comboBox will change as well, even after you've interacted with the UI to change the ComboBox.
  • [SOLVED] Embed qwidget in QML

    8
    0 評價
    8 貼文
    12k 瀏覽
    F
    Since QDeclarative is marked as deprecated in Qt5 you can use QQuickPaintedItem to draw QWidgets in QML.
  • Categorized logging from QML

    5
    1 評價
    5 貼文
    2k 瀏覽
    D
    Code here https://github.com/dangelog/qmllogging :)
  • NetworkAccessManager like interface in QMl

    9
    0 評價
    9 貼文
    2k 瀏覽
    Z
    [quote author="SGaist" date="1414014463"]Hi, Just a question but, would be xmlhttprequest suited for your needs ? You have an example "here":http://qt-project.org/doc/qt-5/qtqml-xmlhttprequest-example.html[/quote] That would exactly be the interface I need, but I want to make my own class. The http request was just an example, the goal is to do different request/reply functionality. For example remote procedure calls. I looked into the code of xmlhttprequest, but it's heavy javascript based. My goal is to have class useable from C++ and QML. Using the finished() signal of the accessManager is also an option, but this would require a big selector for the response function, if I want a special response function for every request.
  • AnimatedImage Bug Fix

    4
    0 評價
    4 貼文
    1k 瀏覽
    SGaistS
    Don't know for Linux but on OS X, it's working fine
  • QtAV: how to import QtAV 1.3 and add new CODEC (e.g H.265) to QtAV

    3
    0 評價
    3 貼文
    3k 瀏覽
    A
    Hi, I don't know if you solved, but I had same problem. The guide you followed uses the visual studio compiler, so I guess you set INCLUDE and LIB in qtcreator. In my case I had mingw so env variables I had to set were CPATH and LIBRARY_PATH
  • Quick MenuBar embedded in QWidget?

    1
    0 評價
    1 貼文
    589 瀏覽
    尚無回覆
  • How to get correct contentHeight from ListView

    3
    0 評價
    3 貼文
    764 瀏覽
    shavS
    Hi, Thanks for reply. I can't add code to my post (is too long) so I've shared the code by html link. My code you can fiend "here":http://dshav.com/pub_pictures/code.html.
  • Problems with exe files generated by QT

    3
    0 評價
    3 貼文
    889 瀏覽
    W
    Thank you for the reply. I have something like this in my code: @ fileName = QFileDialog::getOpenFileName(this,tr("Open Enroll Image"),QDir::currentPath(),tr("Image Files [ *.jpg , *.jpeg , *.bmp , *.png , *.gif]")); if(!fileName.isEmpty()) { QImage imageE(fileName); … @ I think in fileName will be the full path, right? I tried also to run the exe files as administrator (maybe a permission issue) but the error persists. [edit: added missing coding tags @ SGaist]
  • How to make static EXE with commercial license?

    2
    0 評價
    2 貼文
    753 瀏覽
    sierdzioS
    As a commercial customer, you can ask the Qt Company / Digia and get professional support. Here is what I think: You need a static build of Qt itself Configure your build chain (Kit) so that this static build is used Then use both CONFIG += static and CONFIG += staticlib Compile It may work, although I'm not sure about the platform plugin
  • Qt 5.3.2 Application on Framebuffer

    3
    0 評價
    3 貼文
    4k 瀏覽
    K
    Thank you, it works :D here my qmake.conf and qeglfshooks.cpp qmake.conf # # qmake configuration for the odroid u2/u3 boards # http://hardkernel.com/ # http://forum.odroid.com/viewtopic.php?f=9&t=1645 # http://qt-project.org/forums/viewthread/48704/ include(../common/linux_device_pre.conf) EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_odroidu2.cpp # Extra stuff (OpenGL, DirectFB, ...) QMAKE_INCDIR_EGL += $$[QT_SYSROOT]/usr/include QMAKE_LIBDIR_EGL += $$[QT_SYSROOT]/usr/lib/arm-linux-gnueabihf/mali-egl QMAKE_INCDIR_OPENGL_ES2 += $$QMAKE_INCDIR_EGL QMAKE_LIBDIR_OPENGL_ES2 += $$QMAKE_LIBDIR_EGL QMAKE_INCDIR_OPENVG += $$QMAKE_INCDIR_EGL QMAKE_LIBDIR_OPENVG += $$QMAKE_LIBDIR_EGL QMAKE_LIBS_EGL += -lMali QMAKE_LIBS_OPENGL_ES2 += $$QMAKE_LIBS_EGL QMAKE_LIBS_OPENVG += $$QMAKE_LIBS_EGL #modifications to gcc-base.conf COMPILER_FLAGS += -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mvectorize-with-neon-quad DISTRO_OPTS += hard-float QMAKE_CXXFLAGS_RELEASE += -O3 include(../common/linux_arm_device_post.conf) load(qt_config) qeglfshooks_odroidu2.cpp (just the one from linux-arm-hisilicon-hix5hd2-g++) #include "qeglfshooks.h" #include <EGL/fbdev_window.h> #include <unistd.h> #include <fcntl.h> #include <sys/ioctl.h> #include <linux/fb.h> #include <private/qcore_unix_p.h> QT_BEGIN_NAMESPACE class QEglFSOdroidHooks : public QEglFSHooks { private: void fbInit(); public: void platformInit() Q_DECL_OVERRIDE; EGLNativeWindowType createNativeWindow(QPlatformWindow *window, const QSize &size, const QSurfaceFormat &format) Q_DECL_OVERRIDE; void destroyNativeWindow(EGLNativeWindowType window) Q_DECL_OVERRIDE; }; void QEglFSOdroidHooks::fbInit() { int fd = qt_safe_open("/dev/fb0", O_RDWR, 0); if (fd == -1) qWarning("Failed to open fb to detect screen resolution!"); struct fb_var_screeninfo vinfo; memset(&vinfo, 0, sizeof(vinfo)); if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) == -1) qWarning("Could not get variable screen info"); vinfo.bits_per_pixel = 32; vinfo.red.length = 8; vinfo.green.length = 8; vinfo.blue.length = 8; vinfo.transp.length = 8; vinfo.blue.offset = 0; vinfo.green.offset = 8; vinfo.red.offset = 16; vinfo.transp.offset = 24; vinfo.yres_virtual = 2 * vinfo.yres; if (ioctl(fd, FBIOPUT_VSCREENINFO, &vinfo) == -1) qErrnoWarning(errno, "Unable to set double buffer mode!"); qt_safe_close(fd); return; } void QEglFSOdroidHooks::platformInit() { QEglFSHooks::platformInit(); fbInit(); } EGLNativeWindowType QEglFSOdroidHooks::createNativeWindow(QPlatformWindow *window, const QSize &size, const QSurfaceFormat &format) { fbdev_window *fbwin = reinterpret_cast<fbdev_window *>(malloc(sizeof(fbdev_window))); if (NULL == fbwin) return 0; fbwin->width = size.width(); fbwin->height = size.height(); return (EGLNativeWindowType)fbwin; } void QEglFSOdroidHooks::destroyNativeWindow(EGLNativeWindowType window) { free(window); } QEglFSOdroidHooks eglFSOdroidHooks; QEglFSHooks *platformHooks = &eglFSOdroidHooks; QT_END_NAMESPACE
  • [SOLVED] Start QProcess out of QML Issue

    6
    0 評價
    6 貼文
    3k 瀏覽
    p3c0P
    Glad that it worked :) Please mark the post as solved by editing the post title and prepend [solved]
  • Can not unloadImage using QML canvas

    7
    0 評價
    7 貼文
    2k 瀏覽
    T
    One point to bookmark . Though, I have a work-around solution but I will investigate more. Thank you!
  • Displaying LCD Widget of Qt in QML

    5
    0 評價
    5 貼文
    4k 瀏覽
    p3c0P
    Since you can't use Qt Widgets in QML, what i meant earlier was you can load the Qt widgets normally and the QML using QQuickWidgets on the same form layout.
  • 此主題已被刪除!

    1
    0 評價
    1 貼文
    945 瀏覽
    尚無回覆
  • qmlplugindump with debug libraries

    1
    0 評價
    1 貼文
    1k 瀏覽
    尚無回覆
  • Problem with QML User Controls [closed]

    5
    0 評價
    5 貼文
    1k 瀏覽
    M
    Yes, but the one placed in main.qml. I found the error meanwhile: on top of the LoginScreen.qml I wrote @import QtQuick.Controls 1.2@ This was wrong because my installed version has V 1.1 of the QtQuickl controls included, so I changed it to @import QtQuick.Controls 1.2@ and now everything works fine - I wonder why the Button and TextFields were showing properly in the Design View of LoginScreen.qml, though.