Results 1 to 11 of 11

Thread: Cursor is not showing

  1. #1
    Join Date
    Feb 2006
    Posts
    157
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4

    Unhappy Cursor is not showing

    Hai guys,

    My problem is related with the focuz of cursor ( or say default focuz ).

    What happens that , I have a MainWindow in my application containing the following....

    1. One Qcanvas ( in center )
    2 . One or Dock windows containing tool_box ( in sides )
    3 one Tabed widget in bottom

    ----- Just like VC++ / KDevelp Editors.

    4. No : of menues also....



    Cenario :

    My MainWindow having any of dialogs opened , say foucus is now in one of the QLineEditBox ( cursor is now blinking in a QLineEditBox ) in that dialog.

    Now i will minimize MainWindow ( using window_key + D ) keeping the focus like that.
    But after restoring( maximizing ) the MainWindow , i willnot see the blinking_cursor( which was shown , just before ) in QLineEdit .

    If i am pressing the Tab_Button the foucuz is jumping to the next tab_order widget in the Dialog.

    :


    Can you identify what will be the reason for this hiden focuz .
    Please help me if u can...

    Thanks in advance.

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

    Default Re: Cursor is not showing

    Can you provide a minimal compilable example reproducing the problem?

  3. #3
    Join Date
    Feb 2006
    Posts
    157
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4

    Default Re: Cursor is not showing

    version : Qt 3.3.4
    Platform : windows Xp professional
    Created : In Designer
    Compiled : In DOS prompt

    Here is the minimal compilable example attached here. ( developed using designer , complied in dos promot using qmake & nmake )
    In this example you can see the following

    1. MainWindow having a Menus ( file ,edit , help ...etc ).
    NB: set the QMainWindow ->setFoucusPolicy( QWidget::NoFocus )

    2. In File_menu you can see one item ( JustTestingDlg )
    3. If you click on JustTestingDlg, you will see a QDialog with some widgets. ( linedit, buttons..etc )

    First senario( Working ) :
    1. Run the application
    2. Then MainWindow comes
    3. Then click on JustTestingDlg( Menu_Item in MainWindow )
    4. Now you will see a QDialog with 2 lineEditbox, 3 pushbuttons....etc
    5. place the cursor in first QLineEditBox ( say Name ).
    6. Minimise the application using window_key + D. now the applicaiotn will be minimized, you can see only your desktop.
    7. Now Restore/maximise the applicaiton, check where is the cursor now......??????
    8. Now the cursor is in the same position( in Name lineEditBox ) where we left the cursor before minimize the applicaiton.

    ie; this cenario is working properly as we set the propery of focuspolicy = NoFocus.

    Second senario( Problem ) :
    1. change the QMainwindow's property setFoucusPolicy( QWidget::StrongFocus ).
    2. Now run the same applicaiton.
    3 Take the QDialog by clicking in JustTestingDlg ( Menu Item).
    4. place the cursor in first QLineEditBox ( say Name ).
    5. Minimise the applicaiton using the window_key + D. now the applicaiotn will be minimized, you can see only your desktop.
    6. Now Restore/maximise the applicaiton, check where is the cursor now......??????
    7. Now the cursor is not showing any where in QLineEditBox ( Name ). But if you pressing the tab_button, then the focus will be jump to the widget which is next to QLineEditBox( Name ).


    Note that if i am changing this setFouspolicy( QWidget::NoFocus ) in my real application ( what i have mentioned in previous thread ), then also it's not grabing the focus back to the QDialogs after restoring/maximising.
    please tell me why this fous is working differently just because of this focuspolicy.
    Please help me...!!!!

    Thanks in advance
    Attached Files Attached Files
    Last edited by joseph; 20th December 2006 at 08:32.

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

    Default Re: Cursor is not showing

    Under Linux it works correctly - the line edit still has focus after restoring the window. Maybe someone can verify your problem under Windows.

  5. #5
    Join Date
    Feb 2006
    Posts
    157
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4

    Default Re: Cursor is not showing

    Did you try both case
    Qt Code:
    1. 1. setFocusPolicy( NoFocus )
    2. 2. setFocusPolicy( StrongFocus )
    To copy to clipboard, switch view to plain text mode 
    In both cases is it working properly....??
    Last edited by wysota; 20th December 2006 at 10:25. Reason: changed [html] to [code]

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

    Default Re: Cursor is not showing

    Yes, the behaviour was the same in both cases.

  7. #7
    Join Date
    Feb 2006
    Posts
    157
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4

    Unhappy Re: Cursor is not showing

    But i have tried this property in windows


    Qt Code:
    1. setFocusPolicy( NoFocus ) // Now works properly ie; it grabs the focus after restoring
    2. setFocusPolicy( StrongFocus ) // Not grabing the focus to Dialog , after restoring.
    To copy to clipboard, switch view to plain text mode 


    Is there any solution....???

    please help me
    Last edited by jacek; 20th December 2006 at 14:43. Reason: changed [html] to [code]

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

    Default Re: Cursor is not showing

    Do you need that StrongFocus? Have you tried using a focus proxy?

  9. #9
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Thanks
    76
    Thanked 37 Times in 32 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Cursor is not showing

    Since you have a commercial version, You should ask the trolls
    We can't solve problems by using the same kind of thinking we used when we created them

  10. #10
    Join Date
    Feb 2006
    Posts
    157
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4

    Default Re: Cursor is not showing

    Is there anybody who can test my sample code in windows and give me reply...??

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Cursor is not showing

    Please, use [code] tags instead of [html].

Similar Threads

  1. Replies: 1
    Last Post: 5th November 2006, 23:50
  2. Problem showing raw images
    By wkit23 in forum Qt Programming
    Replies: 5
    Last Post: 8th September 2006, 13:33
  3. Replies: 4
    Last Post: 10th May 2006, 22:37
  4. svg icons not showing up
    By ePharaoh in forum Qt Programming
    Replies: 6
    Last Post: 6th April 2006, 15:56
  5. QPixmap designer property not showing up
    By high_flyer in forum Qt Programming
    Replies: 1
    Last Post: 15th March 2006, 19:56

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.