Skip to content
QtWS25 Last Chance
  • 0 Votes
    4 Posts
    430 Views
    Christian EhrlicherC
    @TheEndlessV Then take a look into the include to see if the file maybe is corrupt
  • QTcpServer as HTML Server

    Solved General and Desktop qtcpserver html qt5.14.2 web server
    3
    0 Votes
    3 Posts
    313 Views
    R
    The server page was not loading and the issue was I was using the server's newConnection() signal to immediately write the html page to the client. But you have to wine and dine the client first. I ended up connecting the newConnection() signal to a set up function: void Server::handleConnection() { QTcpSocket* client = nextPendingConnection(); //client->setSocketOption(QAbstractSocket::KeepAliveOption, 0); QObject::connect(client,&QTcpSocket::readyRead,this,[=](){ handleRequest(client); }); } You can then write the HTML content to the client in handleRequest()
  • 0 Votes
    3 Posts
    413 Views
    Y
    Remove space; Inside the table cell but outside my custom widget Here some code snap. @ChrisW67 #include "ElementsListWidget.h" #include "AbstractElement.h" #include "ElementDragEventHandler.h" #include <QAbstractScrollArea> #include <QGridLayout> #include <QLabel> #include <QPixmap> #include <QScrollArea> #include <QSortFilterProxyModel> #include <QVariant> #include <qscrollbar.h> #include <qstandarditemmodel.h> #include <qtreeview.h> ElementsListWidget::ElementsListWidget(QWidget* parent) : QWidget(parent) { QVBoxLayout* mainlayout = new QVBoxLayout(this); mainlayout->setContentsMargins(0, 0, 0, 0); elementsListLayout = new QTreeView(this); elementsListLayout->setContentsMargins(0, 0, 0, 0); elementsListLayout->setHeaderHidden(true); elementsListLayout->setIndentation(0); elementsListLayout->setUniformRowHeights(false); elementsListLayout->setObjectName("ElementsListWidget"); elementsListLayout->setSelectionMode(QAbstractItemView::NoSelection); elementsListLayout->verticalScrollBar()->parent()->setProperty("background_transparent", true); elementsListLayout->horizontalScrollBar()->parent()->setProperty("background_transparent", true); sourceModel = new QStandardItemModel(this); elementsListLayout->setModel(sourceModel); mainlayout->addWidget(elementsListLayout); setLayout(mainlayout); elementsPerRow = 3; totalModelElements = 0; sourceModel->setColumnCount(elementsPerRow); } void ElementsListWidget::addElement(AbstractElement* element) { elementsModel << element; showWidgetOnView(createDisplayUnit(element)); } QWidget* ElementsListWidget::createDisplayUnit(AbstractElement* element) { if (!element) { return nullptr; } QWidget* elementDispalyWidget = new QWidget; elementDispalyWidget->setObjectName("elementDisplayUnit"); QVBoxLayout* elementdisplayLay = new QVBoxLayout(elementDispalyWidget); //elementdisplayLay->setContentsMargins(0, 0, 0, 0); QLabel* elementIconLabel = new QLabel(elementDispalyWidget); elementIconLabel->setObjectName("elementIconLabel"); elementIconLabel->setProperty("element", QVariant::fromValue(static_cast<AbstractElement*>(element))); elementIconLabel->setCursor(Qt::OpenHandCursor); elementIconLabel->setAlignment(Qt::AlignCenter); elementIconLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); elementIconLabel->installEventFilter(new ElementDragEventHandler(elementIconLabel)); // Install event filter elementIconLabel->setPixmap(element->getImage().scaled(50, 50)); QLabel* elementNameLabel = new QLabel(element->getName(), elementDispalyWidget); elementNameLabel->setObjectName("elementNameLabel"); elementNameLabel->setAlignment(Qt::AlignCenter); elementNameLabel->setWordWrap(true); elementdisplayLay->setAlignment(Qt::AlignHCenter); elementdisplayLay->addWidget(elementIconLabel); elementdisplayLay->addWidget(elementNameLabel); elementdisplayLay->addStretch(); elementDispalyWidget->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); return elementDispalyWidget; } void ElementsListWidget::setElementsPerRow(int numberOfelementsPerRow) { if (numberOfelementsPerRow > 0) { elementsPerRow = numberOfelementsPerRow; } } void ElementsListWidget::serachElement(const QString& searchText) { clearModel(); // Iterate through the stored widgets in elementWidgetModel for (AbstractElement* element : elementsModel) { if (element && element->getName().contains(searchText, Qt::CaseInsensitive)) { showWidgetOnView(createDisplayUnit(element)); } } } void ElementsListWidget::showWidgetOnView(QWidget* elementDisplayUnit) { if (elementDisplayUnit == nullptr) { return; } QStandardItem* item = new QStandardItem; // Calculate the row and column count for the new element int row = totalModelElements / elementsPerRow; int column = totalModelElements % elementsPerRow; sourceModel->setItem(row, column, item); elementsListLayout->setIndexWidget(item->index(), elementDisplayUnit); totalModelElements++; } void ElementsListWidget::clearModel() { sourceModel->clear(); totalModelElements = 0; } styel sheet for few widget QWidget#ElementsListWidget { background-color: #DAE0E9; color: #3B5571; border: none; } #elementDisplayUnit { background-color: transparent; font-size: 14px; } #elementIconLabel { width: 64px; background-color: #ffffff; border: 1px solid #BEC9CD; height: 64px; position: relative; /* align-items: center; */ border-radius: 5px; /* justify-content: center; */ background-color: #FFFFFF; } #elementIconLabel:hover { background-color: lightgray; } #elementNameLabel { padding: 0px 0 0 0; font-size: 11px; max-width: 64px; text-align: center; line-height: 12px; /* text-overflow: ellipsis; */ background-color: transparent; /* word-wrap: break-word; */ font-weight: bold; }
  • 0 Votes
    5 Posts
    555 Views
    S
    @SGaist said in Can I charge customer to use Software if I have created Software using open source Qt?: Also, if you do any changes to Qt for one reason or another, you have to publish these changes. In addition to what @SGaist said: You need to have the source code of the Qt version that you used. You can either provide a written offer valid for at least 3 months for your customer to request the Qt source code (not your own source code). Or you provide the Qt source code in the same way as your software (if your software can be downloaded, place a download link to the Qt source code in the same place). A download link to someone else hosting the same Qt source code does not count. You have to host it in the same place as your software. Furthermore, the LGPL requires that the user is able to relink with a different Qt version. If you are using Qt's DLLs this is taken care of already as the user can just replace the DLLs.
  • Error compiling with blank file!!

    Unsolved Mobile and Embedded android qt5.14.2
    3
    0 Votes
    3 Posts
    426 Views
    R
    A complete compilation has already been performed several times. I can not include a new class in the project.. or even a blank file that this error occurs. Will the SDK, NDK and JDK settings be correct?
  • QWebEngineView crashes on Chromium error

    Solved QtWebEngine qt5.14.2 qtwebengine chromium
    11
    0 Votes
    11 Posts
    4k Views
    Jez1337J
    @KH-219Design glad to know I helped and thanks again for your input! After working perfectly during one full day of tests, the problem resurfaced again yesterday. Anything built in C++ using QWebEngineView works for all of my tests until it gets to one of the problem URLs, then abruptly crashes. No other URLs cause this problem and the page in question loads fine in any "real" browser I try it in. Since I'm not tied to any particular version of Qt, I've downgraded from Qt 5.14.2 to Qt 5.13.2. The Qt 5.13.2 QWebEngineView is not crashing. Also, it seems faster than Qt 5.14.2, and doesn't have another annoying behaviour which I believe to be graphics driver-related, which is that for certain pages of a well known UK based left wing newspaper the URL loads and then the whole web engine widget goes grey, and the program freezes. With no interest in faffing around further, I'm concluding that inside Qt 5.14.2, either the implementation of Chromium or the Qt WebEngine wrapper is buggy, at least for my particular combination of hardware and software. Original Problem Using MSVC 2017 + Qt 5.14.2, QWebEngineView crashes randomly on certain URLs which do not appear to be doing anything out of the ordinary. Solution Avoid Qt 5.14.2, or at least avoid the pre-built MSVC 2017 version which comes when you use the offline installer for Qt 5.14.2. In my case this meant downgrading to Qt 5.13.2.
  • 0 Votes
    5 Posts
    778 Views
    WilliamJW
    Thank you Christian! https://bugreports.qt.io/browse/QTBUG-88063 describes exactly what I've been seeing.
  • 0 Votes
    16 Posts
    2k Views
    S
    @Pl45m4 I'll try this...changing it's position
  • 0 Votes
    5 Posts
    895 Views
    O
    Found it! Thanks!
  • Qt wabassembly cache

    Unsolved Qt for WebAssembly webassembly qt5.14.2
    3
    0 Votes
    3 Posts
    628 Views
    N
    @lorn-potter you mean if I update part of my application I should download all application in my browser?
  • QtCreator SIGSEGV in QString copy ctor

    Solved Qt Creator and other tools qtcreator qt5.14.2
    2
    0 Votes
    2 Posts
    474 Views
    J
    Cleaning PATH variable and MSYS2 Environment solve that. I think that it might be caused by different version of some library that was used (because I had a lot of paths in the PATH), but for now it is over and I am happy with that.
  • 0 Votes
    12 Posts
    2k Views
    SGaistS
    Not in the past few days, IIRC, OpenSSL 1.1 support started with 5.10 and the ore-built package switched to it during the 5.12 release cycle.
  • Dynamic libs on Android with Qt5.14.2

    Unsolved Mobile and Embedded dynamic linking android qt5.14.2
    7
    0 Votes
    7 Posts
    2k Views
    sierdzioS
    Trick with android/libs should work for older Qt versions, too, and it works the same on qmake and cmake. If all else fails, you could have different .pri per Qt version... It's a nuisance for sure but my hope is that for Qt 5.14+ it will stay as it is for long.