Results 1 to 7 of 7

Thread: QT5 app don't load via .xinitrc

  1. #1
    Join Date
    Sep 2013
    Posts
    3
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default QT5 app don't load via .xinitrc

    Hello,


    I have a QT5 apps which runs great in xterm but when I want to start it in a .xinitrc file. I have the following error :

    QXcbXSettings::QXcbXSettings(QXcbScreen*) Failed to get selection owner for XSETTINGS_S atom
    QXcbConnection: XCB error: 163 (Unknown), sequence: 150, resource id: 0, major code: 149 (Unknown), minor code: 20

    My .xinitrc is very simple :

    /path/qt5_app -platform xcb



    As I write previously if I create an .xinitrc file with only a call to xterm it's work and if I call my app in the xterm window it's work...

    Thanks to help me to solve my problem or find an other solution to start my app just after a startx command.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QT5 app don't load via .xinitrc

    This could be an issue with the process environment.

    When you launch a terminal, the shell is starts might read different config files then when it runs as a non-interactive process (Bash does that).
    Check the environment right in xinit and in xterm
    Something

    env >> /tmp/xinitenv

    in .xinitrc and then typing something similar in xterm and then comparing the files.

    Another thing could be a race condition, i.e. something else starting or changing the X server state that has finished by the time you enter a command in xterm but that is not yet finished when you run your program directly.

    Cheers,
    _

  3. #3
    Join Date
    Sep 2013
    Posts
    3
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: QT5 app don't load via .xinitrc

    Hello,

    thanks for you reply.

    I have already check environments and environments are the same :

    - via "xterm -e "env"" command
    - when xterm is loaded


    Can you explain to me what is XSETTINGS and which environment variable are required.


    I also try :
    - to load my app in bashrc file in order to load it when bash is call by xterm ==> same problem.
    - to load my app in fluxbox ( in startup script) ==> same problem.

    I have no more idea...


    For information, previous I loaded my QT4 app via xinitrc and it's worked without problem, but I need QT5 for HTML5 support.


    Thanks

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QT5 app don't load via .xinitrc

    Quote Originally Posted by Arnaud-- View Post
    I have already check environments and environments are the same :

    - via "xterm -e "env"" command
    - when xterm is loaded
    Have you also checked the environment your programs sees when it is started from .xinitrc?

    Quote Originally Posted by Arnaud-- View Post
    Can you explain to me what is XSETTINGS and which environment variable are required.
    It isn't an environment variable but an XAtom, basically a setting that X clients can retrieve from the X server.
    It could be accessed by the XCB plugin or by the style. You could try changing the style to rule that out.


    Cheers,
    _

  5. #5
    Join Date
    Sep 2013
    Posts
    3
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: QT5 app don't load via .xinitrc

    Have you also checked the environment your programs sees when it is started from .xinitrc?
    I don't know how to do that :-(

    It could be accessed by the XCB plugin or by the style. You could try changing the style to rule that out.
    I don't know how to do that :-(


    Have you try to reproduce my issue on your development platform or I am the only one with this problem ?


    Thanks again

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QT5 app don't load via .xinitrc

    Quote Originally Posted by Arnaud-- View Post
    I don't know how to do that :-(
    Have you tried directly calling env in the .xinitrc script?

    Quote Originally Posted by Arnaud-- View Post
    I don't know how to do that :-(
    You can pass a style name to the -style commandline argument or use QStyleFactory in your main() to create one and pass it to QWidget::setStyle on your top levle window.

    Quote Originally Posted by Arnaud-- View Post
    Have you try to reproduce my issue on your development platform or I am the only one with this problem ?
    No, sorry, don't have time for that right now.

    Cheers,
    _

  7. #7
    Join Date
    Oct 2012
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT5 app don't load via .xinitrc

    You must set Xinerama to enable in Xorg (file xorg.conf or 10-screen.conf)
    Qt Code:
    1. Section "ServerLayout"
    2. Identifier "Layout0"
    3. Screen 0 "Screen0" 0 0
    4. Option "Xinerama" "1"
    5. EndSection
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Cannot load DLL.
    By cmp1104 in forum Qt Programming
    Replies: 3
    Last Post: 4th April 2013, 23:45
  2. Replies: 6
    Last Post: 4th March 2013, 20:20
  3. 100% CPU load
    By kartun in forum Qt Programming
    Replies: 8
    Last Post: 24th February 2011, 07:11
  4. DLL won't load
    By waynew in forum Qt Programming
    Replies: 8
    Last Post: 25th October 2010, 01:48
  5. Qt4 does not load JPG's.
    By Teuniz in forum Qt Programming
    Replies: 3
    Last Post: 3rd September 2007, 23:06

Tags for this Thread

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.