Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.5k Posts
  • How to set Client CA List on server QSslSocket?

    Unsolved
    4
    0 Votes
    4 Posts
    702 Views
    SGaistS
    The bug report system is for doing both feature requests and bug reports. You have to select the correct type when you fill the report. Note that since it's a new feature, it can only go into Qt 6 as there will be no new minor releases of Qt 5. That said, if the internals have not changed too much you should be able to patch Qt 5.15 for your own build.
  • Build project with custom qml plugin with QT static

    Solved
    1
    0 Votes
    1 Posts
    122 Views
    No one has replied
  • A project build on Raspbian.

    Unsolved
    23
    0 Votes
    23 Posts
    2k Views
    J
    well...the command line works. seems faster, but don't relay on my subjective analysis. I'll see if it helps.
  • How to add stop button to pyqtgraph?

    Unsolved
    2
    0 Votes
    2 Posts
    823 Views
    jsulmJ
    @poordev123 said in How to add stop button to pyqtgraph?: plot = pg.plot() This is local variable in set_up_graph(self). So, it is not hte same used in plot_the_graph(self). I never used PyQtgraph but according to its documentation you should rather do like this: pw = pg.plot(xVals, yVals, pen='r') # plot x vs y in red pw.plot(xVals, yVals2, pen='b') win = pg.GraphicsWindow() # Automatically generates grids with multiple items win.addPlot(data1, row=0, col=0) win.addPlot(data2, row=0, col=1) win.addPlot(data3, row=1, col=0, colspan=2) pg.show(imageData instead of calling static plot() which creates a new plot at each call. I suggest you spend some time to read: https://pyqtgraph.readthedocs.io/en/latest/how_to_use.html as it is not part of Qt.
  • An error occurs when using animation effects.

    Solved
    10
    0 Votes
    10 Posts
    835 Views
    jsulmJ
    @IknowQT said in An error occurs when using animation effects.: Does this mean that the custom class that inherits Qframe class should apply it? Yes, because this property is a property of that custom class. There is no such property in QFrame, so how should it work?
  • How to move a Qt-VS project to a new computer

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    Christian EhrlicherC
    @Puppy-Bear said in How to move a Qt-VS project to a new computer: Problem solved, need to set .user file's path with opening it. mchinand about 13 hours ago Also, don't copy any auto-generated files between the two computers. This includes the <projectname>.pro.user You must not copy the .user file as @mchinand already told you as it contains data (e.g. paths) specific to your configuration.
  • Syntax for Vector of QPushbuttons added to FlowLayout

    Solved
    52
    0 Votes
    52 Posts
    6k Views
    Swati777999S
    @JKSH said in Syntax for Vector of QPushbuttons added to FlowLayout: @Swati777999 said in Syntax for Vector of QPushbuttons added to FlowLayout: In this case , the setminimumsize() for the widget is not used ,that's why the buttons take a vertical layout. That's an incomplete answer. You also get a "vertical layout" if you call flowWidget->setMinimumSize(100, 100). Why? What is the minimum size that you need to get 2 buttons per row? Now, I'm trying out the second part of this design No, don't do this yet. Here's the simplified code for the entire design . I created a new project scrollAreaApp with the base class as QMainWindow scrollAreaApp.cpp #include "scrollareaapp.h" ScrollAreaApp::ScrollAreaApp(QWidget *parent) : QMainWindow(parent) { QWidget *flowWidget = new QWidget(); FlowLayout *flowLayout = new FlowLayout(); flowWidget->setLayout(flowLayout); flowWidget ->setMinimumSize(1200,1200); int n=20; QVector <QPushButton *> buttons(n); for (int ii=0;ii<n;ii++) { QPushButton * pb = new QPushButton(); // creating buttons pb->setMinimumSize(200,200); buttons.push_back(pb); // adding buttons to qvector flowLayout->addWidget(pb); } QWidget *WindowWidget= new QWidget(this); WindowWidget->setMinimumSize(1000,1000); QVBoxLayout *WindowLayout = new QVBoxLayout(WindowWidget); QLabel *WindowHeading = new QLabel("Experimenting with Scrollbar in Flow Layout"); WindowLayout->addWidget(WindowHeading); WindowLayout->setAlignment(WindowHeading,Qt::AlignLeft); WindowLayout->addWidget(flowWidget); QScrollArea *scroll =new QScrollArea(); scroll->setWidget(WindowWidget); this->setCentralWidget(scroll); this->show(); } [image: 8136daec-10be-499f-a954-d0eae3899bf6.PNG] I am getting the desired result.
  • qframe border-radius property question

    Unsolved
    1
    0 Votes
    1 Posts
    367 Views
    No one has replied
  • BUMP - where is QT bluetooth module ?

    Unsolved
    5
    0 Votes
    5 Posts
    315 Views
    Chris KawaC
    It's not missing. It's in \qtconnectivity\src\bluetooth\, just as it was in Qt 5 and just as @hskoglund said in the linked post.
  • Copy / Paste Broken in Macros

    Unsolved
    1
    0 Votes
    1 Posts
    117 Views
    No one has replied
  • How to make real time playback with QGraphicsView and repaint of QWidget?

    Unsolved
    1
    0 Votes
    1 Posts
    114 Views
    No one has replied
  • QTextEdit - text color won't change

    Solved
    2
    0 Votes
    2 Posts
    317 Views
    C
    Well, couldn't figure out why text color wasn't changing, so I just decided to use my custom syntax highlighter to deal with changing the text color and it works quite well.
  • QFontDatabase::addApplicationFont return -1

    Unsolved
    4
    0 Votes
    4 Posts
    478 Views
    Christian EhrlicherC
    Then enable the debug logging for qt.qpa.fonts (see detailed description here: https://doc.qt.io/qt-5/qloggingcategory.html#details ) and see what it prints to your console.
  • unable to change cursor position after document change

    Unsolved
    2
    0 Votes
    2 Posts
    189 Views
    Gojir4G
    hi @django-Reinhard , You should "apply" the modification done to the cursor. When you are using editor->textCursor(), you receive a QTextCursor object by copy and not by reference, which means that the change are only applied locally but not applied to the QPlaintextEdit instance itself. This should fix your issue: QTextCursor tc = editor->textCursor(); tc.setPosition(...); editor.setTextCursor(tc);
  • Best way to create an OSD (on screen display with Qt)

    Unsolved
    5
    0 Votes
    5 Posts
    666 Views
    O
    @SGaist They are very much dynamic.
  • QDataStream >> QList causes the program to crash when I try to open an invalid file

    Unsolved
    6
    0 Votes
    6 Posts
    694 Views
    Christian EhrlicherC
    @Donald-Duck said in QDataStream >> QList causes the program to crash when I try to open an invalid file: QDataStream &operator<<(QDataStream &dataStream, Something foo){ This is the serialization operator, not the one which is used for deserialization. dataStream >> myList What is myList? Since QDataStream stores the size of the QList first it may read high number and tries to allocate the memory then. So you will most likely get an out of memory exception which can be catched with a try/catch. To make sure you read only your files I suggest adding a magic pattern in the first bytes which you can check to be sure that it's really your file. And also add a checksum at the end so you can check this too later on.
  • Highlight QtreeView row on mouse hover

    Unsolved
    2
    0 Votes
    2 Posts
    893 Views
    Christian EhrlicherC
    Use a custom QStyledItemDelegate and set QStyle::State_MouseOver in QStyleOptionViewItem.state for every index in your row or derive from QTableView,overwrite initViewItemOption() and set State_MouseOver there (only for Qt6). Note: some styles might ignore this flag.
  • Sending email issue.

    Solved
    12
    0 Votes
    12 Posts
    985 Views
    J
    @J-Hilk yeah, thank you. "Allow less secure apps" did the magic.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    8 Views
    No one has replied
  • How to Create a QList or QVector of mixed types

    Solved
    12
    0 Votes
    12 Posts
    1k Views
    S
    @Pl45m4 said in How to Create a QList or QVector of mixed types: AFAIK all struct members are public. Nope. All struct members are public by default. Just as with a regular class you can declare them private or protected. The only difference between class and struct is the default visibility. And yes, it is bad OOP design, but OOP is not always the best solution. Bjarne Stroutrup himself also talks about data type design. There is no reason to add getters and setters as only member functions if your class is actually just a struct. Don't make things too complicated. @mchinand said in How to Create a QList or QVector of mixed types: For your case, you could also use a vector of QPair/std::pair, where the vector type is QVector<QPair<QPoint, QGraphicsEllipseItem *>> and the QPoint would contain the column/row values. That'll certainly work and sometimes this is the quick way of doing things which I also apply. However, using a struct is a lot more descriptive. I hate it if types are nested too much and you can't figure out what they mean. (Though I'll gladly do the same 😉.)