Results 1 to 9 of 9

Thread: Displaying on multiple desktops?

  1. #1
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Arrow Displaying on multiple desktops?

    I have two desktops. I wish that a particular widget (say Mod2) window appear on the 2nd desktop screen....i.e. a screen different from the one where the main application (say Mod1) resides. My app desires this peculiar behavior.

    I went through the docs and read through QDesktopWidget which gives me access to the screen info, but couldn't find a way to make the widget appear on a different desktop!

    How should I achieve this?

    Thanks

    Nupul.

  2. #2
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Displaying on multiple desktops?

    Did you try to move the widget?
    You get the screen coordinates of your second screen - so it should be possible to simply call QWidget:move with those corredinates.

  3. #3
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Displaying on multiple desktops?

    Quote Originally Posted by ChristianEhrlicher
    Did you try to move the widget?
    You get the screen coordinates of your second screen - so it should be possible to simply call QWidget:move with those corredinates.

    nope...didn't think of this

    I thought there would be some direct way to open the widget window onto the second screen...but am still not able to understand your soln...ummm some code could help

    Thanks

  4. #4
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Displaying on multiple desktops?

    For me I have two desktops:
    QDesktopWidget::screenGeometry(0) returns 0,0 / 1279/1023
    QDesktopWidget::screenGeometry(1) returns -1024,120 / -1,887

    If I now want to move my widget to screen 1, I just have to call QWidget::move() with a point inside -1024,120 / -1,887

    Take a look at qt4-src/examples/tutorial/t1 - a 'hello.move(-800,500);' after hello.show() does the trick.

  5. #5
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Re: Displaying on multiple desktops?

    Thanks a lot!!! But there is a doubt still lingering on....My app opens another app...something like a desklet-viewer. This desklet-viewer is invoked via QProcess....and I would like to have this process show up on the other desktop....how can i achieve this?



    Nupul

  6. #6
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Displaying on multiple desktops?

    Quote Originally Posted by nupul
    Thanks a lot!!! But there is a doubt still lingering on....My app opens another app...something like a desklet-viewer. This desklet-viewer is invoked via QProcess....and I would like to have this process show up on the other desktop....how can i achieve this?



    Nupul
    This highly depends. Are you on Linux or Windows? Is your desklet-viewer written in Qt or some other toolkit? Qt apps accept the standard X11 command line arguments like -geometry. this can be used to position your new process window.
    Save yourself some pain. Learn C++ before learning Qt.

  7. #7
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Displaying on multiple desktops?

    Quote Originally Posted by Chicken Blood Machine
    This highly depends. Are you on Linux or Windows? Is your desklet-viewer written in Qt or some other toolkit? Qt apps accept the standard X11 command line arguments like -geometry. this can be used to position your new process window.
    I am using linux SUSE 10. (AFAIK windows doesn't support the multiple desktop option as yet...)

    The desklet-viewer is an external application NOT written in Qt....i think it's in gtk. I can use kstart for this (to launch an app on another desktop), but it then becomes too KDE specific. There also another tool 'wmctrl' to use, but it can't start a process on another desktop, it can only move "windows" to another desktop. The round about is to start the application, get the window Id and then move but I don't want to do this....any solution that Qt can provide?

    Thanks

    Nupul
    Last edited by nupul; 5th May 2006 at 10:10.

  8. #8
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Displaying on multiple desktops?

    Quote Originally Posted by nupul
    I am using linux SUSE 10. (AFAIK windows doesn't support the multiple desktop option as yet...)

    The desklet-viewer is an external application NOT written in Qt....i think it's in gtk. I can use kstart for this (to launch an app on another desktop), but it then becomes too KDE specific. There also another tool 'wmctrl' to use, but it can't start a process on another desktop, it can only move "windows" to another desktop. The round about is to start the application, get the window Id and then move but I don't want to do this....any solution that Qt can provide?

    Thanks

    Nupul
    No, Qt can't control your GTK app.
    Save yourself some pain. Learn C++ before learning Qt.

  9. #9
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up Re: Displaying on multiple desktops?

    hmmm....seems I'll just use the external programs kstart and wmctrl for this...the former can launch process on another desktop, without changing the existing desktop...the latter can't do this, but can move any "window" onto another desktop...

    but no qualms....i learnt how to do the latter with Qt...above.

    Thanks a lot CBM and Christian!!

    Nupul.

    PS:If you know some more external progs as above...do lemme know

Similar Threads

  1. Displaying Multiple Columns in QListView
    By millard in forum Qt Programming
    Replies: 8
    Last Post: 5th December 2007, 12:03
  2. how to corss compile for windows in Linux
    By safknw in forum Qt Programming
    Replies: 24
    Last Post: 13th May 2006, 05:23

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.