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. Dialog.ui not opening when a variable is declared in Dialog.h
Forum Updated to NodeBB v4.3 + New Features

Dialog.ui not opening when a variable is declared in Dialog.h

Scheduled Pinned Locked Moved Solved General and Desktop
qtcreatorbuttonprogramstop
5 Posts 3 Posters 1.3k 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.
  • L Offline
    L Offline
    Lasith
    wrote on 7 Dec 2017, 07:26 last edited by
    #1

    In my qt c++ aplication I have 2 cpp files namely Dilog.cpp and MianWindow.Cpp! An interface(Dialog.ui) is opened when I click a button in MainWindow.ui! But when I declare a variable(I declared both as private and public) in dialog.h and click the button the Application stops working! When I remove the varaible declared and click the button the apllication works fine! What can be the reason for this?

    J 1 Reply Last reply 7 Dec 2017, 07:45
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 7 Dec 2017, 07:31 last edited by
      #2

      Hi
      What kind of vairable ?
      It sounds very close to impossible what you say :)
      Except if its a pointer. then u can crash the app :)

      L 1 Reply Last reply 7 Dec 2017, 08:23
      0
      • L Lasith
        7 Dec 2017, 07:26

        In my qt c++ aplication I have 2 cpp files namely Dilog.cpp and MianWindow.Cpp! An interface(Dialog.ui) is opened when I click a button in MainWindow.ui! But when I declare a variable(I declared both as private and public) in dialog.h and click the button the Application stops working! When I remove the varaible declared and click the button the apllication works fine! What can be the reason for this?

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 7 Dec 2017, 07:45 last edited by jsulm 12 Jul 2017, 07:50
        #3

        @Lasith Sorry, but from such a description it is simply impossible to say what is wrong. Why don't you post your code?
        "stops working" - what does this mean? What EXACTLY stops working?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • M mrjj
          7 Dec 2017, 07:31

          Hi
          What kind of vairable ?
          It sounds very close to impossible what you say :)
          Except if its a pointer. then u can crash the app :)

          L Offline
          L Offline
          Lasith
          wrote on 7 Dec 2017, 08:23 last edited by
          #4

          @mrjj Thanx for the advice! There was a gloabal variable and local variable with same name leading to the crash! :O

          M 1 Reply Last reply 7 Dec 2017, 08:43
          0
          • L Lasith
            7 Dec 2017, 08:23

            @mrjj Thanx for the advice! There was a gloabal variable and local variable with same name leading to the crash! :O

            M Offline
            M Offline
            mrjj
            Lifetime Qt Champion
            wrote on 7 Dec 2017, 08:43 last edited by
            #5

            @Lasith
            Oh, thats a classic :)

            1 Reply Last reply
            0

            1/5

            7 Dec 2017, 07:26

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved