Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 456.9k Posts
  • How to set displayText() on QlineEdit

    Solved
    4
    0 Votes
    4 Posts
    521 Views
    U
    @SGaist and @Christian-Ehrlicher thanks for the clarification. I used setEchoMode to display the text
  • How Can I put a widget inside a Frame or a Container

    Unsolved
    2
    0 Votes
    2 Posts
    154 Views
    SGaistS
    Hi, What is his widget ? What do you want to do with it ? What should your UI look like ?
  • QTreeView disable scroll to letter match...

    Solved qtreeview
    4
    0 Votes
    4 Posts
    526 Views
    D
    @mrjj I prefer to be able to press F to zoom in to selected items as the selection might happen in another widget. Look at 3d apps with scenegraphs. They don't use search by key. @Christian-Ehrlicher said in QTreeView disable scroll to letter match...: @Dariusz said in QTreeView disable scroll to letter match...: How can I disable this ? OVerwrite QAbstractItemView::keyboardSearch() Thanks! Sounds like that might be it :- )
  • Cannot interact with subclass of QTabWidget

    Solved
    4
    0 Votes
    4 Posts
    291 Views
    Christian EhrlicherC
    @ppp1 Then please mark this topic as solved, thx.
  • add a "responsive" widget to toolbar

    Solved
    8
    0 Votes
    8 Posts
    1k Views
    U
    also, the buttons that actually appear in the drop-down list, become disabled in the list (but i do not explicitly disable them), and when i widen the toolbar and actions come back to the toolbar, they're enabled again. what's the reason?
  • Access to a QT instance which is declared and defined in another method

    Solved
    7
    0 Votes
    7 Posts
    508 Views
    P
    @mrjj Thanks! I know how to get access to this object.
  • Prevent the child of a QSplitter from resizing when the splitter resizes

    Unsolved
    1
    0 Votes
    1 Posts
    257 Views
    No one has replied
  • QVTKwidget not shown in QtDesigner

    Solved
    15
    0 Votes
    15 Posts
    6k Views
    SGaistS
    Hi, I would advise to ask that to the VTK folks as they are the more knowledgeable about their library.
  • How to refresh QTableView after an SQL Commit?

    Solved
    19
    0 Votes
    19 Posts
    6k Views
    L
    @JonB Wow! I can’t thank you enough for that thorough explanation. That’s exactly what I needed to learn. I’ll be sure to take all of that information and practice on a few smaller examples to help solidify it, and then integrate it into my project. Edit: I got it to work!! Thank you to everyone who contributed. My understanding of these particular topics has grown substantially!
  • Load .3ds or .obj file with Qt3D

    Unsolved
    4
    0 Votes
    4 Posts
    2k Views
    beeckscheB
    @esconda So far .3ds files shouldn't be supported to load as mesh: https://doc.qt.io/qt-5/qt3drender-qmesh.html#details Years ago I had some problems loading my own Wavefront .obj file too, and still don't know where the problem was. I would start to load the .obj from the examples . So you can ensure, thats not a problem of your file.
  • QOpenGLFunctions_3_2_Core problems on ARM Platforms

    Unsolved
    4
    0 Votes
    4 Posts
    858 Views
    K
    @jsulm the Jetson Nano has OpenGL 4.6: khaled@jetson-nano:~/Repositories/colmap/build$ glxinfo | grep "OpenGL version" OpenGL version string: 4.6.0 NVIDIA 32.2.3
  • Arrow with control point children, how to keep arrow position centered?

    Solved
    3
    0 Votes
    3 Posts
    234 Views
    enjoysmathE
    The items being moved are QGraphicsObject subclasses Arrow together with their ControlPoint's. This code works: def update_centroid_pos(self): if not self._updatingPointPos: self._updatingPointPos = True center = self.point_center() delta = self.mapFromParent(self.pos()) - center for point in self._points: point.setPos(point.pos() + delta) self.setPos(self.mapToParent(center)) self._updatingPointPos = False However, it doesn't support press-moving. What happens is the control point moves twice as far as it should and so shows an accelerating movement while the cursor moves at a constant rate. So I just changed my scene editing to be the same as when you place a ControlPoint : it's held under cursor until the user presses again. This works for my purposes.
  • Draggable PyQt5 tabs in custom TabWidget work in min example, but not in practice

    Solved
    3
    0 Votes
    3 Posts
    559 Views
    enjoysmathE
    def mouseMoveEvent(self, e): if e.buttons() != Qt.RightButton: return globalPos = self.mapToGlobal(e.pos()) tabBar = self.tabBar() posInTab = tabBar.mapFromGlobal(globalPos) index = tabBar.tabAt(posInTab) tabBar.dragged_content = self.widget(index) tabBar.dragged_tabname = self.tabText(index) tabRect = tabBar.tabRect(index) pixmap = QPixmap(tabRect.size()) tabBar.render(pixmap,QPoint(),QRegion(tabRect)) mimeData = QMimeData() drag = QDrag(tabBar) drag.setMimeData(mimeData) drag.setPixmap(pixmap) cursor = QCursor(Qt.OpenHandCursor) drag.setHotSpot(posInTab) drag.setDragCursor(cursor.pixmap(),Qt.MoveAction) drag.exec_(Qt.MoveAction) Replace code with this code. In particular we don't take e.pos() except once at the top, then we use globalPos for computing poosInTab, then drag.setHotSpot(posInTab). It works!
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    13 Views
  • QMYSQL driver not loaded Windows 10 problem

    Unsolved
    3
    0 Votes
    3 Posts
    503 Views
    G
    You can look at a similar problem that I had here https://forum.qt.io/topic/109245/mysql-connection-on-deployment-machines-not-work-windows
  • MYSQL connection on deployment machines not work (Windows)

    Solved
    14
    0 Votes
    14 Posts
    1k Views
    G
    Thank you for your reply. Yes I thought the same as you and try to install the last vcredis C++ from my Visutal Studio installation but without any success. It give me msvcp140.dll. Anyway, currently I do not have time to investigate my Windows development machine configuration, there is clearly a problem between QT Creator environment variable used to compile my app and my manual settings when I compile DLL from my terminal. I will investigate that the next year, right now I missed enough time with this trouble of mysql dll to get it work and I have to code to finish the next release of my app which have to be released on December... To fix this problem temporary I copied de missing dll by hand and add them in the MSI package installer to be deployed to the target customer machines in the app root folder. It's not the best solution but it works.
  • QtCreator Permission Denied to File

    Solved qtcreator bug permissions embedded linux windows10
    8
    0 Votes
    8 Posts
    6k Views
    rafaelellinR
    @aha_1980 Hi again! I created a bug report at https://bugreports.qt.io/browse/QTCREATORBUG-23295, lets hope that someone finds a fix. Thanks for your time!
  • Alternative signal and slot crashes if there is a widget to update in the slot

    Solved
    4
    0 Votes
    4 Posts
    520 Views
    U
    @mrjj and @Pablo-J-Rogina thanks for the help. This worked. void MainWindow::on_pushButton_clicked() { captureWig = new SecondForm(this); QObject::connect(captureWig, &SecondForm::clicked, this, &MainWindow::someSlotW); You are right about creating at the wrong place and having many instances.
  • 0 Votes
    7 Posts
    1k Views
    S
    @J-Hilk Thank you, JonB and you were right. For me it actually makes more sense that e.g. at first you connect to the device and then you say "okay, if the signal "connected" is emitted then call the function x.y.". So after changing it, it works now. However, after getting all services and calling "service->discoverDetails" and then "service->characteristics" the characteristics List is empty. After connection is successfull: void Scanner::startServiceDiscovery(){ connect(controller, &QLowEnergyController::discoveryFinished, this, &Scanner::discoveryFinished); controller->discoverServices(); } void Scanner::discoveryFinished(){ qDebug() << "\nService Discovery finished. Following Services found:\n"; QList<QBluetoothUuid> serviceList = controller->services(); for(QBluetoothUuid &sl : serviceList){ qDebug() << controller->createServiceObject(sl)->serviceName() << "Uuid: " << sl; } uartService = controller->createServiceObject(adafruitServiceUuid); qDebug() <<"\nChose the following service: " << (*uartService).serviceName(); connect(uartService, &QLowEnergyService::stateChanged, this, &Scanner::printChars); qDebug() << uartService->state(); //here the state is QLowEnergyService::DiscoveryRequired uartService->discoverDetails(); } void Scanner::printChars(){ qDebug() << uartService->state(); // here the state is now QLowEnergyService::DiscoveringServices const QList<QLowEnergyCharacteristic> chars = uartService->characteristics(); qDebug()<< chars.size(); //however the list size is 0 for (const QLowEnergyCharacteristic &ch : chars) { qDebug() << &ch; } } btw: I know that there is an example for BLE Scanner. But for a project, I want to create an own desktop application which connnects to a peripheral and live plots the data which are received from the sensor with qcustomplot. So I need a QWidget Application because QCustomPlot is a widget...
  • Enum class sample

    Unsolved
    12
    0 Votes
    12 Posts
    755 Views
    KutyusK
    @Kutyus said in Enum class sample: QMetaEnum::fromTypeBle::Message().valueToKey(m) When I comment out the line wich contains the QMetaEnum::fromTypeBle::Message().valueToKey(m), the code is compiled succes. How can i get the enum name from its value?