qt4.7

QObject based class has a queued connection to itself

纵然是瞬间 提交于 2019-12-01 18:19:41
I was digging into some source code I am working on. I found a peculiar statement that someone had coded. The source code is a GUI application with a QML GUI and uses QT 4.7.x. The snippet below belongs to core application logic. // connect signal-slots for decoupling QObject::connect (this, SIGNAL(setCurrentTaskSignal(int)), this, SLOT(SetCurrentTaskSlot(int)), Qt::QueuedConnection); It's strange that the object connects to itself via a queued connection which essentially means that the object may "live" in different threads at the same time? At first glance It didn't made any sense to me.

How to add a tick mark to a slider if it cannot inherit QSlider

别来无恙 提交于 2019-12-01 00:39:56
I have a Qt dialog and there is a slider in it, when the dialog is initialized the slider will be set a value. In order to remind the user what is the default value, I want to add a mark to the slider, just draw a line or a triangle above the handle. Here, the slider should be of QSlider type, that means I can't implement a customized control derived from QSlider. Is there any way to realize it ? I'm not clear why you can't derive a control from QSlider . You can still treat it like a QSlider , just override the paintEvent method. The example below is pretty cheesy, visually speaking, but you

32-bit Qt application on win 7 x64 won't run, but runs fine from Qt Creator?

浪尽此生 提交于 2019-11-30 20:28:06
My development box is Windows 7 x64. I have both 32-bit and 64-bit versions of Qt 4.7.4 built on my box. When I configure my app to use the 32-bit version of Qt, it runs fine in Qt Creator (ctrl-R), but when I try to double-click the exe in Windows Explorer (or run from cmd prompt), I get: --------------------------- RenameTemplatePreviewFiles_Qt_win.exe - Application Error --------------------------- The application was unable to start correctly (0xc000007b). Click OK to close the application. --------------------------- OK --------------------------- If I switch my configuration to 64-bit Qt

How do you get System default font settings in Qt?

泄露秘密 提交于 2019-11-30 11:13:23
I am building a desktop app using Qt, my dev machine is win 7 x64 with japanese locale, standard system font is Meiryo . Most of win 7 UI is in this font, though classic/older programs such as ui font customization window itself uses different font which is MS UI Gothic. This doesn't bother me until I found that QtCreator builds my app with MS UI Gothic in one place, and Meiryo in the other. For example, qlabels, qlineedits, qcombobox all uses MS UI Gothic, but a custom completer with a qtableview i add later uses Meiryo. I made most of the UI in QtCreator's Designer, and the completer I added

32-bit Qt application on win 7 x64 won't run, but runs fine from Qt Creator?

∥☆過路亽.° 提交于 2019-11-30 04:53:57
问题 My development box is Windows 7 x64. I have both 32-bit and 64-bit versions of Qt 4.7.4 built on my box. When I configure my app to use the 32-bit version of Qt, it runs fine in Qt Creator (ctrl-R), but when I try to double-click the exe in Windows Explorer (or run from cmd prompt), I get: --------------------------- RenameTemplatePreviewFiles_Qt_win.exe - Application Error --------------------------- The application was unable to start correctly (0xc000007b). Click OK to close the