Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Pass DBus method call an array

    2
    0 Votes
    2 Posts
    2k Views
    G
    operator<< of QDBusMessage takes a QVariant as argument. There's no implicit conversion between an array of uchar and QVariant, that's why the compiler bails out. You will have to create a QVariant with the contents of your array.
  • QPersistentModelIndex problems in debug libraries

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Simple form with pixel manipulation

    12
    0 Votes
    12 Posts
    7k Views
    M
    @QImage image(800, 600, QImage::Format_ARGB32); QPainter painter(&image); // make a dark qimage for(int i=1;i<800;i++){ for(int j=1;j<600;j++){ painter.setPen(QColor(0, 0, 0)); painter.drawPoint(i,j); } } scene->addPixmap(QPixmap::fromImage(image)); view->setScene(scene); layout->addWidget(view); w.setLayout(layout); w.show(); for(int i=1;i<8000;i++){ for(int j=1;j<600;j++){ painter.setPen(QColor(i%5, i%5, j%5)); painter.drawPoint(i,j); } } scene->addPixmap(QPixmap::fromImage(image)); view->setScene(scene);@ it takes some time to draw the form but i want to see the result after each iteration. is it possible?
  • Simple calculation using line edit

    5
    0 Votes
    5 Posts
    3k Views
    C
    I went through couple of demo calculator apps and all of them seem to have a single line edit handling all the operations. In addition to that, the line edit seems divided in half since while the different operations take place you can merely see the result at a specific time, unless you hit the "=" key which somehow terminates the calculations and displays the final result. Similar to Windows default calculator... Can someone please explain how can I possibly add that to my calculator app as well? Thank you in advance.
  • Disable Proxy connections in QTcpSocket

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Is there some way to generate random Multicast address ?

    5
    0 Votes
    5 Posts
    4k Views
    M
    I need to solve similar issue, some one know how to check is multicast group exists?
  • 0 Votes
    5 Posts
    7k Views
    G
    [quote author="Ashish Mittal" date="1329131286"]Thanks a lot Volker!!!!, I am able to solve the problem by moving my entire code from custom thread class to a class derived from Qobject and I simply called MoveToThread() on this object. [/quote] Correct. That's the way QThread is supposed to use now.
  • [Solved]QProcess against Linux

    3
    0 Votes
    3 Posts
    2k Views
    T
    Yes thank you for your tips. I got some configure commands but if I want to for ex set a new timezone I don't really sure how to do it with the dpkg-reconfigure tzdata. My prj is a emmbedded sys where the user should be able to change this settings among some others as systime and date etc etc. So I need to get wet with linux but I'm lazy so if someone could show a simple solution I would be happy. I learn Linux for the moment but it's a time issue in the sys development too.
  • [SOLVED]set addresses in linux

    5
    0 Votes
    5 Posts
    3k Views
    F
    ifconfig is the widely adopted program to manage NICs. It can slightly change in its syntax, but that is the command to go if you need to be as much portable as possible. Other ways rely heavily on the distribution and will nullify the adoption of Qt as cross platform! By the way, while it is true that each distribution as its own way to set up addresses (text files, nm, scripts,...) each one must obey the ifconfig command.
  • Firefox Browser stuck when droping link to QMainWindow

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • I am unable to set path in QFileSystemModel

    4
    0 Votes
    4 Posts
    3k Views
    F
    I don't think the problem here is that the setRootPath does not change the view content, since the model is created from scratch....
  • Show/hide top-level submenu at runtime

    3
    0 Votes
    3 Posts
    4k Views
    L
    [quote author="Volker" date="1329084878"]the only way I see is to disable the menu item/action or remove it from the menu or menu bar.[/quote] Thanks, I'll try your method today.
  • Segmentation fault... [SOLVED]

    8
    0 Votes
    8 Posts
    7k Views
    K
    [quote author="Volker" date="1329072554"]The solution is at the top of the very first post - in case someone looks at the end of the thread for the solution :)[/quote] lol sorry for that ...next time I ll post at bottom
  • Speed of gif

    6
    0 Votes
    6 Posts
    3k Views
    K
    Hi i think im having some problems understanding how to use the threads to my benefit.... I`ve changed my main like this: @#include <QtGui/QApplication> #include <QObject> #include "waitthread.h" #include "loadthread.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); QApplication::setStyle (new IconSize ()); LoadThread * load_thread = new LoadThread (); WaitThread * wait_thread = new WaitThread (); QObject::connect (load_thread, SIGNAL(load_finished()), wait_thread, SLOT(loading_finished())); load_thread->start (); wait_thread->start (); return a.exec &#40;&#41;; }@ the loadthread.cpp: @LoadThread::LoadThread() { mainWin = new MainWindow (); } void LoadThread::run (){ //--------------------do some stuff emit load_finished (); mainWin->show (); }@ And the waitThread.cpp @#include "waitthread.h" WaitThread::WaitThread() { loadwidg = new LoadingWidget (); loadwidg->show (); } void WaitThread::run (){ } void WaitThread::loading_finished (){ loadwidg->close (); delete loadwidg; this->terminate (); } @ Somehow..the mainWin doesnt show and the loadingwidget neither --------EDIT My bad loadingWidget is shown. ----EDIT 2 found my first mistake the mainWin must be shown in a different method otherwise the thread finishes when run finishes
  • Login code

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Displaying an image in a QGLWidget

    2
    0 Votes
    2 Posts
    2k Views
    J
    (bump) Still stuck and anxious for a solution.
  • How to use a special qm file?

    2
    0 Votes
    2 Posts
    1k Views
    sierdzioS
    Take a look at: "QTranslator":http://developer.qt.nokia.com/doc/qt-4.8/qtranslator.html first code snippet shows how to modify main routine "QML internationalisation":http://doc.qt.nokia.com/4.7-snapshot/qdeclarativei18n.html
  • Stylesheet: linking custom fonts

    6
    0 Votes
    6 Posts
    11k Views
    K
    Chuck, I think it's important to know whether QT C++ uses True Type Fonts already installed in the user's computer or if we can deploy our chosen TTF, to be used in a computer that doesn't have this TTF previously installed. It seems a stupid doubt, but QT docs aren't clear enough - specially for beginners, like me. I don't know if I can use a specially designed personal TTF in my software (it would make my life easier, by using only Text Classes) or if I have to use bitmap images to get the exact text design I want in all plataforms. As there are differences about TTF handling in Linux... and also because sometimes we need to use a special TTF in our programs, TTF deployment without the need to install a new font in the target computer would be a very useful feature to me. I don't want to use QML - I am too old to learn a new language. In my old times, C++ was tough enough to be learned and in the present, I confess that QT libraries are being almost too much to be explored by a STL-er. :) What can you and other experts say about? (Please, forgive my awful english. It is not my mother language) Valdemar Katayama Kjaer Brazil [quote author="Chuck Gao" date="1306668207"]Try QFontDatabase from Qt C++ or FontLoader from QML :) Try: @int QFontDatabase::addApplicationFont ( const QString & fileName ) [static] QStringList QFontDatabase::applicationFontFamilies ( int id ) [static]@ @import QtQuick 1.0 Column { FontLoader { id: fixedFont; name: "Courier" } FontLoader { id: webFont; source: "http://www.mysite.com/myfont.ttf" } Text { text: "Fixed-size font"; font.family: fixedFont.name } Text { text: "Fancy font"; font.family: webFont.name } }@[/quote]
  • How to wait on read and close event simultaneously on QTcpSocket

    17
    0 Votes
    17 Posts
    11k Views
    A
    Thanks for your qucik reply. As of now I have coded the way suggested by you. But my confusion is , if readyRead signal is calling the slot then which thread will call this slot Is this a worker thread or the GUI thread(main app thread) ? My main app is creating multiple thread and I am creating one socket in each thread and registering readyRead() signal in each thread with some slot in that thread class only. If I am printing thread id in the slot it is giving same as GUI thread id. It means only GUI thread is calling this slots, ideally it should be worker thread, otherwise what is the point of using worker thread. One more doubt is this SLOT is unique call back for the entire app, ot will be different for each thread class.??
  • [SOLVED] Getting Necessitas to work?

    8
    0 Votes
    8 Posts
    10k Views
    ?
    It appears that there might be some problem with the version of ant provided with Necessitas, at least in my case (windows 7 x64), for some reason nothing made it work until I installed winant in the same location. That fixed it right away. Also I had no luck with the "read information from application" feature that is supposed to scan which modules of Qt are needed, ain't working both in the office and at home, have to manually select the Qt libraries used by the project. EDIT: After toying with Necessitas the last few days under both Windows and Ubunty my conclusion is the majority of issues lie within ant. It just plainly sucks, its performance, its stability, the very act of actually working as intended... I've had a ton of stock Qt examples and personal code that failed miserably to deploy on the simulator while the actual APK files installed and ran flawlessly on my Transformer TF101. Ironically, it is exactly ant that has the audacity to ask for donations "in case I liked it"... well no, I didn't like it at all... A friendly advice - deploy on an actual device and don't even bother with ant for the time being.