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]Opening of same independed sub_mainwindows from a mainwindow
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]Opening of same independed sub_mainwindows from a mainwindow

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

    Hi,

    I trying to develop an application that needs to open from my mainwindow
    some other mainwindows.(lets call them submainwindows)

    My problem is that every time i open a new submainwindow my
    previews submainwindow takes the variables of the new one
    (and i don't want this)

    I tried to make an array of this submainwindows, so that everyone
    will be separate than the others...
    but this way my problem is that the compiler gives me an error
    that may not be initialized.

    Does anybody can help me with this?

    PS: I would prefer not to use an array of mainwindows
    (but if it is necessary i will do it)

    Thank you in advance
    Kostis

    Using:Qt Creator 2.4.1 under UBUNTU

    1 Reply Last reply
    0
    • P Offline
      P Offline
      prady_80
      wrote on last edited by
      #2

      From your problem, there seems to be a parent child relationship between the mainwindow and the so called sub windows. If that is not required you should consider them to be re-parented. i.e remove the parent child relationships and see.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        koleygr
        wrote on last edited by
        #3

        Thank you prady_80,
        I will try to learn about this relation.. ( Since then, I just observe that they probably have not that kind of
        relationship...) In their header file is:
        @public:
        explicit MySubMainWindow(QWidget *parent = 0);@

        I think that my problem is that in the cpp file before Widget start, i define some parameters that i need...
        (So they are probably external for my whole program)
        I doing this because i haven't find a better solution to pass argument in the SLOTS...
        Probably is time to find another way...

        Thank you anyway,
        I will check the relationship of QWidgets too...

        Using:Qt Creator 2.4.1 under UBUNTU

        1 Reply Last reply
        0
        • K Offline
          K Offline
          koleygr
          wrote on last edited by
          #4

          Finally i found a better solution and now i dont have a problem...
          Insteed of defining my parameters on the top of the cpp fole, i defined them
          as private in the header...
          So,every new (sub)mainwindow has its own parameters

          Using:Qt Creator 2.4.1 under UBUNTU

          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