Results 1 to 10 of 10

Thread: Best way to open a Qt window from web page?

  1. #1
    Join Date
    Oct 2007
    Location
    India
    Posts
    162
    Thanks
    20
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Best way to open a Qt window from web page?

    I have a web page open in opera browser and on click on a button on the web page, i want to open a Qt window. The web page uses CGI call to start the Qt application. Now, the Qt application to be opened will lay on top of the web page and it will be frameless so that it seems to blend into the web layout. So, i need the window to be frameless.

    Now, I want to know how can i open a frameless Qt window from a web page. Should i use QtWebView? or should i just set the window hint to be frameless?
    What Qt widget can i use to embed my application window into?

  2. #2
    Join Date
    Jan 2006
    Posts
    132
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Best way to open a Qt window from web page?

    Not sure how you expect this to work. From a web server you wont be able to display a native operating system window directly on the client pc. Using CGI could only work if the "server" (Apache, IIS) is local, running on the client machine itself. You would than need to locate the browser window and paint the Qt window over it.

    IMHO a better approach would be to write a plugin for the browser (using Qt). Still that plugin must first be installed on every client PC that wants to use it.

  3. #3
    Join Date
    Oct 2007
    Location
    India
    Posts
    162
    Thanks
    20
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Best way to open a Qt window from web page?

    Actually my application is on an embedded device. The older version of the application already runs on it and the Qt application is executed from the web browser. The browser is not full fledged Opera but a customized version so i guess they are already using some kind of plugin. The existing application runs full screen from the browser. But my application needs to be of smaller size not full screen.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Best way to open a Qt window from web page?

    If you want to embed your application into some other window, them embed it, not lay it on top of the other application. As already said opera surely has some plugin API available so you can implement your application using that API. Another question is - why not get rid of Opera and switch to WebKit?

  5. #5
    Join Date
    Oct 2007
    Location
    India
    Posts
    162
    Thanks
    20
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Best way to open a Qt window from web page?

    Actually my job is to only build the Qt application. I can't touch Opera and other stuff as it doesn't come under my access. My job is to allow the web page to execute my application by simply calling my application along with some arguments.

    Should i just resize the window and set it to frameless and show it on top of web page? If user clicks on the part of the web page behind my application, my application will be hidden and control will be transferred to the web page.

    So, is it ok to just resize the window and make it frameless?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Best way to open a Qt window from web page?

    Quote Originally Posted by montylee View Post
    Actually my job is to only build the Qt application. I can't touch Opera and other stuff as it doesn't come under my access. My job is to allow the web page to execute my application by simply calling my application along with some arguments.
    So that's not your problem.

    Should i just resize the window and set it to frameless and show it on top of web page?
    What if the webpage scrolls down or your window's widget take more place than a "hole" in the webpage? What if someone places focus in your application and then wants to scroll down the webpage? Lots of problems...

    So, is it ok to just resize the window and make it frameless?
    It will work, but the outcome will be... bad. I strongly advise against it. And I really suggest you push the project manager to switch Opera to WebKit. It would solve many problems, this one included.

  7. #7
    Join Date
    Oct 2007
    Location
    India
    Posts
    162
    Thanks
    20
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Best way to open a Qt window from web page?

    Actually there is no scrolling involved. The web page behind my application is a small webpage with no scrolling etc...
    Regarding focus, i just need to hide my application if someone clicks outside my application. There is no scrolling etc. involved. Basically the web page won't take any events except click and if user clicks on it my application will be minimized/hidden.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Best way to open a Qt window from web page?

    Why not make that all a single application then? Either get rid of Opera and use QtWebKit which will allow you to embed any widget you like or make your application a plugin to Opera. The current design you have is... sick.

  9. #9
    Join Date
    Oct 2007
    Location
    India
    Posts
    162
    Thanks
    20
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Best way to open a Qt window from web page?

    hmmm, the schedule of this project is tight and i have to provide them my application and an interface to access my application. It's not possible to replace Opera by Qt Webkit at the moment, but in future they might do it.

    So, for now, i am thinking of making my Qt window frameless.

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Best way to open a Qt window from web page?

    Quote Originally Posted by montylee View Post
    So, for now, i am thinking of making my Qt window frameless.
    Suit yourself, just know this bad design will stay as there will always be a deadline for something. I really suggest you implement the application as a plugin to Opera. How hard can it be?

    http://www.opera.com/docs/pluginapi/

Similar Threads

  1. How to set Qt window transparent?
    By montylee in forum Qt Programming
    Replies: 17
    Last Post: 24th December 2013, 20:11
  2. Set a window as child at runtime
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 26th November 2007, 09:30
  3. Change shape of window / animate window
    By sabeesh in forum Qt Programming
    Replies: 3
    Last Post: 31st October 2007, 08:16
  4. How to open external page link using tabwidget
    By jyoti in forum Qt Programming
    Replies: 2
    Last Post: 13th November 2006, 10:43
  5. right way to open a new window
    By wind in forum Newbie
    Replies: 1
    Last Post: 1st November 2006, 11:17

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.