Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • Full-screen rich desktop application

    5
    0 Votes
    5 Posts
    3k Views
    L
    You may start reading right "here":http://developer.qt.nokia.com/doc/qt-4.8/qtquick.html.
  • Problem in running qtsql related project independently?

    4
    0 Votes
    4 Posts
    2k Views
    P
    ok i will check thank's for suggestion.
  • Using a macro to access and application name.

    11
    0 Votes
    11 Posts
    6k Views
    C
    So yes ... I am back with the solution for those of you who don't don't use QT for a living like Mr. Lukas and are still interested in how things work. As Volker pointed out the QDeclarativeView, as every other GUI class, must live in the main thread. That is why the following code does not work: @int main(int argc, char ** argv) { QCoreApplication* app = qApp; return qApp->exec(); return app.exec(); }@ Strange looking code I know but I tried it. :) Basically, in layman terms we are trying to run an application within an application using the same memory space. (Or some thing like that). Definitely not the correct way to do things. So what can we do, well there's... @ int main(int argc, char *argv[]) { QApplication app(argc, argv); QDeclarativeView view; view.setSource(QUrl::fromLocalFile("application.qml")); view.show(); return app.exec(); }@ This works but keep in mind that this creates the QDeclarativeView instance as a variable on the stack. However if you use the code: @int main(int argc, char *argv[]) { QApplication app(argc, argv); QDeclarativeView *qmlView = new QDeclarativeView; qmlView->setSource(QUrl::fromLocalFile("myQML.qml")); qmlView->show(); return app.exec(); }@ the QDeclarativeView is not instanced on the stack rather on what I think Lukas was referring to as the "heap". (The heap is the name for a block of RAM that is used to store dynamic variables). One thing to keep in mind is that in the first example the QDeclarativeView instance is automatically destroyed when the function terminates, but in the second example we can use delete on a main window when we have finished with it to save memory. So to reference my particular situation there was already and event loop which had been started by Maya. So all I had to do was add this to my function: @int myFunction(){ QDeclarativeView *qmlView = new QDeclarativeView; qmlView->setSource(QUrl::fromLocalFile("myQML.qml")); qmlView->show(); }@ And that's pretty much it. :) Hopefully others will find this information more helpful then just telling them to go get an education. :)
  • QTreeWidget Indicator Checkmarks

    3
    0 Votes
    3 Posts
    2k Views
    J
    Thanks Gerolf. Subclassing QStyledItemDelegate worked. I only had to reimplement the paint function. I painted the checkbox area of the items via QPainter::drawPixmap(QRect, QPixmap). I used QStyle::subElementRect(QStyle::SE_CheckBoxIndicator, &option, widget) to supply the QRect object and created the QPixmap object using customized icons.
  • How to create attribute for QStrandardItem?

    2
    0 Votes
    2 Posts
    2k Views
    G
    You can define your own "Qt::ItemDataRoles":/doc/qt-4.8/qt.html#ItemDataRole-enum and use data() and setData() methods of the items. For example: @ enum MyItemDataRoles { MyIdRole = Qt::UserRole + 1, MyStringDataRole }; QStandardItem *item = ...; item->setData(23, MyIdRole); int id = item->data(MyIdRole).toInt(); item->setData("blubb", MyStringDataRole); qDebug() << item->data(MyStringDataRole).toString(); @
  • [SOLVED]not getting the right information from QTableView

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Problem compiling Qt-Mobility

    3
    0 Votes
    3 Posts
    3k Views
    A
    Thank you a lot AcerExtensa. Everrything gona be allright.
  • Make Widget visible in QScrollArea (by Layout)

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Events during form close...

    8
    0 Votes
    8 Posts
    5k Views
    V
    That is a great point Volker. Thank you all for your input. I will be testing this today.
  • Context menu breaks TreeView structure and selection

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • QGraphicsWebView in a QGraphicsScene

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • How to check wether a Qstring is alpha numeric

    4
    0 Votes
    4 Posts
    7k Views
    G
    Use QRegExp, check this "post":http://www.zorched.net/2009/05/08/password-strength-validation-with-regular-expressions/ I hope this help you :)
  • 0 Votes
    7 Posts
    34k Views
    U
    This is what i did , this is how i set my thread : @m_MyThread = new QThread(); m_MainWorker = new MainWorker(); connect(m_MyThread,SIGNAL(started()),m_MainWorker,SLOT(doWork())); m_MainWorker->moveToThread(m_MyThread); m_MyThread->start();@
  • SSPI support

    4
    0 Votes
    4 Posts
    2k Views
    G
    No, it didn't yet. As merge requests on gitorious are closed now, the new place to look for such things would be "Gerrit":http://codereview.qt-project.org/ or ask at #qt-labs on freenode IRC.
  • [Solved]Process open program

    3
    0 Votes
    3 Posts
    1k Views
    T
    Thank you thats what I needed
  • QGraphicsPolygonItem - corner positions stay the same even when it moves

    2
    0 Votes
    2 Posts
    1k Views
    C
    "QGraphicsItem::mapToScene":http://developer.qt.nokia.com/doc/qt-4.8/qgraphicsitem.html#mapToScene-3
  • Is it possible to modify the properties of the DockWidget?

    1
    0 Votes
    1 Posts
    809 Views
    No one has replied
  • OpenGL 3.2 with OS X Lion

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Understanding the free license

    4
    0 Votes
    4 Posts
    5k Views
    F
    Thank you all for your replies! I will check the links. bq. I am not an expert about licensing and it is a complicated topic. In my opinion LGPL fits your needs because it places copyleft restrictions on the Qt framework but does not apply these restrictions to your software that merely link with the Qt libraries. Ok, this may be the answer to my question since all I need to do is create a simple application that will be used by 10 or so people where I work. I just don't want to do the wrong thing. Thanks
  • Can QML Viwer be run on a seperate Thread?

    3
    0 Votes
    3 Posts
    2k Views
    G
    QDeclarativeView, as every other GUI class, must live in the main thread. There is no way to circumvent this and move it to another thread.