qml

Subclassing QSqlTableModel insert new value

穿精又带淫゛_ 提交于 2019-12-24 08:25:19
问题 I want to show SQL data from a local db-File in a QML-Tableview and than would like to do some edits to the sql-database. What I managed to do after about three weeks: Showing my data in a QML-Tableview. I am not sure if I really need to subclass QSqlTableModel and I definitly would be glad if subclassing would not be neccessary at all. In my main.cpp following should create my model and directly add a record. // Create an instance of the SqlModel for accessing the data SqlDataModel *sqlModel

QML scaling does not work with non-integer scaling factors

南楼画角 提交于 2019-12-24 08:18:00
问题 I'm writing an application using QML. I'm having trouble when I scale my GUI by non-integer factors. According to the docs, Qt::AA_EnableHighDpiScaling should enable device-independent pixels, therefore automatically taking care of most of the scaling: The application attribute Qt::AA_EnableHighDpiScaling , introduced in Qt 5.6, enables automatic scaling based on the pixel density of the monitor. In a blog post about 5.6, they admit that there can be problems: Q: Are non-integer scale factors

how to open ios gallery in Qt

拟墨画扇 提交于 2019-12-24 08:13:06
问题 i'm trying to open ios gallery with Qt , i found many article and answers . i test them but they didn't work in ios(10) here are two links that are not working for me Link 1 : Open ios gallery with FileDialog{} Link 2 : Mixing Objective-c with Qt to access gallery in ios first link explained how to open gallery with FileDialog ,according to link and it's description : in iOS just create a FileDialog inside the QML file and set folder: shortcuts.pictures. It will call the iOS gallery. . below

Qml - c++ signal parameters “undefined” in qml

馋奶兔 提交于 2019-12-24 07:06:12
问题 I receive a signal from a worker thread and re-emit it via C++ Singleton (CTaskManager) to qml. void CTaskManager::runAsync(CTask* task) { Q_CHECK_PTR(task); QThread* thread = new QThread(); task->moveToThread(thread); connect(this , SIGNAL(canceled()) , task , SLOT(cancel()) , Qt::DirectConnection); connect(task , SIGNAL(progressChanged(float)) , this , SLOT(setProgress(float)) , Qt::DirectConnection); connect(task , SIGNAL(finished(bool,unsigned int, const QVariantMap&)) , this , SLOT

Bringing activity on top while screen locked

99封情书 提交于 2019-12-24 06:47:56
问题 I'm developing a VOIP application with Qt/QML in Android, other VOIP applications like WhatsApp and Skype, bring up their call activities when the incoming call is received and screen is locked. I am trying to implement something like this. I have two questions: What about implementing this feature completely in Java Implementing this feature with QML and bringing qml activity on top when the screen is locked I have implemented a simple java call screen with window manager and WindowManager

How to make a “True Transparent” window to cursor, preferably on a pure QML? (Qt 5.7)

蹲街弑〆低调 提交于 2019-12-24 05:45:23
问题 "True Transparency" explanation (image, 76kb). On that image ApplicationWindow have a visually transparent layer. But in fact, cursor does not go to the window behind ApplicationWindow (in this case - QT Creator). "True Transparency" is achieved if add (uncomment) "Qt.WindowTransparentForInput" flag, but the buttons are no longer available (it's are obvious, I know). I have tried a various flags with similar meanings (from the documentation), but did not find a working combination - cursor

How to integrate a custom GraphicsItem into a QML scene?

大兔子大兔子 提交于 2019-12-24 05:36:08
问题 Assume you have created the following custom QGraphicsRectItem in C++: class MyCustomItem : public QGraphicsRectItem { public: MyCustomItem(MyCustomItem* a_Parent = 0); virtual ~MyCustomItem(); // specific methods private: // specific data }; Assume also that you have defined in a QML script an ApplicationWindow : // main.qml import QtQuick 2.4 import QtQuick.Controls 1.3 import QtQuick.Window 2.0 ApplicationWindow { id: myWindow title: qsTr("My Window") width: 640 height: 480 visible: true }

how to set the QML application window transparent by Qt 5.6?

爷,独闯天下 提交于 2019-12-24 05:06:08
问题 I am new in Qt & QML, now I set a window and want to set it transparent, user can see my desktop cross my application. I try to use WA_TranslucentBackground and opacity , however it doesn't work. Here is my QML code, it's very simple: import QtQuick 2.6 import QtQuick.Window 2.2 import QtQuick.Controls 1.4 Window { visible: true width: Screen.width height: Screen.height title: qsTr("Input") flags: Qt.WA_TranslucentBackground | Qt.FramelessWindowHint MouseArea { anchors.fill: parent onClicked:

Using TableView as ListView-delegate

馋奶兔 提交于 2019-12-24 04:32:35
问题 I have a model that contains several QStandardItemModels . Now I want to create a view that displays a TableView for each QStandardItemModel . I had the idea to have a ListView that has a TableView as delegate, something like this: ListView { id: myListView anchors { fill: parent margins: 5 } model: testModel delegate: CompareDelegate { } } And in CompareDelegate.qml : Item { id: base width: 500 height: 300 TableView { anchors.fill: parent } } How do I get the TableView inside the delegate to

QML: using Matrix4x4 transform

别等时光非礼了梦想. 提交于 2019-12-24 04:01:12
问题 How do you rotate, using Matrix4x4 transform, a QML item around another axis than z, with the center of the item as origin of the transformation? To rotate around the y axis with (0,0) as origin, I tried naively: Image { source: "..." width: 100 height: 100 transform: Matrix4x4 { property real a: Math.PI / 4 matrix: Qt.matrix4x4( Math.cos(a), 0, -Math.sin(a), 0, 0, 1, 0, 0, Math.sin(a), 0, Math.cos(a), 0, 0, 0, 0, 1) } } As a result, I get a cut width item whereas I am looking for a