qt5

Use QQmlListProperty to show and modify QList in Qml

寵の児 提交于 2019-12-19 08:13:23
问题 again, well i have a question (and maybe a problem), i make a program with qt and qml in qt5 and qml with qtquick 2.0, and i have a c++ model qlist, and i need modify the list in runtime, i use q QQmlListProperty and show the items in qml, but they are not hide and show in the moment when i add or remove my code is next: class ConceptsList: public QObject{ Q_OBJECT Q_PROPERTY(QQmlListProperty<Concept> concepts READ concepts NOTIFY conceptsChanged) Q_CLASSINFO("DefaultProperty", "concepts")

Use QQmlListProperty to show and modify QList in Qml

跟風遠走 提交于 2019-12-19 08:13:00
问题 again, well i have a question (and maybe a problem), i make a program with qt and qml in qt5 and qml with qtquick 2.0, and i have a c++ model qlist, and i need modify the list in runtime, i use q QQmlListProperty and show the items in qml, but they are not hide and show in the moment when i add or remove my code is next: class ConceptsList: public QObject{ Q_OBJECT Q_PROPERTY(QQmlListProperty<Concept> concepts READ concepts NOTIFY conceptsChanged) Q_CLASSINFO("DefaultProperty", "concepts")

QLibrary - import a class

女生的网名这么多〃 提交于 2019-12-19 07:42:32
问题 I have a QT library and I want to import it in another project. Now, since I want that, even when I modify the library, the other project does not need to be compiled again, I started using QLibrary. But... I can't import a class. Or better, I can import the class, but I can't access its methods. This is the example I made. This is the class declaration: class TESTDLL_LIBSHARED_EXPORT TestDLL_lib { public: TestDLL_lib(); int a; int b; int c; int getValues(); }; and this the implementation:

Programmatically promote QWidget

断了今生、忘了曾经 提交于 2019-12-19 03:43:09
问题 I have an ui file with a QProgressBar in a QWidget . Moreover, I've created my custom progress bar component that inherits from QProgressBar . In QT Designer, I can promote the QProgressBar widget to my custom widget. Is there a way to do this in the widget cpp file instead of using QT Designer? In other words, is there a way to programmatically promote a QWidget into an another custom widget of the same type (a sort of morphing )? Here follows an example: class MyProgressBar : public

Is there any difference between QRegularExpression and QRegExp?

假如想象 提交于 2019-12-18 18:34:28
问题 I see there is a new class for regular expressions - QRegularExpression . Is it just a typedef for QRegExp, or a new class, or what? And why do we need it, we already have QRegExp? 回答1: Ok, after some more digging into the docs, I found it really is a new class, it has improvements, but it is only available in Qt5, so you can't use it if you want to compile on both Qt4 and Qt5: Notes for QRegExp Users The QRegularExpression class introduced in Qt 5 is a big improvement upon QRegExp, in terms

How to build Qt5 with OpenSSL support

旧街凉风 提交于 2019-12-18 17:13:06
问题 What is the correct configuration for building Qt5 with SSL support? I have currently compiled OpenSSL statically with VC2008 using the following command lines: perl Configure VC-WIN32 --prefix=C:\Build-OpenSSL-VC-32 ms\do_ms nmake -f ms\nt.mak nmake -f ms\nt.mak install Configured Qt 5.3.1 with: configure -developer-build -opensource -nomake examples -nomake tests -mp -confirm-license -opengl desktop -no-icu -skip qtserialport -skip qtwebkit-examples -platform win32-msvc2008 -openssl-linked

In Qt 5, what's the right way to show multi-monitor full screen QWidget windows?

余生颓废 提交于 2019-12-18 12:48:11
问题 I have a Windows & Mac program that switches into full-screen mode on multiple monitors. In Qt 4, it seems (I can't find explicit documentation on how to do this) like the 'correct' way to go about this is by creating N QMainWindow 's for the N monitors on the machine, calling QWidget::move() to the N monitor's top-left x,y coordinates, and then calling QWidget::setWindowState(Qt::WindowFullScreen) . I don't know whether this is The Right Thing To Do - again, I can't find any documentation or

Dragging QDockWidgets between QMainWindows

萝らか妹 提交于 2019-12-18 12:33:14
问题 I have a question regarding dragging QDockWidgets between QMainWindows. I have an application with different "DockAreas" which have a QMainWindow member with one or more QDockWidgets. Additionally, I want to make QDockWidgets drag-and-droppable into other, already floating QDockWidgets (not tabbed!). To have the nice hover-effect upon drag-and-drop, the floating QDockWidgets are embedded in a new instance of my DockArea with the QMainWindow member. Now I intercept the mousemove event of the

Qt creator Adding external library (still: Cannot open include file: 'GL/glew.h')

好久不见. 提交于 2019-12-18 12:29:43
问题 I followed the instruction: In the Projects pane, open the project file (.pro). Right-click in the code editor to open the context menu and select Add Library.... Then the following lines were added into the pro file: win32:CONFIG(release, debug|release): LIBS += -L$$PWD/D:/OpenGL/glew-1.5.4/lib/ -lglew32 else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/D:/OpenGL/glew-1.5.4/lib/ -lglew32d INCLUDEPATH += $$PWD/D:/OpenGL/glew-1.5.4/include DEPENDPATH += $$PWD/D:/OpenGL/glew-1.5.4

How to link QtMain in CMake with Qt5?

故事扮演 提交于 2019-12-18 12:13:10
问题 I upgraded my project code from Qt4 to Qt5. It uses CMake. The conversion got well except for one line of Cmake commands related to Qt. I can’t find in current documentation, like http://qt-project.org/doc/qt-5.0/qtdoc/cmake-manual.html http://qt-project.org/doc/qt-5.0/qtdoc/qtmain.html How to link with QtMain from CMake (with Qt5)? It is the only missing bit to convert my project. Can someone point me to a doc explaining this or explain how to do it with Qt5? My Qt4 code worked correctly but