Search Results

Search found 386 results on 16 pages for 'qt4'.

Page 12/16 | < Previous Page | 8 9 10 11 12 13 14 15 16  | Next Page >

  • Should the name of my classes begin with 'Q' in Qt?

    - by Venemo
    Hello Everyone, When I first started working with Qt, it was extremely annoying that every class has a name beginning with 'Q', but now I've got used to it. I'm using Qt Creator, and it highlights code quite well. However, it only highlights class names beginning with 'Q'. And it highlights everything beginning with 'Q' even if there is no such type. It doesn't highlight custom class names. That makes me wonder, should I also begin all my class names with 'Q'? Or at least the reusable ones? (I mean, those that I put in a class library, or reuse in another app.) I've seen several places where they named their classes this way. Is it a good thing? I found this page about Qt's naming conventions, but it doesn't deal with this question. Also, I don't understand why Qt doesn't use namespaces.

    Read the article

  • what property should i set to Fit the text in label

    - by Shadow
    Hi, i want to display a big string in Qlablel for this simply i have created a label in Qt GUI editor, then i put the string, with the Wordwrap property ON. here text is not coming to the next line itself, instead its crossing the view region. but if i give "\n" it works well. how to put up big string in label, to display in visible region.

    Read the article

  • Adding an inheritance to an Qt designed object

    - by Jaguar
    Hello, I have a problem and I want to implement the MVC pattern to my QT application, that's why I need for example to inherite in my QTableWidget about another class like myClass { myMethod(); } but our QTableWidget is contained by our Mainwidows that is designed by the QT designer and generate an ui_MainWindow class ! Do you know how to do that ? Is that a method inside the Qt Designer to do that ? or another method ? Thank you for your answer !

    Read the article

  • Lots of pointer casts in QGraphicsView framework and performance

    - by kleimola
    Since most of the convenience functions of QGraphicsScene and QGraphicsItem (such as items(), collidingItems(), childItems() etc.) return a QList you're forced to do lots of qgraphicsitem_cast or static_cast and QGraphicsItem::Type() checks to get hold of the actual items when you have lots of different type of items in the scene. I thought doing lots of subclass casts were not a desirable coding style, but I guess in this case there are no other viable way, or is there? QList<QGraphicsItem *> itemsHit = someItem->collidingItems(Qt::IntersectsItemShape); foreach (QGraphicsItem *item, itemsHit) { if (item->type() == QGraphicsEllipseItem::type()) { QGraphicsEllipseItem *ellipse = qgraphicsitem_cast<QGraphicsEllipseItem *>(item); // do something } else if (item->type() == MyItemSubclass::type()) { MyItemSubClass *myItem = qgraphicsitem_cast<MyItemSubClass *>(item); // do something } // etc } The above qgraphicsitem_cast could be replaced by static_cast since correct type is already verified. When doing lots of these all the time (very dynamic scene), will the numerous casting affect performance beyond the normal if-else evaluation?

    Read the article

  • Qt -how to know whether content in child widgets has been changed?

    - by Narek
    In QMainWindow I have 2 QSplitters. In that splitters I have QTextEdit, QLineEdits, QTableWinget, Ragio buttons and so on... I want to know if somthing has been chaged after pressing File-New menu button. Is there any general method for doing this? Somwhere I have read that it is recomended to use isWindowModified() function of QMainWindow, but seems it doesn't work.

    Read the article

  • how to get selected item in pyqt Qmenu

    - by Moayyad Yaghi
    hello is there any way to get the selected item in a qmenu ? i want to bind all items in that list to one function and get the item once user click it . i've been looking for a way to get the item's label or index for 3 days , but couldn't find it . any ideas ? thanks in advance

    Read the article

  • In QT 4.6 w/ Webkit: How to handle popup window requests (WebView::createWindow)?

    - by CM
    Hi all, I'm new to QT and have been trying to create a test browser. What I'm trying to do now is to handle js-based popup requests. After reading the QT documentation, I learned that I need to re-implement the QWebView::createWindow method to do just that. Now I've re-implemented this method, but it seems to be not called when I try to click a link that triggers a popup window. Can any one help me? Do I need to subclass both the WebView and WebPage classes? If so, how do I do that? I'm quite new to QT and I've done tons of searches and found nothing. Thank you all in advance for any hint and advice!

    Read the article

  • File write not getting updated in Qt 4.5.3

    - by user249490
    Hi, I have an XML file. My application requires manipulation into that XML file. I will be writing the values into the XML value. I also have interface to display the read contents of the file. The user might add values into that XML (through an interface). Without closing the application he may decide to display the File contents also. Now the problem is, after i write the XML contents into the file, when i view the file through the interface , the values are not getting updated. After i close the application and open it the updated values are available.I am using the following code to achieve this. For writing QXmlStreamWriter and for reading QDomDocument, QDomNodeList. After i complete the writing, I flush and close the file too. lFile.flush(); lFile.close(); After reading also i closed the file. Can someone tell me what am doing wrong??

    Read the article

  • ld returned 1 exit status

    - by uzay95
    This is the code that i'm trying to run: #include <QApplication> #include <QPushButton> int main(int argc,char *argv[]) { QApplication app(argc,argv); return app.exec(); } And this is the error that i'm getting: :-1: error: collect2: ld returned 1 exit status

    Read the article

  • How to install the Qt mobility ?

    - by Shadow
    Hi, i have installed Qt 4.6.2 and developing the application for symbian. Now i want use Qt mobility API for accessing the contacts.. how can i install the Qt mobility and acces the API.. my build environment is windows XP :) Thanks

    Read the article

  • whats wrong with this piece of code for saving contacts

    - by Shadow
    Hi, i am using the latest Nokia Qt SDK. i have tried to add the contacts, its not getting added.. what is missing here.. // Construct contact manager for default contact backend QContactManager* cm = new QContactManager("simulator"); // QContactManager* cm = new QContactManager("memory"); // i tried this, its also not working // Create example contact QContact example; // Add contact name QContactName name; name.setFirstName("John"); name.setLastName("Doe"); example.saveDetail(&name); // Add contact email address //QContactEmailAddress email; // email.setContexts(QContactDetail::ContextHome); //email.setEmailAddress(“[email protected]”); // example.saveDetail(&email); // Finally, save the contact details cm->saveContact(&example); delete cm; Thanks

    Read the article

  • Buffer Overrun Issues VC++

    - by sijith
    When i execute my code i am getting this error LPTSTR lpBuffer; ::GetLogicalDriveStrings(1024,lpBuffer); while(*lpBuffer != NULL) { printf("%s\n", lpBuffer); // or MessageBox(NULL, temp, "Test", 0); or whatever lpBuffer += lstrlen(lpBuffer)+1; printf("sizeof(lpBuffer) %d\n",lstrlen(lpBuffer)); } OutPut C sizeof(lpBuffer) 3 D sizeof(lpBuffer) 3 E sizeof(lpBuffer) 3 F sizeof(lpBuffer) 0

    Read the article

  • Qt: How to use QTimer to print a message to a QTextBrowser every 10 seconds?

    - by Aaron McKellar
    Hello, I have working at this for hours and cannot figure it out nor can I find any help online that works. Basically the gist of what I am trying to accomplish is to have a Qt GUI with a button and a QTextBrowser. When I push the button I want it to diplay a message and then keep printing this message every 10 seconds. I figured I would use QTimer because it makes sense to have a timer to diplay the message every 10 seconds. When I originally implemented this into my buttonClicked() SLOT it caused the program to freeze. I looked online for a solution and found QApplication::processEvents(). So basically in my function I had something like this: while(1) { QTimer *timer; connect(...) //omitted parameters for this example timer.start(10000); ui->diplay->append("Message"); while(timer.isActive()) { QApplication::processEvents() } } I figured it would break out of the timer.isActive() while loop but it won't it simply stays in there. So I figured this is a threading issue. So I figured out how to use QThreads but I still can't get it to work. Basically when I create a thread with a timer on it and the thread tells the timer to start, the program closes and the console says "The program has unexpectedly finished". There has to be an easy way to do this but my track record with Qt has always been that th

    Read the article

  • I'm following Qt Tutorials and got a simple question

    - by nzer0
    If I want to create my own class MyWidget which inherits from QWidget Tutorial tells me to write constructor like this... MyWidget::MyWidget(QWidget *parent) : QWidget(parent){....} I'm wondering what is the role of : QWidget(parent) Does it mean explicit call for QWidget's constructor?

    Read the article

  • Declaration of struct variables in other class when obtained by getters

    - by liaK
    Hi, I am using Qt 4.5 so do C++. I have a class like this class CClass1 { private: struct stModelDetails { QString name; QString code; ..... // only variables and no functions over here }; QList<stModelDetails> m_ModelDetailsList; public: QList<stModelDetails> getModelDetailsList(); ... }; In this I have functions that will populate the m_ModelDetailsList; I have another class say CClassStructureUsage, where I will call the getModelDetailsList() function. Now my need is that I have to traverse the QList and obtain the name, code from each of the stModelDetails. Now the problem is even the CClass1's header file is included it is not able to identify the type of stModelDetails in CClassStructureUsage. When I get the structure list by QList<stModelDetails> ModelList = obj->getModelInformationList(); it says stModelDetails : undeclared identifier. How I can able to fetch the values from the structure? Am I doing anything wrong over here?

    Read the article

  • Qt 4.7 QtDeclarative headers

    - by bitc
    I installed Qt 4.7 beta on OS X. Then I wanted to try out the declarative module: The doc says #include <QtDeclarative> The Minehunt example says #include <qdeclarative.h> Neither is found! Most of the other header files are where they are supposed to be: /Library/Frameworks/Qt*.framework/Versions/4/Headers What do I do?

    Read the article

  • How to generate a window (widget) on button press in qt

    - by Ram
    I had designed some gui through Qt cretor on linux,these design consists of some fields, text edit , & some push buttons . Now my doubt is when i press on push button i want display aanother window . Is there any GUI option for this or any hard code.please let me know if any hard code............. waiting for answer Tanks in advance. Ram

    Read the article

  • how to set the item selection forcefully in Qt

    - by Solitaire
    Hi.. Can any one tell me how to set the item to be selected forcefully.. I tried this after adding items to list row.. QModelIndex index = mylistview->currentIndex(); mylistview ->setCurrentIndex(index); its not working.. index I am getting index (-1,-1).. can any one help me on this Thanks

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16  | Next Page >