Results 1 to 9 of 9

Thread: How to connect my application pages

  1. #1
    Join Date
    Apr 2011
    Posts
    67
    Thanks
    22
    Thanked 5 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default How to connect my application pages

    I have this application that has five 'pages'.By pages i mean that i have five uniquely designed ui for each i.e i have the (year,league,reports,search engine),all have its own .h,.cpp and a .ui.

    My project is called 'smith' and i have a .h,a .cpp and a .ui as you'ld expect.

    I was wondering how i can open my search engine page from say my years page.

    Qt Code:
    1. void years::on_actionSearch_triggered()
    2. {
    3. //Open the search engine page
    4. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to connect my application pages

    are these pages organizes in tabs? are they dialogs? or "plain" widgets?

  3. #3
    Join Date
    Apr 2011
    Posts
    67
    Thanks
    22
    Thanked 5 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to connect my application pages

    My search engine page for instance has got many widgets for instance table views and forms.


    Qt Code:
    1. #include "search_engine.h"
    2. #include "ui_search_engine.h"
    3.  
    4. search_engine::search_engine(QWidget *parent) :
    5. QMainWindow(parent),
    6. ui(new Ui::search_engine)
    7. {
    8. ui->setupUi(this);
    9. //ui has several widgets such as QTableView.
    10. }
    11.  
    12. search_engine::~search_engine()
    13. {
    14. delete ui;
    15. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by thefatladysingsopera; 16th September 2011 at 12:53.

  4. #4
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to connect my application pages

    ok, your search engine is a QMainWindow. what about "years"? also a QMainWindow? where do you create these Widgets?

  5. #5
    Join Date
    Apr 2011
    Posts
    67
    Thanks
    22
    Thanked 5 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to connect my application pages

    year,league,reports,search engine are all main windows.For instance in the year page i have a qtableview and forms to do the CRUD part.

  6. #6
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to connect my application pages

    it is completely irrelevant what is inside these mainwindows. the question is: where do you create them?

  7. #7
    Join Date
    Apr 2011
    Posts
    67
    Thanks
    22
    Thanked 5 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to connect my application pages

    Quote Originally Posted by FelixB View Post
    it is completely irrelevant what is inside these mainwindows. the question is: where do you create them?
    I see why its an obvious error now to have all those multiple main windows.Where can i create them?.

  8. #8
    Join Date
    Mar 2011
    Posts
    63
    Thanks
    11
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to connect my application pages

    One way would be creating them all in main.cpp and connecting some signals

  9. #9
    Join Date
    Apr 2011
    Posts
    67
    Thanks
    22
    Thanked 5 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to connect my application pages

    Quote Originally Posted by meazza View Post
    One way would be creating them all in main.cpp and connecting some signals
    I realized what i was doing was wrong so i am reading articles on Qt designer and stuff and i would be grateful if someone guided me on where to start if you understand my problem.

Similar Threads

  1. Wait for socket to connect without application hang?
    By hakermania in forum Qt Programming
    Replies: 5
    Last Post: 9th October 2011, 12:03
  2. Replies: 2
    Last Post: 9th May 2011, 11:38
  3. Replies: 3
    Last Post: 8th March 2011, 08:57
  4. Use connect() to a Qt terminal application?
    By hakermania in forum Newbie
    Replies: 4
    Last Post: 27th December 2010, 21:01
  5. My application can't connect to database when deploy it???
    By gtthang in forum Installation and Deployment
    Replies: 1
    Last Post: 15th February 2006, 12:01

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.