Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. QObject or QAction?
Forum Updated to NodeBB v4.3 + New Features

QObject or QAction?

Scheduled Pinned Locked Moved Unsolved C++ Gurus
2 Posts 2 Posters 269 Views 2 Watching
  • 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    I am making progress and have run into few gotcha.
    I have managed to "find" "grand" QObject by name.
    Now I have
    QObject *pItemObject;

    when I look into debug messages it shows "Type "
    QAction

    My next task is to actually execute pItemObject method , which is QAction.

    I am not sure about the correct syntax to write something like this , in pseudocode:

    pItemObject -> execcute "on_action...."

    I like to receive / need answers :

    1. why my QObject *pItemObject is seen as type QAction ?
    2. assuming it makes no difference anyway , how do I physically , actual code please, code

    pItemObject -> execute "on_action...." ?

    Thanks very much and I do appreciate all the help I have received from forum members so far.

    6546e65f-bcd7-4ad9-b4f3-876af09c1688-image.png

    1 Reply Last reply
    0
    • Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote on last edited by
      #2
      QAction *action = qobject_cast<QAction *>(pItemObject);
      

      Has been explained to you before.

      Software Engineer
      The Qt Company, Oslo

      1 Reply Last reply
      2
      • Christian EhrlicherC Christian Ehrlicher referenced this topic on
      • Christian EhrlicherC Christian Ehrlicher referenced this topic on

      • Login

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