qtoolbar

Vertical QToolBar from MainWindow

不想你离开。 提交于 2021-02-07 21:57:25
问题 What I want: http://puu.sh/3oUjh.jpg What I have: http://puu.sh/3oUnI.png The toolbar is made in mainwindow.ui, ive tried ui->_toolbar->setLayoutDirection(Qt::LeftToolBarArea); But I get this error: no matching function for call to 'QToolBar::setLayoutDirection(Qt::ToolBarArea)' 回答1: You can use QToolBar::orientation property: ui->myToolbar->setOrientation(Qt::Vertical); You can also use QMainWindow::addToolBar : addToolBar(Qt::LeftToolBarArea, ui->myToolbar); Note that by default the user is

QPushButton not blinking

时间秒杀一切 提交于 2020-01-17 16:39:40
问题 Inspired by Label on QToolBar, possible? I'm trying to develop it. But my button do not blink on click, why? I see in the other app looks like the button color gets gray during the click (while pressed) and the normal button gets blue. But my button which is just all an image don't have any behavior during the click. On the left side is the toolbar using QAction (question linked above) and on the right side is the code below. QApplication a(argc, argv); QMainWindow w; QToolBar barA; barA

How can I customize the appearance of the actions in my QToolBar?

南笙酒味 提交于 2020-01-16 05:40:44
问题 I have just changed some toolbars from Q3ToolBars (with QToolButtons explicitly added to them) into Q4 toolbars (with actions added to them straight away instead.) The old tool buttons had a nice outline around them, but this is not displayed in the new version; the QActions in the Q4 toolbar just look like a line of icons. Is there a way to change the 'button' style in the new version (assuming these actions can be considered as such) and give them the outline? I've looked through the

Breadcrumbs navigation using QToolBar and QListView

久未见 提交于 2020-01-15 09:48:27
问题 I have JSON data something like this {"books":{ "web":{ "front-end":{ "html":["the missing manual", "core html5 canvas"], "css":["css pocket reference", "css in depth"], "js":["you don't know js", "eloquent javascript"] }, "back-end":{ "php":["modern php", "php web services"], "python":["dive into python", "python for everybody", "Think Python", "Effective Python", "Fluent Python"] } }, "database":{ "sql":{ "mysql":["mysql in a nutshell", "mysql cookbook"], "postgresql":["postgresql up and

Problem in restoring floating toolbar for QMainWindow

不羁的心 提交于 2019-12-10 13:32:34
问题 I am seeing a problem while restoring QMainWindow state having QCombobox in floating toolbar. After restoring floating toolbar, my QCombobox is not able to get focus until i click on toolbar handle and move it. Following is gif showing problem, Using QT 5.13. File floating_toolbar.pro QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = floating_toolbar TEMPLATE = app DEFINES += QT_DEPRECATED_WARNINGS #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs

On Qt, how to change the icon of an action in the toolbar at runtime?

梦想与她 提交于 2019-12-05 06:39:29
问题 In a program which calculates abritary precision numbers. I have an action on the taskbar. QAction* button_stop_continue. I've set the icon green icon in the beginning of the program, when calculations are being executed it should turn red and so on. I've already tried something like this: connect(this, SIGNAL(startedComputing()), this, SLOT(turnIconRed())); connect(this, SIGNAL(finishedComputing()), this, SLOT(turnIconGreen())); the function turnIconRed is looking similar to this: void

On Qt, how to change the icon of an action in the toolbar at runtime?

帅比萌擦擦* 提交于 2019-12-03 21:27:10
In a program which calculates abritary precision numbers. I have an action on the taskbar. QAction* button_stop_continue. I've set the icon green icon in the beginning of the program, when calculations are being executed it should turn red and so on. I've already tried something like this: connect(this, SIGNAL(startedComputing()), this, SLOT(turnIconRed())); connect(this, SIGNAL(finishedComputing()), this, SLOT(turnIconGreen())); the function turnIconRed is looking similar to this: void turnIconRed() { button_stop_continue->setIcon(QIcon("images/red-light.png")); } I've come up with some