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. [SOLVED] Force focus
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Force focus

Scheduled Pinned Locked Moved QML and Qt Quick
12 Posts 2 Posters 7.8k 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.
  • F Offline
    F Offline
    fmontigny
    wrote on last edited by
    #3

    Yes,

    I create this page
    @import Qt 4.7
    import QtWebKit 1.0

    Item {
    width: 1024
    height: 550

    WebView {
        id: webView
        url: "http://ljouanneau.com/lab/html5/demodragdrop.html"
        focus: true
        anchors.fill: parent
    }
    

    }@

    And drag and drop doesn't work.
    I think is focus problem

    thx
    fx

    fmontigny

    "time is for all cannot simultaneously"

    [FRANCE]

    1 Reply Last reply
    0
    • AlicemirrorA Offline
      AlicemirrorA Offline
      Alicemirror
      wrote on last edited by
      #4

      "Drag and drop" means scrolling?

      If so, the scrolling is not a property of the webwiew, you should put your view in a flickable area :)

      Enrico Miglino (aka Alicemirror)
      Balearic Dynamics
      Islas Baleares, Ibiza (Spain)
      www.balearicdynamics.com

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fmontigny
        wrote on last edited by
        #5

        no drag and drop means to catch and move element.

        Look this game http://pasjans-online.pl/

        fmontigny

        "time is for all cannot simultaneously"

        [FRANCE]

        1 Reply Last reply
        0
        • AlicemirrorA Offline
          AlicemirrorA Offline
          Alicemirror
          wrote on last edited by
          #6

          Well, I played and completed the game. Score: 653 points :)
          Then I have also understood what you mean.

          First test: opened the site in the browser of the E7-00 (symbian Anna last updates) and C7-00 (the same) it won't work. Exactly happens that the cards moves but seems unresponsives: the movement is not catched by the web script that don't move the card in the right place - i.e. the aces on the four top slots - and cards remain floating on the screen. It is possible that as the actual web browser don't has a full support of this web program also the api can't
          On the contraty opening the same link on the N950 (last firmware update - Beta 2) the game palys correctly. And I suppose that if you will try your application on this device it will rung too. I think that the first thing you should check is what is the game engine that is running on the web and if it is compabile with the webview on the device you are working. Then try with a page that includes any drag-and-drop web application that you for sure see running on the device web browser. Then, is also in this case the application don't work in your webview it maybe possible that you have omitted something.

          As my experience the webview is almost a in-app windows with a web browser instance that depends from the web libraries of the os and sdk version that you are using. What is the device, os version and sdk version you are working on ?

          Enrico Miglino (aka Alicemirror)
          Balearic Dynamics
          Islas Baleares, Ibiza (Spain)
          www.balearicdynamics.com

          1 Reply Last reply
          0
          • F Offline
            F Offline
            fmontigny
            wrote on last edited by
            #7

            I develop a PC to enjoy the graphics power of the QML

            device : desktop application
            os : windows 7
            sdk : 4.7.4

            This qml source code doesn't work but i find a cpp source code and this works.
            I don't understand what the difference.

            main.cpp
            @#include <QtGui>
            #include "mainwindow.h"

            int main(int argc, char * argv[])
            {
            QApplication app(argc, argv);
            QUrl url = QUrl("http://localhost/demo/Etiquetage/Eleve/vide.html");
            MainWindow *browser = new MainWindow(url);
            browser->show();
            return app.exec();
            }@

            mainwindow.cpp
            @#include <QtGui>
            #include <QtWebKit>
            #include "mainwindow.h"

            MainWindow::MainWindow(const QUrl& url)
            {
            view = new QWebView(this);
            view->load(url);

            setCentralWidget(view);
            

            }
            @

            mainwindow.h
            @
            #include <QtGui>

            class QWebView;
            QT_BEGIN_NAMESPACE
            class QLineEdit;
            QT_END_NAMESPACE

            class MainWindow : public QMainWindow
            {
            Q_OBJECT

            public:
            MainWindow(const QUrl& url);

            protected slots:

            private:
            QWebView *view;
            };
            @

            fmontigny

            "time is for all cannot simultaneously"

            [FRANCE]

            1 Reply Last reply
            0
            • AlicemirrorA Offline
              AlicemirrorA Offline
              Alicemirror
              wrote on last edited by
              #8

              Please try cloning this project: https://projects.developer.nokia.com/blackcatcuttingstudio

              It is on-the-run application that uses the browsing features embedded in the application (QML) to navigate the project wiki and some other pages. Try if this version of the browsing with Qt-Complex framework (that includes the components for embedded web pages) and the pages specific for the navigation can work. The first try is that you can clone it (it should run under windows platform), change one of the url pointed to the pages opened and see is the game is working.

              Else you can send me the html piece and I will see what can be. Is your project opensource?

              Enrico Miglino (aka Alicemirror)
              Balearic Dynamics
              Islas Baleares, Ibiza (Spain)
              www.balearicdynamics.com

              1 Reply Last reply
              0
              • F Offline
                F Offline
                fmontigny
                wrote on last edited by
                #9

                I do not understand the link between that and my application.

                I want to create a small web browser. And drag and drop the following is just a website with javascript source code.

                It's not my site so I can not give. I have no access: D

                After testing I discovered that the QWebView (cpp) and WebView (qml) are differents.
                I think there are parameters, in addition, by default in the QML.
                And I think that the resolution of my problem is here.

                fmontigny

                "time is for all cannot simultaneously"

                [FRANCE]

                1 Reply Last reply
                0
                • AlicemirrorA Offline
                  AlicemirrorA Offline
                  Alicemirror
                  wrote on last edited by
                  #10

                  In this project there is a set of pages that include a webveiw with some browsing features. It works. Test the application, download it and use the QML page in your application if it solve your problem or see how it is done.

                  The relation is it.

                  Enrico Miglino (aka Alicemirror)
                  Balearic Dynamics
                  Islas Baleares, Ibiza (Spain)
                  www.balearicdynamics.com

                  1 Reply Last reply
                  0
                  • F Offline
                    F Offline
                    fmontigny
                    wrote on last edited by
                    #11

                    I find the solution.
                    I just write " pressGrabTime: 0 "

                    @import Qt 4.7
                    import QtWebKit 1.0

                    Item {
                    width: 1024
                    height: 550

                    WebView {
                        id: webView
                        url: "http://192.168.2.31/demo/Etiquetage/Eleve/vide.html"
                        focus: true
                        anchors.fill: parent
                        pressGrabTime: 0
                    }
                    
                    Component.onCompleted: {
                        //qCApplication.onSetFocus(webView)
                    }
                    

                    }@

                    Thx for all

                    fx

                    fmontigny

                    "time is for all cannot simultaneously"

                    [FRANCE]

                    1 Reply Last reply
                    0
                    • AlicemirrorA Offline
                      AlicemirrorA Offline
                      Alicemirror
                      wrote on last edited by
                      #12

                      Yes, it is true. I rememebr that grabtime is the delay before the page react to the user interaction, used for zoom-in zoom-out pages in small screens. Great!

                      Enrico Miglino (aka Alicemirror)
                      Balearic Dynamics
                      Islas Baleares, Ibiza (Spain)
                      www.balearicdynamics.com

                      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