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. [solved]cmd/*cmd

[solved]cmd/*cmd

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 1.8k 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.
  • T Offline
    T Offline
    tecky
    wrote on last edited by
    #1
    1. what is the different between:
      @
      QPushButton cmd("ADD");
      QPushButton *cmd = new QPushButton("ADD");
      @

    2. why in this line "*" is required :
      @
      QObject::connect(&*cmd, SIGNAL(clicked()),
      @

    but in this dont:

    @
    l->addWidget(cmd);
    @

    P.S. after previewing post i pressed "ctrl+r" ,habitually (refresh page) hahaha

    1 Reply Last reply
    0
    • S Offline
      S Offline
      stereomatching
      wrote on last edited by
      #2
      @QPushButton cmd("ADD"); //the resource is allocated on stack
      QPushButton *cmd = new QPushButton("ADD"); //the resource is allocated on heap@
      

      you could use directly if cmd is a pointer, using "&*" is weird even it work
      @QObject::connect(cmd, SIGNAL(clicked()),@

      Please pick a good book of C++--recommend c++ primer 5
      if you are running out of time, try "essential c++"

      1 Reply Last reply
      0
      • JeroentjehomeJ Offline
        JeroentjehomeJ Offline
        Jeroentjehome
        wrote on last edited by
        #3

        Hmm, basic C++ issue. Another good book is: Introduction to C++ with Qt. Gives perfect education of C++ while using the basics of Qt

        Greetz, Jeroen

        1 Reply Last reply
        0
        • JeroentjehomeJ Offline
          JeroentjehomeJ Offline
          Jeroentjehome
          wrote on last edited by
          #4

          btw, mark this topic as [SOLVED] in your title!

          Greetz, Jeroen

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tecky
            wrote on last edited by
            #5

            ty all
            (im rly running out of time and have bad c++ knowledge, trying to learn Qt and C++ at the same time)
            but the main problem in choosen book: i have bad english (russian) , so i need good rus book

            1 Reply Last reply
            0
            • Q Offline
              Q Offline
              qxoz
              wrote on last edited by
              #6

              Hi!
              I can recommend you:
              "Язык программирования C++":http://www.ozon.ru/context/detail/id/2988768/
              "Объектно-ориентированное программирование в C++":http://www.ozon.ru/context/detail/id/1313520/

              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