Results 1 to 2 of 2

Thread: bool check status from subclass

  1. #1
    Join Date
    Jun 2013
    Posts
    58
    Thanks
    26
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Windows

    Question bool check status from subclass

    Good day,

    Created 2 classes (mainWindow & qlabel)
    I have a variable of type bool in mainWindow class
    How do I check its status from mainWindow's subclass(qlabel)

    Qt Code:
    1. main.cpp
    2. void MainWindow::on_action_yes_triggered()
    3. {
    4. flag3 = true;
    5. }
    To copy to clipboard, switch view to plain text mode 

    in qlabel class
    Qt Code:
    1. if(MainWindow.flag3 == true)
    2. {
    3. //do function
    4. }
    To copy to clipboard, switch view to plain text mode 

    Errors: expected primary expression before '.'
    where am i going wrong

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: bool check status from subclass

    If qlabel is subclass of MainWindow
    Qt Code:
    1. if(flag3 == true)
    To copy to clipboard, switch view to plain text mode 
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  3. The following user says thank you to Santosh Reddy for this useful post:

    ebsaith (18th June 2013)

Similar Threads

  1. Check http server status (inline/offline) with pyqt
    By fkili in forum Qt Programming
    Replies: 1
    Last Post: 9th October 2012, 00:06
  2. Can Qt check current audio status?
    By bizmopeen in forum Qt Programming
    Replies: 3
    Last Post: 5th November 2010, 02:58
  3. Replies: 3
    Last Post: 8th July 2010, 07:41
  4. How to check COM port status?
    By rajesh in forum Qt Programming
    Replies: 1
    Last Post: 2nd December 2009, 17: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, 12: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.