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. Problem with transform of pointer
Forum Updated to NodeBB v4.3 + New Features

Problem with transform of pointer

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 2.5k Views 1 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.
  • R Offline
    R Offline
    Ruzik
    wrote on last edited by
    #1

    I have parent class and widget, and in class of this widget i write
    @ RizekColorManager * rcm;
    rcm = qobject_cast<RizekColorManager*>(parent());
    if (rcm)
    rcm->setWindowTitle("asd");@
    There no some mistakes, but there are doesnt work, why?
    Advance thanks for your help!

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DenisKormalev
      wrote on last edited by
      #2

      Are you sure that parent of your widget is RizekColorManager instance?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        steno
        wrote on last edited by
        #3

        RizekColorManager has to derive or indirectly derive from QObject and must also have the Q_Object macro according to Qt Assistant.

        1 Reply Last reply
        0
        • F Offline
          F Offline
          Franzk
          wrote on last edited by
          #4

          For a widget, parent has to be a widget. The problem is probably that the parent widget is not actually the expected RizekColorManager.

          "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • R Offline
            R Offline
            Ruzik
            wrote on last edited by
            #5

            Many thanks for your help, I did not consider object CentralWidget

            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