Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Bring window to front -> raise(),show(),activateWindow() don't work on Windows
Forum Updated to NodeBB v4.3 + New Features

Bring window to front -> raise(),show(),activateWindow() don't work on Windows

Scheduled Pinned Locked Moved General and Desktop
29 Posts 9 Posters 61.1k Views 2 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.
  • G Offline
    G Offline
    goetz
    wrote on last edited by
    #20

    I would kick out the native browser and put everything in a "QWebView":http://doc.qt.nokia.com/4.7/qwebview.html. You have control of the window then.

    Is there anything that hinders you from doing it this way (despite having to pack QtWebkit.dll and bloating the package)?

    http://www.catb.org/~esr/faqs/smart-questions.html

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #21

      I would re-think the design criteria. There is a reason window managers don't allow windows of not-active applications to put themselves at the foreground. Why try to circumvent that? What makes your application so super-extra-special that it would need to go around these intentional limitations?

      1 Reply Last reply
      0
      • H Offline
        H Offline
        Hedge
        wrote on last edited by
        #22

        @Volker:
        I still work on z/OS and like my applications slim, so having a QtWebkit just for that purpose isn't an option.

        @Ander:
        My application isn't super special but it brings the browser in front of itself as well. It would be ok if it was possible to start the browser behind it (my application is only like 300 x 400 pixels, not resizeable).

        An option would be to keep it topmost until the user either allows access to Twitter via oAuth v1 or the request times out but I don't really want to play with the topmost-property as that is what I consider a design-fault.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #23

          Maybe "QTextBrowser":http://doc.qt.nokia.com/4.7/qtextbrowser.html fits your needs already. It does not need webkit and is included in QtGui module, that you need anyways.

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • H Offline
            H Offline
            Hedge
            wrote on last edited by
            #24

            Good idea, but the user needs to click on a button (image) on the webpage that opens to authorize my application to aborminate his Twitter-account.

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #25

              The text browser class does not handle network access by default, so you would have to add this yourself. I don't know if that's worth the effort. I personally would just include webkit and don't care for the size of the application (bandwidth is barely a problem nowadays...)

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • S Offline
                S Offline
                situ117
                wrote on last edited by
                #26

                To start the browser in background why don't you try something like this ?

                @
                QLabel* label = new QLabel("Hi");
                label->show();

                QProcess* p = new QProcess();
                QObject::connect(p,SIGNAL(started()),label,SLOT(raise()));
                p->start("firefox");
                @

                So as soon as the browser starts your application will be brought to front.

                EDIT: Replace raise() with your customized function which you're using to bring window to top.

                1 Reply Last reply
                0
                • H Offline
                  H Offline
                  Hedge
                  wrote on last edited by
                  #27

                  @situ117:

                  I don't know how that works with the users default browser.

                  @Volker:

                  The tool is 1.2 MB right now (.NET, I know that doesn't cut) and was 1.8MB when I coded it first in Object Pascal (yeah I really wrote it three times).

                  The Qt-Version on Windows is 7.5MB due to my custom dll's. The users are likely to ask how I justify that increased size. I really want it to be as small as possible.

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    goetz
                    wrote on last edited by
                    #28

                    I'd say having it cross platform does count :-)

                    http://www.catb.org/~esr/faqs/smart-questions.html

                    1 Reply Last reply
                    0
                    • R Offline
                      R Offline
                      redstoneleo
                      wrote on last edited by
                      #29

                      A valid solution here https://stackoverflow.com/a/10808934/1485853

                      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