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. Can we remove Dialog or Mainwindow written on the top of Application output.
Forum Updated to NodeBB v4.3 + New Features

Can we remove Dialog or Mainwindow written on the top of Application output.

Scheduled Pinned Locked Moved Solved General and Desktop
34 Posts 6 Posters 4.2k Views 2 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.
  • A Offline
    A Offline
    Ashutosh_Sachdeva
    wrote on last edited by Ashutosh_Sachdeva
    #22

    @mrjj @jsulm Thanku so much guys for spearing your time and helping. You guys are helping a me lot in learning QT.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Ashutosh_Sachdeva
      wrote on last edited by
      #23

      @jsulm Hi,

      I have one more doubt here as now i have deleted that main-window title and menu bar so if now i want to come back to my previous page then what will be the method to close current page and go back to previous

      1 Reply Last reply
      0
      • JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #24

        Ah well, @mrjj & @jsulm get all the thanks, even when quoting the code I typed into my reply for pre-5.9 which is what the OP needed for his solution (edit whoops, bad hair day :) ). Perhaps I shouldn't have typed in all the stuff it took me time to do....

        A 1 Reply Last reply
        0
        • JonBJ JonB

          Ah well, @mrjj & @jsulm get all the thanks, even when quoting the code I typed into my reply for pre-5.9 which is what the OP needed for his solution (edit whoops, bad hair day :) ). Perhaps I shouldn't have typed in all the stuff it took me time to do....

          A Offline
          A Offline
          Ashutosh_Sachdeva
          wrote on last edited by
          #25

          @JonB
          Hello Sir,

          Thanku so much and i really appreciate that u have speared your precious time to help and it really helpful for me and as a beginner i have a lot of thing to learn from you guys. And also looking forward for more help from you. And sorry that i missed the stuff some how as i saw the top reply and it solved the problem too.

          Thanku once again for the help and looking toward to learn more from you.

          JonBJ 1 Reply Last reply
          1
          • A Ashutosh_Sachdeva

            @JonB
            Hello Sir,

            Thanku so much and i really appreciate that u have speared your precious time to help and it really helpful for me and as a beginner i have a lot of thing to learn from you guys. And also looking forward for more help from you. And sorry that i missed the stuff some how as i saw the top reply and it solved the problem too.

            Thanku once again for the help and looking toward to learn more from you.

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #26

            @Ashutosh_Sachdeva
            Sorry, you are right. I now see @jsulm posted

            If using setWindowFlags you need to keep all other flags:

            setWindowFlags(windowFlags() | Qt::FramelessWindowHint);

            I truly never spotted that he had offered that! My bad! I get tetchy... ;-)

            1 Reply Last reply
            0
            • A Offline
              A Offline
              Ashutosh_Sachdeva
              wrote on last edited by
              #27

              @JonB
              I have one more doubt here as now i have deleted that main-window title and menu bar so if now i want to come back to my previous page then what will be the method to close current page and go back to previous.

              as this->hide will hide the previous page but i want to store the status of current page as if i want to go back i can go back to previous page or my main menu page.

              I hope i'm able to explain my requirement

              JonBJ 1 Reply Last reply
              0
              • A Ashutosh_Sachdeva

                @JonB
                I have one more doubt here as now i have deleted that main-window title and menu bar so if now i want to come back to my previous page then what will be the method to close current page and go back to previous.

                as this->hide will hide the previous page but i want to store the status of current page as if i want to go back i can go back to previous page or my main menu page.

                I hope i'm able to explain my requirement

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by JonB
                #28

                @Ashutosh_Sachdeva
                Deleting title bars does not affect anything.

                While you are dealing with (modal) dialogs the "going back" does not apply, you don't leave the calling page.

                If you have separate windows somewhere, and you want to display one at a time and navigate between them, use QStackedWidget. This will preserve state, and you won't be using hide/show yourself. (Having said that, it will use hide/show internally, using those on windows/widgets does not lose state.)

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  Ashutosh_Sachdeva
                  wrote on last edited by
                  #29

                  @JonB

                  OK, But what i'm asking for ex. i have one menu page and there is one drop down menu, now if i click on one of the item from menu it will take me to that page and now if i want to back to menu page then how can i go as now we have a window without any cross button on the left corner to close the window.

                  "for ex. i saw somewhere if we click right button of the mouse then current page will be closed and it will take us to main menu page back and so on."

                  JonBJ 1 Reply Last reply
                  0
                  • A Ashutosh_Sachdeva

                    @JonB

                    OK, But what i'm asking for ex. i have one menu page and there is one drop down menu, now if i click on one of the item from menu it will take me to that page and now if i want to back to menu page then how can i go as now we have a window without any cross button on the left corner to close the window.

                    "for ex. i saw somewhere if we click right button of the mouse then current page will be closed and it will take us to main menu page back and so on."

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by JonB
                    #30

                    @Ashutosh_Sachdeva

                    • I don't understand your "menus" sometimes a menu seems to mean a dialog and sometimes it seems to mean some dropdown menu. Which is why I said you might wish to change your terminology, for precisely this reason.

                    • As I said, if your "menu" is a "modal dialog" which you call exec() on, afterward you will be back in the calling page.

                    • Yes, if you choose to remove the title bar on a window/dialog which has the close button then you won't have a close button to press, as I mentioned earlier. You will have to provide some other means (button, key press, right-click, whatever you invent) to exit the dialog/window. Or, for a stacked widget, you would typically have links down the lefthand side to allow navigation between pages. I don't know what else to say.

                    "for ex. i saw somewhere if we click right button of the mouse then current page will be closed and it will take us to main menu page back and so on."

                    You would have to implement that yourself, it doesn't come "out-of-the-box".

                    If you really want more help on this, I suggest you clarify what you mean, because reading a post which talks about a "menu" being both a "dropdown" and a "page" makes it impossible (for me) to understand.

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      Ashutosh_Sachdeva
                      wrote on last edited by
                      #31

                      @JonB
                      Ok i will try to be more specific from next time.

                      Now i have created a mouse event to close the current window. But now what where i got stuck is:

                      Suppose you have three pages from first page you triigered to second page and from second page you triggered to third page and now you want to come back to second page from the third page. So how can you hide/close the current page only

                      void Searchpage::mousePressEvent(QMouseEvent *event)
                      {
                      if(event->buttons()== Qt::RightButton)
                      {
                      hide();
                      }
                      }

                      if i'm using the hide function its's hiding the all other pages.

                      JonBJ 1 Reply Last reply
                      0
                      • A Ashutosh_Sachdeva

                        @JonB
                        Ok i will try to be more specific from next time.

                        Now i have created a mouse event to close the current window. But now what where i got stuck is:

                        Suppose you have three pages from first page you triigered to second page and from second page you triggered to third page and now you want to come back to second page from the third page. So how can you hide/close the current page only

                        void Searchpage::mousePressEvent(QMouseEvent *event)
                        {
                        if(event->buttons()== Qt::RightButton)
                        {
                        hide();
                        }
                        }

                        if i'm using the hide function its's hiding the all other pages.

                        JonBJ Offline
                        JonBJ Offline
                        JonB
                        wrote on last edited by JonB
                        #32

                        @Ashutosh_Sachdeva
                        I don't know, you're presumably hiding the wrong page, or you need to reshow the second page (secondPage->show()), or whatever is necessary.

                        Did you look at QStackedWidget? If you can use that it will be better than your potentially-ugly-and-complex list of hides & shows.

                        1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          Ashutosh_Sachdeva
                          wrote on last edited by
                          #33

                          @JonB

                          Yes i have gone through the QStackWidget.

                          And mouse event function is also working fine now .

                          JonBJ 1 Reply Last reply
                          0
                          • A Ashutosh_Sachdeva

                            @JonB

                            Yes i have gone through the QStackWidget.

                            And mouse event function is also working fine now .

                            JonBJ Offline
                            JonBJ Offline
                            JonB
                            wrote on last edited by
                            #34

                            @Ashutosh_Sachdeva
                            Assuming you mean you have changed over to QStackedWidget, isn't it nicer/cleaner than all those show/hides yourself? And it makes code easier to follow. :)

                            1 Reply Last reply
                            1

                            • Login

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