qt

Run a Qt app in a different language?

假如想象 提交于 2021-02-19 02:17:25
问题 I'm working on a Qt application that used to be a KDE application. In the old days, I just had to use some syntax like: KDELANG=de ./my_app That ran my_app in German, and only my_app. It might not have been KDELANG, but it was some environment variable like that. I've spent a ridiculous amount of time trying to coax this answer out of Google, and I give up. There must be some way to run a Qt (4.5 if that matters) application in some other language without switching over my entire locale to

Qt: QWidget::paintEngine: Should no longer be called

最后都变了- 提交于 2021-02-19 01:59:07
问题 I'm trying to make an app where you can draw with your finger on a canvas. To achieve this, I'm subclassing QWidget as MFCanvas , registered the class in QML with qmlRegisterType<>() , implementing the virtual paintEvent(); function, and drawing on it with a QPainter inside the paintEvent(); function. The Problem: Upon construction, the QPainter throws this warning: QWidget::paintEngine: Should no longer be called Then, serveral other related warnings are thrown: QPainter::begin: Paint device

QAbstractVideoSurface example

这一生的挚爱 提交于 2021-02-19 01:46:05
问题 I'm trying to make myself a QML Camera item which has more functions, and also provide a source to the VideoOutput element. Such as this: VideoOutput{ source:mycamera } MyCustomCamera{ id:mycamera } in the document it says If you are extending your own C++ classes to interoperate with VideoOutput, you can either provide a QObject based class with a mediaObject property that exposes a QMediaObject derived class that has a QVideoRendererControl available, or you can provide a QObject based

Qt编写自定义控件大全

谁都会走 提交于 2021-02-18 23:23:24
平时在各种项目实战中,Qt自带的几十个控件已经满足不了现有项目的需求了,所以需要自己自定义一些控件,随着项目越做越多,自定义的控件数量也越来越多,再加上一些网页找我定制控件,特意整理成一整套控件集合,做成了插件形式,可以直接集成到qtcreator中使用。 开源主页:[ https://gitee.com/feiyangqingyun ]( https://gitee.com/feiyangqingyun ) 不定期增加控件及修正BUG和改进算法。目前已超过133个控件。 代码相当完整和规范。 来源: oschina 链接: https://my.oschina.net/u/114502/blog/1932454

How to update/redraw QChart after data is added to QLineSeries?

依然范特西╮ 提交于 2021-02-18 22:09:05
问题 I am generating some data that I want to chart using QChart & friends. This is my first time using QChart , and so basically what I did was copy the QLineSeries Example and modify it to my needs. My current code looks like this: quint64 last=0; quint64 *lastp=&last; MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) , series( nullptr ) { ui->setupUi(this); QChart *chart = new QChart(); series=new QLineSeries(chart); chart->legend()->hide(); chart->addSeries

How to update/redraw QChart after data is added to QLineSeries?

不打扰是莪最后的温柔 提交于 2021-02-18 22:01:36
问题 I am generating some data that I want to chart using QChart & friends. This is my first time using QChart , and so basically what I did was copy the QLineSeries Example and modify it to my needs. My current code looks like this: quint64 last=0; quint64 *lastp=&last; MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) , series( nullptr ) { ui->setupUi(this); QChart *chart = new QChart(); series=new QLineSeries(chart); chart->legend()->hide(); chart->addSeries

How can I customize the QCompleter popup window in PyQt?

耗尽温柔 提交于 2021-02-18 21:50:27
问题 I have a few things for a QLineEdit's QCompleter I'm interested in customizing. I want to make it behave similar to the address / search bar in Chrome. How can I limit the number of rows that are displayed? For example, even if there are 15 matches, I only want the QCompleter to show 5. How can I resize the popup window? For example, I want to make the popup window nice and snug. As per the above example, I want the popup window to resize to 5 rows exactly without any showing any ugly scroll

Setting the Style in qml Qt

心不动则不痛 提交于 2021-02-18 18:12:54
问题 I want to set the Style for my elements in qml. For that, I want to use a style like Material Style. Using the example which can be found under: https://doc.qt.io/qt-5/qtquickcontrols2-material.html import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Controls.Material 2.12 ApplicationWindow { visible: true Material.theme: Material.Dark Material.accent: Material.Purple Column { anchors.centerIn: parent RadioButton { text: qsTr("Small") } RadioButton { text: qsTr("Medium"); checked:

Setting the Style in qml Qt

痴心易碎 提交于 2021-02-18 18:12:15
问题 I want to set the Style for my elements in qml. For that, I want to use a style like Material Style. Using the example which can be found under: https://doc.qt.io/qt-5/qtquickcontrols2-material.html import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Controls.Material 2.12 ApplicationWindow { visible: true Material.theme: Material.Dark Material.accent: Material.Purple Column { anchors.centerIn: parent RadioButton { text: qsTr("Small") } RadioButton { text: qsTr("Medium"); checked:

Setting the Style in qml Qt

╄→гoц情女王★ 提交于 2021-02-18 18:10:11
问题 I want to set the Style for my elements in qml. For that, I want to use a style like Material Style. Using the example which can be found under: https://doc.qt.io/qt-5/qtquickcontrols2-material.html import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Controls.Material 2.12 ApplicationWindow { visible: true Material.theme: Material.Dark Material.accent: Material.Purple Column { anchors.centerIn: parent RadioButton { text: qsTr("Small") } RadioButton { text: qsTr("Medium"); checked: