Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • 0 Votes
    15 Posts
    5k Views
    JonBJ
    @n-2204 Please try to format your posts readably. For lines of code use the Code tag when posting, or but lines of 3-backticks above & below. You are also now asking this same question in a new thread you have created (https://forum.qt.io/topic/125774/qtableview-how-to-make-noneditable-column). You should stick to one thread, not create multiple ones. where i should give like it will be applicable for table1 or table2 I don't know what you mean. To use the flags() approach you must sub-class QStandardItemModel, which I assume is what your GAS_tool is, else this will have no effect. If you want to use the setFlags() approach, you do not need to sub-class, but must set the flags explicitly on each item which is to be non-editable. I also wrote this in your other thread.
  • warning QToolbar::actionTriggered is not a signal[crazy-connect-no-signal]

    Unsolved
    3
    0 Votes
    3 Posts
    262 Views
    E
    @mrjj Maybe it‘s a bug for the Qt 6.0
  • Proper way to make a cmake project (pri) dependent on another cmake project (pri)

    Solved
    2
    0 Votes
    2 Posts
    151 Views
    fcarneyF
    My paths were relative to a cd. This messed things up.
  • 0 Votes
    12 Posts
    12k Views
    N
    @sayan275 Not clear why, but I think this does what you need: set the keyboardTracking property of the spinbox to false, then do the following: void MainWindow::on_mySpinBox_valueChanged(int arg1) { on_mySpinBox_editingFinished(); } void MainWindow::on_mySpinBox_editingFinished() { // what you need to be done, on spinbox loosing focus or arrows adjusting (and not while editing) }
  • 0 Votes
    10 Posts
    756 Views
    jeremy_kJ
    @Inhahe said in How can I do something when the user clicks on a particular span/frame/block/fragment/whatever of text in a QTextEdit?: here's my code: def addmsg(textedit, nick, message): if config.show_timestamp: obj_now = datetime.now() textedit.insertPlainText(f"[{obj_now.hour: >2}:{obj_now.minute: >2}] ") textedit.insertPlainText("<") #textedit.insertHtml(f'<a href="{nick}">{nick}</a>') #doesn't work right, bug in qt charFormat = QTextCharFormat() charFormat.setAnchorHref(nick) textedit.textCursor().insertText(nick, charFormat) textedit.insertPlainText("> ") colorify(textedit, message) textedit.insertHtml("<br>") both the QTextCharFormat approach and the insertHtml approach (commented out in the above) result in the link extending all the way to the end of the line, which it seems it shouldn't. Just posting it in case you happen to have any insight; I expect I'll have to figure this out myself ;/ Using textedit.insertHtml(f'<a href="{nick}">{nick}</a>&gt;') rather than adding > as plain text fixes the issue for me with Qt 5.15.2 and PyQt 5.15.3. I haven't tried using the QTextCharFormat method.
  • QGlib::Value::set: Unable to handle value type "gchararray".

    Unsolved
    1
    0 Votes
    1 Posts
    143 Views
    No one has replied
  • How to achieve a blurred background

    Solved
    6
    0 Votes
    6 Posts
    7k Views
    S
    @Chris-Kawa Hi, can you post a small example to get this feature please? Or can you tell me where I should go to look for more about that? Thank you
  • Converting image to RGB16 in array

    Unsolved
    6
    0 Votes
    6 Posts
    390 Views
    SGaistS
    Never done what ?
  • How to link (FTDI)d2xx library to qt project?

    Unsolved
    2
    0 Votes
    2 Posts
    415 Views
    SGaistS
    Hi, If using Qt Creator, you have a wizard to help you.
  • MDI Area Ghosting

    Unsolved
    1
    0 Votes
    1 Posts
    170 Views
    No one has replied
  • Get the correct date days passed after current date

    Solved
    9
    0 Votes
    9 Posts
    907 Views
    HolidayH
    @JonB Thanks for help. Yes, the main question in my problem was: what we mean by "days". 24 hour or days between midnight. When I found an answer on this question, I found a solution. Huge thanks everyone for help!
  • Instantiate a constructor with QObject *objectParent as the default parameter?

    Solved
    4
    0 Votes
    4 Posts
    295 Views
    C
    There we go, got it to work now by adding = nullptr to the TestClass constructor like this: TestClass(QObject * objectParent = nullptr) Thanks so much.
  • QSerialPort can't handle custom baud rate of 500K??

    Unsolved
    9
    0 Votes
    9 Posts
    666 Views
    E
    The problem was with my Arduino code. I have modified it and it now works even at 500K baud rate!
  • This topic is deleted!

    Unsolved
    3
    0 Votes
    3 Posts
    18 Views
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    16 Views
  • Faulting module path: C:\WINDOWS\SYSTEM32\ntdll.dll

    Solved
    4
    0 Votes
    4 Posts
    2k Views
    Christian EhrlicherC
    @sierdzio told you to inspect the backtrace!
  • This topic is deleted!

    Solved
    3
    0 Votes
    3 Posts
    15 Views
  • QGraphicsView using QOpenGLWidget as viewport, bad text rendering

    Solved
    4
    0 Votes
    4 Posts
    561 Views
    A
    @closer_ex They added a lot of highly expensive Q_ASSERT-statements sometime in Qt 5. That might be the cause of high CPU usage. EDIT: You can verify that by defining your own Q_ASSERT and Q_ASSERT_X macros before including the first Qt header file.
  • Can't get QSettings to write my settings properly

    Solved qsettings c++ config file font font family
    14
    0 Votes
    14 Posts
    2k Views
    R
    I fixed this by setting QFont font = this->font(); to ui->appName->font(); in case anyone comes across this.
  • memory leak width QPainter/QPrinter

    Unsolved qpainter qprinter memory leak
    18
    0 Votes
    18 Posts
    4k Views
    AaronCA
    @Christian-Ehrlicher Thanks for tracking that down. Hope Qt gets it fixed soon.