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] QComboBox copy
Forum Updated to NodeBB v4.3 + New Features

[solved] QComboBox copy

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 3.6k 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.
  • P Offline
    P Offline
    p91paul
    wrote on last edited by
    #1

    I've subclassed QComboBox, and I want to create a copy constructor. Is this possible? I've seen the copy constructor exist but it is private, and there is another protected that accepts a QComboBoxPrivate and a QWidget as arguments.
    thanks
    Paolo

    edit: I've seen copy constructor and operator= are declared private explicitly to avoid object copy. this makes things harder =D

    EDIT: guys I love qt. I no more need help, since I want to do this to use qt designer to create comboboxes than transform then in my custom class. Then I discovered widget promotion, and I've seen the light. :D

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      Hi Paolo,
      just as a side note: all QObjects arte copy disabled. Only the data containers (strings, containers, variant, ...) are copy enabled.
      This is by design, as widgets are typically created by new, not by assignment. This is also necassary as the parent child relation ship comes also into the game.

      Think of a QMainWindow with a huge UI insid (many child widgets with child widgets with ...). Copying that will be really complicated, especially as the parent only has a QWidget pointer but the cchild is a QWidget derived class...

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      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