Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Update a row in a QSqlTableModel

    7
    0 Votes
    7 Posts
    5k Views
    F
    I am a computer science's engineering student, I have been learning Qt for the last 2-3 month so I am a beginner in Qt. My purpose in this moment is just to learn, so I make the most of your forum.
  • How can i get c++ code from .ui file

    5
    0 Votes
    5 Posts
    6k Views
    S
    Hi Himan, I confirm what sierdzio said, all the information is on the ui_*.h file. The .cpp code you are looking for is inside the setupUi function. The ui class is divided in three parts: pointers to QObjects, QWidgets, etc definition setupUi Function retranslateUi Function You can say that the setupUi is your ui class constructor. It is the one that constructs the ui, check it out. Regards, Sebastian Edit: fixed up list layout; Andre
  • [Solved] how to refer a dynamically added table widget inside a tab widget?

    12
    0 Votes
    12 Posts
    7k Views
    A
    I am marking the topic as [Solved] then. Next time, you can do that yourself by using the Edit link next to the first posting in this topic.
  • QtSql test application

    7
    0 Votes
    7 Posts
    4k Views
    M
    The warning message about the Mac Os version being unsupported is not related to the linker error. To get rid of it, specify the Mac Os target SDK as 10.6 as described here: http://doc.qt.nokia.com/latest/deployment-mac.html#architecture-dependencies
  • Using QUndoCommand with QTextEdit

    2
    0 Votes
    2 Posts
    2k Views
    C
    Answering my own questions here: first, by attaching to textEdited() instead of textChanged(), you are able to ignore any changes to the text made using setText(). Second, since a QLineEdit is a relatively short amount of text I simply stored the old text and the new text: this has the benefit of working regardless of whether the change is an insertion or deletion, letting me use the same Command class. It won't scale well, but for this app that's not a concern.
  • Passing a Windows handle a widget

    5
    0 Votes
    5 Posts
    3k Views
    P
    As i know you can render QWidget as a bitmap and then render this bitmap on another window.
  • [Solved] When do menus show for dialogs?

    2
    0 Votes
    2 Posts
    2k Views
    C
    To answer my own question: the dialog is showing the menus from its parent, and I had set a null parent for one of them.
  • QScrollBar and handle height

    6
    0 Votes
    6 Posts
    9k Views
    EddyE
    Just a thought: why not use a "QSlider":http://doc.qt.nokia.com/4.8-snapshot/qslider.html#details? Sounds this is what you want and you can use stylesheet to change the look of the handle.
  • Windows 8 Metro Style

    15
    0 Votes
    15 Posts
    10k Views
    sierdzioS
    @elte12: who? I'm fine, myself, thanks ;) but I doubt you meant me.
  • Strange problem with layout

    3
    0 Votes
    3 Posts
    2k Views
    S
    Yes Chris i'm sorry, you're right. I thought the problem was that originally i would only the menuLayout displayed vertically, then i changed my mind and i am going to display all with vertical layout. I'm sorry. Thanks Luca
  • Adding console to mainwindow

    3
    0 Votes
    3 Posts
    2k Views
    C
    Are you just wanting to display the output of commands sent from elsewhere, or are you talking about an actual interactive command line?
  • SelectedIndexes() generates an error!

    10
    0 Votes
    10 Posts
    8k Views
    G
    insertRecord does what it's name says, it inserts a record, not edits one. "from the docs:":http://doc.qt.nokia.com/4.7/qsqltablemodel.html#insertRecord [quote] Inserts the record after row. If row is negative, the record will be appended to the end. Calls insertRows() and setRecord() internally. Returns true if the row could be inserted, otherwise false. [/quote] Perhaps you were looking for: "setRecord":http://doc.qt.nokia.com/4.7/qsqltablemodel.html#setRecord ?
  • [Solved]Can't receive signal from another thread

    3
    0 Votes
    3 Posts
    3k Views
    U
    Change exit to return works. (Or remove wait() after start()) For these prevent thread from sleep or terminate. Thanks.
  • How to make win32 window as a parent of Qwidget window.

    2
    0 Votes
    2 Posts
    2k Views
    P
    Maybe "this post":http://stackoverflow.com/questions/4608130/how-to-embed-window-from-another-application-in-our-wpf-window-as-user-control will somehow help you.
  • [self Solved]model segmentation fault

    2
    0 Votes
    2 Posts
    3k Views
    P
    this sinppet is not wrong, I just delete data that has been new. big lesson
  • QScrollbar vertical bar goes to the buttom?

    3
    0 Votes
    3 Posts
    2k Views
    P
    thank you very much
  • QTabBar: padding size inside tabs

    5
    0 Votes
    5 Posts
    7k Views
    N
    It would only help if the left button (QLabel in this case) was placed in the top left corner of tab (0,0). But this is not the case in Gnome (padding from screenshot), so when I set fixedWidth of QLabel to 35 and tabSizeHint width to 35 too, QLabel just don't fit in tab.
  • Way to know when QGraphicsView is finished rendering?

    6
    0 Votes
    6 Posts
    3k Views
    R
    [quote author="Chris H" date="1323784331"]Looking at the code for the render() function in 4.7, it doesn't look like there are any signals being emitted during the process. Maybe there is something in the objects themselves?[/quote] Right - nor is the 'render()' function virtual, so you can't override it. [quote author="Andre" date="1323787413"]You are not downloading the images from the drawing code, are you?[/quote] Nope.
  • Problem in receiving data on QTcpSocket

    4
    0 Votes
    4 Posts
    4k Views
    S
    That should be the problem! Qt Signals & Slots rely's on the event-loop, When you initialize a QApplication (Gui) or QCoreApplication (non-Gui), the event-loop starts after you call exec()! Now the problem is that a QApplication or QCoreApplication needs to be created in the main thread! and that thread is started before your library is loaded... good thing is there are some options! :) You can can try to call QApplication::processEvents() from your main applications event loop You can create a second thread and start QApplication::exec() from there
  • How to bind a event handler to qtCheckbox

    7
    0 Votes
    7 Posts
    12k Views
    K
    Hi, i am new to qt. I have create a same function as andre but i cant find a way the get the value of the checkbox that was clicked. @QSignalMapper* mapper = new QSignalMapper(this); QMultiMap<QString, QString>::iterator a = examination.find("test_id"); while (a != examination.end() && a.key() == "test_id") { QCheckBox* cb = new QCheckBox(a.value(),this); _layout2->addWidget(cb); xml.readNextStartElement(); ++a; connect(cb, SIGNAL( stateChanged(int) ), mapper, SLOT(map())); mapper->setMapping(cb, i); } _layout2->addWidget(kataxwrisi); connect(kataxwrisi,SIGNAL(clicked()),this,SLOT(ReadXMLFile())); connect(mapper, SIGNAL(mapped(QString)), this, SLOT(checkboxClicked(QString))); } void QXSRExample::checkboxClicked(QString checkbox){ }@ for example if the first checkbox has the value "A" i want to know.. what can i do?