[Minor] "-stylesheet" goes fullscreen

Bugs and Suggestions in XnView MP or XnConvert MP which have been resolved.

Moderators: helmut, XnTriq, xnview

User avatar
XnTriq
Moderator & Librarian
Posts: 6040
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

[Minor] "-stylesheet" goes fullscreen

Post by XnTriq »

  • [   ] Fullscreen when starting with a file « Startup « General « General « Settings... « Tools
... is deactivated, but XnView^MP starts in fullscreen mode anyway, when I launch it with the -stylesheet parameter ...
  • Code: Select all

    C:\Progra~1\XnViewMP\xnview.exe -stylesheet test.qss
... to append the styles from an external QSS file to those in default.style.
User avatar
xnview
Author of XnView
Posts: 37889
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: [Minor] "-stylesheet" goes fullscreen

Post by xnview »

Are you sure for -stylesheet? It's not -style?
-stylesheet doesn't take an argument...
Pierre.
User avatar
XnTriq
Moderator & Librarian
Posts: 6040
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: [Minor] "-stylesheet" goes fullscreen

Post by XnTriq »

I got the information from a post dated 27/Nov/2007 at the official Qt Labs Developer Blogs:
Girish Ramakrishnan ([url=http://labs.qt.nokia.com/2007/11/27/theming-qt-for-fun-and-profit/]Theming Qt for fun and profit[/url]) wrote:Qt 4.3′s well kept secret
In Qt 4.3, users can customize the style of any application without touching or recompiling the code. All Qt applications can take an external stylesheet using the -stylesheet command line switch. So, create a file called mystyle.qss containing “QPushButton { background: red; }”. Now start, any Qt applications as “qtapp -stylesheet mystyle.qss”. Sweeeet.
The author links to this page:
Qt Rference Documentation (QApplication Class Reference » [url=http://doc.trolltech.com/latest/qapplication.html#QApplication]QApplication::QApplication[/url]) wrote:All Qt programs automatically support the following command line options:
  • -style= style, sets the application GUI style. Possible values are motif, windows, and platinum. If you compiled Qt with additional styles or have additional styles as plugins these will be available to the -style command line option.
  • -style style, is the same as listed above.
  • -stylesheet= stylesheet, sets the application styleSheet. The value must be a path to a file that contains the Style Sheet. Note: Relative URLs in the Style Sheet file are relative to the Style Sheet file's path.
  • -stylesheet stylesheet, is the same as listed above.
My findings so far:
  1. As expected, this parameter doesn't do anything in connection with a .qss file:

    Code: Select all

    C:\Progra~1\XnViewMP\xnview.exe -style test.qss
    C:\Progra~1\XnViewMP\xnview.exe -style=test.qss
  2. Passing the name of a built-in skin as an argument OTOH works just fine:

    Code: Select all

    C:\Progra~1\XnViewMP\xnview.exe -style plastique
    C:\Progra~1\XnViewMP\xnview.exe -style=plastique
  3. XnView starts in fullscreen mode,
    the styles from both default.style and test.qss are applied:

    Code: Select all

    C:\Progra~1\XnViewMP\xnview.exe -stylesheet test.qss
  4. XnView starts in standard mode,
    the styles from both default.style and test.qss are applied:

    Code: Select all

    C:\Progra~1\XnViewMP\xnview.exe -stylesheet=test.qss
  5. XnView starts in standard mode with the “Plastique” skin,
    the styles from both default.style and test.qss are applied:

    Code: Select all

    C:\Progra~1\XnViewMP\xnview.exe -style=plastique -stylesheet=test.qss
Conclusion: There's no bug! I just have to keep in mind that the -stylesheet switch expects an equals=sign. Otherwise the argument won't be accepted.
  • Moving to “Fixed Bugs & Added Suggestions”...