Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 6

Qt-interest Archive, June 2007
Error when a new widget is added


Message 1 in thread

i'm attaching the header file and the mainwindow.cpp file.

here is the gist of what is happening

in mainwindow.h you have the declaration of various pointers for widgets.

     QWidget* whiteBackgroundWidget;
    QWidget* tabProductSelectionWidget;
    QWidget* tabBrowseCatalogWidget;
    ......
    .......
    QWidget* pixBrowseCatalogTop;
    QWidget* pixBrowseCatalogMid;

    QPushButton* btBrowseCatalogDetailsTop;

and then you finally see :

    float* data1;

followed by some commented code.

now in the constructor for this class : what you can see is that there's a
function called createWidgets() where each of these widgets are
instantiated. and followed by setWidgets where all of these widgets are
given their final positions , depending upon the state of the system.

anyways setWidgets is not important.

if i comment out the line float* data1 in the header file, everything runs
smoothly and the code executes as it should with appropriate results. but as
soon as i uncomment the code (even if i instantiate the pointer in the
mainwindow.cpp file, and dont use it ).. the application crashes somewhere
in the middle of the createWidgets() function. the exact error message
generated by VC++ is :

Unhandled exception at 0x087bf23f in TabApp28.exe : 0xC0000005: Access
violation writing location 0x00000004.

QWidget::create: Failed to create window (Cannot create a top-level child
window.)
QWidget::create: Failed to create window (Cannot create a top-level child
window.)
QWidget::create: Failed to create window (Cannot create a top-level child
window.)
QWidget::create: Failed to create window (Cannot create a top-level child
window.)
QWidget::create: Failed to create window (Cannot create a top-level child
window.)
QWidget::create: Failed to create window (Cannot create a top-level child
window.)
QWidget::create: Failed to create window (Cannot create a top-level child
window.)
QWidget::create: Failed to create window (Cannot create a top-level child
window.)
QWidget::create: Failed to create window (Cannot create a top-level child
window.)
QWidget::create: Failed to create window (Cannot create a top-level child
window.)
First-chance exception at 0x087bf23f in TabApp28.exe : 0xC0000005: Access
violation writing location 0x00000004.
Unhandled exception at 0x087bf23f in TabApp28.exe: 0xC0000005: Access
violation writing location 0x00000004.

any ideas that comes to your mind is really looked for.

cheers
Harsh






On 6/25/07, Harsh Vardhan <vardhan.harsh@xxxxxxxxx> wrote:
>
> chal mai dekhta hoon isse. try karta hoon , agar nahi hota hai to fir se
> code bhejta hoon.
>
> khair tere ko compile karne ke liye to QT chahiye hoga along with MS
> Visual studio. to bus mai code snippet bhej paaonga. isiliye apne end pe hi
> try karta hoon
>
> cheers
> Harsh
>
>
> On 6/25/07, Aseem Rastogi < aseem@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> >
> >
> > http://publib.boulder.ibm.com/infocenter/macxhelp/v6v81/index.jsp?topic=/com.ibm.vacpp6m.doc/language/ref/clrc05snewhnd.htm
> > http://msdn2.microsoft.com/en-us/library/5fath9te(VS.80).aspx
> > <http://msdn2.microsoft.com/en-us/library/5fath9te%28VS.80%29.aspx>
> >
> > sample code:
> >
> > #include <new.h>
> > void new_handler() {
> >   printf ("new_handler() : out of memory !!!\n");
> >   abort();
> > }
> >
> > int main ()
> > {
> >     set_new_handler(&new_handler);
> > }
> >
> > This can be helpful in catching no memory scenarios.
> >
> > -Aseem.
> >
> >
>
>
> --
> Harsh Vardhan
> For Mechartes Researchers Pvt. Ltd.
> TBIU , IIT Delhi, New Delhi - 110016
> +91 - 93120 - 72096
> http://www.mechartes.com




-- 
 [ signature omitted ] 
#ifndef MainWindow_H
#define MainWindow_H
#include <QMainWindow>
#include <QtOCCViewerContext.h>
#include <QtOCCViewWidget.h>
#include <Aspect_RectangularGrid.hxx>
#include <QtOCCInputOutput.h>
#include "tabwidget.h"
#include "masterlist.h"
#include "VerticalButtons.h"
#include "norwegianwoodstyle.h"
#include "customCombo.h"




class QAction;
class QRadioButton;
class QTabWidget;
class QMenu;
class QVBoxLayout;
class QHBoxLayout;
class QLabel;
class QComboBox;
class QPushButton;
class QSpacerItem;
class QFile;
class QDir;
class QProgressBar;
class QTableWidget;
class QPixmap;
class QPrinter;
class QPainter;
class QRectF;
class QFrame;


class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    MainWindow();
signals:

private slots:
	void changeLoc();
	void actOnbtProductSelectionExpansion();
	void incState();

private:
	void createWidgets();
	static void setTexture(QPalette &palette, QPalette::ColorRole role,
                           const QPixmap &pixmap);

	void setWidgets();

	int ResolutionWidth;
	int ResolutionHeight;
	int state;
	int MAX_STATE;

	QWidget* whiteBackgroundWidget;
	QWidget* tabProductSelectionWidget;
	QWidget* tabBrowseCatalogWidget;
	QWidget* tabExportOptionsWidget;
	QWidget* verticalBlankBlueWidget;
	QWidget* verticalBlankGreyWidget;
	QLabel*  lblProductName;

	

	QPushButton* btProductSelection;
	QPushButton* btBrowseCatalog;
	QPushButton* btExportOptions;

	
	QWidget* wgtLeftRuler;
	QWidget* wgtRightRuler;
	QWidget* wgtUpRuler;
	QWidget* wgtDownRuler;
	QWidget* wgtBlankScreen;

	///*
	QFrame* frmProductSelection;
	QFrame* frmProductSelectionLabel;
	QLabel* lblProductSelection;
	QPushButton* btProductSelectionExpansion;

	QComboBox* cmbProductSelectionProductRange;
	QComboBox* cmbProductSelectionCasingSize;
	QComboBox* cmbProductSelectionHoleSize;
	QPushButton* btProductSelectionPreview;

	QWidget* wgtSeparatorTop;

	QFrame* frmProductSearch;

	QLabel* lblProductSearch;
	QPushButton* btProductSearchExpansion;
	QFrame* frmProductSearchLabel;

	QComboBox* cmbProductSearchProductRange;
	QComboBox* cmbProductSearchCasingSize;
	QComboBox* cmbProductSearchHoleSize;
	QPushButton* btProductSearchPreview;

	QWidget* wgtSeparatorBottom;
	//*/

	QPushButton* testInterface;

	QPushButton* btZoom;
	
	QPushButton* btRotate;
	QPushButton* btPan;
	QPushButton* btFitAll;
	
	QPushButton* btViewBack;
	QPushButton* btViewFront;
	QPushButton* btViewRight;

	//QPushButton* anyButton;
	
	QPushButton* btViewTop;
	QPushButton* btViewAxo;

	
	QPushButton* btViewWireframe;
	QPushButton* btViewShaded;

	QPushButton* btChangeLights;
	QPushButton* btMeasure;
	QPushButton* btChangeBackgroundColor;

	QPushButton* btViewInfo;

	///*
	QWidget* pixProductPreview;
	QPushButton* btProductSelectionComponentDetails;
	QLabel* lblProductSelectionComponentDetails;
	QPushButton* btProductSelectionLaunch;
	QFrame* frmPixProductPreview;

	QWidget* wgtProductSelectionComponents;
	QWidget* wgtProductSelectionProgress;
	QRadioButton** radBtProductSelectionComponents;

	QWidget* pixProductSearch;
	QPushButton* btProductSearchLeft;
	QPushButton* btProductSearchRight;
	QFrame* frmPixProductSearchPreview;
	QPushButton* btProductSearchComponentDetails;
	QLabel* lblProductSearchComponentDetails;
	QPushButton* btProductSearchLaunch;

	QWidget* wgtProductSearchComponents;
	QWidget* wgtProductSearchProgress;
	QRadioButton** radBtProductSearchComponents;
	//*/

	
	QPushButton* btBrowseCatalogUp;
	QPushButton* btBrowseCatalogDown;

	QFrame* frmBrowseCatalogTopOuter;
	QFrame* frmBrowseCatalogTopInner;
	//QLabel* testLabel1;

		
	QFrame* frmBrowseCatalogMidOuter;
	QFrame* frmBrowseCatalogMidInner;


	QWidget* pixBrowseCatalogTop;
	QWidget* pixBrowseCatalogMid;
	
	QPushButton* btBrowseCatalogDetailsTop;

	float* data1;
	
	//QPushButton* btBrowseCatalogDetailsMid;
	/*
	QLabel* lblBrowseCatalogDetailsTop;
	QLabel* lblBrowseCatalogDetailsMid;
	*/
	

	//QFrame* frmBrowseCatalogBotOuter;
	//QFrame* frmBrowseCatalogBotInner;
	//QWidget* pixBrowseCatalogBot;
	//QPushButton* btBrowseCatalogDetailsBot;
	//QLabel* lblBrowseCatalogDetailsBot;







	
	

	






    //QStatusBar *statusbar;

	QtOCCViewWidget*     myOCC; // the central view widget of OCC
	QtOCCViewerContext*  myVC;  // The viewing context of OCC. 
	
	//QtOCCInputOutput* reader;
	
	//QString* myLastFolder;
		
	//masterList* Master;
	
};
#endif

#pragma region Include Files
#pragma region Include Files
#include <QtGui>
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QComboBox>
#include <QtGui/QHBoxLayout>
#include <QtGui/QLabel>
#include <QtGui/QMainWindow>
#include <QtGui/QMenu>
#include <QtGui/QMenuBar>
#include <QtGui/QPushButton>
#include <QtGui/QRadioButton>
#include <QtGui/QSpacerItem>
#include <QtGui/QStatusBar>
#include <QtGui/QTabWidget>
#include <QtGui/QVBoxLayout>
#include <QtGui/QWidget>
#include <QtGui/QtGui>
#include <QtGui/QProgressBar>
#include <QtGui/QFileDialog.h>
#include <QtGui/QFrame>
#include <QString>


#include <QtCore/QTextStream>
#include <QtCore/QFileInfo>
#include <Geom_Transformation.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include <QtCore/QString>

#include <Aspect_RectangularGrid.hxx>
#include "MainWindow.h"
#include "linklist.h"
#include "partdetails.h"


#pragma endregion

void LoadBottle(Handle_AIS_InteractiveContext theContext);

MainWindow::MainWindow()
{

	state = 17;
	MAX_STATE = 18;
	QSize size(1024, 768);
    size = size.expandedTo(minimumSizeHint());
    resize(size);
	ResolutionWidth=this->width();
	ResolutionHeight=this->height();
	createWidgets();
	setWindowTitle("Mechartes EDM Tool");
	setMinimumSize(160, 160);
	showMaximized();
	//setCentralWidget(tabWidget);
	statusBar()->showMessage(tr("Casewell Product Line"));
	//loadAssembly->setVisible(false);
	setWidgets();
	
	

   
  
}

void MainWindow::createWidgets()
{
	//#pragma region Added Widgets
	whiteBackgroundWidget = new QWidget(this);
	verticalBlankBlueWidget = new QWidget(this);
	verticalBlankGreyWidget = new QWidget(this);
	
	
	
	lblProductName = new QLabel(this);
	wgtLeftRuler = new QWidget(this);
	wgtDownRuler = new QWidget(this);
	wgtUpRuler = new QWidget(this);
	wgtRightRuler = new QWidget(this);
	myVC  = new QtOCCViewerContext();
	myOCC = new QtOCCViewWidget(this);
	myOCC->initialize( myVC->getContext() );

	tabProductSelectionWidget = new QWidget(this);
	wgtBlankScreen = new QWidget(this);
	
	tabBrowseCatalogWidget = new QWidget(this);
	
	tabExportOptionsWidget = new QWidget(this);

	btProductSelection = new QPushButton(this);
	btBrowseCatalog = new QPushButton(this);
	btExportOptions = new QPushButton(this);
	///*
	frmProductSelection = new QFrame(this);
	frmProductSelectionLabel = new QFrame(this);
	lblProductSelection = new QLabel(this);
	btProductSelectionExpansion = new QPushButton(this);

	cmbProductSelectionProductRange = new QComboBox(this);
	cmbProductSelectionCasingSize = new QComboBox(this);
	cmbProductSelectionHoleSize  = new QComboBox(this);
	btProductSelectionPreview = new QPushButton(this);
	wgtSeparatorTop = new QWidget(this);
	wgtSeparatorBottom = new QWidget(this);
	frmProductSearch = new QFrame(this);
	lblProductSearch = new QLabel(this);
	btProductSearchExpansion = new QPushButton(this);
	frmProductSearchLabel = new QFrame(this);

	cmbProductSearchProductRange = new QComboBox(this);
	cmbProductSearchCasingSize = new QComboBox(this);
	cmbProductSearchHoleSize = new QComboBox(this);
	btProductSearchPreview = new QPushButton(this);
	//*/
	testInterface = new QPushButton(this);
	

	btZoom = new QPushButton(this);
	
	btRotate = new QPushButton(this);
	btPan = new QPushButton(this);
	btFitAll = new QPushButton(this);
	
	btViewBack = new QPushButton(this);
	btViewFront = new QPushButton(this);
	btViewRight = new QPushButton(this);
	
	btViewTop = new QPushButton(this);
	
	btViewAxo = new QPushButton(this);

	
	btViewWireframe = new QPushButton(this);
	btViewShaded = new QPushButton(this);

	btChangeLights = new QPushButton(this);
	btMeasure = new QPushButton(this);
	btChangeBackgroundColor = new QPushButton(this);

	btViewInfo = new QPushButton(this);
///*
	pixProductPreview = new QWidget(this);
	btProductSelectionComponentDetails = new QPushButton(this);
	lblProductSelectionComponentDetails = new QLabel(this);
	btProductSelectionLaunch = new QPushButton(this);
	frmPixProductPreview = new QFrame(this);

	
	wgtProductSelectionProgress = new QWidget(this);
	wgtProductSelectionComponents = new QWidget(this);

	pixProductSearch = new QWidget(this);
	btProductSearchLeft = new QPushButton(this);
	btProductSearchRight = new QPushButton(this);
	frmPixProductSearchPreview = new QFrame(this);
	btProductSearchComponentDetails = new QPushButton(this);
	lblProductSearchComponentDetails = new QLabel(this);
	btProductSearchLaunch = new QPushButton(this);

	wgtProductSearchComponents = new QWidget(this);
	wgtProductSearchProgress = new QWidget(this);

	#pragma endregion
/*

	btBrowseCatalogUp = new QPushButton(this);
	btBrowseCatalogDown = new QPushButton(this);
	
	frmBrowseCatalogTopOuter = new QFrame(this);
	frmBrowseCatalogTopInner = new QFrame(this);
	
	frmBrowseCatalogMidOuter = new QFrame(this);
	frmBrowseCatalogMidInner = new QFrame(this);

	
	pixBrowseCatalogTop = new QWidget(this);
	pixBrowseCatalogMid = new QWidget(this);
	
	btBrowseCatalogDetailsTop= new QPushButton(this);
	btBrowseCatalogDetailsMid = new QPushButton(this);

	lblBrowseCatalogDetailsTop = new QLabel(this);
	lblBrowseCatalogDetailsMid = new QLabel(this);


	
	frmBrowseCatalogBotOuter = new QFrame(this);
	frmBrowseCatalogBotInner = new QFrame(this);

	pixBrowseCatalogBot = new QWidget(this);
	btBrowseCatalogDetailsBot = new QPushButton(this);
	lblBrowseCatalogDetailsBot = new QLabel(this);
	*/
	


	connect(testInterface,SIGNAL(clicked()),this,SLOT(incState()));
	connect(btProductSelection,SIGNAL(clicked()),this,SLOT(changeLoc()));
	connect(btProductSelectionExpansion,SIGNAL(clicked()),this,SLOT(actOnbtProductSelectionExpansion()));

}

void MainWindow::setTexture(QPalette &palette, QPalette::ColorRole role,
                                    const QPixmap &pixmap)
{
    for (int i = 0; i < QPalette::NColorGroups; ++i) {
        QColor color = palette.brush(QPalette::ColorGroup(i), role).color();
        palette.setBrush(QPalette::ColorGroup(i), role, QBrush(color, pixmap));
    }
}


void MainWindow::setWidgets()
{
	QColor color(63,58,52);
	QPalette palette;
	palette.setColor(this->backgroundRole(),color);

	this->setPalette(palette);
	this->setAutoFillBackground(true);

	int noOfComponents = 5;

	
	
	delete wgtProductSelectionComponents;
	wgtProductSelectionComponents = new QWidget(this);
	radBtProductSelectionComponents = new QRadioButton* [noOfComponents];
	for (int i=0;i< noOfComponents;i++)
	{
		radBtProductSelectionComponents[i] = new QRadioButton(wgtProductSelectionComponents);
		radBtProductSelectionComponents[i]->setText(tr("Not Selected"));
	}

	delete wgtProductSearchComponents;
	wgtProductSearchComponents = new QWidget(this);
	radBtProductSearchComponents = new QRadioButton* [noOfComponents];
	for (int i=0;i< noOfComponents;i++)
	{
		radBtProductSearchComponents[i] = new QRadioButton(wgtProductSearchComponents);
		radBtProductSearchComponents[i]->setText(tr("Not Selected"));
	}
	


	#pragma region Definition of Screen Resolution
	int workingWidth = ResolutionWidth;
	int workingHeight = 0.83203125 * ResolutionHeight;
	int startingPointX = 0;
	int workingArea = ResolutionHeight - statusBar()->height();
	int startingPointY = (workingArea - workingHeight)/2;
	#pragma endregion 
	

	#pragma region White Background Widget Placing and Look
	int whiteBackgroundWidgetY;
	int whiteBackgroundWidgetX;
	int whiteBackgroundWidgetHeight;
	int whiteBackgroundWidgetWidth;
	if (state == 1 ) 
	{
		whiteBackgroundWidgetY = startingPointY + (68.0/639.0)*workingHeight;
		whiteBackgroundWidgetX = startingPointX + (13.0/1024.0)*workingWidth;
		whiteBackgroundWidgetHeight = (596.0 - 68.0)/(639.0)*workingHeight;
		whiteBackgroundWidgetWidth  = (1024.0 - 13.0)/(1024)*workingWidth;
	}
	else if (state >=2 && state <=18)
	{
		whiteBackgroundWidgetY = startingPointY + (68.0/639.0)*workingHeight;
		whiteBackgroundWidgetX = startingPointX + (208.0/1024.0)*workingWidth;
		whiteBackgroundWidgetHeight = (596.0 - 68.0)/(639.0)*workingHeight;
		whiteBackgroundWidgetWidth  = (1024.0 - 208.0)/(1024)*workingWidth;
	}

	whiteBackgroundWidget->setGeometry(whiteBackgroundWidgetX,whiteBackgroundWidgetY,whiteBackgroundWidgetWidth,whiteBackgroundWidgetHeight);
	color.setRgb(240,240,239);
	palette.setColor(whiteBackgroundWidget->backgroundRole(),color);
	whiteBackgroundWidget->setPalette(palette);
	whiteBackgroundWidget->setAutoFillBackground(true);


	#pragma endregion 
	#pragma region Vertical Blank Blue Widget Placing and Look

	int verticalBlankBlueWidgetX = 0;
	int verticalBlankBlueWidgetY = whiteBackgroundWidgetY;
	int verticalBlankBlueWidgetWidth = 6.0/1024.0*workingWidth;
	int verticalBlankBlueWidgetHeight = ResolutionHeight - statusBar()->height() -  verticalBlankBlueWidgetY;
	verticalBlankBlueWidget->setGeometry(verticalBlankBlueWidgetX,verticalBlankBlueWidgetY,verticalBlankBlueWidgetWidth,verticalBlankBlueWidgetHeight);
	color.setRgb(109,197,249);
	palette.setColor(verticalBlankBlueWidget->backgroundRole(),color);
	verticalBlankBlueWidget->setPalette(palette);
	verticalBlankBlueWidget->setAutoFillBackground(true);
	#pragma endregion
	#pragma region Vertical Blank Grey Widget Placing and Look

	int verticalBlankGreyWidgetX = verticalBlankBlueWidgetWidth;
	int verticalBlankGreyWidgetY = verticalBlankBlueWidgetY;

	int verticalBlankGreyWidgetWidth;
	int verticalBlankGreyWidgetHeight;
	
	verticalBlankGreyWidgetWidth = whiteBackgroundWidgetX - verticalBlankBlueWidgetWidth;
	verticalBlankGreyWidgetHeight = verticalBlankBlueWidgetHeight;
	
	verticalBlankGreyWidget->setGeometry(verticalBlankGreyWidgetX,verticalBlankGreyWidgetY,verticalBlankGreyWidgetWidth,verticalBlankGreyWidgetHeight);
	color.setRgb(47,47,47);
	palette.setColor(verticalBlankGreyWidget->backgroundRole(),color);
	verticalBlankGreyWidget->setPalette(palette);
	verticalBlankGreyWidget->setAutoFillBackground(true);
	if (state == 2)
	{
		//verticalBlankGreyWidget->setVisible(false);
		verticalBlankGreyWidget->setWindowOpacity(0.2);
	}

	#pragma endregion
	#pragma region Tab Product Selection, Button Placing and Look

	int verticaltabHeight = (157.0)/639.0*workingHeight;
	int verticaltabWidth = (30.0 - 13.0)/1024.0*workingWidth;

	int tabProductSelectionX;
	int tabProductSelectionY;

	if (state >=1 && state <=17)
	{
		tabProductSelectionX = whiteBackgroundWidgetX;
		tabProductSelectionY = whiteBackgroundWidgetY;
	}
	else if (state == 18)
	{
		tabProductSelectionX = startingPointX + (13.0/1024.0)*workingWidth;
		tabProductSelectionY = whiteBackgroundWidgetY;
	}
	
	tabProductSelectionWidget->setGeometry(tabProductSelectionX,tabProductSelectionY,verticaltabWidth,verticaltabHeight);
	tabProductSelectionWidget->setStyleSheet("background-image: url(:/vertical_tabs.png)");
	
	btProductSelection->setGeometry(tabProductSelectionX,tabProductSelectionY+verticaltabHeight*0.125,15,128);
	//btProductSelection->setGeometry(500,400,100,200);
	btProductSelection->setStyleSheet("background-image: url(:/prod_sel.png); color:white");
	//btProductSelection->setText("");
	//btProductSelection->setFlat(true);
	#pragma endregion

	#pragma region Tab BrowseCatalog, Button Placing and Look
	
	
	int tabBrowseCatalogX;
	int tabBrowseCatalogY;

	if (state >=1 && state <=17)
	{
		tabBrowseCatalogX = startingPointX + (13.0/1024.0)*workingWidth;
		tabBrowseCatalogY = 1.0/3.0*whiteBackgroundWidgetHeight+whiteBackgroundWidgetY;
	}
	else if (state == 18)
	{
		tabBrowseCatalogX = whiteBackgroundWidgetX;
		tabBrowseCatalogY = 1.0/3.0*whiteBackgroundWidgetHeight+whiteBackgroundWidgetY;
	}

	tabBrowseCatalogWidget->setGeometry(tabBrowseCatalogX,tabBrowseCatalogY,verticaltabWidth,verticaltabHeight);
	tabBrowseCatalogWidget->setStyleSheet("background-image: url(:/vertical_tabs.png)");

	btBrowseCatalog->setGeometry(tabBrowseCatalogX,tabBrowseCatalogY+verticaltabHeight*0.125,15,128);
	btBrowseCatalog->setStyleSheet("background-image: url(:/browse_catalog.png); color:white");
	btBrowseCatalog->setText("");
	btBrowseCatalog->setFlat(true);

	#pragma endregion
	#pragma region Tab Export Options, Button Placing and Look

	int tabExportOptionsX;
	int tabExportOptionsY;
	if (state ==1 )
	{
		tabExportOptionsX = whiteBackgroundWidgetX;
		tabExportOptionsY = 2.0/3.0*whiteBackgroundWidgetHeight+whiteBackgroundWidgetY;
	}
	else if (state >=2 && state <=18)
	{
		tabExportOptionsX = startingPointX + (13.0/1024.0)*workingWidth;
		tabExportOptionsY = 2.0/3.0*whiteBackgroundWidgetHeight+whiteBackgroundWidgetY;
	}

	tabExportOptionsWidget->setGeometry(tabExportOptionsX,tabExportOptionsY,verticaltabWidth,verticaltabHeight);
	tabExportOptionsWidget->setStyleSheet("background-image: url(:/vertical_tabs.png)");

	btExportOptions->setGeometry(tabExportOptionsX,tabExportOptionsY+verticaltabHeight*0.125,15,128);
	btExportOptions->setStyleSheet("background-image: url(:/export_options.png); color:white");
	btExportOptions->setText("");
	btExportOptions->setFlat(true);
	#pragma endregion
	
	#pragma region Status Bar color
	color.setRgb(236,233,216);
	palette.setColor(statusBar()->backgroundRole(),color);
	statusBar()->setPalette(palette);
	statusBar()->setAutoFillBackground(true);
	#pragma endregion
	
	#pragma region Product Name Label placing text and look
	int lblProductNameX = 20.0/1024.0*workingWidth;
	int lblProductNameY = 30.0/639.0*workingHeight + startingPointY;
	int lblProductNameWidth = (151.0-20.0)/1024.0*workingWidth;
	int lblProductNameHeight = (43.0-30.0)/(639.0)*workingHeight;

	lblProductName->setGeometry(lblProductNameX,lblProductNameY,lblProductNameWidth,lblProductNameHeight);
	lblProductName->setText("MECHARTES");
	lblProductName->setWordWrap(true);
	lblProductName->setStyleSheet("font: large \"Times New Roman\"; font-size: 12px; color: white ");
	#pragma endregion
	

	#pragma region Scale depiction on the left side
	int wgtLeftRulerX = whiteBackgroundWidgetX + (32.0 - 13.0)/1011.0*whiteBackgroundWidgetWidth;
	int wgtLeftRulerY = whiteBackgroundWidgetY + (87.0 - 68.0)/528.0*whiteBackgroundWidgetHeight;
	int wgtLeftRulerWidth = 6.0/1011.0*whiteBackgroundWidgetWidth;
	int wgtLeftRulerHeight = 505.0/528.0*whiteBackgroundWidgetHeight;

	wgtLeftRuler->setGeometry(wgtLeftRulerX,wgtLeftRulerY,wgtLeftRulerWidth,wgtLeftRulerHeight);
	wgtLeftRuler->setStyleSheet("background-image: url(:/left_ruler.png); color:white");
	#pragma endregion

	#pragma region Scale depiction on the UP side
	int wgtUpRulerX = wgtLeftRulerX;
	int wgtUpRulerY = wgtLeftRulerY;
	int wgtUpRulerWidth = 970.0/1011.0*whiteBackgroundWidgetWidth;
	int wgtUpRulerHeight = 9.0/528.0*whiteBackgroundWidgetHeight;

	wgtUpRuler->setGeometry(wgtUpRulerX,wgtUpRulerY,wgtUpRulerWidth,wgtUpRulerHeight);
	wgtUpRuler->setStyleSheet("background-image: url(:/up_ruler.png); color:white");
	#pragma endregion

	#pragma region Scale depiction on the Right side
	int wgtRightRulerX = wgtLeftRulerX + wgtUpRulerWidth - wgtLeftRulerWidth;
	int wgtRightRulerY = wgtLeftRulerY;
	int wgtRightRulerWidth = wgtLeftRulerWidth;
	int wgtRightRulerHeight = wgtLeftRulerHeight;

	wgtRightRuler->setGeometry(wgtRightRulerX,wgtRightRulerY,wgtRightRulerWidth,wgtRightRulerHeight);
	wgtRightRuler->setStyleSheet("background-image: url(:/right_ruler.png); color:white");
	#pragma endregion

	#pragma region Scale depiction on the Bottom side
	int wgtDownRulerX = wgtLeftRulerX;
	int wgtDownRulerY = wgtLeftRulerY + wgtLeftRulerHeight - wgtUpRulerHeight;
	int wgtDownRulerWidth = wgtUpRulerWidth;
	int wgtDownRulerHeight = wgtUpRulerHeight;

	wgtDownRuler->setGeometry(wgtDownRulerX,wgtDownRulerY,wgtDownRulerWidth,wgtDownRulerHeight);
	wgtDownRuler->setStyleSheet("background-image: url(:/down_ruler.png); color:white");
	#pragma endregion

	
	#pragma region Placement of Central View Widget
	
	int myOCCX = wgtLeftRulerX + wgtLeftRulerWidth+2;
	int myOCCY = wgtUpRulerY + wgtUpRulerHeight+2;
	int myOCCWidth = wgtRightRulerX - myOCCX -2;
	int myOCCHeight = wgtDownRulerY - myOCCY - 2;
	
	myOCC->setGeometry(myOCCX,myOCCY,myOCCWidth,myOCCHeight);
	
	#pragma endregion

	#pragma region Placement and look for blank screen widget
	int wgtBlankScreenX = myOCCX;
	int wgtBlankScreenY = myOCCY;
	int wgtBlankScreenWidth = myOCCWidth;
	int wgtBlankScreenHeight = myOCCHeight;

	wgtBlankScreen->setGeometry(wgtBlankScreenX,wgtBlankScreenY,wgtBlankScreenWidth,wgtBlankScreenHeight);
	wgtBlankScreen->setStyleSheet("background-image: url(:/blank_screen.png); color:white");
	//wgtBlankScreen->setVisible(false);
	if (state >=2 && state <=18)
		wgtBlankScreen->setVisible(false);
	else
		wgtBlankScreen->setVisible(true);

	#pragma endregion

	#pragma region Product Selection Frame Widget Place & Look

	int frmProductSelectionX =0;
	int frmProductSelectionY = 0;
	int frmProductSelectionWidth=0;
	int frmProductSelectionHeight=0;

	if (state ==1 || state == 18) // not visible at all. happens only in state 1
	{
		frmProductSelection->setVisible(false);
	}
	else if (state == 2 || state == 4 || state == 10 || state == 11) // internal state 1 : label + comboboxes + preview
	{
		frmProductSelection->setVisible(true);
		frmProductSelectionX = tabBrowseCatalogX + verticaltabWidth*1.3;
		frmProductSelectionY = whiteBackgroundWidgetY + (94.0 - 70.0)/(528.0)*whiteBackgroundWidgetHeight;
		frmProductSelectionWidth = tabProductSelectionX - (208.0 - 198.0)/1011.0*whiteBackgroundWidgetWidth - frmProductSelectionX;
		frmProductSelectionHeight = tabProductSelectionY + verticaltabHeight - (222.0 - 218.0)/528.0*whiteBackgroundWidgetHeight - frmProductSelectionY;
	}
	else if (state == 9 || state == 8 || state == 3 || state == 5) // internal state 2 : minmized view no boxes visible
	{
		frmProductSelection->setVisible(true);
		frmProductSelectionX = tabBrowseCatalogX + verticaltabWidth*1.3;
		frmProductSelectionY = whiteBackgroundWidgetY + (94.0 - 70.0)/(528.0)*whiteBackgroundWidgetHeight;
		frmProductSelectionWidth = tabProductSelectionX - (208.0 - 198.0)/1011.0*whiteBackgroundWidgetWidth - frmProductSelectionX;
		frmProductSelectionHeight = 19.0/640.0*workingHeight;
	}
	else if (state == 6 || state == 12 || state == 13 || state == 14) // internal state 3 : expanded view without compent details and with launch button
	{
		frmProductSelection->setVisible(true);
		frmProductSelectionX = tabBrowseCatalogX + verticaltabWidth*1.3;
		frmProductSelectionY = whiteBackgroundWidgetY + (94.0 - 70.0)/(528.0)*whiteBackgroundWidgetHeight;
		frmProductSelectionWidth = tabProductSelectionX - (208.0 - 198.0)/1011.0*whiteBackgroundWidgetWidth - frmProductSelectionX;
		frmProductSelectionHeight = 288.0/640.0*workingHeight;
	}
	else if (state == 7 || state == 15 || state == 16 || state == 17) // internal state 4
	{
		frmProductSelection->setVisible(true);
		frmProductSelectionX = tabBrowseCatalogX + verticaltabWidth*1.3;
		frmProductSelectionY = whiteBackgroundWidgetY + (94.0 - 70.0)/(528.0)*whiteBackgroundWidgetHeight;
		frmProductSelectionWidth = tabProductSelectionX - (208.0 - 198.0)/1011.0*whiteBackgroundWidgetWidth - frmProductSelectionX;
		frmProductSelectionHeight = (250.0 + 15.0*noOfComponents + 20.0 + 12.0 + 18.0 + 17.0 + 12.0)/640.0*workingHeight;
	}


	frmProductSelection->setStyleSheet("color : white");
	frmProductSelection->setGeometry(frmProductSelectionX,frmProductSelectionY,frmProductSelectionWidth,frmProductSelectionHeight);
	frmProductSelection->setFrameStyle(QFrame::Panel | QFrame::Raised);

	#pragma endregion

	#pragma region Product Selection Label Frame Widget Place & Look

	int frmProductSelectionLabelX =0;
	int frmProductSelectionLabelY = 0;
	int frmProductSelectionLabelWidth=0;
	int frmProductSelectionLabelHeight=0;

	if (state ==1 || state == 18) // not visible. 
	{
		frmProductSelectionLabel->setVisible(false);
	}
	else if (state == 2 || state == 4 || state == 6 || state == 7 || (state >=10 && state <=17)) // expanded view
	{
		frmProductSelectionLabel->setVisible(true);
		frmProductSelectionLabelX = frmProductSelectionX;
		frmProductSelectionLabelY = frmProductSelectionY;
		frmProductSelectionLabelWidth = frmProductSelectionWidth;
		frmProductSelectionLabelHeight = 20.0/640.0*workingHeight;
	}
	else if (state == 9 || state == 8 || state == 3 || state == 5 ) // contracted view
	{
		frmProductSelectionLabel->setVisible(true);
		frmProductSelectionLabelX = frmProductSelectionX;
		frmProductSelectionLabelY = frmProductSelectionY;
		frmProductSelectionLabelWidth = frmProductSelectionWidth;
		frmProductSelectionLabelHeight = frmProductSelectionHeight;
	}


	frmProductSelectionLabel->setStyleSheet("color : blue");
	frmProductSelectionLabel->setGeometry(frmProductSelectionLabelX,frmProductSelectionLabelY,frmProductSelectionLabelWidth,frmProductSelectionLabelHeight);
	frmProductSelectionLabel->setFrameStyle(QFrame::Panel | QFrame::Raised);

	#pragma endregion

	#pragma region Label Product Selection

	int lblProductSelectionX;
	int lblProductSelectionY;
	int lblProductSelectionWidth;
	int lblProductSelectionHeight;

	if (state == 1 || state == 18)
	{
		lblProductSelection->setVisible(false);
	}
	else if ( state == 2 || state == 4 || state == 10 || state == 11) // internal state 1 
	{
		lblProductSelection->setVisible(true);
		lblProductSelectionX = frmProductSelectionX + 7.0/164.0*frmProductSelectionWidth;
		lblProductSelectionY = frmProductSelectionY + 4.0/(217.0-93.0)*frmProductSelectionHeight;
		lblProductSelectionWidth = (132.0 - 41.0)/(198.0-34.0)*frmProductSelectionWidth;
		lblProductSelectionHeight = (12.0)/(217.0-93.0)*frmProductSelectionHeight;
	}
	else if ((state >=12 && state <=17) || state == 9 || state == 8 ||state == 3 || state == 5 || state == 6 || state == 7) // internal state 2,3,4
	{
		lblProductSelection->setVisible(true);
		lblProductSelectionX = frmProductSelectionLabelX + 7.0/164.0*frmProductSelectionWidth;
		lblProductSelectionY = frmProductSelectionLabelY + 2.0/(640.0)*workingHeight;
		lblProductSelectionWidth = (132.0 - 41.0)/(164.0)*frmProductSelectionLabelWidth;
		lblProductSelectionHeight = frmProductSelectionLabelHeight;
	}


	lblProductSelection->setGeometry(lblProductSelectionX,lblProductSelectionY,lblProductSelectionWidth,lblProductSelectionHeight);
	lblProductSelection->setStyleSheet("color : rgb(83,83,83)");
	lblProductSelection->setText("Product Selection");

	#pragma endregion 

	#pragma region Button Expansion Button Selection

	int btProductSelectionExpansionX;
	int btProductSelectionExpansionY;
	int btProductSelectionExpansionWidth;
	int btProductSelectionExpansionHeight;

	if (state == 1 || state == 18)
	{
		btProductSelectionExpansion->setVisible(false);
	}
	else if (state == 9 || state == 8 || state == 2 || state == 4) // internal state 2
	{
		btProductSelectionExpansion->setVisible(true);
		btProductSelectionExpansionX = frmProductSelectionX + (169.0 - 34.0)/(198.0-34.0)*frmProductSelectionWidth;
		btProductSelectionExpansionY = lblProductSelectionY;
		btProductSelectionExpansionWidth = (25.0)/(198.0-34.0)*frmProductSelectionWidth;
		btProductSelectionExpansionHeight = (13.0)/(640.0)*workingHeight;
	}
	else if (state == 3 || state == 5 || state ==6 || state == 7 || (state >= 10 && state <=17)) // internal state 1,3,4
	{
		btProductSelectionExpansion->setVisible(true);
		btProductSelectionExpansionX = frmProductSelectionLabelX + (169.0 - 34.0)/(198.0-34.0)*frmProductSelectionLabelWidth;
		btProductSelectionExpansionY = lblProductSelectionY;
		btProductSelectionExpansionWidth = (25.0)/(198.0-34.0)*frmProductSelectionLabelWidth;
		btProductSelectionExpansionHeight = (13.0)/(640.0)*workingHeight;
	}

	btProductSelectionExpansion->setGeometry(btProductSelectionExpansionX,btProductSelectionExpansionY,btProductSelectionExpansionWidth,btProductSelectionExpansionHeight);
	btProductSelectionExpansion->setStyleSheet("background-image: url(:/bt_down_arrow.png)");
	

	#pragma endregion

	#pragma region Product Selection Frame Combo Boxes

	int comboBoxWidth;
	int comboBoxHeight;
	int comboBoxGapHeight;

	comboBoxWidth = (193.0-41.0)/(1024.0)*workingWidth;
	comboBoxHeight = (16.0)/(640.0)*workingHeight;
	comboBoxGapHeight = (6.0)/(640.0)*workingHeight;

	int YoffsetProductSelectionFrame;

	int cmbProductSelectionProductRangeX;
	int cmbProductSelectionProductRangeY;

	int cmbProductSelectionCasingSizeX;
	int cmbProductSelectionCasingSizeY;

	int cmbProductSelectionHoleSizeX;
	int cmbProductSelectionHoleSizeY;

	int btProductSelectionPreviewWidth;
	int btProductSelectionPreviewX;
	int btProductSelectionPreviewY;

	if (state == 9 || state == 8 || state == 1 || state == 3 || state == 5 || state == 18 )
	{
		cmbProductSelectionProductRange->setVisible(false);
		cmbProductSelectionCasingSize->setVisible(false);
		cmbProductSelectionHoleSize->setVisible(false);
		btProductSelectionPreview->setVisible(false);
	}
	else if (state == 2 || state == 4 || state == 6 || state == 7 || (state >=10 && state <=17))
	{
		cmbProductSelectionProductRange->setVisible(true);
		cmbProductSelectionCasingSize->setVisible(true);
		cmbProductSelectionHoleSize->setVisible(true);
		btProductSelectionPreview->setVisible(true);

		YoffsetProductSelectionFrame = 14.0/640.0*workingHeight;

		cmbProductSelectionProductRangeX = lblProductSelectionX;
		cmbProductSelectionProductRangeY = frmProductSelectionY + frmProductSelectionLabelHeight + YoffsetProductSelectionFrame;

		cmbProductSelectionCasingSizeX = lblProductSelectionX;
		cmbProductSelectionCasingSizeY = cmbProductSelectionProductRangeY + comboBoxHeight + comboBoxGapHeight;

		cmbProductSelectionHoleSizeX = lblProductSelectionX;
		cmbProductSelectionHoleSizeY = cmbProductSelectionCasingSizeY + comboBoxHeight + comboBoxGapHeight;

		btProductSelectionPreviewWidth = (59.0)/(1024.0)*workingWidth;
		btProductSelectionPreviewX = cmbProductSelectionHoleSizeX + comboBoxWidth - btProductSelectionPreviewWidth;
		btProductSelectionPreviewY = cmbProductSelectionHoleSizeY + comboBoxHeight + comboBoxGapHeight;

	}
	cmbProductSelectionProductRange->setGeometry(cmbProductSelectionProductRangeX,cmbProductSelectionProductRangeY,comboBoxWidth,comboBoxHeight);
	cmbProductSelectionCasingSize->setGeometry(cmbProductSelectionCasingSizeX,cmbProductSelectionCasingSizeY,comboBoxWidth,comboBoxHeight);
	cmbProductSelectionHoleSize->setGeometry(cmbProductSelectionHoleSizeX,cmbProductSelectionHoleSizeY,comboBoxWidth,comboBoxHeight);
	btProductSelectionPreview->setGeometry(btProductSelectionPreviewX,btProductSelectionPreviewY,btProductSelectionPreviewWidth,comboBoxHeight);

	btProductSelectionPreview->setStyleSheet("background-image: url(:/preview_button.png); color : rgb(83,83,83)");
	btProductSelectionPreview->setText("Preview");
	
	QColor grey1(55, 55, 55);
	QColor grey2(95, 95, 95);
    QColor slightlyOpaqueBlack(0, 0, 0, 63);
	 
	QPixmap backgroundImage(60,60);
	backgroundImage.fill(Qt::red);
	QPixmap buttonImage(60,60);
	buttonImage.fill(QColor(57,57,57));
    QPixmap midImage = buttonImage;

    QPainter painterCombo;
    painterCombo.begin(&midImage);
    painterCombo.setPen(Qt::NoPen);
    painterCombo.fillRect(midImage.rect(), slightlyOpaqueBlack);
    painterCombo.end();


	QPalette paletteCombo = QApplication::style()->standardPalette();
	paletteCombo = QPalette(grey1);
    paletteCombo.setBrush(QPalette::BrightText, QColor(93,93,93));
    paletteCombo.setBrush(QPalette::Base, grey2);
    paletteCombo.setBrush(QPalette::Highlight, QColor(161,161,161));
    setTexture(paletteCombo, QPalette::Button, buttonImage);
    setTexture(paletteCombo, QPalette::Mid, midImage);
    setTexture(paletteCombo, QPalette::Window, backgroundImage);

	QBrush brushCombo = paletteCombo.background();
    brushCombo.setColor(brushCombo.color().dark());

    paletteCombo.setBrush(QPalette::Disabled, QPalette::WindowText, brushCombo);
    paletteCombo.setBrush(QPalette::Disabled, QPalette::Text, brushCombo);
    paletteCombo.setBrush(QPalette::Disabled, QPalette::ButtonText, brushCombo);
    paletteCombo.setBrush(QPalette::Disabled, QPalette::Base, brushCombo);
    paletteCombo.setBrush(QPalette::Disabled, QPalette::Button, brushCombo);
    paletteCombo.setBrush(QPalette::Disabled, QPalette::Mid, brushCombo);

	cmbProductSelectionCasingSize->setStyle(new QWindowsStyle);
	cmbProductSelectionCasingSize->setStyleSheet("border-width: 3px;");

	cmbProductSelectionCasingSize->setPalette(paletteCombo);
	cmbProductSelectionProductRange->setStyle(new QWindowsStyle);
	cmbProductSelectionProductRange->setPalette(paletteCombo);
	cmbProductSelectionHoleSize->setStyle(new QWindowsStyle);

	cmbProductSelectionHoleSize->setPalette(paletteCombo);
	cmbProductSelectionProductRange->setStyleSheet("border-width: 3px;");
	cmbProductSelectionHoleSize->setStyleSheet("border-width: 3px;");


	#pragma endregion

	#pragma region Product Selection Preview Frame & Launch Button

	int pixProductPreviewX;
	int pixProductPreviewY;
	int pixProductPreviewW;
	int pixProductPreviewH;

	int btProductSelectionComponentDetailsX;
	int btProductSelectionComponentDetailsY;
	int btProductSelectionComponentDetailsW;
	int btProductSelectionComponentDetailsH;

	int lblProductSelectionComponentDetailsX;
	int lblProductSelectionComponentDetailsY;
	int lblProductSelectionComponentDetailsW;
	int lblProductSelectionComponentDetailsH;

	int btProductSelectionLaunchX;
	int btProductSelectionLaunchY;
	int btProductSelectionLaunchW;
	int btProductSelectionLaunchH;
	if (state == 9 || state == 8 || state == 1 || state == 2 || state == 3 || state == 4 || state == 5 || state == 10 || state == 11 || state == 18) // internal state 1,2
	{
		pixProductPreview->setVisible(false);
		btProductSelectionComponentDetails->setVisible(false);
		lblProductSelectionComponentDetails->setVisible(false);
		btProductSelectionLaunch->setVisible(false);
		frmPixProductPreview->setVisible(false);
	}
	else if (state == 6 || (state >=12 && state <=14)) // internal state 3
	{
		frmPixProductPreview->setVisible(true);
		pixProductPreview->setVisible(true);
		btProductSelectionComponentDetails->setVisible(true);
		lblProductSelectionComponentDetails->setVisible(true);
		btProductSelectionLaunch->setVisible(true);

		pixProductPreviewX = cmbProductSelectionProductRangeX;
		pixProductPreviewY = btProductSelectionPreviewY + comboBoxHeight + 9.0/640.0*workingHeight;
		pixProductPreviewW = comboBoxWidth;
		pixProductPreviewH = 107.0/640.0*workingHeight;

		btProductSelectionComponentDetailsX = pixProductPreviewX;
		btProductSelectionComponentDetailsY = pixProductPreviewY + pixProductPreviewH + 13.0/640.0*workingHeight;
		btProductSelectionComponentDetailsW = 8.0/1024.0*workingWidth;
		btProductSelectionComponentDetailsH = 8.0/640.0*workingHeight;

		lblProductSelectionComponentDetailsX = btProductSelectionComponentDetailsX + btProductSelectionComponentDetailsW + 4.0/1024.0*workingWidth;
		lblProductSelectionComponentDetailsY = btProductSelectionComponentDetailsY - 2.0/639.0*workingHeight;
		lblProductSelectionComponentDetailsW = comboBoxWidth - btProductSelectionComponentDetailsW;
		lblProductSelectionComponentDetailsH = 12.0/640.0*workingHeight;

		btProductSelectionLaunchW = btProductSelectionPreviewWidth;
		btProductSelectionLaunchH = comboBoxHeight;
		btProductSelectionLaunchX = pixProductPreviewX + pixProductPreviewW - btProductSelectionLaunchW;
		btProductSelectionLaunchY = pixProductPreviewY + pixProductPreviewH + 31.0/640.0*workingHeight;
	}
	else if (state == 7 || (state >=15 && state <=17))  // internal state 4
	{
		
		frmPixProductPreview->setVisible(true);
		pixProductPreview->setVisible(true);
		btProductSelectionComponentDetails->setVisible(true);
		lblProductSelectionComponentDetails->setVisible(true);
		btProductSelectionLaunch->setVisible(true);

		pixProductPreviewX = cmbProductSelectionProductRangeX;
		pixProductPreviewY = btProductSelectionPreviewY + comboBoxHeight + 9.0/640.0*workingHeight;
		pixProductPreviewW = comboBoxWidth;
		pixProductPreviewH = 107.0/640.0*workingHeight;

		btProductSelectionComponentDetailsX = pixProductPreviewX;
		btProductSelectionComponentDetailsY = pixProductPreviewY + pixProductPreviewH + 13.0/640.0*workingHeight;
		btProductSelectionComponentDetailsW = 8.0/1024.0*workingWidth;
		btProductSelectionComponentDetailsH = 8.0/640.0*workingHeight;

		lblProductSelectionComponentDetailsX = btProductSelectionComponentDetailsX + btProductSelectionComponentDetailsW + 4.0/1024.0*workingWidth;
		lblProductSelectionComponentDetailsY = btProductSelectionComponentDetailsY - 2.0/639.0*workingHeight;
		lblProductSelectionComponentDetailsW = comboBoxWidth - btProductSelectionComponentDetailsW;
		lblProductSelectionComponentDetailsH = 12.0/640.0*workingHeight;

		btProductSelectionLaunchW = btProductSelectionPreviewWidth;
		btProductSelectionLaunchH = comboBoxHeight;
		btProductSelectionLaunchX = pixProductPreviewX + pixProductPreviewW - btProductSelectionLaunchW;
		btProductSelectionLaunchY = pixProductPreviewY + pixProductPreviewH + (24.0 + 15.0*noOfComponents + 20.0 + 12.0 + 18.0)/640.0*workingHeight;

	}

	pixProductPreview->setGeometry(pixProductPreviewX,pixProductPreviewY,pixProductPreviewW,pixProductPreviewH);
	frmPixProductPreview->setGeometry(pixProductPreviewX-2,pixProductPreviewY-2,pixProductPreviewW+4,pixProductPreviewH+4);
	frmPixProductPreview->setStyleSheet("color : red");
	frmPixProductPreview->setFrameStyle(QFrame::Panel | QFrame::Raised);

	pixProductPreview->setStyleSheet("border: 1px solid white; background-image: url(:/blank_product_preview.png); ");

	btProductSelectionComponentDetails->setGeometry(btProductSelectionComponentDetailsX,btProductSelectionComponentDetailsY,btProductSelectionComponentDetailsW,btProductSelectionComponentDetailsH);
	btProductSelectionComponentDetails->setStyleSheet("background-image: url(:/blue_plus.png); ");

	lblProductSelectionComponentDetails->setGeometry(lblProductSelectionComponentDetailsX,lblProductSelectionComponentDetailsY,lblProductSelectionComponentDetailsW,lblProductSelectionComponentDetailsH);
	lblProductSelectionComponentDetails->setText("Component Details");
	//lblProductSelectionComponentDetails->setStyleSheet("background-image: url(:/blue_plus.png); ");
	

	btProductSelectionLaunch->setGeometry(btProductSelectionLaunchX,btProductSelectionLaunchY,btProductSelectionLaunchW,btProductSelectionLaunchH);
	btProductSelectionLaunch->setStyleSheet("background-image: url(:/preview_button.png); color : rgb(83,83,83)");
	btProductSelectionLaunch->setText("Launch");




	#pragma endregion

	#pragma region Components Expanded List & Progress Bar

	int wgtProductSelectionComponentsX;
	int wgtProductSelectionComponentsY;
	int wgtProductSelectionComponentsW;
	int wgtProductSelectionComponentsH;

	int wgtProductSelectionProgressX;
	int wgtProductSelectionProgressY;
	int wgtProductSelectionProgressW;
	int wgtProductSelectionProgressH;

	int componentsProductSelectionGap = 3.0/640.0*workingHeight;
	int componentsProductSelectionRadioButtonHeight = 12.0/639.0*workingHeight;

	if ( (state >=1 && state <=6) || (state >=8 && state <=14) || state == 18)
	{
		for (int i=0;i<noOfComponents;i++)
			radBtProductSelectionComponents[i]->setVisible(false);
		wgtProductSelectionComponents->setVisible(false);
		wgtProductSelectionProgress->setVisible(false);

	}
	else if (state == 7 || (state >=15 && state <=17))
	{
		
		for (int i=0;i<noOfComponents;i++)
			radBtProductSelectionComponents[i]->setVisible(true);
		wgtProductSelectionComponents->setVisible(true);
		wgtProductSelectionProgress->setVisible(true);

		wgtProductSelectionComponentsX = pixProductPreviewX;
		wgtProductSelectionComponentsY = pixProductPreviewY + pixProductPreviewH + 22.0/639.0*workingHeight;
		wgtProductSelectionComponentsW = pixProductPreviewW;
		wgtProductSelectionComponentsH = noOfComponents*15.0/639.0*workingHeight;

		wgtProductSelectionProgressX = pixProductPreviewX;
		wgtProductSelectionProgressY = wgtProductSelectionComponentsY + wgtProductSelectionComponentsH + 18.0/639.0*workingHeight;
		wgtProductSelectionProgressW = wgtProductSelectionComponentsW;
		wgtProductSelectionProgressH = 12.0/639.0*workingHeight;

		
	}

	wgtProductSelectionComponents->setGeometry(wgtProductSelectionComponentsX,wgtProductSelectionComponentsY,wgtProductSelectionComponentsW,wgtProductSelectionComponentsH);
	wgtProductSelectionProgress->setGeometry(wgtProductSelectionProgressX,wgtProductSelectionProgressY,wgtProductSelectionProgressW,wgtProductSelectionProgressH);
	wgtProductSelectionProgress->setStyleSheet("background-image: url(:/progress.png);");
	for (int i=0;i<noOfComponents;i++)
	{
		radBtProductSelectionComponents[i]->setGeometry(1,componentsProductSelectionGap*(i+1) + i*componentsProductSelectionRadioButtonHeight,wgtProductSelectionComponentsW-2,componentsProductSelectionRadioButtonHeight);
		//radBtProductSelectionComponents[i]->setStyle(new QMacStyle);
	}
	




	#pragma endregion

	#pragma region Separator Between Product Selection and Product Search
	
	int wgtSeparatorTopX;
	int wgtSeparatorTopY;
	int wgtSeparatorTopW;
	int wgtSeparatorTopH;

	if (state == 1 || state == 18)
	{
		wgtSeparatorTop->setVisible(false);
	}
	else if ((state >=2 && state <=17))
	{
		wgtSeparatorTop->setVisible(true);
		wgtSeparatorTopX = frmProductSelectionX;
		wgtSeparatorTopY = 14.0/640.0*workingHeight + frmProductSelectionHeight + frmProductSelectionY;
		wgtSeparatorTopW = frmProductSelectionWidth;
		wgtSeparatorTopH = 10.0/640.0*workingHeight;
	}

	wgtSeparatorTop->setGeometry(wgtSeparatorTopX,wgtSeparatorTopY,wgtSeparatorTopW,wgtSeparatorTopH);
	wgtSeparatorTop->setStyleSheet("background-image: url(:/separator.png)");



	#pragma endregion

	#pragma region Product Search Frame Widget Place & Look


	int frmProductSearchX =0;
	int frmProductSearchY = 0;
	int frmProductSearchW=0;
	int frmProductSearchH=0;

	if (state ==1 || state == 18)
	{
		frmProductSearch->setVisible(false);
	}
	else if (state ==2 || state == 3 || state == 12 || state == 15) // internal state 1
	{
		frmProductSearch->setVisible(true);
		frmProductSearchX = frmProductSelectionX;
		frmProductSearchY = wgtSeparatorTopY + wgtSeparatorTopH + 14.0/640.0*workingHeight;
		frmProductSearchW = frmProductSelectionWidth;
		frmProductSearchH = tabProductSelectionY + verticaltabHeight - (222.0 - 218.0)/528.0*whiteBackgroundWidgetHeight - frmProductSelectionY;
	}
	else if (state == 7 || state == 4 || state == 5 || state ==6) // internal state 2
	{

		frmProductSearch->setVisible(true);
		frmProductSearchX = frmProductSelectionX;
		frmProductSearchY = wgtSeparatorTopY + wgtSeparatorTopH + 14.0/640.0*workingHeight;
		frmProductSearchW = frmProductSelectionWidth;
		frmProductSearchH = 19.0/640.0*workingHeight;
	}
	else if (state == 8 || state == 10 || state == 13 || state == 16) // internal state 3
	{
		frmProductSearch->setVisible(true);
		frmProductSearchX = frmProductSelectionX;
		frmProductSearchY = wgtSeparatorTopY + wgtSeparatorTopH + 14.0/640.0*workingHeight;
		frmProductSearchW = frmProductSelectionWidth;
		frmProductSearchH = 288.0/639.0*workingHeight;
	}
	else if (state == 9 || state == 11 || state == 14 || state == 17) // internal state 4
	{
		
		frmProductSearch->setVisible(true);
		frmProductSearchX = frmProductSelectionX;
		frmProductSearchY = wgtSeparatorTopY + wgtSeparatorTopH + 14.0/640.0*workingHeight;
		frmProductSearchW = frmProductSelectionWidth;
		frmProductSearchH = (250.0 + + 15.0*noOfComponents + 20.0 + 12.0 + 18.0 + 17.0 + 12.0)/640.0*workingHeight;
	}


	frmProductSearch->setStyleSheet("color : gray");
	frmProductSearch->setGeometry(frmProductSearchX,frmProductSearchY,frmProductSearchW,frmProductSearchH);
	frmProductSearch->setFrameStyle(QFrame::Panel | QFrame::Raised);

	#pragma endregion

	#pragma region Product Search Label Frame Widget Place & Look

	int frmProductSearchLabelX =0;
	int frmProductSearchLabelY = 0;
	int frmProductSearchLabelW=0;
	int frmProductSearchLabelH=0;

	if (state ==1 || state == 18)
	{
		frmProductSearchLabel->setVisible(false);
	}
	else if (state == 2 || state == 3 || (state >=8 && state <=17))
	{
		frmProductSearchLabel->setVisible(true);
		frmProductSearchLabelX = frmProductSearchX;
		frmProductSearchLabelY = frmProductSearchY;
		frmProductSearchLabelW = frmProductSearchW;
		frmProductSearchLabelH = 20.0/639.0*workingHeight;
	}
	else if (state == 7 || state == 4 || state == 5 || state == 6)
	{
		frmProductSearchLabel->setVisible(true);
		frmProductSearchLabelX = frmProductSearchX;
		frmProductSearchLabelY = frmProductSearchY;
		frmProductSearchLabelW = frmProductSearchW;
		frmProductSearchLabelH = frmProductSearchH;
	}

	frmProductSearchLabel->setStyleSheet("color : blue");
	frmProductSearchLabel->setGeometry(frmProductSearchLabelX,frmProductSearchLabelY,frmProductSearchLabelW,frmProductSearchLabelH);
	frmProductSearchLabel->setFrameStyle(QFrame::Panel | QFrame::Raised);

	#pragma endregion

	#pragma region Label Product Search

	int lblProductSearchX;
	int lblProductSearchY;
	int lblProductSearchW;
	int lblProductSearchH;

	if (state == 1 || state == 18)
	{
		lblProductSearch->setVisible(false);
	}
	else if (state == 2 || state == 3 || state == 12 || state == 15)
	{
		lblProductSearch->setVisible(true);
		lblProductSearchX = frmProductSearchX + 7.0/164.0*frmProductSearchW;
		lblProductSearchY = frmProductSearchY + 4.0/(217.0-93.0)*frmProductSearchH;
		lblProductSearchW = (132.0 - 41.0)/(198.0-34.0)*frmProductSearchW;
		lblProductSearchH = (12.0)/(639.0)*workingHeight;
	}
	else if ( (state <= 17) && state != 2 && state !=3 && state !=12 && state !=15)
	{
		lblProductSearch->setVisible(true);
		lblProductSearchX = frmProductSearchX + 7.0/164.0*frmProductSearchW;
		lblProductSearchY = frmProductSearchY + 4.0/(640.0)*workingHeight;
		lblProductSearchW = (132.0 - 41.0)/(198.0-34.0)*frmProductSearchW;
		lblProductSearchH = (12.0)/(640.0)*workingHeight;
	}

	lblProductSearch->setGeometry(lblProductSearchX,lblProductSearchY,lblProductSearchW,lblProductSearchH);
	lblProductSearch->setStyleSheet("color : rgb(83,83,83)");
	lblProductSearch->setText("Product Search");

	#pragma endregion 

	#pragma region Button Expansion Button Search

	int btProductSearchExpansionX;
	int btProductSearchExpansionY;
	int btProductSearchExpansionW;
	int btProductSearchExpansionH;

	if (state == 1 || state == 18)
	{
		btProductSearchExpansion->setVisible(false);
	}
	else if (state == 2 || state == 3 || state == 12 || state == 15)
	{
		btProductSearchExpansion->setVisible(true);
		btProductSearchExpansionX = frmProductSearchX + (169.0 - 34.0)/(198.0-34.0)*frmProductSearchW;
		btProductSearchExpansionY = lblProductSearchY;
		btProductSearchExpansionW = (25.0)/(198.0-34.0)*frmProductSearchW;
		btProductSearchExpansionH = (13.0)/(217.0-93.0)*frmProductSearchH;
	}
	else if ( (state <= 17) && state != 2 && state !=3 && state !=12 && state !=17)
	{
		btProductSearchExpansion->setVisible(true);
		btProductSearchExpansionX = frmProductSearchX + (169.0 - 34.0)/(198.0-34.0)*frmProductSearchW;
		btProductSearchExpansionY = lblProductSearchY;
		btProductSearchExpansionW = (25.0)/(198.0-34.0)*frmProductSearchW;
		btProductSearchExpansionH = (13.0)/(640.0)*workingHeight;

	}

	btProductSearchExpansion->setGeometry(btProductSearchExpansionX,btProductSearchExpansionY,btProductSearchExpansionW,btProductSearchExpansionH);
	btProductSearchExpansion->setStyleSheet("background-image: url(:/bt_down_arrow.png)");
	

	#pragma endregion

	#pragma region Product Search Frame Combo Boxes

	int YoffsetProductSearchFrame;

	int cmbProductSearchProductRangeX;
	int cmbProductSearchProductRangeY;

	int cmbProductSearchCasingSizeX;
	int cmbProductSearchCasingSizeY;

	int cmbProductSearchHoleSizeX;
	int cmbProductSearchHoleSizeY;

	int btProductSearchPreviewW;
	int btProductSearchPreviewX;
	int btProductSearchPreviewY;

	if (state == 7 || state == 1 || state == 4 || state == 5 || state == 6 || state == 18)
	{
		cmbProductSearchProductRange->setVisible(false);
		cmbProductSearchCasingSize->setVisible(false);
		cmbProductSearchHoleSize->setVisible(false);
		btProductSearchPreview->setVisible(false);
	}
	else if (state == 2 || state == 3 || (state >=8 && state <=17))
	{
		cmbProductSearchProductRange->setVisible(true);
		cmbProductSearchCasingSize->setVisible(true);
		cmbProductSearchHoleSize->setVisible(true);
		btProductSearchPreview->setVisible(true);

		YoffsetProductSearchFrame = 13.0/639.0*workingHeight;

		cmbProductSearchProductRangeX = lblProductSearchX;
		cmbProductSearchProductRangeY = frmProductSearchY + frmProductSearchLabelH + YoffsetProductSearchFrame;

		cmbProductSearchCasingSizeX = lblProductSearchX;
		cmbProductSearchCasingSizeY = cmbProductSearchProductRangeY + comboBoxHeight + comboBoxGapHeight;

		cmbProductSearchHoleSizeX = lblProductSearchX;
		cmbProductSearchHoleSizeY = cmbProductSearchCasingSizeY + comboBoxHeight + comboBoxGapHeight;

		btProductSearchPreviewW = (193.0 - 132.0)/(198.0-34.0)*frmProductSearchW;
		btProductSearchPreviewX = cmbProductSearchHoleSizeX + comboBoxWidth - btProductSearchPreviewW;
		btProductSearchPreviewY = cmbProductSearchHoleSizeY + comboBoxHeight + comboBoxGapHeight;
	}

	cmbProductSearchProductRange->setGeometry(cmbProductSearchProductRangeX,cmbProductSearchProductRangeY,comboBoxWidth,comboBoxHeight);
	cmbProductSearchCasingSize->setGeometry(cmbProductSearchCasingSizeX,cmbProductSearchCasingSizeY,comboBoxWidth,comboBoxHeight);
	cmbProductSearchHoleSize->setGeometry(cmbProductSearchHoleSizeX,cmbProductSearchHoleSizeY,comboBoxWidth,comboBoxHeight);
	btProductSearchPreview->setGeometry(btProductSearchPreviewX,btProductSearchPreviewY,btProductSearchPreviewW,comboBoxHeight);

	btProductSearchPreview->setStyleSheet("background-image: url(:/preview_button.png); color : rgb(83,83,83)");
	btProductSearchPreview->setText("Search");
	
	cmbProductSearchCasingSize->setStyle(new QWindowsStyle);
	cmbProductSearchCasingSize->setStyleSheet("border-width: 3px;");

	cmbProductSearchCasingSize->setPalette(paletteCombo);
	cmbProductSearchProductRange->setStyle(new QWindowsStyle);
	cmbProductSearchProductRange->setPalette(paletteCombo);
	cmbProductSearchHoleSize->setStyle(new QWindowsStyle);

	cmbProductSearchHoleSize->setPalette(paletteCombo);
	cmbProductSearchProductRange->setStyleSheet("border-width: 3px;");
	cmbProductSearchHoleSize->setStyleSheet("border-width: 3px;");


	#pragma endregion

	#pragma region Lanch Button , Preview and Component Label Product Search

	int pixProductSearchX;
	int pixProductSearchY;
	int pixProductSearchW;
	int pixProductSearchH;

	int btProductSearchLeftX;
	int btProductSearchLeftY;
	int btProductSearchLeftW;
	int btProductSearchLeftH;

	int btProductSearchRightX;
	int btProductSearchRightY;
	int btProductSearchRightW;
	int btProductSearchRightH;

	int frmPixProductSearchPreviewX;
	int frmPixProductSearchPreviewY;
	int frmPixProductSearchPreviewW;
	int frmPixProductSearchPreviewH;

	int btProductSearchComponentDetailsX;
	int btProductSearchComponentDetailsY;
	int btProductSearchComponentDetailsW;
	int btProductSearchComponentDetailsH;

	int lblProductSearchComponentDetailsX;
	int lblProductSearchComponentDetailsY;
	int lblProductSearchComponentDetailsW;
	int lblProductSearchComponentDetailsH;

	int btProductSearchLaunchX;
	int btProductSearchLaunchY;
	int btProductSearchLaunchW;
	int btProductSearchLaunchH;

	if ( (state >=1 && state <=7) || state == 12 || state == 15 || state == 18) 
	{
		pixProductSearch->setVisible(false);
		btProductSearchLeft->setVisible(false);
		btProductSearchRight->setVisible(false);
		frmPixProductSearchPreview->setVisible(false);
		btProductSearchComponentDetails->setVisible(false);
		lblProductSearchComponentDetails->setVisible(false);
		btProductSearchLaunch->setVisible(false);
	}
	else if ((state >=8 && state <=11) || (state >=3 && state <=14) || (state >=16 && state <=17))
	{
		pixProductSearch->setVisible(true);
		btProductSearchLeft->setVisible(true);
		btProductSearchRight->setVisible(true);
		frmPixProductSearchPreview->setVisible(true);
		btProductSearchComponentDetails->setVisible(true);
		lblProductSearchComponentDetails->setVisible(true);
		btProductSearchLaunch->setVisible(true);

		btProductSearchLeftX = cmbProductSearchCasingSizeX;
		btProductSearchLeftY = btProductSearchPreviewY + comboBoxHeight + 10.0/639.0*workingHeight;
		btProductSearchLeftW = 17.0/1024.0*workingWidth;
		btProductSearchLeftH = 106.0/639.0*workingHeight;

		pixProductSearchX = btProductSearchLeftX + btProductSearchLeftW;
		pixProductSearchY = btProductSearchLeftY;
		pixProductSearchW = 119.0/1024.0*workingWidth;
		pixProductSearchH = 105.0/639.0*workingHeight;

		btProductSearchRightX = pixProductSearchX + pixProductSearchW;
		btProductSearchRightY = pixProductSearchY;
		btProductSearchRightW = btProductSearchLeftW;
		btProductSearchRightH = btProductSearchLeftH;

		frmPixProductSearchPreviewX = btProductSearchLeftX - 2;
		frmPixProductSearchPreviewY = btProductSearchLeftY - 2;
		frmPixProductSearchPreviewW = btProductSearchRightX + btProductSearchRightW - frmPixProductSearchPreviewX + 2;
		frmPixProductSearchPreviewH = btProductSearchLeftH + 4;

		btProductSearchComponentDetailsX = frmPixProductSearchPreviewX;
		btProductSearchComponentDetailsY  = frmPixProductSearchPreviewY + frmPixProductSearchPreviewH + 12.0/639.0*workingHeight;
		btProductSearchComponentDetailsW = 8.0/1024.0*workingWidth;
		btProductSearchComponentDetailsH = 8.0/639.0*workingHeight;

		lblProductSearchComponentDetailsX = btProductSearchComponentDetailsX + btProductSearchComponentDetailsW + 4.0/1024.0*workingWidth;
		lblProductSearchComponentDetailsY = btProductSearchComponentDetailsY - 2.0/639.0*workingHeight;
		lblProductSearchComponentDetailsW = btProductSearchComponentDetailsX + comboBoxWidth - btProductSearchComponentDetailsW;
		lblProductSearchComponentDetailsH = 12.0/639.0*workingHeight;

		btProductSearchLaunchW = btProductSearchPreviewW;
		btProductSearchLaunchH = comboBoxHeight;
		btProductSearchLaunchX = cmbProductSearchCasingSizeX + comboBoxWidth - btProductSearchLaunchW ;
		
		if (state == 8 || state == 10 || state == 13 || state == 16)
			btProductSearchLaunchY = 8.0/639.0*workingHeight + lblProductSearchComponentDetailsY + lblProductSearchComponentDetailsH;
		else
			btProductSearchLaunchY = btProductSearchRightY + btProductSearchRightH + (21.0 + 15.0*noOfComponents + 20.0 + 12.0 + 18.0)/639.0*workingHeight;
	}

	pixProductSearch->setGeometry(pixProductSearchX,pixProductSearchY,pixProductSearchW,pixProductSearchH);
	btProductSearchLeft->setGeometry(btProductSearchLeftX,btProductSearchLeftY,btProductSearchLeftW,btProductSearchLeftH);
	btProductSearchRight->setGeometry(btProductSearchRightX,btProductSearchRightY,btProductSearchRightW,btProductSearchRightH);
	frmPixProductSearchPreview->setGeometry(frmPixProductSearchPreviewX,frmPixProductSearchPreviewY,frmPixProductSearchPreviewW,frmPixProductSearchPreviewH);
	btProductSearchComponentDetails->setGeometry(btProductSearchComponentDetailsX,btProductSearchComponentDetailsY,btProductSearchComponentDetailsW,btProductSearchComponentDetailsH);
	lblProductSearchComponentDetails->setGeometry(lblProductSearchComponentDetailsX,lblProductSearchComponentDetailsY,lblProductSearchComponentDetailsW,lblProductSearchComponentDetailsH);
	btProductSearchLaunch->setGeometry(btProductSearchLaunchX,btProductSearchLaunchY,btProductSearchLaunchW,btProductSearchLaunchH);

	pixProductSearch->setStyleSheet("background-image: url(:/preview_search_window.png);");
	btProductSearchLeft->setStyleSheet("background-image: url(:/Button_left.png);");
	btProductSearchRight->setStyleSheet("background-image: url(:/Button_right.png);");
	frmPixProductSearchPreview->setFrameStyle(QFrame::Panel | QFrame::Raised);
	btProductSearchComponentDetails->setStyleSheet("background-image: url(:/blue_plus.png);");
	
	lblProductSearchComponentDetails->setText("Component Details");
	btProductSearchLaunch->setStyleSheet("background-image: url(:/preview_button.png); color : rgb(83,83,83)");
	btProductSearchLaunch->setText("Launch");

	#pragma endregion

	#pragma region Product Search Components Expanded List & Progress Bar

	int wgtProductSearchComponentsX;
	int wgtProductSearchComponentsY;
	int wgtProductSearchComponentsW;
	int wgtProductSearchComponentsH;

	int wgtProductSearchProgressX;
	int wgtProductSearchProgressY;
	int wgtProductSearchProgressW;
	int wgtProductSearchProgressH;

	int componentsProductSearchGap = 3.0/640.0*workingHeight;
	int componentsProductSearchRadioButtonHeight = 12.0/639.0*workingHeight;

	if ( state >=1 && state <=17 && state != 9 && state != 11 && state != 14 && state != 17 || state == 18)
	{
		for (int i=0;i<noOfComponents;i++)
			radBtProductSearchComponents[i]->setVisible(false);
		wgtProductSearchComponents->setVisible(false);
		wgtProductSearchProgress->setVisible(false);

	}
	else if (state == 9 || state == 11 || state == 14 || state == 17)
	{
		
		for (int i=0;i<noOfComponents;i++)
			radBtProductSearchComponents[i]->setVisible(true);
		wgtProductSearchComponents->setVisible(true);
		wgtProductSearchProgress->setVisible(true);

		wgtProductSearchComponentsX = btProductSearchLeftX + 3.0/1024.0*workingWidth;
		wgtProductSearchComponentsY = btProductSearchLeftY + btProductSearchLeftH + 22.0/1024.0*workingWidth;
		wgtProductSearchComponentsW = btProductSearchLeftW + btProductSearchRightW + pixProductSearchW - 6.0/639.0*workingHeight;
		wgtProductSearchComponentsH = noOfComponents*15.0/639.0*workingHeight;

		wgtProductSearchProgressX = btProductSearchLeftX;
		wgtProductSearchProgressY = wgtProductSearchComponentsY + wgtProductSearchComponentsH + 18.0/639.0*workingHeight;
		wgtProductSearchProgressW = wgtProductSearchComponentsW;
		wgtProductSearchProgressH = 12.0/639.0*workingHeight;

		
	}

	wgtProductSearchComponents->setGeometry(wgtProductSearchComponentsX,wgtProductSearchComponentsY,wgtProductSearchComponentsW,wgtProductSearchComponentsH);
	wgtProductSearchProgress->setGeometry(wgtProductSearchProgressX,wgtProductSearchProgressY,wgtProductSearchProgressW,wgtProductSearchProgressH);
	wgtProductSearchProgress->setStyleSheet("background-image: url(:/progress.png);");
	for (int i=0;i<noOfComponents;i++)
	{
		radBtProductSearchComponents[i]->setGeometry(1,componentsProductSearchGap*(i+1) + i*componentsProductSearchRadioButtonHeight,wgtProductSearchComponentsW-2,componentsProductSearchRadioButtonHeight);
		//radBtProductSearchComponents[i]->setStyle(new QMacStyle);
	}

	#pragma endregion

	#pragma region One Separator at the Bottom

	int wgtSeparatorBottomX;
	int wgtSeparatorBottomY;
	int wgtSeparatorBottomW;
	int wgtSeparatorBottomH;

	if (state == 1 || state == 18)
	{
		wgtSeparatorBottom->setVisible(false);
	}
	else if (state >=2 && state <=17)
	{
		wgtSeparatorBottom->setVisible(true);
		wgtSeparatorBottomX = frmProductSearchX;
		wgtSeparatorBottomY = 14.0/640.0*workingHeight + frmProductSearchH + frmProductSearchY;
		wgtSeparatorBottomW = frmProductSearchW;
		wgtSeparatorBottomH = 10.0/640.0*workingHeight;
	}

	wgtSeparatorBottom->setGeometry(wgtSeparatorBottomX,wgtSeparatorBottomY,wgtSeparatorBottomW,wgtSeparatorBottomH);
	wgtSeparatorBottom->setStyleSheet("background-image: url(:/separator.png)");

	#pragma endregion

	#pragma region Buttons at the bottom of the screen
	int bottomButtonsStartX = 271.0/1024.0*workingWidth;
	int bottomButtonsStartY = 8.0/640.0*workingHeight + whiteBackgroundWidgetY + whiteBackgroundWidgetHeight;
	int bottomButtonsBigSpacing = 26.0/1024.0*workingWidth;
	int bottomButtonsSmallSpacing = 2.0/1024.0*workingWidth;
	int bottomButtonW =  37.0/1024.0*workingWidth;
	int bottomButtonH =  27.0/640.0*workingHeight;

	int btZoomX = bottomButtonsStartX;
	int btRotateX = btZoomX + bottomButtonW + bottomButtonsSmallSpacing;
	int btPanX = btRotateX + bottomButtonW + bottomButtonsSmallSpacing;
	int btFitAllX = btPanX + bottomButtonW + bottomButtonsSmallSpacing;

	int btViewRightX = btFitAllX + bottomButtonW + bottomButtonsBigSpacing;
	int btViewBackX = btViewRightX + bottomButtonW + bottomButtonsSmallSpacing;
	int btViewFrontX = btViewBackX + bottomButtonW + bottomButtonsSmallSpacing;
	int btViewTopX = btViewFrontX + bottomButtonW + bottomButtonsSmallSpacing;
	int btViewAxoX = btViewTopX + bottomButtonW + bottomButtonsSmallSpacing;

	int btViewWireframeX = btViewAxoX + bottomButtonW + bottomButtonsBigSpacing;
	int btViewShadedX = btViewWireframeX + bottomButtonW + bottomButtonsSmallSpacing;

	int btChangeLightsX = btViewShadedX + bottomButtonW + bottomButtonsBigSpacing;
	int btChangeBackgroundColorX = btChangeLightsX + bottomButtonW + bottomButtonsSmallSpacing;
	int btMeasureX = btChangeBackgroundColorX + bottomButtonW + bottomButtonsSmallSpacing;

	int btViewInfoX = btMeasureX + bottomButtonW + bottomButtonsBigSpacing;

	btZoom->setGeometry(btZoomX,bottomButtonsStartY,bottomButtonW,bottomButtonH);
	btZoom->setStyleSheet("background-image: url(:/zoom.png)");

	btPan->setGeometry(btPanX,bottomButtonsStartY,bottomButtonW,bottomButtonH);
	btPan->setStyleSheet("background-image: url(:/pan.png)");

	btRotate->setGeometry(btRotateX,bottomButtonsStartY,bottomButtonW,bottomButtonH);
	btRotate->setStyleSheet("background-image: url(:/rotate.png)");

	btFitAll->setGeometry(btFitAllX,bottomButtonsStartY,bottomButtonW,bottomButtonH);
	btFitAll->setStyleSheet("background-image: url(:/fitall.png)");

	btViewBack->setGeometry(btViewBackX,bottomButtonsStartY,bottomButtonW,bottomButtonH);
	btViewBack->setStyleSheet("background-image: url(:/viewback.png)");

	btViewFront->setGeometry(btViewFrontX,bottomButtonsStartY,bottomButtonW,bottomButtonH);
	btViewFront->setStyleSheet("background-image: url(:/viewFront.png)");

	btViewRight->setGeometry(btViewRightX,bottomButtonsStartY,bottomButtonW,bottomButtonH);
	btViewRight->setStyleSheet("background-image: url(:/viewright.png)");

	btViewTop->setGeometry(btViewTopX,bottomButtonsStartY,bottomButtonW,bottomButtonH);
	btViewTop->setStyleSheet("background-image: url(:/viewTop.png)");
	

	btViewAxo->setGeometry(btViewAxoX,bottomButtonsStartY,bottomButtonW,bottomButtonH);
	btViewAxo->setStyleSheet("background-image: url(:/viewAxo.png)");
	
	
	btViewWireframe->setGeometry(btViewWireframeX,bottomButtonsStartY,bottomButtonW,bottomButtonH);
	btViewWireframe->setStyleSheet("background-image: url(:/viewWireframe.png)");

	btViewShaded->setGeometry(btViewShadedX,bottomButtonsStartY,bottomButtonW,bottomButtonH);
	btViewShaded->setStyleSheet("background-image: url(:/viewSolid.png)");

	btChangeLights->setGeometry(btChangeLightsX,bottomButtonsStartY,bottomButtonW,bottomButtonH);
	btChangeLights->setStyleSheet("background-image: url(:/viewLights.png)");

	btChangeBackgroundColor->setGeometry(btChangeBackgroundColorX,bottomButtonsStartY,bottomButtonW,bottomButtonH);
	btChangeBackgroundColor->setStyleSheet("background-image: url(:/background_color.png)");

	btMeasure->setGeometry(btMeasureX,bottomButtonsStartY,bottomButtonW,bottomButtonH);
	btMeasure->setStyleSheet("background-image: url(:/measure.png)");

	
	btViewInfo->setGeometry(btViewInfoX,bottomButtonsStartY,bottomButtonW,bottomButtonH);
	btViewInfo->setStyleSheet("background-image: url(:/info.png)");

	#pragma endregion

	#pragma region Testing Widgets
	statusBar()->setVisible(false);

	testInterface->setGeometry(lblProductNameX+lblProductNameWidth+lblProductNameWidth,lblProductNameY,lblProductNameWidth,lblProductNameHeight*2);
	testInterface->setText("Change State");
	//whiteBackgroundWidget->setVisible(false);
	//verticalBlankBlueWidget->setVisible(false); 
	//verticalBlankGreyWidget->setVisible(false); 
	
	
	
	//lblProductName->setVisible(false); 
	//wgtLeftRuler->setVisible(false); 
	//wgtDownRuler->setVisible(false);
	//wgtUpRuler->setVisible(false);
	//wgtRightRuler->setVisible(false);
//	myVC->setVisible(false);
	//myOCC->setVisible(false); 
	
	//wgtBlankScreen->setVisible(false);

	//tabProductSelectionWidget->setVisible(false); 
	
	//tabBrowseCatalogWidget->setVisible(false); 
	
	//tabExportOptionsWidget->setVisible(false);

	//btProductSelection->setVisible(false); 
	
	//btBrowseCatalog->setVisible(false); 
	//btExportOptions->setVisible(false); 
	//frmProductSelection->setVisible(false); 
	//frmProductSelectionLabel->setVisible(false);
	//lblProductSelection->setVisible(false);
	//btProductSelectionExpansion->setVisible(false);

	//cmbProductSelectionProductRange->setVisible(false);
	//cmbProductSelectionCasingSize->setVisible(false);
	//cmbProductSelectionHoleSize->setVisible(false);
	//btProductSelectionPreview->setVisible(false);
	//wgtSeparatorTop->setVisible(false);
	//wgtSeparatorBottom->setVisible(false);
	//frmProductSearch->setVisible(false);
	//lblProductSearch->setVisible(false);
	//btProductSearchExpansion->setVisible(false);
	//frmProductSearchLabel->setVisible(false);

	//cmbProductSearchProductRange->setVisible(false);
	//cmbProductSearchCasingSize->setVisible(false);
	//cmbProductSearchHoleSize->setVisible(false);
	//btProductSearchPreview->setVisible(false);
	#pragma endregion
/*
	#pragma region Browse Catalog Top and Middle Frames plus Buttons

	int btBrowseCatalogUpX;
	int btBrowseCatalogUpY;
	int btBrowseCatalogUpW;
	int btBrowseCatalogUpH;

	int btBrowseCatalogDownX;
	int btBrowseCatalogDownY;
	int btBrowseCatalogDownW;
	int btBrowseCatalogDownH;

	int frmBrowseCatalogTopOuterX;
	int frmBrowseCatalogTopOuterY;
	int frmBrowseCatalogTopOuterW;
	int frmBrowseCatalogTopOuterH;

	int frmBrowseCatalogTopInnerX;
	int frmBrowseCatalogTopInnerY;
	int frmBrowseCatalogTopInnerW;
	int frmBrowseCatalogTopInnerH;

	int frmBrowseCatalogMidOuterX;
	int frmBrowseCatalogMidOuterY;
	int frmBrowseCatalogMidOuterW;
	int frmBrowseCatalogMidOuterH;

	int frmBrowseCatalogMidInnerX;
	int frmBrowseCatalogMidInnerY;
	int frmBrowseCatalogMidInnerW;
	int frmBrowseCatalogMidInnerH;

	int pixBrowseCatalogTopX;
	int pixBrowseCatalogTopY;
	int pixBrowseCatalogTopW;
	int pixBrowseCatalogTopH;

	int pixBrowseCatalogMidX;
	int pixBrowseCatalogMidY;
	int pixBrowseCatalogMidW;
	int pixBrowseCatalogMidH;

	int btBrowseCatalogDetailsTopX;
	int btBrowseCatalogDetailsTopY;
	int btBrowseCatalogDetailsTopW;
	int btBrowseCatalogDetailsTopH;

	int btBrowseCatalogDetailsMidX;
	int btBrowseCatalogDetailsMidY;
	int btBrowseCatalogDetailsMidW;
	int btBrowseCatalogDetailsMidH;

	int lblBrowseCatalogDetailsTopX;
	int lblBrowseCatalogDetailsTopY;
	int lblBrowseCatalogDetailsTopW;
	int lblBrowseCatalogDetailsTopH;

	int lblBrowseCatalogDetailsMidX;
	int lblBrowseCatalogDetailsMidY;
	int lblBrowseCatalogDetailsMidW;
	int lblBrowseCatalogDetailsMidH;

	int gapBetweenFrameBrowseCatalog = 14.0/639.0*workingHeight;

	if (state <=17) 
	{
		btBrowseCatalogUp->setVisible(false);
		btBrowseCatalogDown->setVisible(false);
		
		frmBrowseCatalogTopOuter->setVisible(false);
		frmBrowseCatalogTopInner->setVisible(false);
		
		frmBrowseCatalogMidOuter->setVisible(false);
		frmBrowseCatalogMidInner->setVisible(false);
		
		pixBrowseCatalogTop->setVisible(false);
		pixBrowseCatalogMid->setVisible(false);
		btBrowseCatalogDetailsTop->setVisible(false);
		btBrowseCatalogDetailsMid->setVisible(false);
		lblBrowseCatalogDetailsTop->setVisible(false);
		lblBrowseCatalogDetailsMid->setVisible(false);
		
	}
	else if (state == 18)
	{
		btBrowseCatalogUp->setVisible(true);
		btBrowseCatalogDown->setVisible(true);
		
		frmBrowseCatalogTopOuter->setVisible(true);
		frmBrowseCatalogTopInner->setVisible(true);
		
		frmBrowseCatalogMidOuter->setVisible(true);
		frmBrowseCatalogMidInner->setVisible(true);
		
		pixBrowseCatalogTop->setVisible(true);
		pixBrowseCatalogMid->setVisible(true);
		btBrowseCatalogDetailsTop->setVisible(true);
		btBrowseCatalogDetailsMid->setVisible(true);
		lblBrowseCatalogDetailsTop->setVisible(true);
		lblBrowseCatalogDetailsMid->setVisible(true);
		

		btBrowseCatalogUpX = 44.0/1024.0*workingWidth + startingPointX; 
		btBrowseCatalogUpY = whiteBackgroundWidgetY;
		btBrowseCatalogUpW = 143.0/1024.0*workingWidth; 
		btBrowseCatalogUpH = 25.0/639.0*workingHeight;

		btBrowseCatalogDownX = btBrowseCatalogUpX;
		btBrowseCatalogDownY = startingPointY + workingHeight - btBrowseCatalogUpH;
		btBrowseCatalogDownW = btBrowseCatalogUpW;
		btBrowseCatalogDownH = btBrowseCatalogUpH;

		frmBrowseCatalogTopOuterX = 35.0/1024.0*workingWidth ;
		frmBrowseCatalogTopOuterY = 130.0/639.0*workingHeight+ startingPointY;
		frmBrowseCatalogTopOuterW = 163.0/1024.0*workingWidth;
		frmBrowseCatalogTopOuterH = 140.0/639.0*workingHeight;

		frmBrowseCatalogTopInnerX = frmBrowseCatalogTopOuterX + 5.0/1024.0*workingWidth;
		frmBrowseCatalogTopInnerY = frmBrowseCatalogTopOuterY + 8.0/639.0*workingHeight;
		frmBrowseCatalogTopInnerW = 152.0/1024.0*workingWidth;
		frmBrowseCatalogTopInnerH = 107.0/639.0*workingHeight;

		frmBrowseCatalogMidOuterX = frmBrowseCatalogTopOuterX;
		frmBrowseCatalogMidOuterY = frmBrowseCatalogTopOuterY + frmBrowseCatalogTopOuterH + gapBetweenFrameBrowseCatalog;
		frmBrowseCatalogMidOuterW = frmBrowseCatalogTopOuterW;
		frmBrowseCatalogMidOuterH = frmBrowseCatalogTopOuterH;

		frmBrowseCatalogMidInnerX = frmBrowseCatalogMidOuterX + 5.0/1024.0*workingWidth;;
		frmBrowseCatalogMidInnerY = frmBrowseCatalogMidOuterY + 8.0/639.0*workingHeight;;
		frmBrowseCatalogMidInnerW = frmBrowseCatalogTopInnerW;
		frmBrowseCatalogMidInnerH = frmBrowseCatalogTopInnerH;

		pixBrowseCatalogTopX = frmBrowseCatalogTopInnerX+2;
		pixBrowseCatalogTopY = frmBrowseCatalogTopInnerY+2;
		pixBrowseCatalogTopW = frmBrowseCatalogTopInnerW-4;
		pixBrowseCatalogTopH = frmBrowseCatalogTopInnerH-4;

		pixBrowseCatalogMidX = frmBrowseCatalogMidInnerX+2;
		pixBrowseCatalogMidY = frmBrowseCatalogMidInnerY+2;
		pixBrowseCatalogMidW = frmBrowseCatalogMidInnerW-4;
		pixBrowseCatalogMidH = frmBrowseCatalogMidInnerH-4;

		btBrowseCatalogDetailsTopX = frmBrowseCatalogTopOuterX + 2.0/1024.0*workingWidth;
		btBrowseCatalogDetailsTopY = frmBrowseCatalogTopInnerY + frmBrowseCatalogTopInnerH ;
		btBrowseCatalogDetailsTopW = 20.0/1024.0*workingWidth;
		btBrowseCatalogDetailsTopH = 22.0/639.0*workingHeight;

		btBrowseCatalogDetailsMidX = btBrowseCatalogDetailsTopX+ 2.0/1024.0*workingWidth;
		btBrowseCatalogDetailsMidY = frmBrowseCatalogMidInnerY + frmBrowseCatalogMidInnerH;
		btBrowseCatalogDetailsMidW = btBrowseCatalogDetailsTopW;
		btBrowseCatalogDetailsMidH = btBrowseCatalogDetailsTopH;

		lblBrowseCatalogDetailsTopX = btBrowseCatalogDetailsTopX + btBrowseCatalogDetailsTopW + 2.0/1024.0*workingWidth;
		lblBrowseCatalogDetailsTopY = frmBrowseCatalogTopInnerY + frmBrowseCatalogTopInnerH + 6.0/639.0*workingHeight;
		lblBrowseCatalogDetailsTopW = 50.0/1024.0*workingWidth;
		lblBrowseCatalogDetailsTopH = 13.0/639.0*workingHeight;

		lblBrowseCatalogDetailsMidX = btBrowseCatalogDetailsMidX + btBrowseCatalogDetailsMidW + 2.0/1024.0*workingWidth;
		lblBrowseCatalogDetailsMidY = frmBrowseCatalogMidInnerY + frmBrowseCatalogMidInnerH + 6.0/639.0*workingHeight;
		lblBrowseCatalogDetailsMidW = lblBrowseCatalogDetailsTopW;
		lblBrowseCatalogDetailsMidH = lblBrowseCatalogDetailsTopH;
	}

	btBrowseCatalogUp->setGeometry(btBrowseCatalogUpX,btBrowseCatalogUpY,btBrowseCatalogUpW,btBrowseCatalogUpH);
	btBrowseCatalogUp->setStyleSheet("background-image: url(:/browseCatalogUpButton.png)");

	btBrowseCatalogDown->setGeometry(btBrowseCatalogDownX,btBrowseCatalogDownY,btBrowseCatalogDownW,btBrowseCatalogDownH);
	btBrowseCatalogDown->setStyleSheet("background-image: url(:/browseCatalogDownButton.png)");

	frmBrowseCatalogTopOuter->setGeometry(frmBrowseCatalogTopOuterX,frmBrowseCatalogTopOuterY,frmBrowseCatalogTopOuterW,frmBrowseCatalogTopOuterH);
	frmBrowseCatalogTopOuter->setFrameStyle(QFrame::Panel | QFrame::Raised);

	frmBrowseCatalogTopInner->setGeometry(frmBrowseCatalogTopInnerX,frmBrowseCatalogTopInnerY,frmBrowseCatalogTopInnerW,frmBrowseCatalogTopInnerH);
	frmBrowseCatalogTopInner->setFrameStyle(QFrame::Panel | QFrame::Raised);
	


	frmBrowseCatalogMidOuter->setGeometry(frmBrowseCatalogMidOuterX,frmBrowseCatalogMidOuterY,frmBrowseCatalogMidOuterW,frmBrowseCatalogMidOuterH);
	frmBrowseCatalogMidOuter->setFrameStyle(QFrame::Panel | QFrame::Raised);

	frmBrowseCatalogMidInner->setGeometry(frmBrowseCatalogMidInnerX,frmBrowseCatalogMidInnerY,frmBrowseCatalogMidInnerW,frmBrowseCatalogMidInnerH);
	frmBrowseCatalogMidInner->setFrameStyle(QFrame::Panel | QFrame::Raised);

	
	pixBrowseCatalogTop->setGeometry(pixBrowseCatalogTopX,pixBrowseCatalogTopY,pixBrowseCatalogTopW,pixBrowseCatalogTopH);
	pixBrowseCatalogTop->setStyleSheet("background-image: url(:/browseCatalogPreview.png)");

	pixBrowseCatalogMid->setGeometry(pixBrowseCatalogMidX,pixBrowseCatalogMidY,pixBrowseCatalogMidW,pixBrowseCatalogMidH);
	pixBrowseCatalogMid->setStyleSheet("background-image: url(:/browseCatalogPreview.png)");

	btBrowseCatalogDetailsTop->setGeometry(btBrowseCatalogDetailsTopX,btBrowseCatalogDetailsTopY,btBrowseCatalogDetailsTopW,btBrowseCatalogDetailsTopH);
	btBrowseCatalogDetailsTop->setStyleSheet("background-image: url(:/browseCatalogDetails.png)");

	btBrowseCatalogDetailsMid->setGeometry(btBrowseCatalogDetailsMidX,btBrowseCatalogDetailsMidY,btBrowseCatalogDetailsMidW,btBrowseCatalogDetailsMidH);
	btBrowseCatalogDetailsMid->setStyleSheet("background-image: url(:/browseCatalogDetails.png)");

	lblBrowseCatalogDetailsTop->setGeometry(lblBrowseCatalogDetailsTopX,lblBrowseCatalogDetailsTopY,lblBrowseCatalogDetailsTopW,lblBrowseCatalogDetailsTopH);
	lblBrowseCatalogDetailsTop->setStyleSheet("color : rgb(83,83,83)");
	lblBrowseCatalogDetailsTop->setText("Details");
	
	lblBrowseCatalogDetailsMid->setGeometry(lblBrowseCatalogDetailsMidX,lblBrowseCatalogDetailsMidY,lblBrowseCatalogDetailsMidW,lblBrowseCatalogDetailsMidH);
	lblBrowseCatalogDetailsMid->setStyleSheet("color : rgb(83,83,83)");
	lblBrowseCatalogDetailsMid->setText("Details");

#pragma endregion
	*/
/*
	#pragma region Browse Catalog Bottom Frame plus Buttons

	int frmBrowseCatalogBotOuterX;
	int frmBrowseCatalogBotOuterY;
	int frmBrowseCatalogBotOuterW;
	int frmBrowseCatalogBotOuterH;

	int frmBrowseCatalogBotInnerX;
	int frmBrowseCatalogBotInnerY;
	int frmBrowseCatalogBotInnerW;
	int frmBrowseCatalogBotInnerH;

	int pixBrowseCatalogBotX;
	int pixBrowseCatalogBotY;
	int pixBrowseCatalogBotW;
	int pixBrowseCatalogBotH;

	int btBrowseCatalogDetailsBotX;
	int btBrowseCatalogDetailsBotY;
	int btBrowseCatalogDetailsBotW;
	int btBrowseCatalogDetailsBotH;

	int lblBrowseCatalogDetailsBotX;
	int lblBrowseCatalogDetailsBotY;
	int lblBrowseCatalogDetailsBotW;
	int lblBrowseCatalogDetailsBotH;

	if (state <=17) 
	{
		frmBrowseCatalogBotOuter->setVisible(false);
		frmBrowseCatalogBotInner->setVisible(false);
		pixBrowseCatalogBot->setVisible(false);
		btBrowseCatalogDetailsBot->setVisible(false);
		lblBrowseCatalogDetailsBot->setVisible(false);
		
	}
	else if (state == 18)
	{
		frmBrowseCatalogBotOuter->setVisible(true);
		frmBrowseCatalogBotInner->setVisible(true);
		pixBrowseCatalogBot->setVisible(true);
		btBrowseCatalogDetailsBot->setVisible(true);
		lblBrowseCatalogDetailsBot->setVisible(true);

		frmBrowseCatalogBotOuterX = frmBrowseCatalogMidOuterX;
		frmBrowseCatalogBotOuterY = frmBrowseCatalogMidOuterY + frmBrowseCatalogMidOuterH + gapBetweenFrameBrowseCatalog;
		frmBrowseCatalogBotOuterW = frmBrowseCatalogMidOuterW;
		frmBrowseCatalogBotOuterH = frmBrowseCatalogMidOuterH;

		frmBrowseCatalogBotInnerX = frmBrowseCatalogBotOuterX + 5.0/1024.0*workingWidth;;
		frmBrowseCatalogBotInnerY = frmBrowseCatalogBotOuterY + 8.0/639.0*workingHeight;;
		frmBrowseCatalogBotInnerW = frmBrowseCatalogTopInnerW;
		frmBrowseCatalogBotInnerH = frmBrowseCatalogTopInnerH;

		pixBrowseCatalogBotX = frmBrowseCatalogBotInnerX+2;
		pixBrowseCatalogBotY = frmBrowseCatalogBotInnerY+2;
		pixBrowseCatalogBotW = frmBrowseCatalogBotInnerW-4;
		pixBrowseCatalogBotH = frmBrowseCatalogBotInnerH-4;

		btBrowseCatalogDetailsBotX = btBrowseCatalogDetailsTopX+ 2.0/1024.0*workingWidth;
		btBrowseCatalogDetailsBotY = frmBrowseCatalogBotInnerY + frmBrowseCatalogBotInnerH ;
		btBrowseCatalogDetailsBotW = btBrowseCatalogDetailsTopW;
		btBrowseCatalogDetailsBotH = btBrowseCatalogDetailsTopH;

		lblBrowseCatalogDetailsBotX = btBrowseCatalogDetailsBotX + btBrowseCatalogDetailsBotW + 2.0/1024.0*workingWidth;
		lblBrowseCatalogDetailsBotY = frmBrowseCatalogBotInnerY + frmBrowseCatalogBotInnerH + 6.0/639.0*workingHeight;
		lblBrowseCatalogDetailsBotW = lblBrowseCatalogDetailsTopW;
		lblBrowseCatalogDetailsBotH = lblBrowseCatalogDetailsTopH;
	}

	frmBrowseCatalogBotOuter->setGeometry(frmBrowseCatalogBotOuterX,frmBrowseCatalogBotOuterY,frmBrowseCatalogBotOuterW,frmBrowseCatalogBotOuterH);
	frmBrowseCatalogBotOuter->setFrameStyle(QFrame::Panel | QFrame::Raised);

	frmBrowseCatalogBotInner->setGeometry(frmBrowseCatalogBotInnerX,frmBrowseCatalogBotInnerY,frmBrowseCatalogBotInnerW,frmBrowseCatalogBotInnerH);
	frmBrowseCatalogBotInner->setFrameStyle(QFrame::Panel | QFrame::Raised);

	pixBrowseCatalogBot->setGeometry(pixBrowseCatalogBotX,pixBrowseCatalogBotY,pixBrowseCatalogBotW,pixBrowseCatalogBotH);
	pixBrowseCatalogBot->setStyleSheet("background-image: url(:/browseCatalogPreview.png)");

	btBrowseCatalogDetailsBot->setGeometry(btBrowseCatalogDetailsBotX,btBrowseCatalogDetailsBotY,btBrowseCatalogDetailsBotW,btBrowseCatalogDetailsBotH);
	btBrowseCatalogDetailsBot->setStyleSheet("background-image: url(:/browseCatalogDetails.png)");


	lblBrowseCatalogDetailsBot->setGeometry(lblBrowseCatalogDetailsBotX,lblBrowseCatalogDetailsBotY,lblBrowseCatalogDetailsBotW,lblBrowseCatalogDetailsBotH);
	lblBrowseCatalogDetailsBot->setStyleSheet("color : rgb(83,83,83)");
	lblBrowseCatalogDetailsBot->setText("Details");
	

	#pragma endregion
	*/



}

string itos(int i)	// convert int to string
{
	stringstream s;
	s << i;
	return s.str();
}


void MainWindow::changeLoc()
{
	if (state == 1)
		state =2 ;
	else
		state = 1;
	setWidgets();
	update();
}

void MainWindow::actOnbtProductSelectionExpansion()
{
	if (state == 2)
		state =3 ;
	else
		state = 2;
	setWidgets();
	update();
}

void MainWindow::incState()
{
	if (state == MAX_STATE)
		state =1 ;
	else
		state++;
	setWidgets();
	update();
}

Message 2 in thread

On 25.06.07 15:57:14, Harsh Vardhan wrote:
> i'm attaching the header file and the mainwindow.cpp file.
> 
> here is the gist of what is happening
> 
> in mainwindow.h you have the declaration of various pointers for widgets.

If you want us to look at some example code, reduce it to a size where
it still shows the problem but only has a few lines. Nobody is going to
debug this code. Also its not compilable so nobody can actually just put
it somewhere and build it.

Andreas

-- 
 [ signature omitted ] 

Message 3 in thread

i apologize to the community and Andreas & Prateek in particular. the mail
was written in a rush and cut and copied from another mail. i also forgot
that i was attaching those huge files. i'm sorry and would compose the
problem efficiently again.

sorry for the ugly mail

cheers
Harsh


On 6/25/07, Andreas Pakulat <apaku@xxxxxx> wrote:
>
> On 25.06.07 15:57:14, Harsh Vardhan wrote:
> > i'm attaching the header file and the mainwindow.cpp file.
> >
> > here is the gist of what is happening
> >
> > in mainwindow.h you have the declaration of various pointers for
> widgets.
>
> If you want us to look at some example code, reduce it to a size where
> it still shows the problem but only has a few lines. Nobody is going to
> debug this code. Also its not compilable so nobody can actually just put
> it somewhere and build it.
>
> Andreas
>
> --
> You have been selected for a secret mission.
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>


-- 
 [ signature omitted ] 

Message 4 in thread

What is this mail ? There is no "please", it is casual regional lingo
downstream.
Please respect the sanctity of the mailing list and do a google on how
to post questions in forums..
 
Cheers!
Prateek 


________________________________

	From: Harsh Vardhan [mailto:vardhan.harsh@xxxxxxxxx] 
	Sent: Monday, June 25, 2007 3:57 PM
	To: qt-interest@xxxxxxxxxxxxx
	Subject: Error when a new widget is added
	
	
	
	i'm attaching the header file and the mainwindow.cpp file. 
	
	here is the gist of what is happening 
	
	in mainwindow.h you have the declaration of various pointers for
widgets. 
	
	     QWidget* whiteBackgroundWidget;
	    QWidget* tabProductSelectionWidget;
	    QWidget* tabBrowseCatalogWidget;
	    ...... 
	    ....... 
	    QWidget* pixBrowseCatalogTop;
	    QWidget* pixBrowseCatalogMid;
	    
	    QPushButton* btBrowseCatalogDetailsTop;
	
	and then you finally see : 
	
	    float* data1;
	
	followed by some commented code. 
	
	now in the constructor for this class : what you can see is that
there's a function called createWidgets() where each of these widgets
are instantiated. and followed by setWidgets where all of these widgets
are given their final positions , depending upon the state of the
system. 
	
	anyways setWidgets is not important. 
	
	if i comment out the line float* data1 in the header file,
everything runs smoothly and the code executes as it should with
appropriate results. but as soon as i uncomment the code (even if i
instantiate the pointer in the mainwindow.cpp file, and dont use it )..
the application crashes somewhere in the middle of the createWidgets()
function. the exact error message generated by VC++ is : 
	
	Unhandled exception at 0x087bf23f in TabApp28.exe : 0xC0000005:
Access violation writing location 0x00000004.
	
	QWidget::create: Failed to create window (Cannot create a
top-level child window.)
	QWidget::create: Failed to create window (Cannot create a
top-level child window.) 
	QWidget::create: Failed to create window (Cannot create a
top-level child window.)
	QWidget::create: Failed to create window (Cannot create a
top-level child window.)
	QWidget::create: Failed to create window (Cannot create a
top-level child window.) 
	QWidget::create: Failed to create window (Cannot create a
top-level child window.)
	QWidget::create: Failed to create window (Cannot create a
top-level child window.)
	QWidget::create: Failed to create window (Cannot create a
top-level child window.) 
	QWidget::create: Failed to create window (Cannot create a
top-level child window.)
	QWidget::create: Failed to create window (Cannot create a
top-level child window.)
	First-chance exception at 0x087bf23f in TabApp28.exe :
0xC0000005: Access violation writing location 0x00000004.
	Unhandled exception at 0x087bf23f in TabApp28.exe: 0xC0000005:
Access violation writing location 0x00000004.
	
	any ideas that comes to your mind is really looked for. 
	
	cheers
	Harsh 
	
	
	
	
	
	
	
	
	On 6/25/07, Harsh Vardhan < vardhan.harsh@xxxxxxxxx
<mailto:vardhan.harsh@xxxxxxxxx> > wrote: 

		chal mai dekhta hoon isse. try karta hoon , agar nahi
hota hai to fir se code bhejta hoon. 
		
		khair tere ko compile karne ke liye to QT chahiye hoga
along with MS Visual studio. to bus mai code snippet bhej paaonga.
isiliye apne end pe hi try karta hoon 
		
		cheers
		Harsh 
		
		
		
		
		On 6/25/07, Aseem Rastogi <
aseem@xxxxxxxxxxxxxxxxxxxxxxx <mailto:aseem@xxxxxxxxxxxxxxxxxxxxxxx> >
wrote: 

	
http://publib.boulder.ibm.com/infocenter/macxhelp/v6v81/index.jsp?topic=
/com.ibm.vacpp6m.doc/language/ref/clrc05snewhnd.htm
	
http://msdn2.microsoft.com/en-us/library/5fath9te(VS.80).aspx
<http://msdn2.microsoft.com/en-us/library/5fath9te%28VS.80%29.aspx> 
			
			sample code:
			
			#include <new.h>
			void new_handler() {
			  printf ("new_handler() : out of memory
!!!\n");
			  abort();
			}
			
			int main ()
			{
			    set_new_handler(&new_handler); 
			}
			
			This can be helpful in catching no memory
scenarios.
			
			-Aseem.
			
			




		-- 
		Harsh Vardhan
		For Mechartes Researchers Pvt. Ltd. 
		TBIU , IIT Delhi, New Delhi - 110016 
		+91 - 93120 - 72096
		http://www.mechartes.com 




	-- 
	Harsh Vardhan
	For Mechartes Researchers Pvt. Ltd. 
	TBIU , IIT Delhi, New Delhi - 110016
	+91 - 93120 - 72096
	http://www.mechartes.com 



	-- 
	Harsh Vardhan
	For Mechartes Researchers Pvt. Ltd. 
	TBIU , IIT Delhi, New Delhi - 110016
	+91 - 93120 - 72096
	http://www.mechartes.com 


Message 5 in thread

On 06-25-2007 5:27 AM, "Harsh Vardhan" wrote:

> QWidget::create: Failed to create window (Cannot create a top-level child
> window.)

I remember seeing this a while back in my code. It turned out I was not
deleting widgets when I thought I was, and essentially creating too many
Windows resources.

After a quick look at your code I noticed radBtProductSelectionComponents
was allocated and used over and over, but never deleted. There may be other
objects as well, and this may not be the source of your problem since it is
just an array.

Put a break in qwidget.cpp where this message is generated and see what
objects are failing to create properly.

Keith
**Please do not reply to me, reply to the list.**


--
 [ signature omitted ]