Results 1 to 6 of 6

Thread: Check FOCUS-status on Multiple Windows(sub-forms)

Hybrid View

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

    Default Re: Check FOCUS-status on Multiple Windows(sub-forms)

    You could keep the windows in a list or map so you can always access any of them.

    The focus tracking could either be done by the sub windows and signalled to the main window or through an event filter.

    Cheers,
    _

  2. #2
    Join Date
    Jun 2013
    Posts
    46
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Windows
    Thanks
    24

    Default Re: Check FOCUS-status on Multiple Windows(sub-forms)

    Thanks

    Though, How do I create a List of Windows
    Also in the sub window, where do I check to see its status (How do I create a slot on a "window" to see if focus == true);

    If possible provide me with an example or link to a similar example

    Kind Regards

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

    Default Re: Check FOCUS-status on Multiple Windows(sub-forms)

    Quote Originally Posted by 2lights View Post
    Though, How do I create a List of Windows
    Qt Code:
    1. QList<miniFormClass*> windows;
    To copy to clipboard, switch view to plain text mode 

    Quote Originally Posted by 2lights View Post
    Also in the sub window, where do I check to see its status (How do I create a slot on a "window" to see if focus == true);
    Windows don't have focus, individual input widgets do.
    See stampede's suggestion of connecting to the application's focusChanged() signal.

    Cheers,
    _

  4. The following user says thank you to anda_skoa for this useful post:

    2lights (16th January 2014)

  5. #4
    Join Date
    Jun 2013
    Posts
    46
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Windows
    Thanks
    24

    Exclamation Re: Check FOCUS-status on Multiple Windows(sub-forms)

    Apologies for the late reply....

    this is what i need...

    From the sub-window created when a button is pressed(Creating several sub-windows based on number of times Button is pressed)
    I Added a check-box on the subwindow
    That when checked it should emit a signal to the main window(Signifying focus status).
    Creating the signal is no problem

    I have a problem defining the SLOT
    Qt Code:
    1. //this is in the main Window .cpp
    2. //The signal is emited from a sub-window (the sub-window is only created when button is pressed)
    3. connect(this, SIGNAL(checked()), this, SLOT(doSomething));
    4. error
    To copy to clipboard, switch view to plain text mode 

    How do i create the slot in mainWindow to pick up the signal from sub-window
    //will pass certain variables from sub-window to main-window via the signal and slot mechanism

    Many thanks
    Last edited by 2lights; 16th January 2014 at 09:26.

Similar Threads

  1. bool check status from subclass
    By ebsaith in forum Newbie
    Replies: 1
    Last Post: 18th June 2013, 13:54
  2. Can Qt check current audio status?
    By bizmopeen in forum Qt Programming
    Replies: 3
    Last Post: 5th November 2010, 03:58
  3. Multiple Forms and vertical layout in forms
    By eva2002 in forum Qt Programming
    Replies: 0
    Last Post: 13th January 2010, 06:05
  4. How to check COM port status?
    By rajesh in forum Qt Programming
    Replies: 1
    Last Post: 2nd December 2009, 18:07
  5. How to check the current status of a service
    By Ankitha Varsha in forum Qt Programming
    Replies: 1
    Last Post: 21st October 2008, 13:55

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