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. Qapp command line options
Forum Updated to NodeBB v4.3 + New Features

Qapp command line options

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.4k 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.
  • S Offline
    S Offline
    sango
    wrote on last edited by
    #1

    i'm searching for full list of command line options for Qt applications.
    i found special section on QApplication class reference about it, but i know, that there are another options, "platform" eg.
    does anyone help me?
    Qt version - 5.2

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jan-Willem
      wrote on last edited by
      #2

      Hi Sango,

      I'm not sure if I understand you correctly, but from the documentation and from exploring several programs, it seems to me that you can create your own program specific command line options. When you look at the TextEdit example, you find this code:

      @ QString initialFile = ":/example.html";
      const QStringList args = QCoreApplication::arguments();
      if (args.count() == 2)
      initialFile = args.at(1);

      if (!load(initialFile))
          fileNew();@
      

      If you would type on the command line TextEdit /home/document.html, you would (of course) open document.html in TextEdit. So document.html is what you find at args.at(2).

      Instead of opening a file passed on as argument, you should first check what argument is passed. Something like:
      @if (args.at(1) == -h)
      showHelp();@

      1 Reply Last reply
      0
      • hskoglundH Offline
        hskoglundH Offline
        hskoglund
        wrote on last edited by
        #3

        Maybe you're thinking of the built-in command line options available for all Qt apps? They're easy to find if you grep Qt's source:

        -qmljsdebugger=xxx
        -platformpluginpath xxxx
        -platform xxx
        -qwindowgeometry xxx xxxx
        -geometry xxx xxx (only on Linux)
        -plugin xxx
        -reverse
        -nograb
        -dograb
        -session xxxx
        -gdevel
        -gdebug
        -style xxx
        -stylesheet xxx
        -widgetcount
        -testability

        Note: for Qt console apps, only the first option is available. And the last 6 are only for Widget-flavored apps :-)

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sango
          wrote on last edited by
          #4

          hskoglund, yes, this is what I need, 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