Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.5k Posts
  • [Solved] Example usage of QWidget::InputMethodEvent

    6
    0 Votes
    6 Posts
    8k Views
    T
    The below link is git repo for "Mobile Extensions" Symbian 4 project. It has got whole framework of QGraphicsWidget based widgets developed for mobile phones. Sadly its scrapped. https://qt.gitorious.org/uiemo/uiemo-preview/trees/master One place where you can find this QInputMethodEvent posed is... https://qt.gitorious.org/uiemo/uiemo-preview/blobs/master/src/hbplugins/inputmethods/common/hbinputmodehandler.cpp The software keypads code is at https://qt.gitorious.org/uiemo/uiemo-preview/trees/master/src/hbinput/inputwidgets and actual inputmethods ( QInputContext derived classes) is at https://qt.gitorious.org/uiemo/uiemo-preview/trees/master/src/hbplugins/inputmethods And HbLineEdit code which receives QInputMethodEvent is at https://qt.gitorious.org/uiemo/uiemo-preview/trees/master/src/hbwidgets/editors And https://qt.gitorious.org/uiemo/uiemo-preview/blobs/master/src/hbwidgets/editors/hbabstractedit.cpp handles some of inputMethodEvent events at line 244. And obviously one best place to study in Qt Source code it self...
  • Cant Get Touch Inputs ın QPixMap(image) in QGraphicsView

    2
    0 Votes
    2 Posts
    3k Views
    D
    I try to read between the lines: are you trying to get those events in your QGraphicsItems or in your QGraphicsScene? If so, you need to use QGraphicsItem::setAcceptTouchEvents on your items, then you get the QTouchEvents in your QGraphicsItem::sceneEvent() override (or QGraphicsScene::event).
  • [solved] Trouble getting JSON response with QNetworkRequest

    6
    0 Votes
    6 Posts
    7k Views
    R
    I got it to work! I was reusing the code I wrote for the SOAP service so I had: @ manager->post(request, "") @ I changed it to @ manager->get(request) @ and that did the trick. (Also, apparently the url parameters are case sensitive, though that wasn't the original issue.) EDIT: And of course, thanks to everyone!
  • QPixmap::fromImage segmentation with a non-null QImage

    5
    0 Votes
    5 Posts
    4k Views
    Q
    Here is it: @void Sprite::putPixel(QImage &image, int x, int y, uchar red, uchar green, uchar blue, uchar alpha) { if (image.isNull() || !image.valid(x, y)) return; int n_channels = image.depth() / 8; Q_ASSERT_X(n_channels == 4, "Sprite::putPixel", "Invalid image channels"); Q_ASSERT_X(x >= 0 && x < image.width(), "Sprite::putPixel", "index out of range"); Q_ASSERT_X(y >= 0 && y < image.width(), "Sprite::putPixel", "index out of range"); image.setPixel(x, y, qRgba(int(red), int(green), int(blue), int(alpha))); }@ Or do you mean something else?
  • Closing QMainWindow crashes on lion 10.7 preview 4.

    6
    0 Votes
    6 Posts
    4k Views
    M
    _Mann, did you actually manage to get Lion to build a debug version of your code which you can actually debug using Xcode's gdb? (Sorry, that I am not able to help you with your actual problem though!)
  • SetWindowModified with QGraphicsView, is it bug?

    15
    0 Votes
    15 Posts
    6k Views
    M
    Oh that's good point, Slots/Signals mechanism is really flexible. It will save us lot of time. Thanks for your help
  • Using 32 bits library on 64 bits platforms

    15
    0 Votes
    15 Posts
    10k Views
    G
    If there is no separate package, I would say: no. But that's getting kind of out of scope for this forum now. To get a definitive answer I would better ask in a Debian forum. I personally have only an older version of Kubuntu running.
  • 0 Votes
    5 Posts
    4k Views
    G
    Hi quizzical, Am I right, you try to get the widget pointer of the other running application? That is not possible! You can set an activationWindow for the local application / process. and it only works inside this process. This sendMessage send a message to the first instance of the QtSingleApplication which resides in a different process. You will not get pointers of that process.
  • 0 Votes
    4 Posts
    11k Views
    K
    Thank you very much for your answers guys. I had briefly thought of scope but thought I would have gotten an error when the Scene realised that it couldn't see an object it was supposed to have owned.. and of course all my debugging was in the same scope (duh :) ) For anyone else starting out like me and reading this, this link was quite useful in explaining the scope of the stack and heap. http://stackoverflow.com/questions/79923/what-and-where-are-the-stack-and-heap Thanks also for the tip about using the parent to clean up too, ZapB.
  • Icons for pushbutton

    5
    0 Votes
    5 Posts
    21k Views
    EddyE
    this is the code taken from my ui_dialog.h file This should help you out with your code. Look at the red.png line : all the others remain the same. @ QIcon icon; icon.addFile&#40;QString::fromUtf8(":/blue.png"&#41;, QSize(&#41;, QIcon::Normal, QIcon::On&#41;; icon.addFile&#40;QString::fromUtf8(":/blue.png"&#41;, QSize(&#41;, QIcon::Disabled, QIcon::Off&#41;; icon.addFile&#40;QString::fromUtf8(":/blue.png"&#41;, QSize(&#41;, QIcon::Active, QIcon::Off&#41;; icon.addFile&#40;QString::fromUtf8(":/red.png"&#41;, QSize(&#41;, QIcon::Active, QIcon::On&#41;; icon.addFile&#40;QString::fromUtf8(":/blue.png"&#41;, QSize(&#41;, QIcon::Selected, QIcon::Off&#41;; pushButton->setIcon(icon); pushButton->setCheckable(true);@ i really like to do things like this using Qt Designer and see all the options immediately in the dialog.
  • Custom Widget compilation problem

    4
    0 Votes
    4 Posts
    3k Views
    Z
    It is because MS compiler uses symbol visibility rules by default (ie it only exports those symbols that you tell it to). Whereas with GCC you have to explicitly enable this feature by using @ CONFIG += hide_symbols @ If you add the above to your .pro file it will also fail to link on Linux due to unexported symbols. We use this as it reduces the number of symbols exported in our libs and hence slightly improves application start up time and keeps the private parts of our API private.
  • How to I transfer file with size more than 65KB?

    7
    0 Votes
    7 Posts
    6k Views
    K
    Well, if you start the discussion on how to do best. The question is also, do you really want to send just a big file? For a couple of 100 kB that is acceptable. For a couple of MB it might make sense to spend a little more thinking. Memory is not as expensive anymore as it was, but ultimately one is always reaching the boundaries. So cutting the file into chunks on both is certainly a good thing to think about.
  • [Solved] Signals and Slots help needed

    6
    0 Votes
    6 Posts
    3k Views
    A
    Hi All, I solved it out. It was failing because of incorrect declarations. The final code is : widget.h @class Widget : public QWidget { Q_OBJECT public : Widget(QWidget *parent = 0); private slots: void buttonClicked(); private: QLineEdit *enterjobid; QPushButton *viewbutton; QTextBrowser *jobmessagebrowser; }; @ widget.cpp @Widget::Widget(QWidget *parent) :QWidget(parent) { QVBoxLayout *mainLayout = new QVBoxLayout; QHBoxLayout *row1 = new QHBoxLayout; QLabel *jobid = new QLabel(tr("Enter Job ID")); enterjobid = new QLineEdit; row1->addWidget(jobid); row1->addWidget(enterjobid); QHBoxLayout *row2 = new QHBoxLayout; viewbutton = new QPushButton(tr("View Job Messages")); QPushButton *clearbutton = new QPushButton(tr("Clear")); row2->addWidget(viewbutton); row2->addWidget(clearbutton); jobmessagebrowser = new QTextBrowser; mainLayout->addLayout(row1); mainLayout->addLayout(row2); mainLayout->addWidget(jobmessagebrowser); setLayout(mainLayout); connect (clearbutton,SIGNAL(clicked()), enterjobid,SLOT(clear())); connect (viewbutton,SIGNAL(clicked()), this ,SLOT(buttonClicked())); } void Widget::buttonClicked() { connect (viewbutton,SIGNAL(clicked()), enterjobid,SLOT(selectAll())); //some work } @ Hope this helps out someone. Thanks.
  • QList<QPixmap> 'index out of range'

    8
    0 Votes
    8 Posts
    6k Views
    Z
    To see what triggers this type of error you should run it in qt-creator in the debugger then click on each higher function in the call stack and inspect the local variables to see what causes the problem.
  • [SOLVED] [N00b] Memory management in Qt

    12
    0 Votes
    12 Posts
    11k Views
    M
    bq. In that case, I’ll be careful to always declare a parent. Seems like the easiest solution. And, if you do ever delete anything manually, be sure to set the pointer to 0 after the call to delete. It's a good, safe practice.
  • [solved]QRegExp

    6
    0 Votes
    6 Posts
    4k Views
    S
    While I think @"[0-9a-fA-F]{2},[0-9a-fA-F]{2},[0-9a-fA-F]{2}"@ will be a better choice, your expression works for me with Regexp and Regexp2 syntaxes. Setting greedy mode to on means set minimal to of...;) you should: @ re.setMinimal(false); @
  • 0 Votes
    3 Posts
    5k Views
    L
    You have to manually hide the tray icon (for example at the closeEvent of the main window). @ void MainWidget::closeEvent(QCloseEvent* event) { _systemTrayIcon->hide(); event->accept(); } @ ... will do the trick.
  • Qt 4.8 (origin/master) documentation for src/plugins/platforms/*

    5
    0 Votes
    5 Posts
    4k Views
    K
    uhm ok thanks :)
  • Qml, anchors and rotating

    5
    0 Votes
    5 Posts
    4k Views
    S
    no, it is not scaling, but rotating...
  • Convert from int to hex

    4
    0 Votes
    4 Posts
    28k Views
    Z
    @ lineEdit_7->setText( QString::number( c.red(), 16 ) ); @