Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • QQuickView.grab() issue

    1
    0 Votes
    1 Posts
    514 Views
    No one has replied
  • 0 Votes
    2 Posts
    784 Views
    I
    This may not be the best way but what you could try to do is create an OpenGL context using a fake, high version and then check what was actually created. In QOpenGLContext's docs: "If the OpenGL implementation on your system does not support the requested version of OpenGL context, then QOpenGLContext will try to create the closest matching version." Example: @QSurfaceFormat requestedFormat; requestedFormat.setVersion( 99, 99 ); QOpenGLContext* context = new QOpenGLContext; context->setFormat( requestedFormat ); context->create(); qDebug() << QString("Requested OpenGL version (%1.%2); Actual created version (%3.%4).").arg(requestedFormat.majorVersion()).arg(requestedFormat.minorVersion()).arg(context->format().majorVersion()).arg(context->format().minorVersion());@
  • Hint about transitions

    3
    0 Votes
    3 Posts
    934 Views
    _
    Because I didn't know it :-) It seems it fits perfectly for my needs, thanks.
  • Flickable velocity

    2
    0 Votes
    2 Posts
    740 Views
    E
    The velocity just defines how fast the GridView should flick. You cannot set to which position it should flick as far as I know.
  • Long key press, double key press

    1
    0 Votes
    1 Posts
    929 Views
    No one has replied
  • [SOLVED] Create class with Objective-C header

    5
    0 Votes
    5 Posts
    3k Views
    shavS
    Ok! I've found the solution. The first you need to create the Objective-C class which will implement all logic to methods: header file (notificationmanager.h) of ObjC: @ #ifndef NOTIFICATIONMANAGER_H #define NOTIFICATIONMANAGER_H #ifdef __cplusplus extern "C" { #endif #import <Foundation/Foundation.h> @interface NotificationManager : NSObject (instancetype)init; (void)postNotificationWithTitle:(NSString*)title message:(NSString*)msg; (BOOL)isObjectCreated; (NotificationManager*)defaultManager; (void)clearAllDatas; @end #ifdef __cplusplus } #endif #endif // NOTIFICATIONMANAGER_H @ the implementation (notificationmanager.mm) of ObjC: @ #include "notificationmanager.h" #include <QtCore> @interface NotificationManager () <NSUserNotificationCenterDelegate> @end @implementation NotificationManager static NotificationManager* g_notificationManager = nil; (instancetype)init { self = [super init]; if(self) { [[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:self]; } return self; } (void)postNotificationWithTitle:(NSString*)title message:(NSString*)msg { NSUserNotification* notification = [[NSUserNotification alloc] init]; notification.title = title; notification.informativeText = msg; [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification: notification]; } (BOOL)isObjectCreated { return (g_notificationManager != nil); } (NotificationManager*)defaultManager { if(!g_notificationManager) { g_notificationManager = [[NotificationManager alloc] init]; } return g_notificationManager; } (BOOL)userNotificationCenter:(NSUserNotificationCenter *)center shouldPresentNotification:(NSUserNotification *)notification { Q_UNUSED(center); Q_UNUSED(notification); return YES; } (void)clearAllDatas { [g_notificationManager release]; g_notificationManager = nil; } (void)dealloc { [super dealloc]; qDebug()<<"Object released!!!!"; } @end @ Second you need create C++ class with .mm file implementation (qfnotificationmanager.h): @ #ifndef QFNOTIFICATIONMANAGER_H #define QFNOTIFICATIONMANAGER_H #include <QtCore> #ifdef __cplusplus extern "C" { #endif class QfNotificationManager : public QObject { // Q_OBJECT public: explicit QfNotificationManager(QObject *parent = 0); ~QfNotificationManager(); static QfNotificationManager* defaultManager(QObject *parent = 0); void postNotification(QString title, QString message); signals: public slots: }; #ifdef __cplusplus } #endif #endif // QFNOTIFICATIONMANAGER_H @ and implementation (qfnotificationmanager.mm): @ #include "qfnotificationmanager.h" #include <Foundation/Foundation.h> #include "notificationmanager.h" static QfNotificationManager* g_notificationManager = NULL; QfNotificationManager::QfNotificationManager(QObject *parent) : QObject(parent) { [NotificationManager defaultManager]; } QfNotificationManager::~QfNotificationManager() { [[NotificationManager defaultManager] clearAllDatas]; } QfNotificationManager* QfNotificationManager::defaultManager(QObject *parent) { if(!g_notificationManager) { g_notificationManager = new QfNotificationManager(parent); } return g_notificationManager; } void QfNotificationManager::postNotification(QString title, QString message) { NSString* objcTitle = title.toNSString(); NSString* objcMessage = message.toNSString(); [[NotificationManager defaultManager] postNotificationWithTitle: objcTitle message: objcMessage]; } @ How to use (from .cpp file you need to call this): @ QfNotificationManager::defaultManager(this); QfNotificationManager::defaultManager()->postNotification("Qt Forum Reader", "This is test notification message"); @
  • How to print(with the printer) a QML object ?

    5
    0 Votes
    5 Posts
    4k Views
    S
    Hi beenmanenl, i haven't found my code. Sorry.
  • 0 Votes
    6 Posts
    1k Views
    sierdzioS
    [quote author="aabc" date="1413206015"]If I have 12 QML pages that loads dynamically, each page contain ~400 MyText elements - Do you think that in this case the pages will be loaded faster if I use the MyText element instead of using Text element and give it the properties ?[/quote] Please benchmark it, I don't know. I guess the difference would not be substantial, but that is a guess. QML enigne provides a lot of flags that can be used in debugging. You can get in touch with QML developers (see maintainers list here on Qt Project website) to get more concrete answers. Or ask on Qt interest mailing list/ IRC.
  • Arbitrary positioning QML popup menu

    3
    0 Votes
    3 Posts
    2k Views
    _
    In general, the Menu seems unreasonable and closed, with no prospect of enlargement. Impossible to know the geometry of the menu window before it opens. I am disappointed implementation of Menu.
  • Does QQuickImageProvider use QPixmapCache ?

    15
    0 Votes
    15 Posts
    4k Views
    A
    How can I determine if my rendering target is 32 bit or 16 bit ?
  • TableView limit size

    1
    0 Votes
    1 Posts
    493 Views
    No one has replied
  • [SOLVED] QtQuick 2 stuttering problem.

    6
    0 Votes
    6 Posts
    3k Views
    slettaS
    That makes sense then. I've noticed the same behaviour on OSX as well, when attaching the MacBook to a projector for instance. There are a few different problems causing this problem. The root cause is that the OS and windowing system blocks in OpenGL's swapBuffers based on the vsync of only one screen (the primary display in this case) rather than for the display the window displayed on. Qt's animation system is also ticked globally, not per window (except for the Animator classes when using threaded rendering). That means that even if the system were to support it, we still couldn't do individual frame rates on two separate displays. I'm also not sure that is desired. It would have a lot of side effects...
  • Problem getting Screen.desktopAvailableHeight when Component.onCompleted

    3
    0 Votes
    3 Posts
    891 Views
    S
    I see. Thank you. :)
  • QGraphicsTransform3D and QGraphicsTransform duality

    3
    0 Votes
    3 Posts
    811 Views
    SGaistS
    Hi, IIRC, the first one applies to the old Qt3d module (which was never officially released) while the other to the QGraphicsView and friends part of Qt Base. If you are interested by the Qt3d module, you should rather check the wip/newapi branch. Hope it helps
  • QmlListProperty access in javascript

    2
    0 Votes
    2 Posts
    1k Views
    T
    Hi, The qmllistproperties work slightly in a different way than regular. You need to implement a number of static functions to get everything working. Check the documentation, it has examples to get you started!
  • HELP! There is no effect by calling QWindow::lower() on android device

    3
    0 Votes
    3 Posts
    814 Views
    S
    OK, I got it! Thanks very much. :)
  • 0 Votes
    1 Posts
    577 Views
    No one has replied
  • Javascript to qml

    1
    0 Votes
    1 Posts
    677 Views
    No one has replied
  • Define a path (custom direction) for particles of an emitter

    4
    0 Votes
    4 Posts
    1k Views
    D
    Maybe "here":https://qt.gitorious.org/qt/qtdeclarative/source/29c4b643272a43022081cce063394bac823ab529:examples/declarative/particles/trails/fireworks.qml near the end of the file.
  • [Solved] ListView: Modify the animation/rebound behaviour of snap mode

    3
    0 Votes
    3 Posts
    1k Views
    benlauB
    It works! Thank you!