Results 1 to 2 of 2

Thread: Determination of properties to control the read-only mode

  1. #1
    Join Date
    Nov 2016
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Determination of properties to control the read-only mode

    I'm a newbie in qt. And i started to read the book. In which i found out the following code.

    Qt Code:
    1. class MyClass : public QObject {
    2. Q_OBJECT
    3. Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
    4. private:
    5. bool m_bReadOnly;
    6. public:
    7. MyClass(QObject* pobj = 0) : QObject(pobj)
    8. , m_bReadOnly(false)
    9. {
    10. }
    11. public:
    12. void setReadOnly(bool bReadOnly)
    13. {
    14. m_bReadOnly = bReadOnly;
    15. }
    16. bool isReadOnly() const
    17. {
    18. return m_bReadOnly;
    19. }
    20. }
    To copy to clipboard, switch view to plain text mode 
    This code about "Determination of properties to control the read-only mode".
    But i didn't understand it. And if someone know something about it. Plz,write down your answer. And where do i have to write this code in which file?
    Last edited by anda_skoa; 19th November 2016 at 12:48. Reason: missing [code] tags

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

    Default Re: Determination of properties to control the read-only mode

    Maybe you should first explain what you don't understand?

    Declaration of the property? Any part of the implementation for the property? Usage of the property?

    Cheers,
    _

Similar Threads

  1. QTextBrowser read only mode
    By Wer_Bn in forum Qt Programming
    Replies: 8
    Last Post: 11th May 2015, 21:03
  2. Replies: 1
    Last Post: 14th October 2013, 07:07
  3. read file in b/w mode
    By eric in forum Qt Programming
    Replies: 3
    Last Post: 11th December 2007, 20:35
  4. How to open a file in Read Write mode
    By merry in forum Qt Programming
    Replies: 13
    Last Post: 16th November 2007, 14:40
  5. read input string --> text mode
    By eleanor in forum Qt Programming
    Replies: 1
    Last Post: 25th October 2007, 18:08

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.