Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Behind the Scenes
  3. Wiki Discussion
  4. New DocumentWindow wiki page - How to do this on Linux / Mac?
QtWS25 Last Chance

New DocumentWindow wiki page - How to do this on Linux / Mac?

Scheduled Pinned Locked Moved Wiki Discussion
10 Posts 6 Posters 6.8k Views
  • 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
    giesbert
    wrote on 30 Mar 2011, 08:11 last edited by
    #1

    I have just added a "page":http://developer.qt.nokia.com/wiki/Assigning_a_file_type_to_an_Application_on_Windows in the Snippets category that details a class to deal with file type registration for editors on windows. I would really welcome any comments you may have, on the text of the Wiki page or the API of the class.

    Thanks a lot.

    Nokia Certified Qt Specialist.
    Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mgran
      wrote on 30 Mar 2011, 09:18 last edited by
      #2

      The first codeblock hides part of the ToC - we don't have a fix for that :/

      Project Manager - Qt Development Frameworks

      1 Reply Last reply
      0
      • G Offline
        G Offline
        giesbert
        wrote on 30 Mar 2011, 10:09 last edited by
        #3

        I've seen this, but how to solve it?
        insert empty lines is no solution... :-(

        Nokia Certified Qt Specialist.
        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on 30 Mar 2011, 10:54 last edited by
          #4

          If someone has an idea how to do this on linux / on the mac, it would be nice to know, so we can adapt the class to be more general and platform independant.

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          1 Reply Last reply
          0
          • V Offline
            V Offline
            vinb
            wrote on 30 Mar 2011, 13:06 last edited by
            #5

            On linux, you edit /etc/mailcap and /etc/mime.types to achieve this. I never done it manualy only through a gui. So im not a real help here. :(

            Here a litle example:
            /etc/mime.types:
            @
            video/mpeg mpeg mpg mpe
            video/mp4 mp4
            video/quicktime qt mov
            @
            /etc/mailcap:
            @
            video/mpeg; /usr/bin/mplayer '%s'; description="MPEG Video Format"; test=test -n "$DISPLAY"
            video/quicktime; /usr/bin/mplayer '%s'; description="Apple Quicktime Video"; test=test -n "$DISPLAY"
            video/x-mpeg2; /usr/bin/mplayer '%s'; description="MPEG Video"; test=test -n "$DISPLAY"
            video/x-mpeg; /usr/bin/mplayer '%s'; description="MPEG 2 Video"; test=test -n "$DISPLAY"
            video/mpeg; /usr/bin/mplayer '%s'; description="MPEG 2 Video"; test=test -n "$DISPLAY"
            video/x-ms-afs; /usr/bin/mplayer '%s'; description="Audio Video Interleave - Microsoft"; test=test -n "$DISPLAY"
            video/x-ms-asf; /usr/bin/mplayer '%s'; description="MS ASF video"; test=test -n "$DISPLAY"
            @

            1 Reply Last reply
            0
            • G Offline
              G Offline
              giesbert
              wrote on 30 Mar 2011, 13:07 last edited by
              #6

              hi vinb, thanks for the info.

              I will look into this, I'm sure it is possible...

              My biggest problem was: I did not know where the information is located...

              Nokia Certified Qt Specialist.
              Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

              1 Reply Last reply
              0
              • V Offline
                V Offline
                vinb
                wrote on 30 Mar 2011, 13:32 last edited by
                #7

                im only happy that i can help(a little) you for once ;)
                you can check "this":http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html or "this":http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec for more info.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  stemd
                  wrote on 5 Dec 2011, 11:47 last edited by
                  #8

                  I know for sure that it can be done on Linux, but you have kind of situation like of HTML before W3C gained ground, everybody (Gnome, KDE, Xfce) does things in its own way, as there is no standard which gained ground.

                  At least with /etc/mime.types and /etc/mailcap you can define types, but to assign apps which will open some type of document you'll need to check GConf/gconf-editor for Gnome (e.g. for Ubuntu till Unity, dconf-editor for Ubuntu with Unity), KDE is simpler but files do not have letter G in them... :)

                  /etc/alternatives dir with symlinks is also part of the game. Hopefully LSB (Linux Standard Base) will get it eventually.

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    Smar
                    wrote on 5 Dec 2011, 13:26 last edited by
                    #9

                    [quote author="mariusg" date="1301476705"]The first codeblock hides part of the ToC - we don't have a fix for that :/[/quote]

                    I ”solved” this by adding one new line.

                    This is more of normal CSS layouting issue than related to Wiki: unless you say so, table-like elements will not go over each other.

                    The TOC has its own space, which limits the space other elements can take. This is all wanted, because otherwise elements would be under that TOC, being completely unreadable. So TOC must have its own space only for itself.

                    When adding full-width element like code block, if it is next to TOC, it must either be made smaller than full-width or moved below the TOC. Depending of how the site is designed, it behaves like one of these.

                    This line I added moved the code block enough of pixels lower that it is not anymore considered to be next of TOC, hence be able to use full wiki page width for itself. So if there isn’t enough of ”preview” text for article before first code block, this will happen. Just means that maybe there is something else that could be written? ;)

                    EDIT: or did it go below / top of TOC before? Anyway, this is why it behaves so...

                    EDIT2: Okay, sorry everyone, now I see this is old post...

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      a.min
                      wrote on 16 Sept 2013, 13:33 last edited by
                      #10

                      Hi Gerolf,

                      Thank you for the great article. However, it seems to be a little bit outdated now. Your code does not seem to work with the following combination (sorry cannot locate the problem exactly):

                      • qt5.1.0
                      • windows 7 64-bit
                      • mingw64 gcc 4.8.0

                      DDE messages work if the process is already running. But DDE fails at the first startup when double-clicking the icon: It yields the Windows error message "There was a problem sending the command to the program".

                      BTW, other posts suggest that DDE is deprecated and one should use "DropTarget" and COM instead. However, I could not figure out how to do this with activeqt, either.

                      Any help will be appreciated…

                      PS: On 64-bit the code (line 233-234)
                      @ //IA64: Assume DDE LPARAMs are still 32-bit
                      Q_ASSERT(::UnpackDDElParam(WM_DDE_EXECUTE, message->lParam, &unused, (UINT_PTR*)&hData));
                      @ had to be replaced to use "message->lParam" directly with no UnpackDDElParam(). This yields the command string which is otherwise corrupted.

                      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