Russian Qt Forum
Октябрь 03, 2024, 12:16 *
Добро пожаловать, Гость. Пожалуйста, войдите или зарегистрируйтесь.
Вам не пришло письмо с кодом активации?

Войти
 
  Начало   Форум  WIKI (Вики)FAQ Помощь Поиск Войти Регистрация  

Страниц: [1]   Вниз
  Печать  
Автор Тема: QGraphicsScene + QToolButton  (Прочитано 4465 раз)
andrew.k
Гость
« : Ноябрь 21, 2011, 22:10 »

Кнопке QToolButton, которая находится внутри сцены назначено меню QMenu.
Почему-то не получается убрать черный треугольник.
setArrowType( Qt::NoArrow);
стрелка на месте. В чем дело?
Записан
andrew.k
Гость
« Ответ #1 : Ноябрь 21, 2011, 22:21 »

сделал через QSS.
QToolButton::menu-indicator {
   image: none;
}

Помогло, но не знаю верно ли задал параметр?

Где вообще найти полный список всех параметров с возможными значениями.
В документации только кучи примеров.
Записан
Bepec
Гость
« Ответ #2 : Ноябрь 22, 2011, 12:08 »

QSS поддерживает CSS так что сцылко

Конструктор кнопко:
http://www.pagetutor.com/button_designer/index.html

Описание CSS:
http://htmlbook.ru/css/

PS мне лично конструктор помогал.
Записан
andrew.k
Гость
« Ответ #3 : Ноябрь 22, 2011, 17:48 »

QSS поддерживает CSS так что сцылко

Конструктор кнопко:
http://www.pagetutor.com/button_designer/index.html

Описание CSS:
http://htmlbook.ru/css/

PS мне лично конструктор помогал.
Все-таки QSS это не совсем CSS.

Как мне узнать, например, какие атрибуты я могу применять к QToolButton?
Вот что мне дает ассистент:
Цитировать
Supports the box model.

If the QToolButton has a menu, is ::menu-indicator subcontrol can be used to style the indicator. By default, the menu-indicator is positioned at the bottom right of the Padding rectangle of the widget.

If the QToolButton is in QToolButton::MenuButtonPopup mode, the ::menu-button subcontrol is used to draw the menu button. ::menu-arrow subcontrol is used to draw the menu arrow inside the menu-button. By default, it is positioned in the center of the Contents rectangle of the menu-button subcontrol.

When the QToolButton displays arrows, the ::up-arrow, ::down-arrow, ::left-arrow and ::right-arrow subcontrols are used.

Warning: If you only set a background-color on a QToolButton, the background will not appear unless you set the border property to some value. This is because, by default, the QToolButton draws a native border which completely overlaps the background-color. For example,
 QToolButton { background-color: red; border: none; }

See Customizing QToolButton for an example.
Плюс экзамплы. Этого мало.

Вот где я мог найти свое решение?
Записан
Bepec
Гость
« Ответ #4 : Ноябрь 23, 2011, 08:35 »

http://doc.qt.nokia.com/4.7/stylesheet-reference.html#subcontrol-origin-prop

К примеру вот тут.
Записан
andrew.k
Гость
« Ответ #5 : Ноябрь 23, 2011, 09:55 »

По  ссылке subcontrol orgin
Записан
Страниц: [1]   Вверх
  Печать  
 
Перейти в:  


Страница сгенерирована за 0.123 секунд. Запросов: 20.