octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: movable tab test


From: Rik
Subject: Re: movable tab test
Date: Sat, 30 Nov 2013 12:36:11 -0800

On 11/28/2013 05:58 AM, address@hidden wrote:
> Message: 7
> Date: Thu, 28 Nov 2013 12:46:34 +0000
> From: Richard Crozier <address@hidden>
> To: Thorsten Liebig <address@hidden>
> Cc: address@hidden
> Subject: Re: GUI editor tabs
> Message-ID: <address@hidden>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> On 28/11/2013 12:38, Thorsten Liebig wrote:
>> > Am 28.11.2013 13:03, schrieb Richard Crozier:
>>> >> On 28/11/2013 11:43, Thorsten Liebig wrote:
>>>> >>> Just make it depend on the Qt version found?
>>>> >>>
>>>> >>> #if QT_VERSION >= 0x040500
>>>> >>>      _tab_widget->setMovable (true);
>>>> >>> #endif
>>>> >>>
>>>> >>>
>>> >>
>>> >> This works for me. It's quite a small change, would you make it, or 
>>> >> should I create a changeset?
>>> >>
>>> >> Richard
>>> >>
>>> >>
>> > Please make the changeset, I have little time atm and it is your idea ;)
>> > But I like the change...
>> > Please verify that  "0x040500" as the version is correct, but I'm pretty 
>> > sure it should.
>> > Does it work with Qt5 as well?
>> >
>> > regards
>> > Thorsten
>> >
>> >
>> >
> Ok, I'll check and create a patch. I should really learn how to make an 
> online clone so I can send pull requests.
>
>  From the Qt5 online docs the property and access functions for this are 
> the same.
11/30/13

Richard,

The preferred way to handle these things is to test for the functionality
rather than the version number.  This leaves the build process less
vulnerable to changes in the library code.  For example, we don't have to
worry about whether there is a maximum version where this feature is no
longer supported because we only ever check whether the function exists or not.

For a possible template, see the configure macro
OCTAVE_CHECK_FUNC_QABSTRACTITEMMODEL_BEGINRESETMODEL in m4/acinclude.m4. 
Using cut and paste I think you could work up an
OCTAVE_CHECK_FUNC_QTABWIDGET_SETMOVABLE macro and then use an #ifdef test
in file-editor.cc to make this work.  If you must use a version number,
take a look at the macro OCTAVE_CHECK_FUNC_SETPLACEHOLDERTEXT.  It uses a
version number, but we could always decide to improve it at a later date to
check for functionality and the Octave code base would be unaffected since
it uses the result of the macro in an #ifdef test rather than directly
checking the version number.

--Rik



reply via email to

[Prev in Thread] Current Thread [Next in Thread]