Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt Academy Launch in California!

    [SOLVED]Opening of same independed sub_mainwindows from a mainwindow

    General and Desktop
    2
    4
    1151
    Loading More Posts
    • 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
      koleygr last edited by

      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 Reply Quote 0
      • P
        prady_80 last edited by

        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 Reply Quote 0
        • K
          koleygr last edited by

          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 Reply Quote 0
          • K
            koleygr last edited by

            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 Reply Quote 0
            • First post
              Last post