qt4.8

QTablewidget drop without creating new rows

依然范特西╮ 提交于 2019-12-01 12:32:04
I have a QTableWidget and 1 column has only checkboxes, so for those items I have these flags: /* create prototype for checkbox item */ checkItem = new QTableWidgetItem(); Qt::ItemFlags flags = checkItem->flags(); flags &= ~Qt::ItemIsEditable; flags &= ~Qt::ItemIsDropEnabled; flags &= ~Qt::ItemIsDragEnabled; flags |= Qt::ItemIsUserCheckable; checkItem->setFlags(flags); /**/ Ok that works... almost. I can't drop anything in those items, that's good. But now there can be dropped in between 2 cells, so there is a new row created. How can I prevent that? In the other columns where the cells are

QTablewidget drop without creating new rows

送分小仙女□ 提交于 2019-12-01 09:56:10
问题 I have a QTableWidget and 1 column has only checkboxes, so for those items I have these flags: /* create prototype for checkbox item */ checkItem = new QTableWidgetItem(); Qt::ItemFlags flags = checkItem->flags(); flags &= ~Qt::ItemIsEditable; flags &= ~Qt::ItemIsDropEnabled; flags &= ~Qt::ItemIsDragEnabled; flags |= Qt::ItemIsUserCheckable; checkItem->setFlags(flags); /**/ Ok that works... almost. I can't drop anything in those items, that's good. But now there can be dropped in between 2

Set background color only partially with stylesheets

隐身守侯 提交于 2019-12-01 05:07:29
问题 How can I set the background color for a part of the background like in the following image: Of course, without border frames, I want to set only the cyan color. I need to set the length of the left part (cyan) as the percentage of the widget length, e.g 30%. 回答1: With css I would hack qlineargradient a little bit. Note that edge of cyan may be a little blurry. QFrame { background-color: qlineargradient(x1:0, x2: 1, stop: 0 cyan, stop: 0.29 cyan, stop: 0.2901 white, stop: 1 white); } 回答2: If

Obtaining the Qt 4.8 SDK

旧街凉风 提交于 2019-12-01 02:23:12
问题 I haven't used Qt on Windows in a while. I know that now we're supposed to download the open source version from the Qt Project website. But the page at http://qt-project.org/downloads has separate links to installers for Qt libraries and Qt Creator. I remember being able to just download the full SDK and get started, but now I have t separately install MinGW, the libraries and Qt Creator. Can I still get the libraries and Qt Creator in a single bundle, and if yes, where should I look? 回答1: I

Visual studio 2012 and Qt4.8.5 : How to see QString contents in debug mode.

ぃ、小莉子 提交于 2019-11-30 06:42:00
I use visual studio 2012 and Qt4.8.5, unfortunately I can not see the QString text variable when I work in debug mode. Is someone has a tip allow it ? Qt4.8.5 plug-in doesn't exist for VS2012. Thank a lot Xavier There is a quick and explicit solution (MSVC native, no need for plugins nor setting up .dat files), see my answer from here Say you have QString str ( Qt4 ), then add to the debugger watch window: ((str).d)->array,su the appendix ,su tells the debugger to interpret the data as unicode and null terminated string. Note : For a Qt5 QString str it could be (char*)str.d + str.d->offset,su

Visual studio 2012 and Qt4.8.5 : How to see QString contents in debug mode.

[亡魂溺海] 提交于 2019-11-29 06:23:31
问题 I use visual studio 2012 and Qt4.8.5, unfortunately I can not see the QString text variable when I work in debug mode. Is someone has a tip allow it ? Qt4.8.5 plug-in doesn't exist for VS2012. Thank a lot Xavier 回答1: There is a quick and explicit solution (MSVC native, no need for plugins nor setting up .dat files), see my answer from here Say you have QString str ( Qt4 ), then add to the debugger watch window: ((str).d)->array,su the appendix ,su tells the debugger to interpret the data as

Non-blocking worker - interrupt file copy

天涯浪子 提交于 2019-11-26 02:14:37
问题 I\'m dealing with very large files, in excess of hundreds of GB in size. The User needs to be able to move these files between disks and is on a restricted system with no default file manager. It\'s possible for the User to realize they\'ve made a mistake and cancel the operation, and as far as I can tell the User will have to wait for the current copy or rename operation to complete. This can leave them feeling frustrated as they wait potentially minutes, only to see that their many GB file