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. [Partially Solved] [Question] How to code and Display 3 Programs in 1 Program with 1 UI?
Forum Updated to NodeBB v4.3 + New Features

[Partially Solved] [Question] How to code and Display 3 Programs in 1 Program with 1 UI?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 1.4k 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.
  • M Offline
    M Offline
    MeerMusik
    wrote on 12 Jan 2014, 22:39 last edited by
    #1

    Evening.

    I am new to C++ and Qt and I have a very noobish Question.

    I am looking for "the best" way to create 1 Program which has different Funtions.

    Function A: A very simple File Editor / Importer / Exporter
    Function B: A ListView or something similar to Display Weblinks and Descriptions (readed from a Text File)
    Function C: A QWebView to Open and Display the SSL Weblinks

    I thought using a TabView would be a good way to go: Function A -> Tab A / Function B -> Tab B and so on.

    When the first 3 Functions are working, i have to implement more which also need to be Displayed. One of them is a REST/JSON/SQL Routine Mix.

    But:
    When someone clicks multiple Weblinks in "Linklist", the QWebView should display them all. But i fear the Screen would be "overloaded". Is there a better approach? Should i use something like MDI or anything else? The whole thing must be compatible from Windows 7/8 down to Windows XP Machines. No use on a MAC but maybe at some Point on Linux.

    Some Problem i ran into also:
    When i create the specific .H + .CPP Files, i always use the "depends on QObject" thing. And when i create the Menus not in Mainwindow.cpp but i.e. in Editor.cpp, i always have the Problem that i cant compile at all.

    Qt tells me that the Ui is not defined [Sorry i cant remember the correct Message yet].
    But i when create all the Stuff in the Mainwindow.cpp, everxthing works fine.

    Seems i am doing some very dumb beginner Error somewhere.

    Oh yes: I use QT 5.2 with the latest offical Creator. Both of them self compiled with MingW.

    Thank You!
    Oliver

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jeroentjehome
      wrote on 13 Jan 2014, 13:10 last edited by
      #2

      Hi,
      The Menus that you want to display are part of the MainWindow?? So, yes, the ui pointer to the menu's and other GUI elements is private. Other classes can't reach it. You could pass your menu pointer to the class that constructs the menu. Or make the ui pointer itself protected or public, however this is not recommended! (gives bad and ugly code).

      Using a MDI gives lots of work. You could also place the opened Weblinks in dialogs that are non modal. They are still in the same event handler loop as the mainwindow, so easy to control. When the user clicks the mainwindow, the non modal dialogs gets pushed to the background. You are always able to pop them back if needed.

      For you general idea about using the QObject derived stuff for a new class:
      A QObject only makes your class available for the QObject handling stuff that makes Qt great. You are able to assign parents and child relationships. Without the QObject you are not able to use the signal/slot mechanism and lots more of cool QObject things.

      Greetz, Jeroen

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dheerendra
        Qt Champions 2022
        wrote on 13 Jan 2014, 14:08 last edited by
        #3

        I felt it too much for answering the question. Here design related item and issues are mixed up. How about you providing the issues as separate questions. We can help you.

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on 13 Jan 2014, 14:19 last edited by
          #4

          Hello... Open Qt 5.2 and search for examples -> Config Dialog Example... I guess thats what you need... Three buttons, three frames...

          Your problem about UI... Its located in MainWindow "private", so other classes can't access it... As far I know moving it out of "private" is not so smart and you will have to do some stuff before other classes will be able to access it...

          1 Reply Last reply
          0
          • M Offline
            M Offline
            MeerMusik
            wrote on 16 Jan 2014, 09:51 last edited by
            #5

            Hello and Sorry for the late reply.

            I will create specific Threads when i need some specific answers. I have only hoped for some General tips.

            Thanks and have a good Day everyone :)
            Oliver

            1 Reply Last reply
            0
            • J Offline
              J Offline
              Jeroentjehome
              wrote on 16 Jan 2014, 13:28 last edited by
              #6

              If this helped you enough, place [SOLVED] in front of your first post. This to indicate that the question is solved and other forum users may void reading it.

              Greetz, Jeroen

              1 Reply Last reply
              0

              5/6

              16 Jan 2014, 09:51

              • Login

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