Hi Sascha,

I think the library base name MitkQmlItems would be very reasonable, but
unfortunately the import statement actually refers to the name of the
directory that contains the qmldir file. The official Qt documentation
explains the details best:

http://qt-project.org/doc/qt-5/qtqml-modules-qmldir.html
http://qt-project.org/doc/qt-5/qtqml-modules-identifiedmodules.html#semantics-of-identified-modules

There's always the option of using resource files with whatever directory
structure you want, but that means you have to wait for your application to
re-link every time you change a .qml file. To me one one of the most
appealing parts of QML UI development is the ability to edit-test-edit very
quickly.

Maybe one solution would be to put QmlItems at a hierarchical level such as:

MITK
`-- Modules
    `-- org
        `-- mitk
            `-- QmlItems

Then you'd import the module with:

import org.mitk.QmlItems 1.0

Or, if you didn't want that directory structure in the source tree, you
could use CMake to generate it the CMAKE_BINARY_DIR by coping files.

Taylor


On Mon, Mar 10, 2014 at 10:55 AM, Sascha Zelzer <[email protected]
> wrote:

>  Hi Taylor,
>
> thanks a lot for the feedback.
>
> I am not sure I fully understood your concerns and I do not know QML very
> well. Is the import statement using the shared libraries base name? If so,
> it would read
>
>    import MitkQmlItems 1.0
>
> since the library is named MitkQmlItems. Is this still looking strange to
> a QML developer?
>
> Thanks,
> Sascha
>
>
>
>
> On 03/07/2014 10:48 PM, Taylor Braun-Jones wrote:
>
> Sorry for not replying sooner, but I'll provide my feedback anyway.
>
>  One unfortunate side effect of the new module directory naming is for
> the use of QML plugins and modules. Since a QML plugin === shared library
> === MITK Module, you can setup your application to find the QML plugins by
> simply adding a couple lines like:
>
>     m_View.engine()->addImportPath(AWESOME_APP_SOURCE_DIR "/Modules");
>    m_View.engine()->addImportPath(AWESOME_APP_BINARY_DIR "/Modules");
>
>  Then you just add a qmldir (or qmldir.in that generates qmldir in the
> binary directory) to your module directory and use an import statement like:
>
>     import MyAwesomeModule 1.0
>
>  If the current QML code were made available as a QML plugin, the import
> statement would be:
>
>     import QmlItems 1.0
>
>  Which is pretty bad as a QML plugin name...
>
>  Otherwise, I really like the effort to standardize naming. Thanks!
>
>  Taylor
>
>
> On Mon, Mar 3, 2014 at 6:40 AM, Sascha Zelzer <[email protected]
> > wrote:
>
>> Hi,
>>
>> In order to tidy up the names of MITK artefacts like shared libraries and
>> executables,
>> the changes referred in the cited email below have now been committed to
>> the MITK master.
>>
>> The commits introduced some backwards-incompatible build-system changes
>> which you need
>> to take into account in your MITK based project (after updating to the
>> current master or
>> when using the up-coming March release):
>>
>>   * When referring to MITK modules in your CMake files, make sure to
>> prefix
>>     them with "Mitk", e.g.
>>
>>        mitk_create_module(... DEPENDS Segmentation)
>>
>>     needs to be changed to
>>
>>        mitk_create_module(... DEPENDS MitkSegmenation)
>>
>>   * The module "Qmitk" was renamed to "MitkQtWidgets"
>>   * The module "QmitkExt" was renamed to "MitkQtWidgetsExt"
>>   * If you happen to use a call to us::ModuleRegistry::GetModule("..."),
>>     you need to check that the correcly prefixed module name is used in
>>     case you are trying to retrieve a us::Module* object for a MITK
>> module.
>>
>> Thanks,
>>
>> Sascha
>>
>>
>>
>> On 02/12/2014 02:36 PM, Sascha Zelzer wrote:
>> > Dear MITK users,
>> >
>> > as many of you know, MITK has a long history and has grown tremendously
>> > over the last ten years. Parts of that history are still reflected in
>> > the current MITK source tree layout and the naming of directories,
>> > executables, libraries etc.
>> >
>> > We now want to introduce a consistent naming scheme. However, these
>> > changes will very likely require modifications of the CMake files of
>> > MITK based projects because some module names will change.
>> >
>> > Your own projects naming scheme will of course not be affected but you
>> > could reuse some of the MITK CMake code to enforce your own naming
>> > scheme for your MITK modules.
>> >
>> > This mail is intended to gather feedback from the community for the
>> > proposal [1] and as a preliminary announcement.
>> >
>> > Thank you,
>> >
>> > Sascha
>> >
>> > [1] http://mitk.org/Development/NamingConventions
>> >
>> >
>> >
>> >
>> >
>> ------------------------------------------------------------------------------
>> > Android apps run on BlackBerry 10
>> > Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
>> > Now with support for Jelly Bean, Bluetooth, Mapview and more.
>> > Get your Android app in front of a whole new audience.  Start now.
>> >
>> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
>> > _______________________________________________
>> > mitk-users mailing list
>> > [email protected]
>> > https://lists.sourceforge.net/lists/listinfo/mitk-users
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Subversion Kills Productivity. Get off Subversion & Make the Move to
>> Perforce.
>> With Perforce, you get hassle-free workflows. Merge that actually works.
>> Faster operations. Version large binaries.  Built-in WAN optimization and
>> the
>> freedom to use Git, Perforce or both. Make the move to Perforce.
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
>>  _______________________________________________
>> mitk-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/mitk-users
>>
>
>
>
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to