[Jahshaka-cvs] jah/jahwidgets/test widgetHarness.cpp, NONE, 1.1 widgetHarness.pro, NONE, 1.1
Status: Beta
Brought to you by:
jahshaka
From: John B. <ok_...@us...> - 2006-09-19 10:26:29
|
Update of /cvsroot/jahshaka/jah/jahwidgets/test In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv13888/jahwidgets/test Added Files: widgetHarness.cpp widgetHarness.pro Log Message: * Adding widgetHarness for testing of Qt wigdets --- NEW FILE: widgetHarness.cpp --- /* -*- mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- */ // jahwidgets - A widget library representation. // Copyright (C) 2006 Visual Media FX Ltd. // Released under the LGPL. // For more information, see http://www.jahshaka.org. // Test a widget: usage widgetHarness <classname> #include <qapplication.h> #include <qstylefactory.h> #include <qvbox.h> #include "widgets.h" int main( int argc, char** argv ) { if ( argc < 2 ) { printf( "Usage: widgetHarness <classname>\n" ); return 0; } QApplication app( argc, argv ); QVBox* vbox = new QVBox(); QWidget* widget = jahwidgets::qt3::Widgets().create( argv[1], vbox ); if ( !widget ) { qWarning( "Unable to create widget: %s", argv[1] ); return -1; } QStyle* style = QStyleFactory::create( "v3" ); if ( style ) { QApplication::setStyle( style ); } else { qWarning( "Unable to load 'v3' style" ); } app.setMainWidget( vbox ); vbox->adjustSize(); vbox->show(); return app.exec(); } --- NEW FILE: widgetHarness.pro --- TEMPLATE = app CONFIG = debug qt TARGET = widgetHarness unix !mac:LIBS += -Wl,-E INCLUDEPATH += . ../src/qt3/widgets # Link against wrapper, not widgets, because on the mac widgets is a plugin (not a dynamic lib) LIBS += -L../src/qt3/wrapper -lwrapper # Input SOURCES += widgetHarness.cpp mac { # Fixup the wrapper library path. Called using 'make install' fixup_dylib_path.path = . fixup_dylib_path.extra = install_name_tool -change libwrapper.dylib.1 `pwd`/../src/qt3/wrapper/libwrapper.dylib.1 widgetHarness INSTALLS += fixup_dylib_path } |