Results 1 to 2 of 2

Thread: InputContext Issue

  1. #1
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: InputContext Issue

    I've used the sample code in myinputpanel.cpp and myinputpanelcontext.cpp successfully to bring up a custom widget for spinbox inputs. The spinboxes were part of a widget created in Qt Designer. But, I'm having issues when trying to use the inputcontext mechanism in another place.

    I want to bring up a custom dialog whenever a specified column of a QTableWidget is clicked. The code I'm using to do this:

    Qt Code:
    1. RaceDialog rd;
    2. rd.exec();
    To copy to clipboard, switch view to plain text mode 

    Where RaceDialog is a QDialog built from Qt Designer. It's a simple dialog with a spinbox.

    The dialog is shown when the column is clicked, and when I click on the spinbox input box, my custom widget is presented. But, it doesn't seem to get the focus--I get beeps whenever I click on my custom widget (clicks on the spinbox are still accepted).

    I can't figure out why I have no issues when the spinbox is on the applications central widget, but the input panel doesn't get focus when I dynamically instantiate a dialog with a spinbox on it.

    Is it because the spinbox is on a QDialog instead of a QWidget?

    My slightly modified versions of myinputpanel.cpp, .h, and myinputpanelcontext.cpp, .h are attached (but I think differences from the sample code are irrelevant).

    Thanks,

    Dave Thomas


    Added after 12 minutes:


    I guess it's an event loop thing.

    When I make the RaceDialog static, and use rd->show() instead of rd->exec(), it works ok.

    So, I'll just do that.
    Attached Files Attached Files
    Last edited by davethomaspilot; 23rd May 2013 at 22:18.

  2. The following user says thank you to davethomaspilot for this useful post:


  3. #2
    Join Date
    May 2013
    Posts
    20
    Thanks
    10
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: InputContext Issue

    hi,

    i have tried the attached files but still facing the same issue....

    the inputs are being handled in the myinputpanelcontext.cpp class (found using QDebug) but the LineEdit Where in it has to redirect the inputs are not being done.

Similar Threads

  1. Qt 5.0.1 Issue
    By kiboi in forum Qt-based Software
    Replies: 0
    Last Post: 22nd March 2013, 05:22
  2. InputContext on QDialog
    By Niamita in forum Qt Programming
    Replies: 0
    Last Post: 14th March 2013, 06:21
  3. MS C++ issue
    By sepehr in forum Installation and Deployment
    Replies: 4
    Last Post: 29th December 2008, 23:45
  4. XML issue
    By jbpvr in forum Qt Programming
    Replies: 1
    Last Post: 25th August 2008, 13:01
  5. UI issue.
    By kaushal_gaurav in forum Qt Programming
    Replies: 2
    Last Post: 13th August 2008, 11:41

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.