Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • How to set QML TableViewStyle to show Middle Ellipses (ElideMiddle)

    Unsolved
    2
    0 Votes
    2 Posts
    563 Views
    T
    I figured it out. I needed to add the width: parent.width to the delegates headerDelegate: Rectangle { height: 20 color: "lightsteelblue" Text { width: parent.width text: styleData.value elide: Text.ElideMiddle } } itemDelegate: Rectangle { Text { width: parent.width text: styleData.value elide: Text.ElideMiddle } }
  • Console without " problem

    Solved
    7
    0 Votes
    7 Posts
    728 Views
    mranger90M
    I know this is solved, but just as a follow up, you could try qDebug.noquote() << command << mitm.fileName();
  • Compiling a .pro file with dependencies

    Unsolved
    4
    0 Votes
    4 Posts
    473 Views
    jsulmJ
    @Geeva You should really post the error message, else we can only guess here. Most probably you did not install the *-dev packages for the dependencies.
  • Add space to QGridLayout

    Solved
    7
    0 Votes
    7 Posts
    8k Views
    Cobra91151C
    So, I was right and fixed it by adding QScrollArea with QGridLayout. I created the test example: Code: QPushButton *testButton1 = new QPushButton("Test1"); testButton1->setMinimumHeight(23); QPushButton *testButton2 = new QPushButton("Test2"); testButton2->setMinimumHeight(23); QPushButton *testButton3 = new QPushButton("Test"); testButton3->setMinimumHeight(23); QPushButton *testButton4 = new QPushButton("Test"); testButton4->setMinimumHeight(23); QPushButton *testButton5 = new QPushButton("Test"); testButton5->setMinimumHeight(23); QPushButton *testButton6 = new QPushButton("Test"); testButton6->setMinimumHeight(23); QPushButton *testButton7 = new QPushButton("Test"); testButton7->setMinimumHeight(23); QPushButton *testButton8 = new QPushButton("Test"); testButton8->setMinimumHeight(23); QPushButton *testButton9 = new QPushButton("Test"); testButton9->setMinimumHeight(23); QPushButton *testButton10 = new QPushButton("Test"); testButton10->setMinimumHeight(23); QPushButton *testButton11 = new QPushButton("Test"); testButton11->setMinimumHeight(23); QPushButton *testButton12 = new QPushButton("Test"); testButton12->setMinimumHeight(23); QPushButton *testButton13 = new QPushButton("Test"); testButton13->setMinimumHeight(23); QPushButton *testButton14 = new QPushButton("Test"); testButton14->setMinimumHeight(23); QPushButton *testButton15 = new QPushButton("Test"); testButton15->setMinimumHeight(23); QPushButton *testButton16 = new QPushButton("Test"); testButton16->setMinimumHeight(23); QFont sectionFont; sectionFont.setBold(true); QLabel *section1Label = new QLabel("Section 1", this); section1Label->setFont(sectionFont); QLabel *section2Label = new QLabel("Section 2", this); section2Label->setFont(sectionFont); QWidget *testWidget = new QWidget(this); QScrollArea *testScrollArea = new QScrollArea(this); testScrollArea->setWidgetResizable(true); testScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); testScrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); QGridLayout *testGridLayout = new QGridLayout(); testGridLayout->addWidget(testButton1, 1, 0); testGridLayout->addWidget(testButton2, 1, 1); testGridLayout->addWidget(testButton3, 1, 2); testGridLayout->addWidget(testButton4, 1, 3); testGridLayout->addWidget(testButton5, 1, 4); testGridLayout->addWidget(section1Label, 2, 0); testGridLayout->addWidget(testButton6, 3, 0); testGridLayout->addWidget(testButton7, 3, 1); testGridLayout->addWidget(testButton8, 3, 2); testGridLayout->addWidget(testButton9, 3, 3); testGridLayout->addWidget(testButton10, 3, 4); testGridLayout->addWidget(section2Label, 4, 0); testGridLayout->addWidget(testButton11, 5, 0); testGridLayout->addWidget(testButton12, 5, 1); testGridLayout->addWidget(testButton13, 5, 2); testGridLayout->addWidget(testButton14, 5, 3); testGridLayout->addWidget(testButton15, 5, 4); testGridLayout->addWidget(testButton16, 5, 0); testWidget->setLayout(testGridLayout); testScrollArea->setWidget(testWidget); QHBoxLayout *mainHBoxLayout = new QHBoxLayout(); mainHBoxLayout->addWidget(testScrollArea); setLayout(mainHBoxLayout); Now it adds the scrollbars and the space between those buttons: [image: bc395c8d-a4ce-4abf-a2fc-d15307f07f25.png] The issue is resolved.
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    1 Views
  • How to zoom QImage at a given point

    Unsolved
    3
    0 Votes
    3 Posts
    677 Views
    N
    Thank you for the reply. I have already check that example. But this also have same issue. and picture get zoomed in from the top corner.
  • QObject: cannot create children for a parent which is in a different thread

    Unsolved
    2
    0 Votes
    2 Posts
    396 Views
    jsulmJ
    @Subuday said in QObject: cannot create children for a parent which is in a different thread: When I add to my code Add what?
  • Update QListWidget item

    Unsolved
    11
    0 Votes
    11 Posts
    2k Views
    SGaistS
    Something is not clear, do you want to use a delegate or have cell widgets ?
  • QtCreator properties widget

    Unsolved
    4
    0 Votes
    4 Posts
    478 Views
    SGaistS
    Hi, Just one thing to take into account, Qt Creator is GPLv3 with exception licensed.
  • Loading tree into QStandardItemModel from QThreadPool

    Unsolved
    4
    0 Votes
    4 Posts
    491 Views
    SGaistS
    I just realised that I misread your code, and thought you where using a convenience class like QTreeWidget. Anyway, that doesn't mean you can't use QStandardItemModel, far from it. However I would rework the code to not manipulate the items like you do but only generate them / update their content once your processing is done. You can use QObjects in other threads but you have to do that carefully, see the QThread.
  • Can't render triangle with opengl

    Unsolved
    6
    0 Votes
    6 Posts
    762 Views
    SGaistS
    Thanks for the detailed feedback !
  • Is there HTTP parser?

    Unsolved
    8
    0 Votes
    8 Posts
    2k Views
    SGaistS
    Then at least you can get some inspiration from that module to implement yours.
  • date time on axisX truncated and replaced with ...

    Unsolved
    1
    0 Votes
    1 Posts
    170 Views
    No one has replied
  • How to code " in QT Regular Expression?

    Unsolved
    7
    0 Votes
    7 Posts
    687 Views
    Gojir4G
    @Subuday I think your test string should be: QString test = "\r\n\r\\MyBody\""; You have to double escape backslash only in your regular expression. I suggest that you test your regular expression in a regex tester, like https://regex101.com, and then when it works, import it in your code. Otherwise it could be a nightmare to find the correct one.
  • Call widget of mainwindow in an other class

    Solved
    15
    0 Votes
    15 Posts
    2k Views
    ?
    @mrjj thanks it works
  • With QTextStream streamOut and streamOut <<data stop over 316 lines in text file?

    Solved
    9
    0 Votes
    9 Posts
    866 Views
    F
    @VRonin Thank I will try that too
  • Draw a rectangle when mouse is clicked

    Unsolved
    3
    0 Votes
    3 Posts
    2k Views
    mrjjM
    Hi and welcome to the forums you could also just use a list QList<QRect> rects; and store the rects in there and then in paintEvent, loop the list and draw the rects.
  • QJson: Document too large to store in data structure

    Solved
    4
    0 Votes
    4 Posts
    2k Views
    U
    @jsulm : Thanks for the reply. Will surely keep in mind to post such questions in QT mailing list. :)
  • Problem with using RegExp

    Solved
    6
    0 Votes
    6 Posts
    535 Views
    S
    @mranger90 Thank you!
  • QObject::connect: No such signal QTableWidget::itemChanged(QTableWidgetItem *item)

    Solved
    7
    0 Votes
    7 Posts
    2k Views
    M
    @jsulm said in QObject::connect: No such signal QTableWidget::itemChanged(QTableWidgetItem *item): @masayoshi said in QObject::connect: No such signal QTableWidget::itemChanged(QTableWidgetItem *item): void MainWindow::onTableitemChanged(QTableWidgetItem *item) it should be Item not item: onTableItemChanged Thank you! It works.