Search Results

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

Page 38/77 | < Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >

  • How to find item selected from customContextMenuRequested() on QTreeView item?

    - by vinaym
    I have implemented contextual menus in QTreeView items with the following code MyDerivedQTreeView->setModel(MyDerivedQAbstractItemModel); MyDerivedQTreeView->setContextMenuPolicy(Qt::CustomContextMenu); connect(MyDerivedQTreeView, SIGNAL(customContextMenuRequested(const QPoint &)), MyDerivedQAbstractItemModel(), SLOT(contextualMenu(const QPoint &))); void MyDerivedQAbstractItemModel::contextualMenu(const QPoint& point) { QMenu *menu = new QMenu; menu->addAction(QString("Test Item"), this, SLOT(test_slot())); menu->exec(MyDerivedQTreeView->mapToGlobal(point)); } MyDerivedQAbstractItemModel::contextualMenu() gets called and I can see the contextual menu. Problem is contextual menu should be visible only if user right-clicks on an item and it should be customized as per the item selected. How do I get whether/which item is selected from QPoint information? I am on Qt 4.5.3.

    Read the article

  • QTreeView memory consumption

    - by Eye of Hell
    Hello. I'm testing QTreeView functionality right now, and i was amazed by one thing. It seems that QTreeView memory consumption depends on items count O_O. This is highly unusual, since model-view containers of such type only keeps track for items being displayed, and rest of items are in the model. I have written a following code with a simple model that holds no data and just reports that it has 10 millions items. With MFC, Windows API or .NET tree / list with such model will take no memory, since it will display only 10-20 visible elements and will request model for more upon scrolling / expanding items. But with Qt, such simple model results in ~300Mb memory consumtion. Increasing number of items will increase memory consumption. Maybe anyone can hint me what i'm doing wrong? :) #include <QtGui/QApplication> #include <QTreeView> #include <QAbstractItemModel> class CModel : public QAbstractItemModel { public: QModelIndex index ( int i_nRow, int i_nCol, const QModelIndex& i_oParent = QModelIndex() ) const { return createIndex( i_nRow, i_nCol, 0 ); } public: QModelIndex parent ( const QModelIndex& i_oInex ) const { return QModelIndex(); } public: int rowCount ( const QModelIndex& i_oParent = QModelIndex() ) const { return i_oParent.isValid() ? 0 : 1000 * 1000 * 10; } public: int columnCount ( const QModelIndex& i_oParent = QModelIndex() ) const { return 1; } public: QVariant data ( const QModelIndex& i_oIndex, int i_nRole = Qt::DisplayRole ) const { return Qt::DisplayRole == i_nRole ? QVariant( "1" ) : QVariant(); } }; int main(int argc, char *argv[]) { QApplication a(argc, argv); QTreeView oWnd; CModel oModel; oWnd.setUniformRowHeights( true ); oWnd.setModel( & oModel ); oWnd.show(); return a.exec(); }

    Read the article

  • System context menu Icon not transparent like WinRAR

    - by Samir
    I added a icon at the system context menu(the popped up menu when we right mouse click on any file/foler). But the icon is not transparent(in xp its not notice able, but in vista/win7 it is clearly visible) there is a white background beneath the icon. But WinRAR or TortoiseSVN icons don't have any white background, they are transparent. I tried the following C++ code: #define BITMAP_MAIN 201 //in resource.h BITMAP_MAIN BITMAP "main.bmp" // in .rc file // showing icon in menu... HBITMAP imgMain = LoadBitmap( aHinstance, MAKEINTRESOURCE(BITMAP_MAIN) ); SetMenuItemBitmaps ( hSubmenu, uMenuIndex, MF_BYPOSITION, imgMain, imgMain); [main.bmp is 16X16] Also the icon(.bmp) is not shown fully in non-english OS. So is there be any special technique to make the icon in the system context menu transparent like WinRAR?

    Read the article

  • Create a jQueryUI 1.8 Button menu

    - by Brian M. Hunt
    Now that jQueryUI 1.8 is out, I was browsing through the updates and came across the new Button widget, and in particular one of the demos with the SplitButton with a dropdown. This demo seems to suggest that the Button widget could be used to create a dropdown menu here. As a matter of discussion, I was wondering what ways there are to go about creating a dropdown menu with this new Button widget. Cheers.

    Read the article

  • Remove application entry from switch-app menu

    - by bdhar
    What am I trying to achieve? I am writing a windows-form based application in C# .NET 2.0. The application should behave like this: No form should be visible; just a system tray icon is the entire application. So, I have to hide the form during startup and make a NotifyIcon available in the system tray with a ContextMenuStrip attached to it. What have I done so far? I have created a Windows application with the default form's properties WindowState-Minimized and ShowInTaskbar-false. Added a NotifyIcon and attached a ContextMenuStrip to it. What's happening? The application starts as a system tray icon and the form is hidden. So far so good. But when I am working with other applications and when I switch between other application using the Alt-Tab combination in Windows, the application icon appears in the switch-application menu; and when I select my application, the form appears. What's expected? The application should not be available in the switch-application menu; because, the form is empty and there is no functionality attached to it. All that is needed is the system-tray icon. How to hide the application entry from the switch-application menu? Thanks.

    Read the article

  • GWT: Select a TreeItem with right click

    - by Ivan
    I'm capturing a right click event to show a context menu. What I haven't been able to figure out, is how to make the right click actually select the TreeItem, prior to showing of context menu. All help is appreciated. private Tree tree = new Tree() { @Override public void onBrowserEvent(Event event) { if (event.getTypeInt() == Event.ONCONTEXTMENU) { DOM.eventPreventDefault(event); showContextMenu(event); } super.onBrowserEvent(event); } @Override protected void setElement(Element elem) { super.setElement(elem); sinkEvents(Event.ONCONTEXTMENU); } };

    Read the article

  • Show context menu when link is long pressed in TextView

    - by Al
    I have a TextView with its MovementMethod set to LinkMovementMethod. Text added to the TextView is a combination of normal text and URLs. For URLs, I would like to offer a context menu when the URL is long pressed for doing things such as copying the address. I've had a look at the source for LinkMovementMethod but it doesn't seem to have any long pressed related code I could override. Any ideas on how to go around achieving this?

    Read the article

  • Simulating a mouse button click in Windows

    - by Ncarlson
    Hi everyone, I'm writing Remote Desktop clone in C++ using QT. So far I'm able to move the mouse cursor around fine. QT has a nice setPos function for that. However, I'm a bit lost as to what API/Library to use for simulating mouse button clicks. One method I'm aware of is to send the WM_(event) to a window using the window's HWND. However, I was hoping there was a more salient method for taking complete control over a mouse. Is there any other way to tell the operating system that the left mouse button has been clicked? Thanks.

    Read the article

  • C# datagridview right click select row and show menu to delete it

    - by Data-Base
    Hello, I have few columns in my DataGridView, and there is data in my rows, I saw few solutions in here, but I can not combine them! simply a way to right-click on a row it select the whole row and show a menu with an option to delete the row and when the option selected it will delete the row I made few attempts but none is working and it looks messy any suggestions? cheers

    Read the article

  • Animated gifs in QMovie

    - by Jason
    I'm displaying an animated gif in my application by creating a QLabel, and setting the movie as a QMovie. The problem I'm having is that when the gif is displayed, any part of the image that stays a constant color throughout the animation shows up as the background color. I hope I'm explaining that clearly. Here's the code I'm using to create the animation if that helps: rewardLabel=new QLabel(); rewardLabel->setCursor(QCursor(Qt::BlankCursor)); rewardLabel->setWindowFlags(Qt::FramelessWindowHint); rewardLabel->hide(); string movieTemp="animations/"+animationFiles[animationIndex]; QString movieFile(movieTemp.c_str()); rewardMovie=new QMovie(movieFile); rewardLabel->setMovie(rewardMovie); Let me know if I need to explain the situation better. Thanks in advance.

    Read the article

  • Android: CustomListAdapter

    - by primal
    Hi, I have implemented a custom list view which looks like the twitter timeline. adapter = new MyClickableListAdapter(this, R.layout.timeline, mObjectList); setListAdapter(adapter); The constructor for MyClickableListAdapter is as follows private class MyClickableListAdapter extends ClickableListAdapter{ public MyClickableListAdapter(Context context, int viewId, List objects) { super(context, viewId, objects); } ClickableListAdapter extends BaseAdapter and implements the necessary methods. The xml code for the list view is as follows <ListView android:id="@+id/android:list" android:layout_width="fill_parent" android:layout_height="wrap_content" /> This is what it looks like. I have 3 questions 1) I tried registering a context menu for the list view by adding the line after setting the list adapter registerforContextMenu(getListView()); But on long-click the menu doesnt get displayed. I cannot understand what I am doing wrong! 2) Is it possible to display a textview above the listview? I tried it by adding the code for textview above the listview. But then, only the textview gets displayed. 3) I have seen in many twitter clients that on clicking post a window pops up from the top covering only some portion of the screen and rest of the timeline is visible. How can this be done possibly without starting a new activity? Any help would be much appreciated..

    Read the article

  • What is the component a popup menu click originated from

    - by Ralph Rickenbach
    Having a popup menu attached to several components on a form (buttons, but also things like TCharts), I would like to know which component was right clicked to start the popup menu in the first place. The Sender parameter of the click method just points to the TMenuItem, its parent to the popup menu (or the parenting menu item). How do I get the originating component?

    Read the article

  • What kind of library to use for display of graphical objects and right click context menus

    - by Gopal
    Hi all, Goal: To develop a web based NMS interface which displays a network topology (e.g., switches, routers, links, endhosts). Each node should be 'movable' (draggable to an appropriate place manually or their best location computed algorithmically). I should be able to zoom into the network graph (say if there are many clusters of nodes and I want to concentrate on a particular cluster of nodes). I should be able to right-click any node or link and get a context menu (e.g., 'show routing table', 'show interfaces', 'show bandwidth utilization graph' etc.). The data for this network topology will be fetched by making calls to an apache based webserver where the backend scripts in python will fetch the appropriate data and send it via JSON to the web client. Question: I am assuming that some sort of javascript library/framework will be most appropriate for this - jQuery, Dojo, Moo etc. [I've never used any of these before]. Which of these would be most recommended for this sort of thing. Which would be easiest to learn (say in a months time). Thanks for any tips.

    Read the article

  • Check Clipboard for Copied texts.

    - by Bibhas
    I want to add an Cut/Copy/Paste ContextMenuStrip in a RichTextBox, but the problem is, I want to enable or disable the Paste button with respect to the current condition of the windows clipboard.. I mean, if any text is copied already, then that button should be Enabled, otherwise disabled. Any idea how I can accomplish that?

    Read the article

  • GUI style question: Icons in context menus?

    - by Andrew White
    Hi, It seems like not so long ago that it was standard to have icons/images in context menus and Microsoft seems to keep this up. But nowadays it seems to have disappeared in other apps: Chrome, iTunes etc. Anyone have an opinion / idea why this has happened or is it just completely personal taste (I for one like the images). A.

    Read the article

  • Design pattern for mouse interaction

    - by mike
    I need some opinions on what is the "ideal" design pattern for a general mouse interaction. Here the simplified problem. I have a small 3d program (QT and openGL) and I use the mouse for interaction. Every interaction is normally not only a single function call, it is mostly performed by up to 3 function calls (initiate, perform, finalize). For example, camera rotation: here the initial function call will deliver the current first mouse position, whereas the performing function calls will update the camera etc. However, for only a couple of interactions, hardcoding these (inside MousePressEvent, MouseReleaseEvent MouseMoveEvent or MouseWheelEvent etc) is not a big deal, but if I think about a more advanced program (e.g 20 or more interactions) then a proper design is needed. Therefore, how would you design such a interactions inside QT. I hope I made my problem clear enough, otherwise don't bother complain :-) Thanks

    Read the article

  • WPF c# Context Menu Text Alignment

    - by Grant
    Hi, i am building a context menu for a WPF c# application and just for simplicity's sake, if i have text and then i add an image, the text is always aligned at the top of the menu items cell and i cant figure out how to align it to the center. i have tried the veticalalignment property and veticalcontentalignment property but they dont help.. any ideas?

    Read the article

  • C++ context menu image at left side showing partially, no fully

    - by Samir
    In C++ #define BITMAP_MAIN 201 //in resource.h BITMAP_MAIN BITMAP "main.bmp" // in .rc file // showing icon in menu... HBITMAP imgMain = LoadBitmap( aHinstance, MAKEINTRESOURCE(BITMAP_MAIN) ); SetMenuItemBitmaps ( hSubmenu, uMenuIndex, MF_BYPOSITION, imgMain, imgMain); The problem is in non-English XP OS the main.bmp is showing partially in the context menu. In Vista, Window7 main.bmp is showing just fine. Also in English XP its ok. But why the image is not showing fully in non-English XP? How would I use .ico file here instead of .bmp? This is to make the image transparent.

    Read the article

  • Custom Context Menu with Javascript?

    - by viatropos
    Is there a way to add custom fields to the built in browser context menu using Javascript? I know flash/actionscript can do this, how are they doing it? Example: right click on http://josephjewell.com and see the custom context menu. Is this possible with pure javascript or do you have to use flash? Note, I'm looking for adding to the built in browser context menu, not using custom javascript popups to mimic them.

    Read the article

  • IContextMenu::GetCommandString Not showing help text in Windows Explorer

    - by Grant
    Hi, i am implementing a shell context menu for windows explorer and have successfully created the menu's. What i am having trouble with is the IContextMenu::GetCommandString method that displays the help text in the status bar when you hover over the selected menu item. When i do hover over each item nothing is displayed, but whats weird is that some of the other items that i didnt create, eg - open, or print have had their help text turned into garbage.. Here is a code sample of IContextMenu::QueryContextMenu & IContextMenu::GetCommandString.. int ShellExtLib.IContextMenu.QueryContextMenu(IntPtr hMenu, uint indexMenu, uint idCmdFirst, uint idCmdLast, uint uFlags) { uint idCmd = idCmdFirst; StringBuilder sb = new StringBuilder(1024); try { if ((uFlags & 0xf) == 0 || (uFlags & (uint)ShellExtLib.CMF.CMF_EXPLORE) != 0) { uint selectedFileCount = Helpers.DragQueryFile(m_hDrop, 0xffffffff, null, 0); if (selectedFileCount == 1) { Helpers.DragQueryFile(m_hDrop, 0, sb, sb.Capacity + 1); Documents.Add(sb.ToString()); } else { // MULTIPLE FILES SELECTED. for (uint i = 0; i < selectedFileCount; i++) { Helpers.DragQueryFile(m_hDrop, i, sb, sb.Capacity + 1); Documents.Add(sb.ToString()); } } Helpers.InsertMenu(hMenu, indexMenu++, ShellExtLib.UFLAGS.MF_SEPARATOR | ShellExtLib.UFLAGS.MF_BYPOSITION, 0, null); IntPtr hSubMenu = Helpers.CreateMenu(); if (hSubMenu != IntPtr.Zero) { Helpers.InsertMenu(hSubMenu, 0, ShellExtLib.UFLAGS.MF_STRING | ShellExtLib.UFLAGS.MF_BYPOSITION, idCmd++, "Item 1"); Helpers.InsertMenu(hSubMenu, 1, ShellExtLib.UFLAGS.MF_STRING | ShellExtLib.UFLAGS.MF_BYPOSITION, idCmd++, "Item 2"); Helpers.InsertMenu(hSubMenu, 2, ShellExtLib.UFLAGS.MF_SEPARATOR | ShellExtLib.UFLAGS.MF_BYPOSITION, idCmd++, null); Helpers.InsertMenu(hSubMenu, 3, ShellExtLib.UFLAGS.MF_STRING | ShellExtLib.UFLAGS.MF_BYPOSITION, idCmd++, "Item 3"); Helpers.InsertMenu(hSubMenu, 4, ShellExtLib.UFLAGS.MF_SEPARATOR | ShellExtLib.UFLAGS.MF_BYPOSITION, idCmd++, null); Helpers.InsertMenu(hSubMenu, 5, ShellExtLib.UFLAGS.MF_STRING | ShellExtLib.UFLAGS.MF_BYPOSITION, idCmd++, "Item 4"); Helpers.InsertMenu(hSubMenu, 6, ShellExtLib.UFLAGS.MF_STRING | ShellExtLib.UFLAGS.MF_BYPOSITION, idCmd++, "Item 5"); } Helpers.InsertMenu(hMenu, indexMenu++, ShellExtLib.UFLAGS.MF_STRING | ShellExtLib.UFLAGS.MF_BYPOSITION | ShellExtLib.UFLAGS.MF_POPUP, (uint)hSubMenu, "Main Menu"); Helpers.InsertMenu(hMenu, indexMenu++, ShellExtLib.UFLAGS.MF_SEPARATOR | ShellExtLib.UFLAGS.MF_BYPOSITION, 0, null); return (int)(idCmd - idCmdFirst); } } catch { } return 0; } void ShellExtLib.IContextMenu.GetCommandString(int idCmd, uint uFlags, int pwReserved, StringBuilder commandString, int cchMax) { switch (uFlags) { case (uint)ShellExtLib.GCS.VERB: commandString = new StringBuilder("x"); break; case (uint)ShellExtLib.GCS.HELPTEXTA: commandString = new StringBuilder("y"); break; } } Does anyone have any suggestions? I have read a number of articles on how to build shell extensions and have also been reading MSDN as well.. Thanks.

    Read the article

  • QLocale, what is the scope of the global QLocale::setDefault()?

    - by ALoopingIcon
    Problem: I have a QT based multiplatform (win,mac,*nix) application that parses ascii files containing decimal numbers. parsing is done using a variety of different code pieces that use anything from qt string stuff, c++ stdin, oldstyle scanf, etc. ascii files have always the '.' (dot) as separated decimal (e.g. in the file to be parsed 1/10 is written 0.1 as standard in many countries). people using the application within a OS localized for using comma separated decimal encounter a lot of problems (e.g. for french users scanf expect to find 0,1 as a valid textual representation of 1/10 and if they find 0.1 scanf will parse it as 0) How can I be sure that the OS Locale indication of how decimal point has to be written is always ignored? Is it safe assuming that adding QLocale::setDefault(QLocale(QLocale::English,QLocale::UnitedStates)); is enough to get rid of all these problems? Any suggestion for portable ways of setting the locale globally?

    Read the article

  • Persisting a context menu after screen rotation

    - by Macarse
    Hi. I have an activity that on it's onCreate method it does: registerForContextMenu(theView); and in onCreateContextMenu: super.onCreateContextMenu(menu, v, menuInfo); menu.add(blablabla); This works great, but the problem is that the context menu disappears when the screen rotates. How to fix this? Thanks for reading!

    Read the article

< Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >