Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. just curious know. My base class is Qobject. I derive another class from Qobject. can I use the Derive class object in stature?
QtWS25 Last Chance

just curious know. My base class is Qobject. I derive another class from Qobject. can I use the Derive class object in stature?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 497 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    Yash001
    wrote on last edited by
    #1

    class DataRestore : public QObject {
    Q_OBJECT
    };

    mainWindow. h file

    struct InstrumentHandler {
    	typedef struct 
    	{
    		RecoveryManage dataMange;
    		DataRestore *recoverChannelStore;
    	}RecoveryInfo;
    	
    	bool isItRecoverData = false;
    	RecoveryInfo recoverData;
    };
    

    can I create member as DataStore object instead of the pointer of the DataStore type?

    if no then, What is Reason behind that?
    note: Data store class is derive from Object.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      It depends whether you are going to copy your structure or not. If so, then no, you can't have your QObject based members as just plain members. See why here.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • Y Offline
        Y Offline
        Yash001
        wrote on last edited by
        #3

        @SGaist Thank you sir.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved