Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Button won't click when embedded in QWidget

Button won't click when embedded in QWidget

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 628 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lisabeeren
    wrote on last edited by
    #1

    hi, i'm trying to add a button defined in qml to an existing project, but when i click the button it does not respond (does not press down / provide any feedback that it has been clicked, and i don't think the event is fired either). i'm using Qt5.1 under OSX.

    my qml is as follows:

    @import QtQuick 2.1
    import QtQuick.Controls 1.0
    import QtQuick.Window 2.0

    Rectangle {
    width: 200
    height: 200

    Button {
        text: qsTr("Hello World")
        anchors.centerIn: parent
    }
    

    }@

    and i embed this as follows (as per this blog post "here":http://blog.qt.digia.com/blog/2013/02/19/introducing-qwidgetcreatewindowcontainer/ ):

    @QQuickView *qqView = new QQuickView();
    QWidget *container = QWidget::createWindowContainer(qqView, this);
    container->setMinimumSize(200, 200);
    container->setMaximumSize(400, 400);
    container->setFocusPolicy(Qt::TabFocus);@

    any tips on how to get this working?

    with thanks

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved