Results 1 to 10 of 10

Thread: PRIMARY Selections

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: PRIMARY Selections

    Use a timer. That's the only way - a timer with one, two second timeout. You won't need a better resolution anyway. I just have a question -- what do you need it for?
    Last edited by wysota; 11th September 2006 at 16:01.

  2. #2
    Join Date
    Aug 2006
    Location
    istanbul, turkey
    Posts
    42
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: PRIMARY Selections

    i'm writing a dictionary just behaves like babylon. (Actually it has finished with this functionality) As babylon translates the highlighted-text to target language i need the highlighted text somehow. Unfortunately Acrobat files does not seem to be used as easy.

    i noticed something, the text editor Kate is working perfectly even if i don't add any code (like timer). i think Kate forwards the signal to all windows perharps. the same behaviour can be seen on QT Assistant's help text. Weird!!??

    yes you're right. timer is the most efficient solution.

    Thanks
    Regards

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: PRIMARY Selections

    It's not Kate or Assistant. It is X11's responsibility to map selections to clipboard selections. It should work with all Qt widgets out of the box too. Maybe it is Acrobat which causes the trouble? Maybe it uses some kind of artificial selection?

  4. #4
    Join Date
    Aug 2006
    Location
    istanbul, turkey
    Posts
    42
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: PRIMARY Selections

    right i've just tested it with other qt applications then it worked. But unfortunately mozilla, open office, and most of the other programs are not qt based (i think so). because they don't work while qt based applications work. i haven't tested it with acrobat, but even babylon does not work acrobat reader in windows

    but i'm sure it doesn't work with non-qt widgets/applications.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: PRIMARY Selections

    Quote Originally Posted by hayati
    but i'm sure it doesn't work with non-qt widgets/applications.
    Hmm... it works fine for me... I tested kate->OO, OO->Firefox, Firefox->kate and OO->kate, all worked well.

  6. #6
    Join Date
    Aug 2006
    Location
    istanbul, turkey
    Posts
    42
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: PRIMARY Selections

    yes they speak each other with no problem. OO-->kate, mozilla-->OO middle click past operations are managed by X11. even my qt widget responses paste from selection buffer with middle mouse button click. this is ok.
    But non qt applications don't emit selectionChanged() signal except to owner and previous owner of selection-buffer/clipboard.
    So my application pastes the selection if you click to the lineEdit with middle mouse button as usual. But i want not to click middle mouse button on my lineEdit. As soon as change in selection buffer occurs than my lineEdit should get the selection in the buffer.
    it should act like babylon, in other words; my qt app's lineEdit widget should get selection buffer changes regardless from any other application - qt or nonqt. It should not need to get the selection buffer via middle button click.

    the point is qt applications( kate, qt assistant) emits selectionChanged() to my application even if my application isn't the owner and previous owner. But mozilla, OO and most of the other programs don't emit this signal. they emit this signal only to owner and prev owner. this statement is standard of X11 as stated qt docs.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: PRIMARY Selections

    Quote Originally Posted by hayati
    So my application pastes the selection if you click to the lineEdit with middle mouse button as usual. But i want not to click middle mouse button on my lineEdit. As soon as change in selection buffer occurs than my lineEdit should get the selection in the buffer.
    it should act like babylon, in other words; my qt app's lineEdit widget should get selection buffer changes regardless from any other application - qt or nonqt. It should not need to get the selection buffer via middle button click.
    Strange requirement, but ok. Use a timer as already suggested. In the timeout slot simply check if the content of the selection changed since last check and act accordingly.

Similar Threads

  1. Sharing Selections between Model and ProxyModel
    By mentat in forum Qt Programming
    Replies: 14
    Last Post: 27th January 2010, 17:31

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
  •  
Qt is a trademark of The Qt Company.