Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • 0 Votes
    2 Posts
    4k Views
    T
    Ok, solved it ... It seems like you have to set the default font for QTextEdit because it won't read it from HTML. Don't know why it didn't work for me yesterday. The span creation can't be prevented.
  • Input method for Ubuntu written in Qt?

    4
    0 Votes
    4 Posts
    3k Views
    Z
    I would like to use iBus with Qt. iBus input method application developed with Qt C++. But, example in qt-ibus module is can't run. Error : iBus can not connect. All other iBus input tables are fine. All necessary libraries are installed. Is there any iBus input method example written in Qt? Thanks
  • Help on my database class

    7
    0 Votes
    7 Posts
    4k Views
    L
    Well, I have taken another look at your code and you should take another look at QSqlDatabase::addDatabase() and QSqlDatabase::removeDatabase(). The former one takes the database type as parameter whereas the latter one takes a connection name as parameter. In addition, there is no need to use addDatabase() / removeDatabase() if you just want to connect / disconnect. Use open() / close() instead. Keep in mind that all your queries have to be gone out of scope before closing the database connection.
  • Application icon on Unity

    2
    0 Votes
    2 Posts
    3k Views
    M
    I can't speak for ubuntu but it depends on your OS and compilers process for including the icon. On windows for example with Microsoft compilers you include a .rc file with an icon entry. While I dont have a direct answer for you if you can determine how it is done using you compiler you will be one step closer.
  • How we can restrict user to resize window?

    4
    0 Votes
    4 Posts
    3k Views
    L
    [quote author="xeroblast" date="1318653231"]just set the minimum & maximum size according to the size of the window.[/quote] [quote author="pratik041" date="1318654034"]Ya this is working but i found better we can call @setfixedsize ();@ function .[/quote] Both approaches should work but I share the opinion that "QWidget::setFixedSize":http://doc.qt.nokia.com/4.7/qwidget.html#setFixedSize is more appropriate as it will automatically set both the minimum and maximum sizes of the widget. :)
  • Column width in QTableWidget

    2
    0 Votes
    2 Posts
    4k Views
    EddyE
    What you want is possible for the last column using "stretchlastsection":http://doc.qt.nokia.com/4.7/qheaderview.html#stretchLastSection-prop Afaik for another column you will have to calculate the width yourself as you suggested.
  • QHeaderView: get numeric column index by name

    2
    0 Votes
    2 Posts
    4k Views
    G
    You might want to get the underlying model with model() and search that with QAbstractItemModel::match(). If that does not help, you could iterate through the QAbstractItemModel::headerData() results.
  • Why 6 threads for a simple app?

    9
    0 Votes
    9 Posts
    4k Views
    G
    [quote author="mariusg" date="1318616170"] I wouldn't bet on it, the people running this place are not to be trusted! ;)[/quote] Just feed them muffins, and they become handsome :-)
  • Mac OS X: How do you know a Drawer widget is open?

    4
    0 Votes
    4 Posts
    4k Views
    G
    This could be the case, yes. On the other hand, I'm not sure, if Qt creates the very same cocoa objects as native OS X applications.
  • Expose enum to QScriptEngine

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • 0 Votes
    3 Posts
    5k Views
    D
    Hi and thanks for replying! Yeah, it makes sense.. I followed your advice and overwrote accept() (in fact I think it is more efficent). Anyway, I would like to know if it is possible to use auto-connect feature for the current instance of the class, something like on_this_accepted(). I know you can achieve something like that outside the class (in the parent), but it wouldn't be good if you have to repeat the methods for each instance of the class. Maybe it can be done manually (using connect()), but not with auto-connect. Also, Qt Creator generated that slot, so I think it is a bug, isn't it? Thanks again and greetings!
  • QContextMenu over which widget?

    5
    0 Votes
    5 Posts
    5k Views
    M
    Perfect, thanks!!
  • 0 Votes
    2 Posts
    3k Views
    E
    A solution I've found is to remove the empty row inserted at the begining (0), add the new record to the database and then insert again the empty row at the begining of the model. Something like that: @ model = new QSqlRelationalTableModel(this); model->setTable("Produse"); model->setEditStrategy(QSqlTableModel::OnManualSubmit); model->select(); proxyModel = new QSortFilterProxyModel; proxyModel->setSourceModel(model); proxyModel->setFilterKeyColumn(model->fieldIndex("Denumire")); proxyModel->insertRow(0); proxyModel->removeRow(0); int newRow = proxyModel->rowCount(); proxyModel->insertRow(newRow); proxyModel->setData(proxyModel->index(newRow, 1), "text"); proxyModel->setData(proxyModel->index(newRow, 2), 123); ... model->submitAll(); proxyModel->insertRow(0); @ But this is awkward.
  • Problem in Multithreading Application

    15
    0 Votes
    15 Posts
    7k Views
    V
    Hi, looking at the philosophy of object-oriented design, Andre's and Volker's solution seems to be more "correct". However, I somehow prefer the dataflow-oriented solution that Gerolf mentioned (subclassing of QThread and using it as a "proxy"), for the following reason: the overall application is clearly partitioned into "domains" in which things are done in parallel. The borders of these domains are the instances of the QThread subclasses and thus can be identified easily.
  • QTableWidget problem

    3
    0 Votes
    3 Posts
    2k Views
    A
    thank uuuuuuuuu =)
  • [WINDOWS] Subclassing + WM_DWMNCRENDERINGCHANGED = crash

    5
    0 Votes
    5 Posts
    4k Views
    K
    I really don't know, I'll try it in the other computer and I'll let you know
  • 0 Votes
    4 Posts
    2k Views
    G
    Please adjust your topic. It's not sufficient to paste the complete error message here. You get more attention with a good, short and descriptive title. Just hit the edit link right to your first post.
  • [SOLVED] Problem with duplication of Value in QTabWidget

    12
    0 Votes
    12 Posts
    5k Views
    M
    Thanks Volker for your valuable inputs..
  • QSystemTrayIcon in Qt Quick application

    6
    0 Votes
    6 Posts
    8k Views
    A
    It is weird, but now it works for all cases. But why? @void QmlAppView::closeEvent(QCloseEvent *event) { if (trayIcon->isVisible()) { trayIcon->showMessage(tr("Systray"), tr("This application is still running. To quit please click this icon and select Quit")); hide(); //event->ignore(); } }@
  • [Solved] Smooth integration of OpenGL 4.x with Qt...

    6
    0 Votes
    6 Posts
    8k Views
    Z
    Sorry to necro post but this thread came up in a search and it's still un-solved. So here's the "solution":http://developer.qt.nokia.com/wiki/How_to_use_OpenGL_Core_Profile_with_Qt