qt5

How to make a resizable rectangle in QML?

我与影子孤独终老i 提交于 2019-12-28 12:08:07
问题 I'm looking for a simple way to create a rectangle in a QQuickItem . I want to resize, and drag the borders of this rectangle like this (found at resizable QRubberBand) Has someone an idea? 回答1: There are probably several ways to achieve the desired result. Since I've considered the implementation of a similar Component for a cropping tool software of mine, I'm going to share a toy example which uses part of that code. Differently from the rubber band in the example, my Rectangle is resizable

QtCreator转换Qt5风格信号槽连接

隐身守侯 提交于 2019-12-28 10:06:44
这一方法可以将Qt5版本以下旧式的信号槽连接转换为Qt5风格的连接。 使用方法 鼠标指向 connect函数名 ; 右键选择 Refactor -> Convert connect() to Qt 5 Style 。 当前使用Qt Creator 4.8.2版本。 建议使用最新版的QtCreator。 关注微信公众号 Qt君 ,第一时间获取最新推送。 来源: CSDN 作者: Qt君 链接: https://blog.csdn.net/nicai_xiaoqinxi/article/details/103674656

Project ERROR: Unknown module(s) in QT: webkitwidgets

拟墨画扇 提交于 2019-12-28 05:06:26
问题 I am porting code from qt4 to qt5. I added the following line to my .pro file, as suggested: QT += webkitwidgets However, when I run qmake , I get the this error: Project ERROR: Unknown module(s) in QT: webkitwidgets I am developing on Ubuntu 12.04 LTS and installed Qt as described. 回答1: You need to install the webkitwidgets library. On Ubuntu, try this in a terminal: sudo apt-get install libqt5webkit5-dev 回答2: If you need to install the webkit* Windows library for Qt 5.7 you should compile

Project ERROR: Unknown module(s) in QT: webkitwidgets

旧巷老猫 提交于 2019-12-28 05:06:22
问题 I am porting code from qt4 to qt5. I added the following line to my .pro file, as suggested: QT += webkitwidgets However, when I run qmake , I get the this error: Project ERROR: Unknown module(s) in QT: webkitwidgets I am developing on Ubuntu 12.04 LTS and installed Qt as described. 回答1: You need to install the webkitwidgets library. On Ubuntu, try this in a terminal: sudo apt-get install libqt5webkit5-dev 回答2: If you need to install the webkit* Windows library for Qt 5.7 you should compile

Qt5 Static Build yields Failed to load platform plugin “windows”

无人久伴 提交于 2019-12-27 10:18:21
问题 I am writing a Qt application on Windows using Visual Studio 2012 . Using the Qt Add-in and a custom built static distribution of Qt 5.0.2 . I am running into the dreaded "Failed to load platform plugin windows" error whenever I run the application. I have added the following to the linker input: imm32.lib winmm.lib Ws2_32.lib qtmaind.lib Qt5Cored.lib Qt5Guid.lib Qt5Widgetsd.lib At first I thought that maybe I should add "qwindowsd.lib" to that list as well however that did not fix the

Qt5 - Windows :Windows cannot find executable

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 18:28:36
问题 I am trying to build a project using Windows 10 and Qt5.12 . The small program is using the smtp protocol available here. I can confirm that on my Windows I have the OpenSSL 1.1.1c 28 May 2019. On my Ubuntu 19.04 the same exact program compiles and run as usual but not on Windows. I git clone my repository into Windows , followed successfully this post and the program builds correctly. The problem is that when I run it, it cannot find the executable and is asking for it as it is possible to

Qmysql driver not loaded but it's available

只谈情不闲聊 提交于 2019-12-25 09:18:00
问题 I want to connect my database(mysql) with Qt library on ubuntu 16.04. But i faced this error: QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7 Result of ldd /Qt-PATH/Qt5.7.0/5.7/gcc_64/plugins/sqldrivers/libqsqlmysql.so is: linux-vdso.so.1 => (0x00007fff9d55a000) libmysqlclient_r.so.16 => not found libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007efc887eb000) libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007efc885b3000

QtPositioning error in Qt 5.3 RC on Android

主宰稳场 提交于 2019-12-25 08:48:04
问题 I’m experimenting with Qt Positioning in Qt 5.3 RC on Android. This is sample of my code, where I create sources of position and satellites: QGeoPositionInfoSource *source = QGeoPositionInfoSource::createDefaultSource(this); if (source) { QStringList posSourcesList = QGeoPositionInfoSource::availableSources(); qDebug() << "Position sources count: " << posSourcesList.count(); foreach (const QString &src, posSourcesList) { qDebug() << "pos source in list: " << src; } source->startUpdates();

Style button background keeping rounded corners

倾然丶 夕夏残阳落幕 提交于 2019-12-25 08:17:27
问题 I want to make a green button. I did this: self.detectButton.setStyleSheet("background: #00ff00") Here it was before the styling: And after: As you can see, the color changed, but the rounded corners were lost. What's the proper way to style the color so the corners are not lost? Secondarily, is there any way to get a theme-generic "ok" button color? This won't look the same on other platforms. 回答1: Do not use stylesheets if you want completely consistent results on all platforms. The reasons

QT 5.7 QML - Reference Error: Class is not defined

半城伤御伤魂 提交于 2019-12-25 08:13:39
问题 I get the "qrc:/main_left.qml:23: ReferenceError: CppClass is not defined" when I run the below code. This code tries to change the position of a rectangle in a window. Main.cpp #include <QGuiApplication> #include <QQmlApplicationEngine> #include <QQmlContext> #include "cppclass.h" #include "bcontroller.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication app(argc, argv); //QGuiApplication app(argc, argv); BController c; CppClass cppClass; QQmlApplicationEngine engine;