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
QtWS25 Last Chance

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
  • 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 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?

    jsulmJ 1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on 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
      0
      • L Lasith

        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?

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by jsulm
        #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
        • mrjjM mrjj

          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 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

          mrjjM 1 Reply Last reply
          0
          • L Lasith

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

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Lasith
            Oh, thats a classic :)

            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