qt4

Detect if qt is running a debug build at runtime

别说谁变了你拦得住时间么 提交于 2020-01-01 04:02:10
问题 How can I detect from within a QObject at runtime whether or not the Qt it's linked against is a debug build or release build? I know about the QT_NO_DEBUG macro, but that is resolved at build time for Qt. Example 1 of when this would be useful: I have a plugin that acts as a crash handler, providing a backtrace. I only want this plugin to attempt to do all this work if the qt debug symbols are available. Example 2: I have a command line argument parser written in pyqt. It wants to print

Visual studio intellisense for headers without .h

我是研究僧i 提交于 2019-12-31 20:30:49
问题 I am using a library that has headers without the .h This defeats visual studio's intellisense (declaration/definition lookup) Anyone know how to tell VS2008 that a file is a header? 回答1: Go to Tools::Options::Text Editor::File Extension tab in Visual Studio. Check the "Map extensionless headers" checkbox, and select the language you want from the combobox. 回答2: I'd hazard a guess that you should ensure the headers are included from a source file (usually a .cpp file). Where the properties

Slot seemingly not recognized in Qt app [duplicate]

白昼怎懂夜的黑 提交于 2019-12-31 05:29:09
问题 This question already has answers here : C++ Qt signal and slot not firing (3 answers) Closed 5 years ago . I have been working on learning C++ and Qt4 recently, but I have hit a stumbling block. I have the following class and implementation: class Window : public QWidget { public: Window(); public slots: void run(); private: //... }; and Window::Window() { //... connect(runBtn,SIGNAL(clicked()),this,SLOT(run())); //... } Window::run() { //... } However, when I attempt to build and run it,

Close the main window and open a new one - PyQt

*爱你&永不变心* 提交于 2019-12-30 18:27:49
问题 In PyQt, is it any way to close the main window and open a new one? In particular, I am trying to close a window and open the same window all over again. I've tried every way I could think of without success (with some resulting in segmentation fault). I need to do this because the new window will have some features according to the parameters that are passed. 回答1: How about this: .... .... def selectMode( self ): self.close() self.field_params = params self.show() 回答2: Well, somehow soon

How to use QMetaMethod with QObject::connect

安稳与你 提交于 2019-12-30 17:58:32
问题 I have two instances of QObject subclasses and two QMetaMethod instances of signal in one of objects and slot in another object. I want to connect this signal and slot with each other. I've looked through the qobject.h file and find that SIGNAL() and SLOT() macro are just add "1" or "2" character to the beginning of method signature so it looks like it should be possible to add the same character to the beginning of string returned by QMetaMethod::signature() but this approach depends on some

QCombobox works very slow with QSqlQueryModel with large model

随声附和 提交于 2019-12-30 11:27:49
问题 I have few comboboxes with very dig data sets within ~ 100K rows and more. I tried it with QStandardItemModel - works fast enough if model is preloaded, also model loading takes few seconds if performed in separate thread. Tried comboboxes with QSqlQueryModel without threading to improve performance but experienced it works much slower than QStandardItemModel (in our project QSqlQueryModel works very fast with such amount of data with QTreeView for example). What could be the problem here? Is

Dynamically set imageSource in ImageView Blackberry 10

南笙酒味 提交于 2019-12-30 11:06:39
问题 Please help me.,i m stuck with this for more than a week.I am emitting a signal with image from my cpp file.I need to replace the default image that i placed in the imageView at QMl using this emitted image. Here is my full code. PostHttp.hpp /* Copyright (c) 2012 Research In Motion Limited. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org

Dynamically set imageSource in ImageView Blackberry 10

喜欢而已 提交于 2019-12-30 11:05:57
问题 Please help me.,i m stuck with this for more than a week.I am emitting a signal with image from my cpp file.I need to replace the default image that i placed in the imageView at QMl using this emitted image. Here is my full code. PostHttp.hpp /* Copyright (c) 2012 Research In Motion Limited. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org

Qt QGraphicsDropShadowEffect is not showing

只谈情不闲聊 提交于 2019-12-30 10:59:34
问题 I am creating a custom widget my_widget inheriting from QWidget . Here, I have a label to which I would like to apply QGraphicsDropShadowEffect however it does not seem to be working since I don't see any shadows. My code is in Python and it's: eff = QGraphicsDropShadowEffect() self.my_widget_label.setGraphicsEffect(eff) I tried various alterations to this code to no avail. After doing a through search on Google, I came across many similar questions without answers. What might be the cause?

Qt QGraphicsDropShadowEffect is not showing

隐身守侯 提交于 2019-12-30 10:59:07
问题 I am creating a custom widget my_widget inheriting from QWidget . Here, I have a label to which I would like to apply QGraphicsDropShadowEffect however it does not seem to be working since I don't see any shadows. My code is in Python and it's: eff = QGraphicsDropShadowEffect() self.my_widget_label.setGraphicsEffect(eff) I tried various alterations to this code to no avail. After doing a through search on Google, I came across many similar questions without answers. What might be the cause?