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

Qt-interest Archive, April 2008
QDesignerCustomWidgetInterface questions


Message 1 in thread

Hi Everybody, 

In 4.3.4, I am setting up a designer plugin: 

1) I don't understand what QtAssistant says about the function isContainer. My custom widget creates it's own QPushButtons. I do NOT want the designer user to be able to add widgets within this custom one. Should I return true or false? I am currently returning false, and that seems correct in this case. What exactly does this setting control? 

2) I am also not clear which properties I need to include in the XML return value of domXml. At the moment, I am just returning the geometry. If I add my own properties via Q_PROPERTY(DESIGNABLE true), do I have to set those in the XML as well? 

3) In the plugin .pro file I have included the line:

	target.path = $$[QT_INSTALL_PLUGINS]/designer

It does not seem to work when generated to a MSVS 2005 project - I have to manually copy the .dll and .lib to the required folder. 

Any references to better documentation would be really welcome! 

Many thinks in advance! 

Tony Rietwyk

--
 [ signature omitted ] 

Message 2 in thread

Tony Rietwyk wrote:

> In 4.3.4, I am setting up a designer plugin:
> 
> 1) I don't understand what QtAssistant says about the function
> isContainer. My custom widget creates it's own QPushButtons. I do NOT want
> the designer user to be able to add widgets within this custom one. Should
> I return true or false? I am currently returning false, and that seems
> correct in this case. What exactly does this setting control?

You should return false. Although returning true provides information about
the way the widget can be used, you would need to do more to make Designer
treat it like a container.

> 2) I am also not clear which properties I need to include in the XML
> return value of domXml. At the moment, I am just returning the geometry.
> If I add my own properties via Q_PROPERTY(DESIGNABLE true), do I have to
> set those in the XML as well?

I don't think so. The .ui files written by Designer should include values
set for each custom widget.

> 3) In the plugin .pro file I have included the line:
> 
> target.path = $$[QT_INSTALL_PLUGINS]/designer
> 
> It does not seem to work when generated to a MSVS 2005 project - I have to
> manually copy the .dll and .lib to the required folder.

Have you included an INSTALLS line, like this?

INSTALLS += target

David
-- 
 [ signature omitted ] 

Message 3 in thread

David wrote:

> Tony Rietwyk wrote:
> 
> > 3) In the plugin .pro file I have included the line:
> > 
> > target.path = $$[QT_INSTALL_PLUGINS]/designer
> > 
> > It does not seem to work when generated to a MSVS 2005 
> project - I have to
> > manually copy the .dll and .lib to the required folder.
> 
> Have you included an INSTALLS line, like this?
> 
> INSTALLS += target

Hi David, 

Thanks for your responses. This is the start of the .pro file, the rest of
the file is just includes for the source files: 

<.pro file contents>

TEMPLATE = lib
TARGET = designer_plugin
target.path = $$[QT_INSTALL_PLUGINS]/designer
INSTALLS += target 
CONFIG += designer plugin debug_and_release
DEFINES += UNICODE WIN32 QT_THREAD_SUPPORT QT_CORE_LIB QT_GUI_LIB


CONFIG(release, debug|release)
{
	DESTDIR = ./Release

	INCLUDEPATH +=  ./GeneratedFiles/Release
	INCLUDEPATH +=  ./Release
	INCLUDEPATH -=  ./GeneratedFiles/Debug
	INCLUDEPATH -=  ./Debug

	MOC_DIR += ./GeneratedFiles/Release
	MOC_DIR -= ./GeneratedFiles/Debug

	OBJECTS_DIR = ./release
}

# Do NOT include a debug config - designer plugins MUST be compiled in
release mode. 

include(designer_plugin.pri)
include(../../src/paths.pri)
include(../../src/database/database.pri)
... <snipped>
</.pro file contents>

Maybe the DEST_DIR or OBJECTS_DIR overrides the target.path? 

Note: I am using VS Integration (but not the designer part), and it is
showing the attached warning whenever I build this project. Strangely, the
VS Integration was downloaded at the same time as 4.3.4, so I don't
understand why they are not in sync. 

Thanks again for you help, 

Tony Rietwyk


--
 [ signature omitted ] 

Message 4 in thread

David wrote:

> Tony Rietwyk wrote:
> 
> > 3) In the plugin .pro file I have included the line:
> > 
> > target.path = $$[QT_INSTALL_PLUGINS]/designer
> > 
> > It does not seem to work when generated to a MSVS 2005 
> project - I have to
> > manually copy the .dll and .lib to the required folder.
> 
> Have you included an INSTALLS line, like this?
> 
> INSTALLS += target

Hi David, 

Thanks for your responses. This is the start of the .pro file, the rest of
the file is just includes for the source files: 

<.pro file contents>

TEMPLATE = lib
TARGET = designer_plugin
target.path = $$[QT_INSTALL_PLUGINS]/designer
INSTALLS += target 
CONFIG += designer plugin debug_and_release
DEFINES += UNICODE WIN32 QT_THREAD_SUPPORT QT_CORE_LIB QT_GUI_LIB


CONFIG(release, debug|release)
{
	DESTDIR = ./Release

	INCLUDEPATH +=  ./GeneratedFiles/Release
	INCLUDEPATH +=  ./Release
	INCLUDEPATH -=  ./GeneratedFiles/Debug
	INCLUDEPATH -=  ./Debug

	MOC_DIR += ./GeneratedFiles/Release
	MOC_DIR -= ./GeneratedFiles/Debug

	OBJECTS_DIR = ./release
}

# Do NOT include a debug config - designer plugins MUST be compiled in
release mode. 

include(designer_plugin.pri)
include(../../src/paths.pri)
include(../../src/database/database.pri)
... <snipped>
</.pro file contents>

Maybe the DEST_DIR or OBJECTS_DIR overrides the target.path? 

Note: I am using VS Integration (but not the designer part), and it is
showing the attached warning whenever I build this project. Strangely, the
VS Integration was downloaded at the same time as 4.3.4, so I don't
understand why they are not in sync. 

Thanks again for you help, 

Tony Rietwyk

Attachment:

Attachment: Qt Integration Warning.png
Description: PNG image


Message 5 in thread

Tony Rietwyk wrote:

> Maybe the DEST_DIR or OBJECTS_DIR overrides the target.path?

I guess it's possible, but it's surprising that these would affect the
install step. On Unix platforms, when building all this at the command
line, typing "make install" would cause the libraries to be installed
correctly. I'm not sure how the Visual Studio Integration handles this.

> Note: I am using VS Integration (but not the designer part), and it is
> showing the attached warning whenever I build this project. Strangely, the
> VS Integration was downloaded at the same time as 4.3.4, so I don't
> understand why they are not in sync.

Unfortunately, I'm not familiar with the Visual Studio Integration, so
one of my colleagues will have to enlighten you about that.

David
-- 
 [ signature omitted ] 

Message 6 in thread

David Boddie wrote:

> Tony Rietwyk wrote:
> 
>> Maybe the DEST_DIR or OBJECTS_DIR overrides the target.path?
> 
> I guess it's possible, but it's surprising that these would affect the
> install step. On Unix platforms, when building all this at the command
> line, typing "make install" would cause the libraries to be installed
> correctly. I'm not sure how the Visual Studio Integration handles this.

Just to follow up, it seems that the installation procedure for Designer
plugins within Visual Studio is somewhat special:

http://trolltech.com/developer/knowledgebase/faq.2006-05-16.6272067269

David
-- 
 [ signature omitted ]