PDA

View Full Version : How to connect my application pages



thefatladysingsopera
16th September 2011, 11:10
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.


void years::on_actionSearch_triggered()
{
//Open the search engine page
}

FelixB
16th September 2011, 11:19
are these pages organizes in tabs? are they dialogs? or "plain" widgets?

thefatladysingsopera
16th September 2011, 11:48
My search engine page for instance has got many widgets for instance table views and forms.



#include "search_engine.h"
#include "ui_search_engine.h"

search_engine::search_engine(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::search_engine)
{
ui->setupUi(this);
//ui has several widgets such as QTableView.
}

search_engine::~search_engine()
{
delete ui;
}

FelixB
16th September 2011, 11:55
ok, your search engine is a QMainWindow. what about "years"? also a QMainWindow? where do you create these Widgets?

thefatladysingsopera
16th September 2011, 12:12
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.

FelixB
16th September 2011, 13:41
it is completely irrelevant what is inside these mainwindows. the question is: where do you create them?

thefatladysingsopera
16th September 2011, 14:07
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?.

meazza
16th September 2011, 15:04
One way would be creating them all in main.cpp and connecting some signals

thefatladysingsopera
16th September 2011, 15:18
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.