Skip to content

How to disable a new tool by default #2823

Answered by jkatnik
jkatnik asked this question in Q&A
Discussion options

You must be logged in to vote

It looks like there is no in-place, elegant way to do that, however ButtonList::fallback() removes size increase/decrease icons from the default set of buttons. Adding my tool type there did the trick.

valuehandler.cpp

QVariant ButtonList::fallback()
{
    auto buttons = CaptureToolButton::getIterableButtonTypes();
    buttons.removeOne(CaptureTool::TYPE_SIZEDECREASE);
    buttons.removeOne(CaptureTool::TYPE_SIZEINCREASE);
    buttons.removeOne(CaptureTool::TYPE_BOLD_ARROW);
    sortButtons(buttons);
    return QVariant::fromValue(buttons);
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jkatnik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant