Search Results

Search found 1902 results on 77 pages for 'qt contextmenu'.

Page 54/77 | < Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >

  • Pyqt - QMenu dynamically populated and clicked

    - by mleep
    I need to be able to know what item I've clicked in a dynamically generated menu system. I only want to know what I've clicked on, even if it's simply a string representation. def populateShotInfoMenus(self): self.menuFilms = QMenu() films = self.getList() for film in films: menuItem_Film = self.menuFilms.addAction(film) self.connect(menuItem_Film, SIGNAL('triggered()'), self.onFilmSet) self.menuFilms.addAction(menuItem_Film) def onFilmRightClick(self, value): self.menuFilms.exec_(self.group1_inputFilm.mapToGlobal(value)) def onFilmSet(self, value): print 'Menu Clicked ', value

    Read the article

  • Speed of QHash lookups using QStrings as keys.

    - by Ryan R.
    I need to draw a dynamic overlay on a QImage. The component parts of the overlay are defined in XML and parsed out to a QHash<QString, QPicture> where the QString is the name (such as "crosshairs") and the QPicture is the resolution independent drawing. I then draw components of the overlay as they are needed at a position determined during runtime. Example: I have 10 pictures in my QHash composing every possible element in a HUD. During a particular frame of video I need to draw 6 of them at different positions on the image. During the next frame something has changed and now I only need to draw 4 of them but 2 of those positions have changed. Now to my question: If I am trying to do this quickly, should I redefine my QHash as QHash<int, QPicture> and enumerate the keys to counteract the overhead caused by string comparisons; or are the comparisons not going to make a very big impact on performance? I can easily make the conversion to integer keys as the XML parser and overlay composer are completely separate classes; but I would like to use a consistent data structure across the application. Should I overcome my desire for consistency and re-usability in order to increase performance? Will it even matter very much if I do?

    Read the article

  • How to make the title bold?

    - by Solitaire
    Hi all, In Qmessagebox how can I make the title text bold? Here is the sample code, which I am using to disply a messagebox int ret = QMessageBox::warning(this, tr("My Application"), tr("document has been modified.\n" "Do you want to save your changes?"), QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Save); I just want “tr("My Application")” to be bold, and rest to be in normal font. How can I do that? By default I am getting the normal font for both title and descriptive text. Thanks.

    Read the article

  • QList as a function parameter - Linking Error - LNK2019

    - by user2445136
    I have an issue with QList as a function parameter and I'll be glad if you can assist me. I have this code for example: void SpinBoxList_Enable(QList spinBoxList) { foreach(QWidget mWidget,*spinBoxList) mWidget-setEnabled(false); } and in the implemantation file I use the QList variable as a pointer: SpinBoxList_Enable(&controlBoardSpinBoxList); ( controlBoardSpinBoxList is a variable of QList ). The Function ToggleBoards_Slot(bool) is a slot that uses When I compile, I get this error message: 1cmosaixserialnumber.obj : error LNK2019: unresolved external symbol "private: void __cdecl CMosaixSerialNumber::SpinBoxList_Disable(class QList *)" (?SpinBoxList_Disable@CMosaixSerialNumber@@AEAAXPEAV?$QList@PEAVQWidget@@@@@Z) referenced in function "public: void __cdecl CMosaixSerialNumber::ToggleBoards_Slot(bool)" (?ToggleBoards_Slot@CMosaixSerialNumber@@QEAAX_N@Z) 1cmosaixserialnumber.obj : error LNK2019: unresolved external symbol "private: void __cdecl CMosaixSerialNumber::SpinBoxList_Enable(class QList *)" (?SpinBoxList_Enable@CMosaixSerialNumber@@AEAAXPEAV?$QList@PEAVQWidget@@@@@Z) referenced in function "private: void __cdecl CMosaixSerialNumber::on_ControlBoardCheckBox_StateChanged(int)" (?on_ControlBoardCheckBox_StateChanged@CMosaixSerialNumber@@AEAAXH@Z) How can I fix this ? Thanks, EVH671

    Read the article

  • reading and writing QByteArrays

    - by synchronicity
    I'm having trouble reading and writing QByteArray data to a file. My goal is to save QPixmap data into a QByteArray and save that QByteArray to a file (with the ability to read this QByteArray back from the file and into a QPixmap). I want to use following code from the QPixmap documentation: QPixmap pixmap(<image path>); QByteArray bytes; QBuffer buffer(&bytes); buffer.open(QIODevice::WriteOnly); pixmap.save(&buffer, "PNG"); // writes pixmap into bytes in PNG format After writing the buffer to a file, I want to be able to retrieve the QByteArray and load it back into a QPixmap using the QPixmap::loadFromData() function. Please let me know if any further clarification is needed (I'm open to alternative approaches as well, I just need to be able to read and write the QPixmap to a file! :) );

    Read the article

  • Dynamic GUI Framework Designing

    - by user575715
    There is a Scenario to be developed for a 3-tier Application .We need to design a Framework or a utility sort of thing . In tradional aspect of GUI Designing , either we tend to create a static gui page and code the elements on it along with other properties of the elements such as (disabled/enabled,image source,name ,id ,which function to be called under onclick event.) or we tend to drag and drop the elements from the control pallete provided by variety of gui frameworks. Certain things i need to design a POC so that we can develop this concept. 1) There must a utility ,such that during creation of screen layout , that screen should be saved in the database(RDBMS) with a screen number. 2) All the Events related to that control should be saved in some other table which will be dynamically mapped during the calling of screen number by the user. 3) When the user call that screen ,a generic function should be invoked which'll call the screen file from the database and apply all the properties ,events,etc at runtime and the final output will be displayed to the user. This POC will help the us to customised the screens according to our usage.also all the code will seperated which can easily be used for some other development process. Thanks Amit Kalra

    Read the article

  • msbuild conversion tool to VS2010

    - by prosseek
    I got vcproj file from QMake (qmake -tp vc win32.pro), and when I run it with msbuild (msbuild for VS 2010), I get the following error. MSBUILD : error MSB4192: The project file ".\win32.vcproj" is in the ".vcproj" or ".dsp" file format , which MSBuild cannot build directly. Please convert the project by opening it in the Visual Studio IDE or running the conversion tool, or, for ".vcproj", use MSBuild to build the solution file conta ining the project instead. I'd like to run the conversion tool for getting VS2010 project file. What's the tool for it?

    Read the article

  • MultiOS "Jet Database" for QtC++?

    - by Airjoe
    Hopefully I can articulate this well: I'm porting an application I made years ago from VB6 (I know, I know!) to QtC++. In my original application, one thing I liked was that I didn't need an actual SQL server running, I could just use MS Access .mdb files. I was wondering if something similar exists for QtC++ that will work on multiple OSes- a database stored in a file, pretty much, but that I can still run SQL queries with. Not sure if something like this exists or not, but any help appreciated, thanks!

    Read the article

  • QT4, paginated showing elements

    - by matiit
    I am going to write an application that uses QT4 (with C++ or python it isnt important in that moment). One of functionality is "Showing all items in database". One item has a Title, author, description and photo (constant size) And there could be very many items. Let's say 400. There won't be enough space to show'em all at once time. One row will have 200px, so i need at most 4 for once time. How to paginate them? I have no idea. I can use limit and offset in SQL queries, but how to tell window: "that's 5th page"? Any solutions?

    Read the article

  • TCP Message Structure with XML

    - by metdos
    Hello Everybody, I'm sending messages over TCP/IP and on the other side I parse TCP message.For example this is one of the sent messages. $DKMSG(requestType=REQUEST_LOGIN&requestId=123&username=metdos&password=123)$EDKMSG Clarification: $DKMSG( //Start )$EDKMSG //End requestType //Parameter REQUEST_LOGIN //Parameter Value Now I also want to add an Xml file to my message. I'm considering this option: $DKMSG(requestType=REQUEST_LOGIN&xmlData= <Item id="56D@MIT" type="SIGNAL"> <Label> <Text>56D</Text> <X1>10</X1> <Y1>40</Y1> <RotateAngle>90</RotateAngle> </Label> <X1>0</X1> <Y1>20</Y1> <Width>35</Width> <Height>10</Height> <Source>sgs3lr</Source> </Item> )$EDKMSG There are problems with this way: 1-)It doesn't seem right to me. 2-)I have to handle delimeter "=" with much more care or I need to change it in parameters. What are your suggestions, thanks.

    Read the article

  • problem with QMainWindow setCentralWidget and stackedWidget

    - by user63898
    Hello i have gui the i created in the designer , simple one . QMainWIndow that contains stackedWidget , the application starts with stackedWidget index 0 that contains qwebkit widget and after some user flow ,it changes to stackedWidget index 1 that contains QTree widget , to center the first widget i use in the QMainWindow constractor this line of code this-setCentralWidget(ui.webView); but when the application switching to index number 1 im getting exception that is coming from the switching command . why ?

    Read the article

  • QWinWidget's position is always 0 (zero)

    - by Kevin
    I hosted a QWinWidget in a CView and want it to stay at a designated position when resizing. But QWinWidget always moves to (0, 0), i.e. left-top corner of the CView. I tried to debug in this way: QWinWidget* pWidget = new QWinWidget(pCView); pWidget->move(50, 50); QPoint pos = pWidget->pos(); Note that: the pos is always (0, 0). Why is that?

    Read the article

  • QGraphicsView ensureVisible() and centerOn()

    - by onurozcelik
    Hi, I am going to do pan/scale stuff on QGraphicsView. So I read the documentation of QGraphicsView and see some utility functions like ensureVisible() and centerOn(). I think I understand what the documentation says but I can' t manage to write a working example. Could you please write/suggest me an example code to understand the issue.

    Read the article

  • Reserve space for initially hidden widget in QVBoxLayout

    - by Skinniest Man
    I am using a QVBoxLayout to arrange a vertical stack of widgets. I want some of them to be initially hidden and only show up when a check box is checked. Here is an example of the code I'm using. MyWidget::MyWidget(QWidget *parent) : QWidget(parent) { QVBoxLayout *layout = new QVBoxLayout(this); QLabel *labelLogTypes = new QLabel(tr("Log Types")); m_checkBoxCsv = new QCheckBox(tr("&Delimited File (CSV)")); m_labelDelimiter = new QLabel(tr("Delimiter:")); m_lineEditDelimiter = new QLineEdit(","); checkBoxCsv_Toggled(m_checkBoxCsv-isChecked()); connect(m_checkBoxCsv, SIGNAL(toggled(bool)), SLOT(checkBoxCsv_Toggled(bool))); QHBoxLayout *layoutDelimitedChar = new QHBoxLayout(); layoutDelimitedChar-addWidget(m_labelDelimiter); layoutDelimitedChar-addWidget(m_lineEditDelimiter); m_checkBoxXml = new QCheckBox(tr("&XML File")); m_checkBoxText = new QCheckBox(tr("Plain &Text File")); // Now that everything is constructed, put it all together // in the main layout. layout-addWidget(labelLogTypes); layout-addWidget(m_checkBoxCsv); layout-addLayout(layoutDelimitedChar); layout-addWidget(m_checkBoxXml); layout-addWidget(m_checkBoxText); layout-addStretch(); } MyWidget::checkBoxCsv_Toggled(bool checked) { m_labelDelimiter-setVisible(checked); m_lineEditDelimiter-setVisible(checked); } I want m_labelDelimiter and m_lineEditDelimiter both to be initially invisible and I want their visibility to toggle with the state of m_checkBoxCsv. This code acheives the functionality I desire, but it doesn't seem to reserve space for the two initially hidden widgets. When I check the checkbox, they become visible, but everything is kind of scrunched to accomodate them. If I leave them initially visible, everything is laid out just the way I would like it. Is there any way to make the QVBoxLayout reserve space for these widgets even if they're initially invisible?

    Read the article

  • QMap inheritance with QMapIterator

    - by gregseth
    Hi, I made a personnal class which inherits QMap: class CfgMgr : public QMap<QString, CfgSet*> {...} I'm trying to iterate over all its elements like that: CfgMgr* m_pDefaults = new CfgMgr; // .../... QMapIterator<QString, CfgSet*> ics(*m_pDefaults); while (ics.hasNext()) { // doing my stuff } And I get the compile error: Can't convert parameter 1 from 'CfgMgr' to 'const QMap< Key,T &' with [ Key=QString, T=CfgSet * ] I tried with a dynamic_cast: QMapIterator<QString, CfgSet*> ics( *dynamic_cast< QMap<QString,CfgSet*>* >(m_pDefaults) ); it compiles, but always returns NULL. What's wrong? How can I solve this?

    Read the article

  • waiting for a signal

    - by Umesha MS
    Hi, I am working on an application which uploads the content of the file to server. To upload the file to server I am using ‘QNetworkAccessManager’ class. Since it works as asynchronous way, I changed it to work as synchronous way by using QEventLoop. Class FileTransfer { Public : QNetworkAccessManager mNetworkManager; Void Upload(QNetworkRequest request, QIODevice *data) { responce = mNetworkManager.put(request, data); EventLoop.exec(); ReadResponce(responce); } Void Stop() { responce ->close(); } } In my sample application I have 2 windows. 1st to select the files and 2nd to show the progress. When user click on upload button in the first window, the 2nd window will be displayed and then I create the FileTransfer object and start uploading. While uploading the file if user closes the form then in the destructor of the window I call the stop of ‘FileTransfer’ after that I delete the ‘FileTransfer’ object. But here the Upload() function is not yet completed so it will crash. Please help me to: How to wait in 'stop()' function until the Upload() function is completed

    Read the article

  • Set global position for a QLabel

    - by alfredozn
    Hi I'm trying to display a QLabel (without parent) at a fixed position using PyQt. The QLabel functions as a graphic that appears only for a moment, it's appears in the middle of the screen by default but I can't find how to move its position. Any suggestion??

    Read the article

  • qapps runs well but breakpoint sometimes generates segmentation fault

    - by yan bellavance
    I have a qApp that generates a segmentation fault only when a breakpoint is inserted in the code (I can put it at different places) and only after 4-5 breakpoint stops. Do I have a problem with my code or is this a DBG bug. the method is part of a QThread Class. Basically what I did is i took the mandlebrot example, and have 3 instances of it in my program. So the program would look like a mainwindow that has 3 mandlebrot widgets in it, one besides the other. Is it possible that GDB doesnt support debugging qthread subclasses that are instantiated multiple times or is it thread-unsafe to do so. I dont have any problems at run-time.

    Read the article

  • What is the purpose of the QAbstractButton::checkStateSet() method?

    - by darkadept
    I'm writing my own 4 state button and I'm not quite sure what to put in the checkStateSet() method, if anything. Here is what I've got so far: SyncDirectionButton::SyncDirectionButton(QWidget *parent) : QAbstractButton(parent) { setCheckable(true); setToolTip(tr("Click to change the sync direction")); _state = NoSync; } void SyncDirectionButton::paintEvent(QPaintEvent *e) { static QPixmapCache::Key noneKey; static QPixmapCache::Key bothKey; static QPixmapCache::Key leftKey; static QPixmapCache::Key rightKey; QPainter p(this); QPixmap pix; if (checkState() == SyncLeft) { if (!QPixmapCache::find(leftKey, &pix)) { pix.load(":/icons/sync-left.png"); leftKey = QPixmapCache::insert(pix); } } else if (checkState() == SyncBoth) { if (!QPixmapCache::find(rightKey, &pix)) { pix.load(":/icons/sync-right.png"); rightKey = QPixmapCache::insert(pix); } } else if (checkState() == SyncRight) { if (!QPixmapCache::find(bothKey, &pix)) { pix.load(":/icons/sync-both.png"); bothKey = QPixmapCache::insert(pix); } } else if (checkState() == NoSync) { if (!QPixmapCache::find(noneKey, &pix)) { pix.load(":/icons/application-exit.png"); noneKey = QPixmapCache::insert(pix); } } p.drawPixmap(0,0,pix); } SyncDirectionButton::DirectionState SyncDirectionButton::checkState() const { return _state; } void SyncDirectionButton::setCheckState(DirectionState state) { setChecked(state != NoSync); if (state != _state) { _state = state; } } QSize SyncDirectionButton::sizeHint() const { return QSize(180,90); } void SyncDirectionButton::checkStateSet() { } void SyncDirectionButton::nextCheckState() { setCheckState((DirectionState)((checkState()+1)%4)); }

    Read the article

  • Self-expanding Widget, on mouse over

    - by Sergiy Migdalskiy
    I want to implement a widget (with some edit boxes and sliders) that would open beneath or next to a button ("Opener") when I hover it. The key is it's a temporary widget - as soon as it loses focus, I want it gone. Also, I want it to pop up right next to the Opener, ideally pointing an arrow to Opener. So, it's basically a tooltip. But it needs to be a widget with buttons and sliders and stuff like that. Is there a clever way to implement it without making a custom widget and writing handlers for all the mouse and focus events and recomputing its ideal position every time I open it or the Opener moves?

    Read the article

  • Force column order, Excel data table

    - by Chris
    I have a Excel Workbook that I use as a report template. I change the datasource on each pivot and datatable in a C# app. When I change the datatable datasource it tweeks the columns. Is there a way to force the column order? private void RefreshRawData(string dataSource, string connection) { xl._Worksheet ws = (xl._Worksheet)xlTemplate.Worksheets["Raw Data"]; xl.ListObject table = ws.ListObjects["Table_ExternalData_1"]; xl.QueryTable qt = table.QueryTable; qt.CommandText = dataSource; qt.Connection = GetExcelConnectionString((string)qt.Connection); qt.BackgroundQuery = false; qt.Refresh(m); Marshal.ReleaseComObject(ws); Marshal.ReleaseComObject(table); Marshal.ReleaseComObject(qt); ws = null; table = null; qt = null; }

    Read the article

< Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >