Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Modification of Qt source code under LGPL

    2
    0 Votes
    2 Posts
    1k Views
    EddyE
    This "thread":http://qt-project.org/forums/viewthread/8241 has a splendid explanation. Thanks to Andre
  • MemoryManagement of QGraphicsItems

    3
    0 Votes
    3 Posts
    4k Views
    ?
    Why not keep the "free" items inside some container, the scene manages the items that are in it, you manage the container that holds the free items, shift items back and forth and so on...
  • Q_PROPERTY and null QVariant

    11
    0 Votes
    11 Posts
    8k Views
    P
    Thanks, Volker. I've read that "For historical reasons, converting a null QVariant results in a null value of the desired type (e.g., an empty string for QString) and a result of false." and now everything is clear. Though I don't like that historical reasons. They forced me to write another three lines of code :)
  • Returning QList with local scope variables

    4
    0 Votes
    4 Posts
    4k Views
    B
    That helped me, thank you both
  • Painting on SVG file..Using mouse Events..?

    8
    0 Votes
    8 Posts
    4k Views
    A
    Ohh.. sorry..! I wasn't finding anyon to ans. so i did..! Anyway you ppl are way too quicker than i thought of..:)
  • How to get the IE Proxy Settings for Qt Application?

    6
    0 Votes
    6 Posts
    8k Views
    M
    I think what he's saying is that he wants his Qt app to "borrow" whatever settings Internet Explorer has configured for its proxy, rather than making the user reconfigure his app separately. I don't know of an easy way to do that, but there may be some sort of native code you could use to either query those settings, or read them from the registry directly. That's just a guess though. It's not something that Qt does natively, AFAIK.
  • 0 Votes
    3 Posts
    2k Views
    S
    Thanks Gerolf , I am new to Qt but know C++, i will move forward with your "implement the model" word and rest of the tips. Rgds, Softy
  • How can i prepend the string in the list of string?

    4
    0 Votes
    4 Posts
    3k Views
    P
    [quote author="KA51O" date="1331644359"].at(index) returns a const reference you need to use the [index] operator if you want to change the returned data. @ for (int count = 0; count < list.size (); count ++) { list[count].prepend (temp_string); } @[/quote] Thanks now it is working.
  • Memory Leaks with QDialog ans QPushButton

    6
    0 Votes
    6 Posts
    4k Views
    A
    Hi, thank you for your answers! as I said in my first post, the widget parent change anything for my memory leaks but I agree this creation on the main window isn't correct. So I change my code with this, I removed all not important things to get a more basic application : @QDialogTestWindow::~QDialogTestWindow(void) { MY_DELETE(m_qDialog); } void QDialogTestWindow::Initialize() { // In this case, give a parent in constructor of widget, layout change nothing, they can be null. m_qDialog = MY_NEW(QDialog,AID_QT)(this); QPushButton* pushButton = MY_NEW(QPushButton,AID_QT)(m_qDialog); //QPushButton* pushButton = MY_NEW(QPushButton,AID_QT)(this); //QPushButton* pushButton = MY_NEW(QPushButton,AID_QT)(); QMenuBar* menubar = MY_NEW(QMenuBar,AID_QT)(this); QMenu* menuFile = menubar->addMenu("File"); m_action = MY_NEW(QAction,AID_QT)(this); menuFile->addAction(m_action); connect(m_action, SIGNAL(triggered()), m_qDialog, SLOT(show())); setMenuBar(menubar); //m_action->trigger(); //m_qDialog->show(); } void QDialogTestWindow::closeEvent( QCloseEvent *e ) { // Close the QDialog before quit the qApp, but it's doesn't affect the memory leak... //if(m_qDialog->isVisible()) //m_qDialog->close(); qApp->quit(); }@ I run my application on windows x86, it's same thing with x64 with others memory leaks size naturally. I didn't tried external memory testing tools. I found one thing: when I use show() of the QDialog instead use the m_action to show the QDialog, I haven't memory leaks! It's weird because if I use close() method of the QDialog in the closeEvent() of my MainWindow instead close manually my QDialog, I get the memory leaks... When I close manually the QDialog, I haven't the issue. An other thing, if I don't instanciate my QPushButton, whatever the parent, I haven't memory leak! So, I will watch the destructor more in details.
  • Custom QStyle and Qt style sheets

    2
    0 Votes
    2 Posts
    3k Views
    M
    Im not 100% sure but I believe that is: "Subclasses of QStyle does not support Cascading Style Sheets (CSS)"
  • New button

    17
    0 Votes
    17 Posts
    6k Views
    M
    its good but in qt-samples i see pictures loaded in svg formats?
  • [SOLVED] QPainter, drawText and HTML

    3
    0 Votes
    3 Posts
    5k Views
    N
    Hi Andre, Thanks a lot. I''l do that.
  • QTextEdit and setStyle

    20
    0 Votes
    20 Posts
    12k Views
    A
    I also have similar problems like GTK+ style of linux does not allow for changing background color of progress bar
  • Accessing object-specific stylesheet in custom delegate

    4
    0 Votes
    4 Posts
    5k Views
    G
    There is no standard way to do such things. If you know, the style sheet is assigned to the widget, you can use pWidget->styleSheet(). If the style sheet is assigned to a higher level widget of the application, you have to scan the hierarchy. But there is no way I know, to get that part of a style sheet that is needed for your specific element. The style sheet is once parsed by the style sheet style and then internally handled in a binary way. all that is done in private classes of QtGui.
  • How to select next row in QTableView programmatically

    2
    0 Votes
    2 Posts
    4k Views
    A
    Did you try the setCurrentIndex() method? If that doesn't give you enough control, you should use the selectionModel() method to manipulate the associated [[doc:QItemSelectionModel]].
  • [Solved] Problem with svg pictures and transparent background

    4
    0 Votes
    4 Posts
    11k Views
    JohanSoloJ
    Thanks anyway!
  • [SOLVED] QTableview with expandable rows

    7
    0 Votes
    7 Posts
    11k Views
    M
    I've found the solution. It's so easy and simple. We may do that using QTreeWidget. @ // Row 1 QTreeWidgetItem *row1 = new QTreeWidgetItem(ui->treeWidget); row1->setText(0, "Row 1"); //Column 1 row1->setText(1, "Data"); //Column 2 // Row 2 QTreeWidgetItem *row2 = new QTreeWidgetItem(ui->treeWidget); row2->setText(0, "Row 2"); //Column 1 //Child row for Row1 QTreeWidgetItem *row1_child = new QTreeWidgetItem(row1); //Custom widget for child row QPushButton *pb = new QPushButton("Custom Child", ui->treeWidget ); //Set custom widget to the child row ui->treeWidget->setItemWidget(row1_child, 0, pb); row1_child->setFirstColumnSpanned(true); @
  • How to share property in different classes?

    10
    0 Votes
    10 Posts
    6k Views
    J
    Though it has been quite old post, I think it's interesting topic. Hmm. How about introducing another simple moc-like code generating tool for this, if there is a certain reason why moc cannot not support getter/setter generation like this.
  • Generate MOC files

    3
    0 Votes
    3 Posts
    3k Views
    T
    I found that build was a little more complicated than that, however I was able to generate the moc_foo.cxx in my build pocess by just running. moc foo.h > moc_foo.h
  • Using icons with QTreeWidgetItem

    6
    0 Votes
    6 Posts
    15k Views
    G
    You're creating a memory leak. QIcon can be used as a value class, you should not create the icons with new.