我们在vs2005中 Qt->Open Solution from .pro File 时,可能会碰到这个问题
这是因为license的问题
看输出:
--- (Import): Generating new project of qtcolortriangle.pro file
--- (qmake) : Using: d:\qt\4.3.0\bin\qmake
--- (qmake) : Working Directory: I:\Soft\QtSetup\solutions\qtcolortriangle-2.4-commercial
--- (qmake) : Arguments: -spec $(QTDIR)\mkspecs\win32-msvc2005 -tp vc "qtcolortriangle.pro" -recursive QMAKE_INCDIR_QT=$(QTDIR)\include QMAKE_LIBDIR_QT= QMAKE_LIBDIR=$(QTDIR)\lib QMAKE_UIC=$(QTDIR)\bin\uic.exe QMAKE_MOC=$(QTDIR)\bin\moc.exe QMAKE_RCC=$(QTDIR)\bin\rcc.exe QMAKE_QMAKE=$(QTDIR)\bin\qmake.exe
--- (Import): Success - 20
[14] - .
[15] - Please choose your region.
[16] - .
[17] - Type 1 for North or South America.
[18] - Type 2 for anywhere outside North and South America.
[19] - .
[20] - Select:
--- (Import): Error - 4
[3] - 此时不应有 (。
[4] - Project ERROR: You are not licensed to use this software.
破解方法很简单:
1.建立一个txt文件;
2.写“license accepted ”到文件里,注意是写引号里面的部分,最后的空格不确定是否必须;
3.把文件名改为"
licenseAccepted",没有后缀名。
放到每个solution的util文件夹里,如 QtSetup\solutions\qtcolorcombobox-2.2-commercial\util\ 下面
好了,爽了
solutions里面的某些可以嵌入到Qt Designer里面,如ColorPicker,还能编辑属性,啧啧啊
直接把 solutions\qtcolorpicker-2.3-commercial\plugin\plugin.pro 用vs2005中的Qt->Open Solution from .pro File打开,release生成一次,就自动地把qtcolorpickerplugin.dll放到
$(QTDIR)\plugins\designer\下了
插件实现原理:
class QtColorPickerPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
QtColorPickerPlugin(QWidget *parent = 0);
~QtColorPickerPlugin() {}
QString name() const;
QString group() const;
QString toolTip() const;
QString whatsThis() const;
QString includeFile() const;
QIcon icon() const;
bool isContainer() const;
QWidget *createWidget(QWidget *parent);
bool isInitialized() const;
void initialize(QDesignerFormEditorInterface *core);
QString domXml() const;
private:
bool m_initialized;
};
posted on 2008-01-12 00:57
七星重剑 阅读(4373)
评论(8) 编辑 收藏 引用 所属分类:
C++ lib -- Qt